From 39c5015ed0983d19f4d5e8b43c99571e2dd2626f Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 23 Nov 2011 15:45:57 -0300 Subject: [PATCH] video: support any type of video in _parse_caps Slight change in semantics for convenience. Shouldn't cause any problems since this function is usually only used on pre-filtered caps and not random caps, and it's hard to imagine a situation where someone would want to rely on the previous behaviour. --- gst-libs/gst/video/video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 2ad97f290b..f22ff4c12f 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -317,8 +317,10 @@ gst_video_parse_caps_chroma_site (GstCaps * caps) * 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. + * represent a video format or does not contain height and width, the + * function will fail and return FALSE. If @caps does not represent a raw + * video format listed in #GstVideoFormat, but still contains video caps, + * this function will return TRUE and set @format to #GST_VIDEO_FORMAT_UNKNOWN. * * Since: 0.10.16 * @@ -429,6 +431,8 @@ gst_video_format_parse_caps (const GstCaps * caps, GstVideoFormat * format, } else { ok = FALSE; } + } else if (g_str_has_prefix (gst_structure_get_name (structure), "video/")) { + *format = GST_VIDEO_FORMAT_UNKNOWN; } else { ok = FALSE; }