Specifying the component is error prone and unnecessary.
https://bugzilla.gnome.org/show_bug.cgi?id=726021
}
OMX_ERRORTYPE
-gst_omx_component_setup_tunnel (GstOMXComponent * comp1, GstOMXPort * port1,
- GstOMXComponent * comp2, GstOMXPort * port2)
+gst_omx_setup_tunnel (GstOMXPort * port1, GstOMXPort * port2)
{
+ GstOMXComponent *comp1;
+ GstOMXComponent *comp2;
OMX_ERRORTYPE err;
- g_return_val_if_fail (comp1 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port1 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port1->port_def.eDir == OMX_DirOutput,
OMX_ErrorUndefined);
- g_return_val_if_fail (comp2 != NULL, OMX_ErrorUndefined);
+ comp1 = port1->comp;
+
g_return_val_if_fail (port2 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port2->port_def.eDir == OMX_DirInput,
OMX_ErrorUndefined);
+ comp2 = port2->comp;
+
g_return_val_if_fail (comp1->core == comp2->core, OMX_ErrorUndefined);
g_mutex_lock (&comp1->lock);
}
OMX_ERRORTYPE
-gst_omx_component_close_tunnel (GstOMXComponent * comp1, GstOMXPort * port1,
- GstOMXComponent * comp2, GstOMXPort * port2)
+gst_omx_close_tunnel (GstOMXPort * port1, GstOMXPort * port2)
{
+ GstOMXComponent *comp1;
+ GstOMXComponent *comp2;
OMX_ERRORTYPE err;
- g_return_val_if_fail (comp1 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port1 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port1->port_def.eDir == OMX_DirOutput,
OMX_ErrorUndefined);
- g_return_val_if_fail (comp2 != NULL, OMX_ErrorUndefined);
+ comp1 = port1->comp;
+
g_return_val_if_fail (port2 != NULL, OMX_ErrorUndefined);
g_return_val_if_fail (port2->port_def.eDir == OMX_DirInput,
OMX_ErrorUndefined);
+ comp2 = port2->comp;
+
g_return_val_if_fail (comp1->core == comp2->core, OMX_ErrorUndefined);
g_return_val_if_fail (port1->tunneled && port2->tunneled, OMX_ErrorUndefined);
OMX_ERRORTYPE gst_omx_component_get_config (GstOMXComponent * comp, OMX_INDEXTYPE index, gpointer config);
OMX_ERRORTYPE gst_omx_component_set_config (GstOMXComponent * comp, OMX_INDEXTYPE index, gpointer config);
-OMX_ERRORTYPE gst_omx_component_setup_tunnel (GstOMXComponent * comp1, GstOMXPort * port1, GstOMXComponent * comp2, GstOMXPort * port2);
-OMX_ERRORTYPE gst_omx_component_close_tunnel (GstOMXComponent * comp1, GstOMXPort * port1, GstOMXComponent * comp2, GstOMXPort * port2);
+
+OMX_ERRORTYPE gst_omx_setup_tunnel (GstOMXPort * port1, GstOMXPort * port2);
+OMX_ERRORTYPE gst_omx_close_tunnel (GstOMXPort * port1, GstOMXPort * port2);
OMX_ERRORTYPE gst_omx_port_get_port_definition (GstOMXPort * port, OMX_PARAM_PORTDEFINITIONTYPE * port_def);
gst_omx_port_deallocate_buffers (self->dec_in_port);
gst_omx_video_dec_deallocate_output_buffers (self);
- gst_omx_component_close_tunnel (self->dec, self->dec_out_port,
- self->egl_render, self->egl_in_port);
+ gst_omx_close_tunnel (self->dec_out_port, self->egl_in_port);
if (state > OMX_StateLoaded) {
gst_omx_component_get_state (self->egl_render, 5 * GST_SECOND);
gst_omx_component_get_state (self->dec, 1 * GST_SECOND);
#undef OMX_IndexParamBrcmVideoEGLRenderDiscardMode
}
- err =
- gst_omx_component_setup_tunnel (self->dec, self->dec_out_port,
- self->egl_render, self->egl_in_port);
+ err = gst_omx_setup_tunnel (self->dec_out_port, self->egl_in_port);
if (err != OMX_ErrorNone)
goto no_egl;
gst_omx_component_set_state (self->egl_render, OMX_StateLoaded);
gst_omx_video_dec_deallocate_output_buffers (self);
- gst_omx_component_close_tunnel (self->dec, self->dec_out_port,
- self->egl_render, self->egl_in_port);
+ gst_omx_close_tunnel (self->dec_out_port, self->egl_in_port);
if (egl_state > OMX_StateLoaded) {
gst_omx_component_get_state (self->egl_render, 5 * GST_SECOND);
gst_omx_component_set_state (self->egl_render, OMX_StateLoaded);
gst_omx_component_set_state (self->dec, OMX_StateLoaded);
- gst_omx_component_close_tunnel (self->dec, self->dec_out_port,
- self->egl_render, self->egl_in_port);
+ gst_omx_close_tunnel (self->dec_out_port, self->egl_in_port);
if (egl_state > OMX_StateLoaded) {
gst_omx_component_get_state (self->egl_render, 5 * GST_SECOND);