Commit 5379fbcd authored by David Schleef's avatar David Schleef
Browse files

video: add gst_video_parse_caps_chroma_site()

parent 085d7e20
......@@ -285,6 +285,46 @@ gst_video_parse_caps_color_matrix (GstCaps * caps)
return NULL;
* gst_video_parse_caps_chroma_site:
* @caps: the fixed #GstCaps to parse
* 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".
* Since: 0.10.29
* Returns: a chroma site string, or NULL if no chroma site could be
* determined.
const char *
gst_video_parse_caps_chroma_site (GstCaps * caps)
GstStructure *structure;
const char *s;
if (!gst_caps_is_fixed (caps))
return NULL;
structure = gst_caps_get_structure (caps, 0);
s = gst_structure_get_string (structure, "chroma-site");
if (s)
return s;
if (gst_structure_has_name (structure, "video/x-raw-yuv")) {
return "mpeg2";
return NULL;
* gst_video_format_parse_caps:
* @caps: the #GstCaps to parse
......@@ -292,6 +292,7 @@ gboolean gst_video_parse_caps_framerate (GstCaps *caps,
gboolean gst_video_parse_caps_pixel_aspect_ratio (GstCaps *caps,
int *par_n, int *par_d);
const char *gst_video_parse_caps_color_matrix (GstCaps * caps);
const char *gst_video_parse_caps_chroma_site (GstCaps * caps);
GstCaps * gst_video_format_new_caps (GstVideoFormat format,
int width, int height, int framerate_n, int framerate_d,
int par_n, int par_d);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment