From 68f18341f6502df6ae80e949fabe4b55cdc7b0f3 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 21 Aug 2018 16:50:38 +0200 Subject: omx: factor out gst_omx_component_send_command() No semantic change. I'm going to add extra debug in this function. https://bugzilla.gnome.org/show_bug.cgi?id=797171 --- omx/gstomx.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/omx/gstomx.c b/omx/gstomx.c index 7abbd05..bea3e59 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -1070,6 +1070,17 @@ gst_omx_component_unref (GstOMXComponent * comp) gst_mini_object_unref (GST_MINI_OBJECT_CAST (comp)); } +static OMX_ERRORTYPE +gst_omx_component_send_command (GstOMXComponent * comp, OMX_COMMANDTYPE cmd, + guint32 param, gpointer cmd_data) +{ + OMX_ERRORTYPE err; + + err = OMX_SendCommand (comp->handle, cmd, param, cmd_data); + + return err; +} + /* NOTE: Uses comp->lock and comp->messages_lock */ OMX_ERRORTYPE gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state) @@ -1110,7 +1121,7 @@ gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state) gst_omx_component_send_message (comp, NULL); } - err = OMX_SendCommand (comp->handle, OMX_CommandStateSet, state, NULL); + err = gst_omx_component_send_command (comp, OMX_CommandStateSet, state, NULL); /* No need to check if anything has changed here */ done: @@ -1818,7 +1829,9 @@ gst_omx_port_set_flushing (GstOMXPort * port, GstClockTime timeout, /* Now flush the port */ port->flushed = FALSE; - err = OMX_SendCommand (comp->handle, OMX_CommandFlush, port->index, NULL); + err = + gst_omx_component_send_command (comp, OMX_CommandFlush, port->index, + NULL); if (err != OMX_ErrorNone) { GST_ERROR_OBJECT (comp->parent, @@ -2369,11 +2382,11 @@ gst_omx_port_set_enabled_unlocked (GstOMXPort * port, gboolean enabled) if (enabled) err = - OMX_SendCommand (comp->handle, OMX_CommandPortEnable, port->index, - NULL); + gst_omx_component_send_command (comp, OMX_CommandPortEnable, + port->index, NULL); else err = - OMX_SendCommand (comp->handle, OMX_CommandPortDisable, + gst_omx_component_send_command (comp, OMX_CommandPortDisable, port->index, NULL); if (err != OMX_ErrorNone) { -- cgit v1.2.1