-
public bool video_calculate_display_ratio (ref uint dar_n, ref uint dar_d, uint video_width, uint video_height, uint video_par_n, uint video_par_d, uint display_par_n, uint display_par_d)
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.
-
public weak Buffer video_convert_frame (Buffer buf, Caps to_caps, ClockTime timeout) throws Error
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 Error).
-
public void video_convert_frame_async (Buffer buf, Caps to_caps, ClockTime timeout, VideoConvertFrameCallback callback, DestroyNotify destroy_notify)
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
MainContext, see
get_thread_default. If GLib before 2.22 is
used, this will always be the global default main context. anymore.
-
public weak Event video_event_new_still_frame (bool in_still)
-
public bool video_event_parse_still_frame (Event event, bool in_still)
Parse a Event, 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
video_event_new_still_frame
-
public bool video_format_convert (VideoFormat format, int width, int height, int fps_n, int fps_d, Format src_format, int64 src_value, Format dest_format, ref int64 dest_value)
Converts among various Format 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.
-
public VideoFormat video_format_from_fourcc (uint32 fourcc)
-
public int video_format_get_component_depth (VideoFormat format, ref int component)
Returns the number of bits used to encode an individual pixel of a given component. Typically this is 8,
although higher and lower values are possible for some formats.
-
public int video_format_get_component_height (VideoFormat format, ref int component, ref int height)
Calculates the height of the component. See of the component index.
-
public int video_format_get_component_offset (VideoFormat format, ref int component, ref int width, ref int height)
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.
-
public int video_format_get_component_width (VideoFormat format, ref int component, ref int width)
Calculates the width of the component. See of the component index.
-
public int video_format_get_pixel_stride (VideoFormat format, ref int component)
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.
-
public int video_format_get_row_stride (VideoFormat format, ref int component, ref int width)
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.
-
public int video_format_get_size (VideoFormat format, ref int width, ref int height)
Calculates the total number of bytes in the raw video format. This number should be used when allocating
a buffer for raw video.
-
public bool video_format_has_alpha (VideoFormat format)
Returns TRUE or FALSE depending on if the video format provides an alpha channel.
-
public bool video_format_is_gray (VideoFormat format)
Determine whether the video format is a grayscale format.
-
public bool video_format_is_rgb (VideoFormat format)
Determine whether the video format is an RGB format.
-
public bool video_format_is_yuv (VideoFormat format)
Determine whether the video format is a YUV format.
-
public Caps video_format_new_caps (VideoFormat format, int width, int height, int framerate_n, int framerate_d, int par_n, int par_d)
Creates a new Caps object based on the
parameters provided.
-
public Caps video_format_new_caps_interlaced (VideoFormat format, int width, int height, int framerate_n, int framerate_d, int par_n, int par_d, bool interlaced)
Creates a new Caps object based on the
parameters provided.
-
public weak Caps video_format_new_template_caps (VideoFormat format)
Creates a new Caps object based on the
parameters provided. Size, frame rate, and pixel aspect ratio are set to the full range.
-
public bool video_format_parse_caps (Caps caps, ref VideoFormat format, ref int width, ref int height)
Determines the VideoFormat 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
VideoFormat, the function will fail and return FALSE.
-
public bool video_format_parse_caps_interlaced (Caps caps, bool interlaced)
Extracts whether the caps represents interlaced content or not and places it in interlaced.
-
public uint32 video_format_to_fourcc (VideoFormat format)
Converts a VideoFormat value into the corresponding
FOURCC. Only a few YUV formats have corresponding FOURCC values. If format has no corresponding FOURCC value, 0 is
returned.
-
public Value video_frame_rate (Pad pad)
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.
-
public bool video_get_size (Pad pad, ref int width, ref int height)
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.
-
public bool video_get_size_from_caps (Caps caps, int size)
-
public unowned string video_parse_caps_chroma_site (Caps caps)
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.
-
public unowned string video_parse_caps_color_matrix (Caps caps)
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.
-
public bool video_parse_caps_framerate (Caps caps, ref int fps_n, ref int fps_d)
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 Caps that have any media type; it is not limited to formats
handled by VideoFormat.
-
public weak Buffer video_parse_caps_palette (Caps caps)
Returns the palette data from the caps as a
Buffer. For RGB8_PALETTED this is containing 256
uint32 values, each containing ARGB colors in native endianness.
-
public bool video_parse_caps_pixel_aspect_ratio (Caps caps, ref int par_n, ref int par_d)
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 Caps that have any media type; it is not limited to formats
handled by VideoFormat.