mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
h264parse: remove codec_data if output is bytestream
codec_data should be removed from the src pad caps if the output is in bytestream format Fixes #606657
This commit is contained in:
parent
ddeb6e17fd
commit
e6ab078785
1 changed files with 8 additions and 2 deletions
|
@ -1169,6 +1169,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
|
|||
{
|
||||
GstH264Sps *sps = NULL;
|
||||
GstCaps *src_caps = NULL;
|
||||
GstStructure *structure;
|
||||
gboolean modified = FALSE;
|
||||
|
||||
/* current PPS dictates which SPS to use */
|
||||
|
@ -1225,14 +1226,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
|
|||
}
|
||||
}
|
||||
|
||||
structure = gst_caps_get_structure (src_caps, 0);
|
||||
/* transforming to non-bytestream needs to make codec-data */
|
||||
if (h264parse->format == GST_H264_PARSE_FORMAT_SAMPLE) {
|
||||
GstBuffer *buf;
|
||||
GstStructure *structure;
|
||||
const GValue *value = NULL;
|
||||
const GstBuffer *codec_data = NULL;
|
||||
|
||||
structure = gst_caps_get_structure (src_caps, 0);
|
||||
value = gst_structure_get_value (structure, "codec_data");
|
||||
if (value != NULL)
|
||||
codec_data = gst_value_get_buffer (value);
|
||||
|
@ -1250,6 +1250,12 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
|
|||
} else {
|
||||
GST_DEBUG_OBJECT (h264parse, "no codec_data yet");
|
||||
}
|
||||
} else if (h264parse->format == GST_H264_PARSE_FORMAT_BYTE) {
|
||||
/* need to remove the codec_data */
|
||||
if (gst_structure_has_field (structure, "codec_data")) {
|
||||
gst_structure_remove_field (structure, "codec_data");
|
||||
modified = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* save as new caps, caps will be set when pushing data */
|
||||
|
|
Loading…
Reference in a new issue