h264parse: Start SEI parsing work
authorLin YANG <oxcsnicho@gmail.com>
Mon, 17 Aug 2009 09:43:51 +0000 (17:43 +0800)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 31 Aug 2009 07:15:06 +0000 (09:15 +0200)
gst/h264parse/gsth264parse.c
gst/h264parse/gsth264parse.h

index 3fbd44e..cd3f8e7 100644 (file)
@@ -210,6 +210,35 @@ gst_nal_bs_read_ue (GstNalBs * bs)
   return ((1 << i) - 1 + gst_nal_bs_read (bs, i));
 }
 
+/* SEI type */
+typedef enum
+{
+  SEI_BUF_PERIOD = 0,
+  SEI_PIC_TIMING = 1
+      /* and more...  */
+} GstSeiPayloadType;
+
+/* SEI pic_struct type */
+typedef enum
+{
+  SEI_PIC_STRUCT_FRAME = 0,     /* 0: %frame */
+  SEI_PIC_STRUCT_TOP_FIELD = 1, /* 1: top field */
+  SEI_PIC_STRUCT_BOTTOM_FIELD = 2,      /* 2: bottom field */
+  SEI_PIC_STRUCT_TOP_BOTTOM = 3,        /* 3: top field, bottom field, in that order */
+  SEI_PIC_STRUCT_BOTTOM_TOP = 4,        /* 4: bottom field, top field, in that order */
+  SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5,    /* 5: top field, bottom field, top field repeated, in that order */
+  SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, /* 6: bottom field, top field, bottom field repeated, in that order */
+  SEI_PIC_STRUCT_FRAME_DOUBLING = 7,    /* 7: %frame doubling */
+  SEI_PIC_STRUCT_FRAME_TRIPLING = 8     /* 8: %frame tripling */
+} GstSeiPicStructType;
+
+/* pic_struct to NumClockTS lookup table */
+static const guint8 sei_num_clock_ts_table[9] = {
+  1, 1, 1, 2, 2, 3, 3, 2, 3
+};
+
+#define Extended_SAR 255
+
 /* SPS: sequential parameter sets */
 struct _GstH264Sps
 {
index 6aea198..8e07a0e 100644 (file)
@@ -80,6 +80,16 @@ struct _GstH264Parse
   /* PPS: sequential parameter set */ 
   GstH264Pps *pps_buffers[MAX_PPS_COUNT];
   GstH264Pps *pps; /* Current PPS */ 
+
+  /* SEI: supplemental enhancement messages */ 
+  /* buffering period */ 
+  guint32 initial_cpb_removal_delay[32];
+  /* picture timing */ 
+  guint32 sei_cpb_removal_delay;
+  guint32 sei_dpb_output_delay;
+  guint8 sei_pic_struct;
+  guint8 sei_ct_type; 
+  /* And more... */ 
 };
 
 struct _GstH264ParseClass