mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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>
This commit is contained in:
parent
d3c2a7c8d1
commit
3459726095
1 changed files with 12 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue