diff options
Diffstat (limited to 'src/gstducativp6dec.c')
-rw-r--r-- | src/gstducativp6dec.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/gstducativp6dec.c b/src/gstducativp6dec.c index d2bcc36..e2af463 100644 --- a/src/gstducativp6dec.c +++ b/src/gstducativp6dec.c @@ -40,17 +40,15 @@ #define PADX 48 #define PADY 48 - -GST_BOILERPLATE (GstDucatiVP6Dec, gst_ducati_vp6dec, GstDucatiVidDec, - GST_TYPE_DUCATIVIDDEC); +#define gst_ducati_vp6dec_parent_class parent_class +G_DEFINE_TYPE (GstDucatiVP6Dec, gst_ducati_vp6dec, GST_TYPE_DUCATIVIDDEC); static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-vp6, " "width = (int)[ 16, 2048 ], " - "height = (int)[ 16, 2048 ], " - "framerate = (fraction)[ 0, max ];") + "height = (int)[ 16, 2048 ], " "framerate = (fraction)[ 0, max ];") ); /* GstDucatiVidDec vmethod implementations */ @@ -71,7 +69,8 @@ static gboolean gst_ducati_vp6dec_allocate_params (GstDucatiVidDec * self, gint params_sz, gint dynparams_sz, gint status_sz, gint inargs_sz, gint outargs_sz) { - gboolean ret = parent_class->allocate_params (self, + gboolean ret = + GST_DUCATIVIDDEC_GET_CLASS (parent_class)->allocate_params (self, sizeof (Ivp6VDEC_Params), sizeof (Ivp6VDEC_DynamicParams), sizeof (Ivp6VDEC_Status), sizeof (Ivp6VDEC_InArgs), sizeof (Ivp6VDEC_OutArgs)); @@ -94,6 +93,7 @@ gst_ducati_vp6dec_allocate_params (GstDucatiVidDec * self, gint params_sz, static GstBuffer * gst_ducati_vp6dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf) { + gpointer data; guint32 sz; if (G_UNLIKELY (vdec->first_in_buffer) && vdec->codec_data) { @@ -101,10 +101,11 @@ gst_ducati_vp6dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf) } /* current codec version requires size prepended on input buffer: */ - sz = GST_BUFFER_SIZE (buf); - push_input (vdec, (guint8 *)&sz, 4); + data = gst_buffer_map (buf, &sz, NULL, GST_MAP_READ); + push_input (vdec, (guint8 *) & sz, 4); - push_input (vdec, GST_BUFFER_DATA (buf), sz); + push_input (vdec, data, sz); + gst_buffer_unmap (buf, data, sz); gst_buffer_unref (buf); return NULL; @@ -114,35 +115,28 @@ gst_ducati_vp6dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf) /* GObject vmethod implementations */ static void -gst_ducati_vp6dec_base_init (gpointer gclass) +gst_ducati_vp6dec_class_init (GstDucatiVP6DecClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstDucatiVidDecClass *bclass = GST_DUCATIVIDDEC_CLASS (klass); gst_element_class_set_details_simple (element_class, "DucatiVP6Dec", "Codec/Decoder/Video", - "Decodes video in On2 VP6 format with ducati", - "Rob Clark <rob@ti.com>"); + "Decodes video in On2 VP6 format with ducati", "Rob Clark <rob@ti.com>"); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_factory)); -} -static void -gst_ducati_vp6dec_class_init (GstDucatiVP6DecClass * klass) -{ - GstDucatiVidDecClass *bclass = GST_DUCATIVIDDEC_CLASS (klass); bclass->codec_name = "ivahd_vp6dec"; bclass->update_buffer_size = GST_DEBUG_FUNCPTR (gst_ducati_vp6dec_update_buffer_size); bclass->allocate_params = GST_DEBUG_FUNCPTR (gst_ducati_vp6dec_allocate_params); - bclass->push_input = - GST_DEBUG_FUNCPTR (gst_ducati_vp6dec_push_input); + bclass->push_input = GST_DEBUG_FUNCPTR (gst_ducati_vp6dec_push_input); } static void -gst_ducati_vp6dec_init (GstDucatiVP6Dec * self, - GstDucatiVP6DecClass * gclass) +gst_ducati_vp6dec_init (GstDucatiVP6Dec * self) { } |