return ret;
}
-#ifdef TIZEN_FEATURE_OMX
-static void
-_destroy_tbm_surface (tbm_surface_h surface)
-{
- GST_DEBUG ("destroy surface %p", surface);
- tbm_surface_internal_destroy (surface);
-}
-#endif
-
/* installed as the GstMiniObject::dispose function of the acquired GstMemory */
static gboolean
gst_omx_allocator_memory_dispose (GstMemory * mem)
{
tbm_surface_h surface = (tbm_surface_h) omx_buf->omx_buf->pBuffer;
mem->foreign_mem = gst_tizen_allocator_alloc_surface (allocator->foreign_allocator,
- &allocator->video_info, surface, omx_buf, (GDestroyNotify)_destroy_tbm_surface);
+ &allocator->video_info, surface, NULL, NULL);
+ gst_mini_object_set_qdata (GST_MINI_OBJECT (mem->foreign_mem),
+ GST_OMX_MEMORY_QUARK, mem, NULL);
+ install_mem_dispose (mem);
break;
}
#endif
else if (pool->output_mode == GST_OMX_BUFFER_MODE_DMABUF)
/* Exporting dmabuf */
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_DMABUF;
+#ifdef TIZEN_FEATURE_OMX
+ else if (pool->output_mode == GST_OMX_BUFFER_MODE_TBM)
+ /* TizenBufferManager */
+ mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_TBM;
+#endif
else
/* Exporting normal buffers */
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_NONE;
+#ifdef TIZEN_FEATURE_OMX
+ GST_INFO_OBJECT (bpool, "foreign memory mode %d", mode);
+#endif
if (!gst_omx_allocator_configure (pool->allocator, min, mode))
return FALSE;
GST_BUFFER_POOL_OPTION_VIDEO_META);
pool->video_info = info;
+#ifdef TIZEN_FEATURE_OMX
+ pool->allocator->video_info = pool->video_info;
+#endif
}
if (pool->caps)
gsize offset[GST_VIDEO_MAX_PLANES] = { 0, };
gint stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, };
#ifdef TIZEN_FEATURE_OMX
- tbm_surface_h surface = NULL;
+ GstOMXBuffer *omx_buf = g_ptr_array_index (pool->allocator->port->buffers, pool->current_buffer_index);
+ tbm_surface_h surface = (tbm_surface_h) omx_buf->omx_buf->pBuffer;
uint32_t _offset = 0;
uint32_t _stride = 0;
#endif
case GST_VIDEO_FORMAT_SN12:
case GST_VIDEO_FORMAT_ST12:
tbm_surface_internal_get_plane_data (surface, 0, NULL, &_offset, &_stride);
+
+ GST_INFO_OBJECT (pool, "[%p] plane[0] offset[%u], stride[%u]", surface, _offset, _stride);
+
offset[0] = _offset;
stride[0] = _stride;
+
tbm_surface_internal_get_plane_data (surface, 1, NULL, &_offset, &_stride);
+
+ GST_INFO_OBJECT (pool, "[%p] plane[1] offset[%u], stride[%u]", surface, _offset, _stride);
+
offset[1] = _offset;
stride[1] = _stride;
break;
pool->output_mode = output_mode;
pool->allocator = gst_omx_allocator_new (component, port);
#ifdef TIZEN_FEATURE_OMX
- pool->allocator->video_info = pool->video_info;
+ GST_INFO_OBJECT (pool, "output mode %d", pool->output_mode);
#endif
g_signal_connect_object (pool->allocator, "omxbuf-released",
port = self->dec_out_port;
#endif
-#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
- port = self->eglimage ? self->egl_out_port : self->dec_out_port;
-#else
- port = self->dec_out_port;
-#endif
-
acq_return = gst_omx_port_acquire_buffer (port, &buf, GST_OMX_WAIT);
if (acq_return == GST_OMX_ACQUIRE_BUFFER_ERROR) {
goto component_error;
if (first_ouput_buffer && GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame))
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_SYNCFRAME;
+#ifndef TIZEN_FEATURE_OMX
+ /* This was added from upstream,
+ but it causes blocking issue when seek on TW3 target. */
if (header)
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_CODECCONFIG;
+#endif
/* TODO: Set flags
* - OMX_BUFFERFLAG_DECODEONLY for buffers that are outside