summaryrefslogtreecommitdiff
path: root/gst/h264parse
diff options
context:
space:
mode:
authorLin YANG <oxcsnicho@gmail.com>2009-08-17 17:42:06 +0800
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-31 09:15:05 +0200
commit397abd5741486310c0aa5868335c128413ca743c (patch)
tree90e4a0cc0db3e116141522d41341cb6a9843f188 /gst/h264parse
parent196b8240e2226f38e32aea88e06f014c8bff16fb (diff)
h264parse: Start PPS parsing work
Diffstat (limited to 'gst/h264parse')
-rw-r--r--gst/h264parse/gsth264parse.c28
-rw-r--r--gst/h264parse/gsth264parse.h5
2 files changed, 33 insertions, 0 deletions
diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c
index 86ff0afaf..3fbd44ebd 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 2fcda2370..6aea198ca 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