GstBuffer *buf;
GstOMXBuffer *omx_buf;
- g_return_val_if_fail (pool->allocating, GST_FLOW_ERROR);
-
omx_buf = g_ptr_array_index (pool->port->buffers, pool->current_buffer_index);
g_return_val_if_fail (omx_buf != NULL, GST_FLOW_ERROR);
g_assert (pool->component && pool->port);
- if (!pool->allocating) {
+ if (gst_buffer_pool_is_active (bpool)) {
omx_buf = gst_omx_buffer_get_omx_buf (buffer);
if (pool->port->port_def.eDir == OMX_DirOutput && !omx_buf->used &&
!pool->deactivated) {
GstAllocator *allocator;
/* Set from outside this pool */
- /* TRUE if we're currently allocating all our buffers */
- gboolean allocating;
/* TRUE if the pool is not used anymore */
gboolean deactivated;
goto done;
}
- GST_OMX_BUFFER_POOL (self->out_port_pool)->allocating = TRUE;
/* This now allocates all the buffers */
if (!gst_buffer_pool_set_active (self->out_port_pool, TRUE)) {
GST_INFO_OBJECT (self, "Failed to activate internal pool");
gst_object_unref (self->out_port_pool);
self->out_port_pool = NULL;
- } else {
- GST_OMX_BUFFER_POOL (self->out_port_pool)->allocating = FALSE;
}
} else if (self->out_port_pool) {
gst_object_unref (self->out_port_pool);
/* Is downstream using our buffer pool? */
if (buffer_is_from_input_pool (self, input)) {
- /* We're done allocating as we received the first buffer from upstream */
- GST_OMX_BUFFER_POOL (input->pool)->allocating = FALSE;
self->in_pool_used = TRUE;
}
pool =
gst_omx_buffer_pool_new (GST_ELEMENT_CAST (self), self->enc,
self->enc_in_port, GST_OMX_BUFFER_MODE_DMABUF);
- GST_OMX_BUFFER_POOL (pool)->allocating = TRUE;
g_signal_connect_object (pool, "allocate",
G_CALLBACK (pool_request_allocate_cb), self, 0);