return GST_VC1_PARSER_ERROR;
}
+/**
+ * gst_vc1_parse_frame_layer:
+ * @data: The data to parse
+ * @size: the size of @data
+ * @framelayer: The #GstVC1FrameLayer to fill.
+ *
+ * Parses @data, and fills @framelayer fields.
+ *
+ * Returns: a #GstVC1ParserResult
+ */
+GstVC1ParserResult
+gst_vc1_parse_frame_layer (const guint8 * data, gsize size,
+ GstVC1FrameLayer * framelayer)
+{
+ GstBitReader br = GST_BIT_READER_INIT (data, size);
+
+ if (gst_bit_reader_get_remaining (&br) < 64) {
+ GST_WARNING ("Could not parse frame layer");
+
+ return GST_VC1_PARSER_ERROR;
+ }
+
+ /* set default values */
+ framelayer->skiped_p_frame = 0;
+
+ framelayer->key = gst_bit_reader_get_bits_uint8_unchecked (&br, 1);
+ gst_bit_reader_skip_unchecked (&br, 7);
+
+ framelayer->framesize = gst_bit_reader_get_bits_uint32_unchecked (&br, 24);
+
+ if (framelayer->framesize == 0 || framelayer->framesize == 1)
+ framelayer->skiped_p_frame = 1;
+
+ /* compute next_framelayer_offset */
+ framelayer->next_framelayer_offset = framelayer->framesize + 8;
+
+ framelayer->timestamp = gst_bit_reader_get_bits_uint32_unchecked (&br, 32);
+
+ return GST_VC1_PARSER_OK;
+}
+
/**
* gst_vc1_parse_frame_header:
* @data: The data to parse
typedef struct _GstVC1SeqStructC GstVC1SeqStructC;
/* Pictures Structures */
+typedef struct _GstVC1FrameLayer GstVC1FrameLayer;
typedef struct _GstVC1FrameHdr GstVC1FrameHdr;
typedef struct _GstVC1PicAdvanced GstVC1PicAdvanced;
typedef struct _GstVC1PicSimpleMain GstVC1PicSimpleMain;
};
+struct _GstVC1FrameLayer
+{
+ guint8 key;
+ guint32 framesize;
+
+ guint32 timestamp;
+
+ /* calculated */
+ guint32 next_framelayer_offset;
+ guint8 skiped_p_frame;
+};
+
/**
* GstVC1FrameHdr:
*
gsize size,
GstVC1SeqStructC *structc);
+GstVC1ParserResult gst_vc1_parse_frame_layer (const guint8 *data,
+ gsize size,
+ GstVC1FrameLayer * framelayer);
+
GstVC1ParserResult gst_vc1_parse_frame_header (const guint8 *data,
gsize size,
GstVC1FrameHdr * framehdr,