summaryrefslogtreecommitdiff
path: root/omx
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2017-12-27 17:18:54 +0100
committerStéphane Cerveau <scerveau@collabora.com>2020-05-20 16:11:34 +0200
commit34597260957fd0bfd563cdac99977322043a12dc (patch)
treec4bb761ac19f97601cfb4b2b2a0f729593a92ba2 /omx
parentd3c2a7c8d1bb94a4bf6fa745ef93d2ca9f59f7d0 (diff)
downloadgst-omx-34597260957fd0bfd563cdac99977322043a12dc.tar.gz
omxvideoenc: factor out gst_omx_video_enc_allocate_out_buffers()
No semantic change. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-omx/-/merge_requests/66>
Diffstat (limited to 'omx')
-rw-r--r--omx/gstomxvideoenc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 6d809ee..6dbfb41 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1566,6 +1566,15 @@ gst_omx_video_enc_ensure_nb_out_buffers (GstOMXVideoEnc * self)
return TRUE;
}
+static gboolean
+gst_omx_video_enc_allocate_out_buffers (GstOMXVideoEnc * self)
+{
+ if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
+ return FALSE;
+
+ return TRUE;
+}
+
static void
gst_omx_video_enc_pause_loop (GstOMXVideoEnc * self, GstFlowReturn flow_ret)
{
@@ -1663,8 +1672,7 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
if (err != OMX_ErrorNone)
goto reconfigure_error;
- err = gst_omx_port_allocate_buffers (port);
- if (err != OMX_ErrorNone)
+ if (!gst_omx_video_enc_allocate_out_buffers (self))
goto reconfigure_error;
err = gst_omx_port_wait_enabled (port, 5 * GST_SECOND);
@@ -2210,7 +2218,7 @@ gst_omx_video_enc_set_to_idle (GstOMXVideoEnc * self)
return FALSE;
if (no_disable_outport) {
- if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
+ if (!gst_omx_video_enc_allocate_out_buffers (self))
return FALSE;
}
@@ -2299,7 +2307,7 @@ gst_omx_video_enc_enable (GstOMXVideoEnc * self, GstBuffer * input)
if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
if (gst_omx_port_set_enabled (self->enc_out_port, TRUE) != OMX_ErrorNone)
return FALSE;
- if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
+ if (!gst_omx_video_enc_allocate_out_buffers (self))
return FALSE;
if (gst_omx_port_wait_enabled (self->enc_out_port,