Make sure plane_num, handle_num fields of MMVideoBuffer are initialized 22/161822/1
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 27 Nov 2017 14:36:34 +0000 (15:36 +0100)
committerSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 27 Nov 2017 14:50:07 +0000 (15:50 +0100)
This fixes waylandsink error with SN21 format

W/GST_LOG ( 1154): gstinfo.c: gst_debug_log_default(1052) > 0:00:01.595899459
1154   0x55654ba280 ERROR  waylandsink gstwaylandsink.c:2141:
gst_wayland_sink_create_wlbuffer_with_previous_plugin_tbm: could not create wl_buffer

Change-Id: Icb2a40de3b64b14d337bdd0280f311e5a9c7a13e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
camerasrc/src/gstcamerasrc.c

index a814b30a85e0d6eff689e11ae848ccf52c3f0ce9..07914adc2e809efb55d2868c074104f6d10b50a7 100644 (file)
@@ -2147,6 +2147,12 @@ static GstMemory *gst_camerasrc_get_zero_copy_data(GstCameraSrc *camerasrc, guin
        memset(mm_buf, 0x0, sizeof(MMVideoBuffer));
 
        mm_buf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO;
+       /*
+        * FIXME: The number of planes should depend on fourcc, now this function
+        * gets called only for SN21 format.
+        */
+       mm_buf->plane_num = 2;
+       mm_buf->handle_num = mm_buf->plane_num;
 
        data.index = index;
        camerasrc_get_frame_data(camerasrc->v4l2_handle, &data);