# GstVideoSink

Provides useful functions and a base class for video sinks.

GstVideoSink will configure the default base sink to drop frames that arrive later than 20ms as this is considered the default threshold for observing out-of-sync frames.

## GstVideoRectangle

Helper structure representing a rectangular area.

### Members

`x` (gint) –

X coordinate of rectangle's top-left point

`y` (gint) –

Y coordinate of rectangle's top-left point

`w` (gint) –

width of the rectangle

`h` (gint) –

height of the rectangle

## GstVideo.VideoRectangle

Helper structure representing a rectangular area.

### Members

`x` (Number) –

X coordinate of rectangle's top-left point

`y` (Number) –

Y coordinate of rectangle's top-left point

`w` (Number) –

width of the rectangle

`h` (Number) –

height of the rectangle

## GstVideo.VideoRectangle

Helper structure representing a rectangular area.

### Members

`x` (int) –

X coordinate of rectangle's top-left point

`y` (int) –

Y coordinate of rectangle's top-left point

`w` (int) –

width of the rectangle

`h` (int) –

height of the rectangle

## GstVideoSink

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSink
                        ╰──GstVideoSink

The video sink instance structure. Derived video sinks should set the height and width members.

### Members

`element` (GstBaseSink) –
No description available
`width` (gint) –

video width (derived class needs to set this)

`height` (gint) –

video height (derived class needs to set this)

### Class structure

#### GstVideoSinkClass

The video sink class structure. Derived classes should override the show_frame virtual function.

##### Fields

`parent_class` (GstBaseSinkClass) –

the parent class structure

### GstVideo.VideoSinkClass

The video sink class structure. Derived classes should override the show_frame virtual function.

##### Attributes

`parent_class` (GstBase.BaseSinkClass) –

the parent class structure

### GstVideo.VideoSinkClass

The video sink class structure. Derived classes should override the show_frame virtual function.

##### Attributes

`parent_class` (GstBase.BaseSinkClass) –

the parent class structure

## GstVideo.VideoSink

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSink
                        ╰──GstVideo.VideoSink

The video sink instance structure. Derived video sinks should set the height and width members.

### Members

`element` (GstBase.BaseSink) –
No description available
`width` (Number) –

video width (derived class needs to set this)

`height` (Number) –

video height (derived class needs to set this)

## GstVideo.VideoSink

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSink
                        ╰──GstVideo.VideoSink

The video sink instance structure. Derived video sinks should set the height and width members.

### Members

`element` (GstBase.BaseSink) –
No description available
`width` (int) –

video width (derived class needs to set this)

`height` (int) –

video height (derived class needs to set this)

### Functions

#### gst_video_sink_center_rect

    gst_video_sink_center_rect (GstVideoRectangle src,
                                GstVideoRectangle dst,
                                GstVideoRectangle * result,
                                gboolean scaling)

Parameters:

`src` –

the GstVideoRectangle describing the source area

`dst` –

the GstVideoRectangle describing the destination area

`result` ( [out]) –

a pointer to a GstVideoRectangle which will receive the result area

`scaling` –

a gboolean indicating if scaling should be applied or not

deprecated : 1.20: Use gst_video_center_rect() instead.

#### GstVideo.VideoSink.prototype.center_rect

    function GstVideo.VideoSink.prototype.center_rect(src: GstVideo.VideoRectangle, dst: GstVideo.VideoRectangle, scaling: Number): {
        // javascript wrapper for 'gst_video_sink_center_rect'
    }

Parameters:

`src` (GstVideo.VideoRectangle) –

the GstVideo.VideoRectangle describing the source area

`dst` (GstVideo.VideoRectangle) –

the GstVideo.VideoRectangle describing the destination area

`scaling` (Number) –

a Number indicating if scaling should be applied or not

deprecated : 1.20: Use gst_video_center_rect() instead.

#### GstVideo.VideoSink.center_rect

    def GstVideo.VideoSink.center_rect (src, dst, scaling):
        #python wrapper for 'gst_video_sink_center_rect'

Parameters:

`src` (GstVideo.VideoRectangle) –

the GstVideo.VideoRectangle describing the source area

`dst` (GstVideo.VideoRectangle) –

the GstVideo.VideoRectangle describing the destination area

`scaling` (bool) –

a bool indicating if scaling should be applied or not

deprecated : 1.20: Use gst_video_center_rect() instead.

### Properties

#### show-preroll-frame

    “show-preroll-frame” gboolean

Whether to show video frames during preroll. If set to FALSE, video frames will only be rendered in PLAYING state.

Flags : Read / Write / Construct

#### show-preroll-frame

    “show-preroll-frame” Number

Whether to show video frames during preroll. If set to false, video frames will only be rendered in PLAYING state.

Flags : Read / Write / Construct

#### show_preroll_frame

    “self.props.show_preroll_frame” bool

Whether to show video frames during preroll. If set to False, video frames will only be rendered in PLAYING state.

Flags : Read / Write / Construct

### Virtual Methods

#### set_info

    gboolean
    set_info (GstVideoSink * video_sink,
              GstCaps * caps,
              const GstVideoInfo * info)

Notifies the subclass of changed GstVideoInfo.

Parameters:

`video_sink` –
No description available
`caps` –

A GstCaps.

`info` –

