From 08181d86dc12bb12c41956bf1df0462169efb330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 6 Jul 2011 08:48:37 +0200 Subject: [PATCH] omxvideodec: Make the inport and outport index configurable by the subclass --- omx/gstomxmpeg4videodec.c | 2 ++ omx/gstomxvideodec.c | 9 +++++++-- omx/gstomxvideodec.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/omx/gstomxmpeg4videodec.c b/omx/gstomxmpeg4videodec.c index 55d992ac88..f20a5cac8a 100644 --- a/omx/gstomxmpeg4videodec.c +++ b/omx/gstomxmpeg4videodec.c @@ -96,6 +96,8 @@ gst_omx_mpeg4_video_dec_class_init (GstOMXMPEG4VideoDecClass * klass) /* TODO: Make this configurable */ videodec_class->core_name = "/usr/local/lib/libomxil-bellagio.so.0"; videodec_class->component_name = "OMX.st.video_decoder.mpeg4"; + videodec_class->in_port_index = 0; + videodec_class->out_port_index = 1; videodec_class->is_format_change = GST_DEBUG_FUNCPTR (gst_omx_mpeg4_video_dec_is_format_change); diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 8007182f51..2d6dfbf12f 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -97,6 +97,9 @@ gst_omx_video_dec_class_init (GstOMXVideoDecClass * klass) GST_DEBUG_FUNCPTR (gst_omx_video_dec_handle_frame); base_video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_omx_video_dec_finish); + + klass->in_port_index = 0; + klass->out_port_index = 1; } static void @@ -122,8 +125,10 @@ gst_omx_video_dec_open (GstOMXVideoDec * self) return FALSE; /* FIXME: Always 0 == input, 1 == output? Make configurable? Let subclass decide? */ - self->in_port = gst_omx_component_add_port (self->component, 0); - self->out_port = gst_omx_component_add_port (self->component, 1); + self->in_port = + gst_omx_component_add_port (self->component, klass->in_port_index); + self->out_port = + gst_omx_component_add_port (self->component, klass->out_port_index); if (!self->in_port || !self->out_port) return FALSE; diff --git a/omx/gstomxvideodec.h b/omx/gstomxvideodec.h index 0ac411c15c..a675e4e072 100644 --- a/omx/gstomxvideodec.h +++ b/omx/gstomxvideodec.h @@ -65,6 +65,8 @@ struct _GstOMXVideoDecClass const gchar *core_name; const gchar *component_name; + + guint32 in_port_index, out_port_index; gboolean (*is_format_change) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state); gboolean (*set_format) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state);