If buffers were released from the pool while
gst_omx_video_enc_handle_frame() was waiting for new buffers,
gst_omx_port_acquire_buffer() was never awaken as the buffers weren't
released through OMX's messaging system.
GQueue isn't thread safe so also protect it with the lock mutex.
return err;
}
+void
+gst_omx_port_requeue_buffer (GstOMXPort * port, GstOMXBuffer * buf)
+{
+ g_mutex_lock (&port->comp->lock);
+ g_queue_push_tail (&port->pending_buffers, buf);
+ g_mutex_unlock (&port->comp->lock);
+
+ /* awake gst_omx_port_acquire_buffer() */
+ gst_omx_component_send_message (port->comp, NULL);
+}
+
/* NOTE: Uses comp->lock and comp->messages_lock */
OMX_ERRORTYPE
gst_omx_port_set_enabled (GstOMXPort * port, gboolean enabled)
OMX_ERRORTYPE gst_omx_port_deallocate_buffers (GstOMXPort *port);
OMX_ERRORTYPE gst_omx_port_populate (GstOMXPort *port);
OMX_ERRORTYPE gst_omx_port_wait_buffers_released (GstOMXPort * port, GstClockTime timeout);
+void gst_omx_port_requeue_buffer (GstOMXPort * port, GstOMXBuffer * buf);
OMX_ERRORTYPE gst_omx_port_mark_reconfigured (GstOMXPort * port);
gst_omx_error_to_string (err), err));
}
} else if (pool->port->port_def.eDir == OMX_DirInput) {
- g_queue_push_tail (&pool->port->pending_buffers, omx_buf);
+ gst_omx_port_requeue_buffer (pool->port, omx_buf);
}
}
}