summaryrefslogtreecommitdiffstats
path: root/sys/vdpau/gstvdpaumpegdecoder.c
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2009-03-26 21:04:48 +0100
committerJan Schmidt <thaytan@noraisin.net>2009-06-20 15:21:21 +0100
commit090638ccec59cebb11327d12ebcff78015716bed (patch)
tree03510134c1a46dfe34d165313a743884d9459502 /sys/vdpau/gstvdpaumpegdecoder.c
parent367708e2ae7435fab215fd93b31234e553220c77 (diff)
downloadgst-plugins-bad-090638ccec59cebb11327d12ebcff78015716bed.tar.gz
gst-plugins-bad-090638ccec59cebb11327d12ebcff78015716bed.tar.bz2
gst-plugins-bad-090638ccec59cebb11327d12ebcff78015716bed.zip
vdpau: extract mpeg version
Diffstat (limited to 'sys/vdpau/gstvdpaumpegdecoder.c')
-rw-r--r--sys/vdpau/gstvdpaumpegdecoder.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/vdpau/gstvdpaumpegdecoder.c b/sys/vdpau/gstvdpaumpegdecoder.c
index c22c27f3..380cf602 100644
--- a/sys/vdpau/gstvdpaumpegdecoder.c
+++ b/sys/vdpau/gstvdpaumpegdecoder.c
@@ -87,7 +87,8 @@ enum
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-mpeg, mpegversion = (int) [ 1, 2 ]")
+ GST_STATIC_CAPS ("video/mpeg, mpegversion = (int) [ 1, 2 ], "
+ "systemstream = (boolean) false")
);
GST_BOILERPLATE (GstVdpauMpegDecoder, gst_vdpau_mpeg_decoder, GstVdpauDecoder,
@@ -98,6 +99,20 @@ static void gst_vdpau_mpeg_decoder_set_property (GObject * object,
static void gst_vdpau_mpeg_decoder_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
+static gboolean
+gst_vdpau_mpeg_decoder_set_caps (GstVdpauDecoder * dec, GstCaps * caps)
+{
+ GstVdpauMpegDecoder *mpeg_dec;
+ GstStructure *structure;
+
+ mpeg_dec = GST_VDPAU_MPEG_DECODER (dec);
+
+ structure = gst_caps_get_structure (caps, 0);
+ gst_structure_get_int (structure, "mpegversion", &mpeg_dec->version);
+
+ return TRUE;
+}
+
/* GObject vmethod implementations */
static void
@@ -121,9 +136,11 @@ gst_vdpau_mpeg_decoder_class_init (GstVdpauMpegDecoderClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
+ GstVdpauDecoderClass *vdpaudec_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ vdpaudec_class = (GstVdpauDecoderClass *) klass;
gobject_class->set_property = gst_vdpau_mpeg_decoder_set_property;
gobject_class->get_property = gst_vdpau_mpeg_decoder_get_property;
@@ -131,6 +148,8 @@ gst_vdpau_mpeg_decoder_class_init (GstVdpauMpegDecoderClass * klass)
g_object_class_install_property (gobject_class, PROP_SILENT,
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
FALSE, G_PARAM_READWRITE));
+
+ vdpaudec_class->set_caps = gst_vdpau_mpeg_decoder_set_caps;
}
static void