From 3a1fad60997f492ac3bdcaa22ccbed3e50ee8239 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 9 Jun 2010 15:32:14 +0200 Subject: [PATCH] h264parse: also collect SPS and PPS nalu in codec_data --- gst/h264parse/gsth264parse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c index 7351d907e9..af433c570f 100644 --- a/gst/h264parse/gsth264parse.c +++ b/gst/h264parse/gsth264parse.c @@ -1383,6 +1383,11 @@ gst_h264_parse_sink_setcaps (GstPad * pad, GstCaps * caps) goto avcc_too_small; gst_nal_bs_init (&bs, data + 2 + 1, len - 1); gst_nal_decode_sps (h264parse, &bs); + /* store for later use, e.g. insertion */ + if (h264parse->sps) { + h264parse->sps_nals[h264parse->sps->sps_id] = + gst_h264_parse_make_nal (h264parse, data + 2, len); + } if (h264parse->format == GST_H264_PARSE_FORMAT_BYTE) nlist = g_slist_append (nlist, gst_h264_parse_make_nal (h264parse, data + 2, len)); @@ -1398,6 +1403,11 @@ gst_h264_parse_sink_setcaps (GstPad * pad, GstCaps * caps) goto avcc_too_small; gst_nal_bs_init (&bs, data + 2 + 1, len - 1); gst_nal_decode_pps (h264parse, &bs); + /* store for later use, e.g. insertion */ + if (h264parse->pps) { + h264parse->pps_nals[h264parse->pps->pps_id] = + gst_h264_parse_make_nal (h264parse, data + 2, len); + } if (h264parse->format == GST_H264_PARSE_FORMAT_BYTE) nlist = g_slist_append (nlist, gst_h264_parse_make_nal (h264parse, data + 2, len));