From: Lin YANG Date: Mon, 17 Aug 2009 09:42:06 +0000 (+0800) Subject: h264parse: Start PPS parsing work X-Git-Tag: 1.19.3~507^2~18243 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=397abd5741486310c0aa5868335c128413ca743c;p=platform%2Fupstream%2Fgstreamer.git h264parse: Start PPS parsing work --- diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c index 86ff0af..3fbd44e 100644 --- a/gst/h264parse/gsth264parse.c +++ b/gst/h264parse/gsth264parse.c @@ -246,6 +246,12 @@ struct _GstH264Sps gboolean pic_struct_present_flag; /* And more... */ }; +/* PPS: pic parameter sets */ +struct _GstH264Pps +{ + guint8 pps_id; + guint8 sps_id; +}; static GstH264Sps * gst_h264_parse_get_sps (GstH264Parse * h, guint8 sps_id) @@ -269,6 +275,28 @@ gst_h264_parse_get_sps (GstH264Parse * h, guint8 sps_id) h->sps = h->sps_buffers[sps_id] = sps; return sps; } +static GstH264Pps * +gst_h264_parse_get_pps (GstH264Parse * h, guint8 pps_id) +{ + GstH264Pps *pps; + g_return_val_if_fail (h != NULL, NULL); + if (pps_id >= MAX_PPS_COUNT) { + GST_DEBUG_OBJECT (h, "requested pps_id=%04x out of range", pps_id); + return NULL; + } + pps = h->pps_buffers[pps_id]; + if (pps == NULL) { + GST_DEBUG_OBJECT (h, "Creating pps with pps_id=%04x", pps_id); + pps = g_slice_new0 (GstH264Pps); + if (pps == NULL) { + GST_DEBUG_OBJECT (h, "Failed!"); + } + } + + h->pps = h->pps_buffers[pps_id] = pps; + return pps; +} + GST_BOILERPLATE (GstH264Parse, gst_h264_parse, GstElement, GST_TYPE_ELEMENT); diff --git a/gst/h264parse/gsth264parse.h b/gst/h264parse/gsth264parse.h index 2fcda23..6aea198 100644 --- a/gst/h264parse/gsth264parse.h +++ b/gst/h264parse/gsth264parse.h @@ -45,8 +45,10 @@ typedef struct _GstH264ParseClass GstH264ParseClass; typedef struct _GstNalList GstNalList; typedef struct _GstH264Sps GstH264Sps; +typedef struct _GstH264Pps GstH264Pps; #define MAX_SPS_COUNT 32 +#define MAX_PPS_COUNT 32 struct _GstH264Parse { GstElement element; @@ -75,6 +77,9 @@ struct _GstH264Parse /* SPS: sequential parameter set */ GstH264Sps *sps_buffers[MAX_SPS_COUNT]; GstH264Sps *sps; /* Current SPS */ + /* PPS: sequential parameter set */ + GstH264Pps *pps_buffers[MAX_PPS_COUNT]; + GstH264Pps *pps; /* Current PPS */ }; struct _GstH264ParseClass