From b75a61342f4ea039d922a966f36b02cd9d9c3ad8 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 27 Feb 2017 10:32:45 -0300 Subject: [PATCH] h264parse: Include `interlace-mode` in caps Those are the rules: In the SPS: * if frame_mbs_only_flag=1 => all frame progressive * if frame_mbs_only_flag=0 => field_pic_flag defines if each frame is progressive or interlaced, thus the mode is 'mixed' in GStreamer terms. https://bugzilla.gnome.org/show_bug.cgi?id=779309 --- gst/videoparsers/gsth264parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 3153c2bc55..aaf4c39ac8 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1791,6 +1791,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) } if (G_UNLIKELY (modified || h264parse->update_caps)) { + GstVideoInterlaceMode imode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; gint width, height; GstClockTime latency; @@ -1864,7 +1865,14 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) gst_base_parse_set_latency (GST_BASE_PARSE (h264parse), latency, latency); } + } + if (sps->frame_mbs_only_flag == 0) + imode = GST_VIDEO_INTERLACE_MODE_MIXED; + + if (s && !gst_structure_has_field (s, "interlace-mode")) + gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING, + gst_video_interlace_mode_to_string (imode), NULL); } }