From: David Schleef Date: Tue, 9 Mar 2010 21:05:23 +0000 (-0800) Subject: video: Add color-matrix handling to caps X-Git-Tag: 1.19.3~511^2~8702 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76afac25b433781c485b2ec5870862e0c9faa1f0;p=platform%2Fupstream%2Fgstreamer.git video: Add color-matrix handling to caps --- diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index f4dc70b..bf7b454 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -250,6 +250,41 @@ gst_video_format_parse_caps_interlaced (GstCaps * caps, gboolean * interlaced) } /** + * gst_video_parse_caps_color_matrix: + * @caps: 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) + * + * Since: 0.10.29 + * + * Returns: TRUE if @caps was parsed correctly. + */ +const char * +gst_video_parse_caps_color_matrix (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, "color-matrix"); + if (s) + return s; + + if (gst_structure_has_name (structure, "video/x-raw-yuv")) { + return "sdtv"; + } + + return NULL; +} + +/** * gst_video_format_parse_caps: * @caps: the #GstCaps to parse * @format: the #GstVideoFormat of the video represented by @caps (output) diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h index 20946dc..f968066 100644 --- a/gst-libs/gst/video/video.h +++ b/gst-libs/gst/video/video.h @@ -291,6 +291,7 @@ gboolean gst_video_parse_caps_framerate (GstCaps *caps, int *fps_n, int *fps_d); 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); GstCaps * gst_video_format_new_caps (GstVideoFormat format, int width, int height, int framerate_n, int framerate_d, int par_n, int par_d);