[Aggregator] condition to make output buffer writable
authorJaeyun <jy1210.jung@samsung.com>
Wed, 23 Jan 2019 08:41:30 +0000 (17:41 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Thu, 24 Jan 2019 06:29:12 +0000 (15:29 +0900)
code review:
calls gst_buffer_make_writable when aggregator needs to concatenate output data

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/nnstreamer/tensor_aggregator/tensor_aggregator.c

index c207c20..5d13be3 100644 (file)
@@ -569,6 +569,8 @@ gst_tensor_aggregator_concat (GstTensorAggregator * self, GstBuffer * outbuf,
   g_assert (frame_size > 0);
 
   srcbuf = gst_buffer_copy (outbuf);
+  outbuf = gst_buffer_make_writable (outbuf);
+
   g_assert (gst_buffer_map (srcbuf, &src_info, GST_MAP_READ));
   g_assert (gst_buffer_map (outbuf, &dest_info, GST_MAP_WRITE));
 
@@ -824,7 +826,6 @@ gst_tensor_aggregator_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
 
   if (frames_in == frames_out) {
     /** push the incoming buffer (do concat if needed) */
-    buf = gst_buffer_make_writable (buf);
     return gst_tensor_aggregator_push (self, buf, frame_size);
   }