summaryrefslogtreecommitdiffstats
path: root/gst/mpegvideoparse/mpegpacketiser.h
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2007-03-16 11:22:47 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2007-03-16 11:22:47 +0000
commit1ff2df1d5f634ee445cd31c4f20f302ac414a48e (patch)
tree853528e552ae0be4f972b17d7a0b03492ac235ed /gst/mpegvideoparse/mpegpacketiser.h
parent22361a2dce0d0a1a7a126e3d23a5b35d18f87230 (diff)
downloadgst-plugins-bad-1ff2df1d5f634ee445cd31c4f20f302ac414a48e.tar.gz
gst-plugins-bad-1ff2df1d5f634ee445cd31c4f20f302ac414a48e.tar.bz2
gst-plugins-bad-1ff2df1d5f634ee445cd31c4f20f302ac414a48e.zip
gst/mpegvideoparse/: Move the MPEG specific byte parsing into the mpegpacketiser code.
Original commit message from CVS: * gst/mpegvideoparse/mpegpacketiser.c: (mpeg_util_find_start_code), (collect_packets), (set_par_from_dar), (set_fps_from_code), (mpeg_util_parse_extension_packet), (mpeg_util_parse_sequence_hdr), (mpeg_util_parse_picture_hdr): * gst/mpegvideoparse/mpegpacketiser.h: * gst/mpegvideoparse/mpegvideoparse.c: (mpegvideoparse_handle_sequence), (mpegvideoparse_handle_picture), (mpegvideoparse_drain_avail), (gst_mpegvideoparse_chain), (mpv_parse_sink_event), (plugin_init): * gst/mpegvideoparse/mpegvideoparse.h: Move the MPEG specific byte parsing into the mpegpacketiser code. Add parsing of picture types, that just feeds into a debug message for now. Fix some 64-bit format strings.
Diffstat (limited to 'gst/mpegvideoparse/mpegpacketiser.h')
-rw-r--r--gst/mpegvideoparse/mpegpacketiser.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/gst/mpegvideoparse/mpegpacketiser.h b/gst/mpegvideoparse/mpegpacketiser.h
index 202c6d9c..426b13aa 100644
--- a/gst/mpegvideoparse/mpegpacketiser.h
+++ b/gst/mpegvideoparse/mpegpacketiser.h
@@ -24,6 +24,8 @@
typedef struct MPEGPacketiser MPEGPacketiser;
typedef struct MPEGBlockInfo MPEGBlockInfo;
+typedef struct MPEGSeqHdr MPEGSeqHdr;
+typedef struct MPEGPictureHdr MPEGPictureHdr;
/* Packet ID codes for different packet types we
* care about */
@@ -48,6 +50,11 @@ typedef struct MPEGBlockInfo MPEGBlockInfo;
#define MPEG_BLOCK_FLAG_PICTURE 0x02
#define MPEG_BLOCK_FLAG_GOP 0x04
+#define MPEG_PICTURE_TYPE_I 0x01
+#define MPEG_PICTURE_TYPE_P 0x02
+#define MPEG_PICTURE_TYPE_B 0x03
+#define MPEG_PICTURE_TYPE_D 0x04
+
struct MPEGBlockInfo {
guint8 first_pack_type;
guint8 flags;
@@ -58,6 +65,24 @@ struct MPEGBlockInfo {
GstClockTime ts;
};
+struct MPEGSeqHdr
+{
+ /* 0 for unknown, else 1 or 2 */
+ guint8 mpeg_version;
+
+ /* Pixel-Aspect Ratio from DAR code via set_par_from_dar */
+ gint par_w, par_h;
+ /* Width and Height of the video */
+ gint width, height;
+ /* Framerate */
+ gint fps_n, fps_d;
+};
+
+struct MPEGPictureHdr
+{
+ guint8 pic_type;
+};
+
struct MPEGPacketiser {
GstAdapter *adapter;
/* position in the adapter */
@@ -97,8 +122,6 @@ struct MPEGPacketiser {
MPEGBlockInfo *blocks;
};
-guint8 *mpeg_find_start_code (guint32 *sync_word, guint8 *cur, guint8 *end);
-
void mpeg_packetiser_init (MPEGPacketiser *p);
void mpeg_packetiser_free (MPEGPacketiser *p);
@@ -113,4 +136,12 @@ MPEGBlockInfo *mpeg_packetiser_get_block (MPEGPacketiser *p, GstBuffer **buf);
/* Advance to the next data block */
void mpeg_packetiser_next_block (MPEGPacketiser *p);
+/* Utility functions for parsing MPEG packets */
+guint8 *mpeg_util_find_start_code (guint32 *sync_word,
+ guint8 *cur, guint8 *end);
+gboolean mpeg_util_parse_sequence_hdr (MPEGSeqHdr *hdr,
+ guint8 *data, guint8 *end);
+gboolean mpeg_util_parse_picture_hdr (MPEGPictureHdr *hdr,
+ guint8 *data, guint8 *end);
+
#endif