mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
h264parse: assume byte-stream if stream-format and codec_data are missing from input caps
This commit is contained in:
parent
7bcc0c71b8
commit
5f6a805dfd
1 changed files with 12 additions and 0 deletions
|
@ -1017,12 +1017,24 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
|
|||
}
|
||||
|
||||
h264parse->codec_data = gst_buffer_ref (codec_data);
|
||||
|
||||
/* if upstream sets codec_data without setting stream-format and alignment, we
|
||||
* assume stream-format=avc,alignment=au */
|
||||
if (format == GST_H264_PARSE_FORMAT_NONE) {
|
||||
format = GST_H264_PARSE_FORMAT_AVC;
|
||||
align = GST_H264_PARSE_ALIGN_AU;
|
||||
}
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (h264parse, "have bytestream h264");
|
||||
/* nothing to pre-process */
|
||||
h264parse->packetized = FALSE;
|
||||
/* we have 4 sync bytes */
|
||||
h264parse->nal_length_size = 4;
|
||||
|
||||
if (format == GST_H264_PARSE_FORMAT_NONE) {
|
||||
format = GST_H264_PARSE_FORMAT_BYTE;
|
||||
align = GST_H264_PARSE_ALIGN_AU;
|
||||
}
|
||||
}
|
||||
|
||||
/* negotiate with downstream, sets ->format and ->align */
|
||||
|
|
Loading…
Reference in a new issue