diff --git a/ChangeLog b/ChangeLog index 774f725ef7..9b67c40fac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-14 Mark Nauwelaerts + + * gst-libs/gst/video/video.c: (gst_video_format_parse_caps): + Video format can also be conveniently determined from (many) + non-fixed caps. + 2008-07-14 Jan Schmidt * gst/playback/gstplaybasebin.c: diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 3be9d40e32..31c534b94d 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -223,8 +223,8 @@ error_overflow: * gst_video_format_parse_caps: * @caps: the #GstCaps to parse * @format: the #GstVideoFormat of the video represented by @caps (output) - * @width: the width of the video represented by @caps (output) - * @height: the height of the video represented by @caps (output) + * @width: the width of the video represented by @caps, may be NULL (output) + * @height: the height of the video represented by @caps, may be NULL (output) * * Determines the #GstVideoFormat of @caps and places it in the location * pointed to by @format. Extracts the size of the video and places it @@ -243,7 +243,9 @@ gst_video_format_parse_caps (GstCaps * caps, GstVideoFormat * format, GstStructure *structure; gboolean ok = TRUE; - if (!gst_caps_is_fixed (caps)) + /* caps must hold exactly 1 structure to be unambiguous, + * but need not be fixed to determine format */ + if (gst_caps_get_size (caps) != 1) return FALSE; structure = gst_caps_get_structure (caps, 0);