summaryrefslogtreecommitdiffstats
path: root/sys/vdpau/mpegutil.h
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2009-03-27 16:55:19 +0100
committerJan Schmidt <thaytan@noraisin.net>2009-06-20 15:21:21 +0100
commit29d0c5bdd8beeb2b1ed25e8bf37eec9a135c5422 (patch)
tree8556d9440934c8ea1b79244f310f924c4644d36f /sys/vdpau/mpegutil.h
parent090638ccec59cebb11327d12ebcff78015716bed (diff)
downloadgst-plugins-bad-29d0c5bdd8beeb2b1ed25e8bf37eec9a135c5422.tar.gz
gst-plugins-bad-29d0c5bdd8beeb2b1ed25e8bf37eec9a135c5422.tar.bz2
gst-plugins-bad-29d0c5bdd8beeb2b1ed25e8bf37eec9a135c5422.zip
vdpau: extract mpeg2 profile from codec_data
Diffstat (limited to 'sys/vdpau/mpegutil.h')
-rw-r--r--sys/vdpau/mpegutil.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/sys/vdpau/mpegutil.h b/sys/vdpau/mpegutil.h
new file mode 100644
index 00000000..f0f8aca0
--- /dev/null
+++ b/sys/vdpau/mpegutil.h
@@ -0,0 +1,63 @@
+/* GStreamer
+ * Copyright (C) 2007 Jan Schmidt <thaytan@mad.scientist.com>
+ * Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __MPEGUTIL_H__
+#define __MPEGUTIL_H__
+
+#include <gst/gst.h>
+
+typedef struct MPEGSeqHdr MPEGSeqHdr;
+
+/* Packet ID codes for different packet types we
+ * care about */
+#define MPEG_PACKET_PICTURE 0x00
+#define MPEG_PACKET_SLICE_MIN 0x01
+#define MPEG_PACKET_SLICE_MAX 0xaf
+#define MPEG_PACKET_SEQUENCE 0xb3
+#define MPEG_PACKET_EXTENSION 0xb5
+#define MPEG_PACKET_SEQUENCE_END 0xb7
+#define MPEG_PACKET_GOP 0xb8
+#define MPEG_PACKET_NONE 0xff
+
+/* Extension codes we care about */
+#define MPEG_PACKET_EXT_SEQUENCE 0x01
+#define MPEG_PACKET_EXT_SEQUENCE_DISPLAY 0x02
+#define MPEG_PACKET_EXT_QUANT_MATRIX 0x03
+
+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;
+
+ /* mpeg2 decoder profile */
+ gint profile;
+};
+
+gboolean mpeg_util_parse_sequence_hdr (MPEGSeqHdr *hdr,
+ guint8 *data, guint8 *end);
+
+#endif