mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
h264parse: increase caps equality check for no codec_data
When converting from avc to byte-stream, there will not be any codec_data in the src caps. Remove it before the equality check to avoid sending caps events downstream on every SPS/PPS change. https://bugzilla.gnome.org/show_bug.cgi?id=761014
This commit is contained in:
parent
f352691a04
commit
72bc7d7f73
1 changed files with 12 additions and 6 deletions
|
@ -1863,14 +1863,20 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
|
|||
|
||||
src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h264parse));
|
||||
|
||||
if (src_caps
|
||||
&& gst_structure_has_field (gst_caps_get_structure (src_caps, 0),
|
||||
"codec_data")) {
|
||||
if (src_caps) {
|
||||
/* use codec data from old caps for comparison; we don't want to resend caps
|
||||
if everything is same except codec data; */
|
||||
gst_caps_set_value (caps, "codec_data",
|
||||
gst_structure_get_value (gst_caps_get_structure (src_caps, 0),
|
||||
"codec_data"));
|
||||
if (gst_structure_has_field (gst_caps_get_structure (src_caps, 0),
|
||||
"codec_data")) {
|
||||
gst_caps_set_value (caps, "codec_data",
|
||||
gst_structure_get_value (gst_caps_get_structure (src_caps, 0),
|
||||
"codec_data"));
|
||||
} else if (!buf) {
|
||||
GstStructure *s;
|
||||
/* remove any left-over codec-data hanging around */
|
||||
s = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_remove_field (s, "codec_data");
|
||||
}
|
||||
}
|
||||
|
||||
if (!(src_caps && gst_caps_is_strictly_equal (src_caps, caps))) {
|
||||
|
|
Loading…
Reference in a new issue