mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
omxvideodec: Make the inport and outport index configurable by the subclass
This commit is contained in:
parent
bc1e73e8c8
commit
08181d86dc
3 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue