h264parse: fix issue that caps "interlace-mode" can't be updated correctly

Upstream overrides the info "interlace-mode", otherwise update it with
SPS info.
This commit is contained in:
Fuwei Tang 2019-08-03 11:31:21 +08:00
parent f7f9f327cd
commit f3587c61ba

View file

@ -2074,12 +2074,17 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
}
}
if (sps->frame_mbs_only_flag == 0)
/* upstream overrides or uses sps info */
if (s && gst_structure_has_field (s, "interlace-mode"))
imode =
gst_video_interlace_mode_from_string (gst_structure_get_string (s,
"interlace-mode"));
else 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);
gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING,
gst_video_interlace_mode_to_string (imode), NULL);
bit_depth_chroma = sps->bit_depth_chroma_minus8 + 8;