summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-08-21 16:50:38 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-09-19 10:52:25 +0200
commit68f18341f6502df6ae80e949fabe4b55cdc7b0f3 (patch)
treedfc11d467c5ed583cc8f5cf86c5d937912b7b3a9
parent9b1598e5ec27e916abee930bf31a23772c946008 (diff)
downloadgst-omx-68f18341f6502df6ae80e949fabe4b55cdc7b0f3.tar.gz
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
-rw-r--r--omx/gstomx.c23
1 files 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) {