Enum value describing the most common video formats.
Helper structure representing a rectangular area.
The video sink instance structure. Derived video sinks should set the
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.
the #GstVideoRectangle describing the source area
the #GstVideoRectangle describing the destination area
a pointer to a #GstVideoRectangle which will receive the result area
a #gboolean indicating if scaling should be applied or not
The video sink class structure. Derived classes should override the
Given the Pixel Aspect Ratio and size of an input video frame, and the
pixel aspect ratio of the intended display device, calculates the actual
display ratio the video will be rendered with.
dar_n and dar_d parameters.
The return value is FALSE in the case of integer overflow or other error.
A boolean indicating success and a calculated Display Ratio in the
Numerator of the calculated display_ratio
Denominator of the calculated display_ratio
Width of the video frame in pixels
Height of the video frame in pixels
Numerator of the pixel aspect ratio of the input video.
Denominator of the pixel aspect ratio of the input video.
Numerator of the pixel aspect ratio of the display device
Denominator of the pixel aspect ratio of the display device
Converts a raw video buffer into the specified output caps.
The output caps can be any raw video formats or any image formats (jpeg, png, ...).
The width, height and pixel-aspect-ratio can also be specified in the output caps.
will point to the #GError).
The converted #GstBuffer, or %NULL if an error happened (in which case @err
a #GstBuffer
the #GstCaps to convert to
the maximum amount of time allowed for the processing.
Converts a raw video buffer into the specified output caps.
The output caps can be any raw video formats or any image formats (jpeg, png, ...).
The width, height and pixel-aspect-ratio can also be specified in the output caps.
finish after @timeout. @callback will always be called from the thread default
%GMainContext, see g_main_context_get_thread_default(). If GLib before 2.22 is used,
this will always be the global default main context.
anymore.
a #GstBuffer
the #GstCaps to convert to
the maximum amount of time allowed for the processing.
%GstVideoConvertFrameCallback that will be called after conversion.
%GDestroyNotify to be called after @user_data is not needed anymore
Creates a new Still Frame event. If @in_still is %TRUE, then the event
represents the start of a still frame sequence. If it is %FALSE, then
the event ends a still frame sequence.
To parse an event created by gst_video_event_new_still_frame() use
gst_video_event_parse_still_frame().
The new GstEvent
boolean value for the still-frame state of the event.
Parse a #GstEvent, identify if it is a Still Frame event, and
return the still-frame state from the event if it is.
If the event represents the start of a still frame, the in_still
variable will be set to TRUE, otherwise FALSE. It is OK to pass NULL for the
in_still variable order to just check whether the event is a valid still-frame
event.
Create a still frame event using gst_video_event_new_still_frame()
%TRUE if the event is a valid still-frame event. %FALSE if not
A #GstEvent to parse
A boolean to receive the still-frame status from the event, or NULL
Converts among various #GstFormat types. This function handles
GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For
raw video, GST_FORMAT_DEFAULT corresponds to video frames. This
function can be to handle pad queries of the type GST_QUERY_CONVERT.
TRUE if the conversion was successful.
a #GstVideoFormat
the width of video
the height of video
frame rate numerator
frame rate denominator
#GstFormat of the @src_value
value to convert
#GstFormat of the @dest_value
pointer to destination value
Converts a FOURCC value into the corresponding #GstVideoFormat.
If the FOURCC cannot be represented by #GstVideoFormat,
#GST_VIDEO_FORMAT_UNKNOWN is returned.
the #GstVideoFormat describing the FOURCC value
a FOURCC value representing raw YUV video
Calculates the height of the component. See
of the component index.
height of component @component
a #GstVideoFormat
the component index
the height of video
Calculates the offset (in bytes) of the first pixel of the component
with index @component. For packed formats, this will typically be a
small integer (0, 1, 2, 3). For planar formats, this will be a
(relatively) large offset to the beginning of the second or third
component planes. See @gst_video_format_get_row_stride for a description
of the component index.
offset of component @component
a #GstVideoFormat
the component index
the width of video
the height of video
Calculates the width of the component. See
of the component index.
width of component @component
a #GstVideoFormat
the component index
the width of video
Calculates the pixel stride (number of bytes from one pixel to the
pixel to its immediate left) for the video component with an index
of @component. See @gst_video_format_get_row_stride for a description
of the component index.
pixel stride of component @component
a #GstVideoFormat
the component index
Calculates the row stride (number of bytes from one row of pixels to
the next) for the video component with an index of @component. For
YUV video, Y, U, and V have component indices of 0, 1, and 2,
respectively. For RGB video, R, G, and B have component indicies of
0, 1, and 2, respectively. Alpha channels, if present, have a component
index of 3. The @width parameter always represents the width of the
video, not the component.
row stride of component @component
a #GstVideoFormat
the component index
the width of video
Calculates the total number of bytes in the raw video format. This
number should be used when allocating a buffer for raw video.
size (in bytes) of raw video format
a #GstVideoFormat
the width of video
the height of video
Returns TRUE or FALSE depending on if the video format provides an
alpha channel.
TRUE if @format has an alpha channel
a #GstVideoFormat
Determine whether the video format is a grayscale format.
TRUE if @format represents grayscale video
a #GstVideoFormat
Determine whether the video format is an RGB format.
TRUE if @format represents RGB video
a #GstVideoFormat
Determine whether the video format is a YUV format.
TRUE if @format represents YUV video
a #GstVideoFormat
Creates a new #GstCaps object based on the parameters provided.
a new #GstCaps object, or NULL if there was an error
the #GstVideoFormat describing the raw video format
width of video
height of video
numerator of frame rate
denominator of frame rate
numerator of pixel aspect ratio
denominator of pixel aspect ratio
Creates a new #GstCaps object based on the parameters provided.
a new #GstCaps object, or NULL if there was an error
the #GstVideoFormat describing the raw video format
width of video
height of video
numerator of frame rate
denominator of frame rate
numerator of pixel aspect ratio
denominator of pixel aspect ratio
#TRUE if the format is interlaced
Determines the #GstVideoFormat of @caps and places it in the location
pointed to by @format. Extracts the size of the video and places it
in the location pointed to by @width and @height. If @caps does not
represent one of the raw video formats listed in #GstVideoFormat, the
function will fail and return FALSE.
TRUE if @caps was parsed correctly.
the #GstCaps to parse
the #GstVideoFormat of the video represented by @caps (output)
the width of the video represented by @caps, may be NULL (output)
the height of the video represented by @caps, may be NULL (output)
Extracts whether the caps represents interlaced content or not and places it
in @interlaced.
TRUE if @caps was parsed correctly.
the fixed #GstCaps to parse
whether @caps represents interlaced video or not, may be NULL (output)
Converts a #GstVideoFormat value into the corresponding FOURCC. Only
a few YUV formats have corresponding FOURCC values. If @format has
no corresponding FOURCC value, 0 is returned.
the FOURCC corresponding to @format
a #GstVideoFormat video format
A convenience function to retrieve a GValue holding the framerate
from the caps on a pad.
The pad needs to have negotiated caps containing a framerate property.
do not contain a framerate.
NULL if the pad has no configured caps or the configured caps
pointer to a #GstPad
Inspect the caps of the provided pad and retrieve the width and height of
the video frames it is configured for.
The pad needs to have negotiated caps containing width and height properties.
TRUE if the width and height could be retrieved.
pointer to a #GstPad
pointer to integer to hold pixel width of the video frames (output)
pointer to integer to hold pixel height of the video frames (output)
Extracts the chroma site used by the caps. Possible values are
"mpeg2" for MPEG-2 style chroma siting (co-sited horizontally,
halfway-sited vertically), "jpeg" for JPEG and Theora style
chroma siting (halfway-sited both horizontally and vertically).
Other chroma site values are possible, but uncommon.
When no chroma site is specified in the caps, it should be assumed
to be "mpeg2".
determined.
a chroma site string, or NULL if no chroma site could be
the fixed #GstCaps to parse
Extracts the color matrix used by the caps. Possible values are
"sdtv" for the standard definition color matrix (as specified in
Rec. ITU-R BT.470-6) or "hdtv" for the high definition color
matrix (as specified in Rec. ITU-R BT.709)
determined.
a color matrix string, or NULL if no color matrix could be
the fixed #GstCaps to parse
Extracts the frame rate from @caps and places the values in the locations
pointed to by @fps_n and @fps_d. Returns TRUE if the values could be
parsed correctly, FALSE if not.
This function can be used with #GstCaps that have any media type; it
is not limited to formats handled by #GstVideoFormat.
TRUE if @caps was parsed correctly.
pointer to a #GstCaps instance
pointer to integer to hold numerator of frame rate (output)
pointer to integer to hold denominator of frame rate (output)
Returns the palette data from the caps as a #GstBuffer. For
#GST_VIDEO_FORMAT_RGB8_PALETTED this is containing 256 #guint32
values, each containing ARGB colors in native endianness.
a #GstBuffer containing the palette data. Unref after usage.
#GstCaps to parse
Extracts the pixel aspect ratio from @caps and places the values in
the locations pointed to by @par_n and @par_d. Returns TRUE if the
values could be parsed correctly, FALSE if not.
This function can be used with #GstCaps that have any media type; it
is not limited to formats handled by #GstVideoFormat.
TRUE if @caps was parsed correctly.
pointer to a #GstCaps instance
pointer to numerator of pixel aspect ratio (output)
pointer to denominator of pixel aspect ratio (output)