From 5f6a805dfde796a0ddd0ccda33e5693b65f4ade5 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 12 Jul 2011 19:01:47 +0200 Subject: [PATCH] h264parse: assume byte-stream if stream-format and codec_data are missing from input caps --- gst/videoparsers/gsth264parse.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 5492b05..b374b72 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -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 */ -- 2.7.4