diff options
author | Julien Isorce <jisorce@oblong.com> | 2017-07-20 09:43:19 +0100 |
---|---|---|
committer | Julien Isorce <jisorce@oblong.com> | 2017-08-17 14:01:27 +0100 |
commit | eec88a965106d66e1b327b9bc15a114b6b0f262e (patch) | |
tree | da603bb7b2bc641b56e70ff4b19baad84061cfc5 /omx/gstomxvideodec.c | |
parent | 7dda0e7f176a988abf5aea0aa336d30c03382f2b (diff) | |
download | gst-omx-eec88a965106d66e1b327b9bc15a114b6b0f262e.tar.gz |
omx{audio,video}{dec,enc}: sequentially disable ports because buffers are not shared
For the history, the parallel disable port has been introduced by:
"00be69f omxvideodec: Disable output port when setting a new format"
and then replicated to videoenc, audiodec and audioenc.
This is only required to do 'parallel' if buffers are shared between ports.
But for decoders and encoders the input and output buffer are of different
nature by definition (bitstream vs images). So they cannot be shared.
Also starting from IL 1.2.0 it is written in the spec that the parallel
disable is not allowed and will return an error. Except when buffers are
shared.
Again here we know in advance that they are not shared so let's always
do a sequential disable.
Tested on Desktop, rpi and zynqultrascaleplus.
https://bugzilla.gnome.org/show_bug.cgi?id=786348
Diffstat (limited to 'omx/gstomxvideodec.c')
-rw-r--r-- | omx/gstomxvideodec.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 290e5a3..b0178b1 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -2053,23 +2053,34 @@ gst_omx_video_dec_disable (GstOMXVideoDec * self) } #endif + /* Disabling at the same time input port and output port is only + * required when a buffer is shared between the ports. This cannot + * be the case for a decoder because its input and output buffers + * are of different nature. So let's disable ports sequencially. + * Starting from IL 1.2.0, this point has been clarified. + * OMX_SendCommand will return an error if the IL client attempts to + * call it when there is already an on-going command being processed. + * The exception is for buffer sharing above and the event + * OMX_EventPortNeedsDisable will be sent to request disabling the + * other port at the same time. */ if (gst_omx_port_set_enabled (self->dec_in_port, FALSE) != OMX_ErrorNone) return FALSE; - if (gst_omx_port_set_enabled (out_port, FALSE) != OMX_ErrorNone) - return FALSE; if (gst_omx_port_wait_buffers_released (self->dec_in_port, 5 * GST_SECOND) != OMX_ErrorNone) return FALSE; - if (gst_omx_port_wait_buffers_released (out_port, - 1 * GST_SECOND) != OMX_ErrorNone) - return FALSE; if (gst_omx_port_deallocate_buffers (self->dec_in_port) != OMX_ErrorNone) return FALSE; - if (gst_omx_video_dec_deallocate_output_buffers (self) != OMX_ErrorNone) - return FALSE; if (gst_omx_port_wait_enabled (self->dec_in_port, 1 * GST_SECOND) != OMX_ErrorNone) return FALSE; + + if (gst_omx_port_set_enabled (out_port, FALSE) != OMX_ErrorNone) + return FALSE; + if (gst_omx_port_wait_buffers_released (out_port, + 1 * GST_SECOND) != OMX_ErrorNone) + return FALSE; + if (gst_omx_video_dec_deallocate_output_buffers (self) != OMX_ErrorNone) + return FALSE; if (gst_omx_port_wait_enabled (out_port, 1 * GST_SECOND) != OMX_ErrorNone) return FALSE; |