A GstVideoInfo corresponding to caps.

Returns –
No description available

Since : 1.20

#### vfunc_set_info

    function vfunc_set_info(video_sink: GstVideo.VideoSink, caps: Gst.Caps, info: GstVideo.VideoInfo): {
        // javascript implementation of the 'set_info' virtual method
    }

Notifies the subclass of changed GstVideo.VideoInfo.

Parameters:

`video_sink` (GstVideo.VideoSink) –
No description available
`caps` (Gst.Caps) –

A Gst.Caps.

`info` (GstVideo.VideoInfo) –

A GstVideo.VideoInfo corresponding to caps.

Returns (Number) –
No description available

Since : 1.20

#### do_set_info

    def do_set_info (video_sink, caps, info):
        #python implementation of the 'set_info' virtual method

Notifies the subclass of changed GstVideo.VideoInfo.

Parameters:

`video_sink` (GstVideo.VideoSink) –
No description available
`caps` (Gst.Caps) –

A Gst.Caps.

`info` (GstVideo.VideoInfo) –

A GstVideo.VideoInfo corresponding to caps.

Returns (bool) –
No description available

Since : 1.20

#### show_frame

    GstFlowReturn
    show_frame (GstVideoSink * video_sink,
                GstBuffer * buf)

render a video frame. Maps to render() and preroll() vfuncs. Rendering during preroll will be suppressed if the show-preroll-frame property is set to FALSE.

Parameters:

`video_sink` –
No description available
`buf` –
No description available
Returns –
No description available

#### vfunc_show_frame

    function vfunc_show_frame(video_sink: GstVideo.VideoSink, buf: Gst.Buffer): {
        // javascript implementation of the 'show_frame' virtual method
    }

render a video frame. Maps to vfunc_render() and vfunc_preroll() vfuncs. Rendering during preroll will be suppressed if the show-preroll-frame property is set to false.

Parameters:

`video_sink` (GstVideo.VideoSink) –
No description available
`buf` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_show_frame

    def do_show_frame (video_sink, buf):
        #python implementation of the 'show_frame' virtual method

render a video frame. Maps to do_render() and do_preroll() vfuncs. Rendering during preroll will be suppressed if the show_preroll_frame property is set to False.

Parameters:

`video_sink` (GstVideo.VideoSink) –
No description available
`buf` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

## Functions

### gst_video_center_rect

    gst_video_center_rect (const GstVideoRectangle * src,
                           const GstVideoRectangle * dst,
                           GstVideoRectangle * result,
                           gboolean scaling)

Takes src rectangle and position it at the center of dst rectangle with or without scaling. It handles clipping if the src rectangle is bigger than the dst one and scaling is set to FALSE.

Parameters:

`src` –

a pointer to GstVideoRectangle describing the source area

`dst` –

a pointer to GstVideoRectangle describing the destination area

`result` ( [out]) –

a pointer to a GstVideoRectangle which will receive the result area

`scaling` –

a gboolean indicating if scaling should be applied or not

Since : 1.20

### GstVideo.prototype.video_center_rect

    function GstVideo.prototype.video_center_rect(src: GstVideo.VideoRectangle, dst: GstVideo.VideoRectangle, scaling: Number): {
        // javascript wrapper for 'gst_video_center_rect'
    }

Takes src rectangle and position it at the center of dst rectangle with or without scaling. It handles clipping if the src rectangle is bigger than the dst one and scaling is set to FALSE.

Parameters:

`src` (GstVideo.VideoRectangle) –

a pointer to GstVideo.VideoRectangle describing the source area

`dst` (GstVideo.VideoRectangle) –

a pointer to GstVideo.VideoRectangle describing the destination area

`scaling` (Number) –

a Number indicating if scaling should be applied or not

Since : 1.20

### GstVideo.video_center_rect

    def GstVideo.video_center_rect (src, dst, scaling):
        #python wrapper for 'gst_video_center_rect'

Takes src rectangle and position it at the center of dst rectangle with or without scaling. It handles clipping if the src rectangle is bigger than the dst one and scaling is set to FALSE.

Parameters:

`src` (GstVideo.VideoRectangle) –

a pointer to GstVideo.VideoRectangle describing the source area

`dst` (GstVideo.VideoRectangle) –

a pointer to GstVideo.VideoRectangle describing the destination area

`scaling` (bool) –

a bool indicating if scaling should be applied or not

Since : 1.20

## Function Macros

### GST_VIDEO_SINK_CAST

    #define GST_VIDEO_SINK_CAST(obj)  ((GstVideoSink *) (obj))

Cast obj to a GstVideoSink without runtime type check.

Parameters:

`obj` –

a GstVideoSink or derived object

### GST_VIDEO_SINK_HEIGHT

    #define GST_VIDEO_SINK_HEIGHT(obj) (GST_VIDEO_SINK_CAST (obj)->height)

### GST_VIDEO_SINK_PAD

    #define GST_VIDEO_SINK_PAD(obj) GST_BASE_SINK_PAD(obj)

Get the sink GstPad of obj.

Parameters:

`obj` –

a GstVideoSink

### GST_VIDEO_SINK_WIDTH

    #define GST_VIDEO_SINK_WIDTH(obj) (GST_VIDEO_SINK_CAST (obj)->width)

The results of the search are