summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit@automotivelinux.org>2017-01-19 07:01:22 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2017-01-19 07:01:22 +0000
commita89b8302db0346269f4202e95ca85dbbb6f75a8e (patch)
tree873e234062fb0fcd8c71bd031bdaa217c877648c /meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch
parent73e6110c6c12a875da9b6da46c8ddaaff79e3c79 (diff)
parent793d8d01d0377dad21f4e1a330f00d822eced086 (diff)
Merge "Merge branch 'chinook_fixed' into chinook" into chinook
Diffstat (limited to 'meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch')
-rw-r--r--meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch b/meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch
new file mode 100644
index 0000000..d863414
--- /dev/null
+++ b/meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-videodec-add-planebuf-to-allocation-request.patch
@@ -0,0 +1,85 @@
+diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
+index c5b69ab..647ac88 100644
+--- a/omx/gstomxvideodec.c
++++ b/omx/gstomxvideodec.c
+@@ -581,7 +581,7 @@ gst_omx_buffer_pool_free_buffer (GstBufferPool * bpool, GstBuffer * buffer)
+ #ifdef HAVE_MMNGRBUF
+ static GstBuffer *
+ gst_omx_buffer_pool_request_videosink_buffer_creation (GstOMXBufferPool * pool,
+- gint dmabuf_fd[GST_VIDEO_MAX_PLANES], gint stride[GST_VIDEO_MAX_PLANES])
++ gint dmabuf_fd[GST_VIDEO_MAX_PLANES], gpointer plane_buf[GST_VIDEO_MAX_PLANES], gint stride[GST_VIDEO_MAX_PLANES])
+ {
+ GstQuery *query;
+ GValue val = { 0, };
+@@ -590,6 +590,7 @@ gst_omx_buffer_pool_request_videosink_buffer_creation (GstOMXBufferPool * pool,
+ GstBuffer *buffer;
+ GArray *dmabuf_array;
+ GArray *stride_array;
++ GArray *planebuf_array;
+ gint n_planes;
+ gint i;
+
+@@ -598,11 +599,13 @@ gst_omx_buffer_pool_request_videosink_buffer_creation (GstOMXBufferPool * pool,
+
+ dmabuf_array = g_array_new (FALSE, FALSE, sizeof (gint));
+ stride_array = g_array_new (FALSE, FALSE, sizeof (gint));
++ planebuf_array = g_array_new (FALSE, FALSE, sizeof (gpointer));
+
+ n_planes = GST_VIDEO_INFO_N_PLANES (&pool->video_info);
+ for (i = 0; i < n_planes; i++) {
+ g_array_append_val (dmabuf_array, dmabuf_fd[i]);
+ g_array_append_val (stride_array, stride[i]);
++ g_array_append_val (planebuf_array, plane_buf[i]);
+ }
+
+ structure = gst_structure_new ("videosink_buffer_creation_request",
+@@ -610,6 +613,7 @@ gst_omx_buffer_pool_request_videosink_buffer_creation (GstOMXBufferPool * pool,
+ "height", G_TYPE_INT, pool->port->port_def.format.video.nFrameHeight,
+ "stride", G_TYPE_ARRAY, stride_array,
+ "dmabuf", G_TYPE_ARRAY, dmabuf_array,
++ "planebuf", G_TYPE_ARRAY, planebuf_array,
+ "allocator", G_TYPE_POINTER, &val,
+ "format", G_TYPE_STRING,
+ gst_video_format_to_string (pool->video_info.finfo->format),
+@@ -704,6 +708,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
+ gint i;
+ gint dmabuf_fd[GST_VIDEO_MAX_PLANES];
+ gint plane_size[GST_VIDEO_MAX_PLANES];
++ gpointer plane_buf[GST_VIDEO_MAX_PLANES];
+ guint phys_addr;
+ OMXR_MC_VIDEO_DECODERESULTTYPE *decode_res =
+ (OMXR_MC_VIDEO_DECODERESULTTYPE *) omx_buf->
+@@ -730,6 +735,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
+
+ plane_size[0] = vmeta->stride[0] *
+ GST_VIDEO_INFO_COMP_HEIGHT (&pool->video_info, 0);
++ plane_buf[0] = omx_buf->omx_buf->pBuffer;
+
+ /* Export dmabuf file descriptors from second and subsequent planes */
+ n_planes = GST_VIDEO_INFO_N_PLANES (&pool->video_info);
+@@ -737,6 +743,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
+ phys_addr = (guint) decode_res->pvPhysImageAddressY + vmeta->offset[i];
+ plane_size[i] = vmeta->stride[i] *
+ GST_VIDEO_INFO_COMP_HEIGHT (&pool->video_info, i);
++ plane_buf[i] = omx_buf->omx_buf->pBuffer + vmeta->offset[i];
+
+ if (!gst_omx_buffer_pool_export_dmabuf (pool, phys_addr, plane_size[i],
+ page_size, &vdbuf_data->id_export[i], &dmabuf_fd[i])) {
+@@ -747,7 +754,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
+
+ if (pool->vsink_buf_req_supported)
+ new_buf = gst_omx_buffer_pool_request_videosink_buffer_creation (pool,
+- dmabuf_fd, vmeta->stride);
++ dmabuf_fd, plane_buf, vmeta->stride);
+ else {
+ GstVideoMeta *new_meta;
+
+@@ -1947,6 +1954,8 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
+ goto caps_failed;
+ }
+
++ /* ...force clearing of reconfiguration flag to prevent subsequent buffers allocation */
++ gst_pad_check_reconfigure(GST_VIDEO_DECODER_SRC_PAD(self));
+ gst_video_codec_state_unref (state);
+
+ GST_VIDEO_DECODER_STREAM_UNLOCK (self);