Merge branch 'upstream/1.16' into tizen_gst_1.16.2
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / video / gstvideofilter.c
index 4d63eea..05961e8 100644 (file)
@@ -252,6 +252,9 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
   GstFlowReturn res;
   GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
   GstVideoFilterClass *fclass;
+#ifdef USE_TBM
+  GstMapFlags out_map_flags = GST_MAP_WRITE;
+#endif
 
   if (G_UNLIKELY (!filter->negotiated))
     goto unknown_format;
@@ -264,11 +267,22 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
             GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
       goto invalid_buffer;
 
+#ifdef USE_TBM
+    if (filter->out_info.finfo->format != GST_VIDEO_FORMAT_SN12)
+      out_map_flags |= GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
+
+    if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
+            out_map_flags)) {
+      gst_video_frame_unmap (&in_frame);
+      goto invalid_buffer;
+       }
+#else
     if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
             GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) {
       gst_video_frame_unmap (&in_frame);
       goto invalid_buffer;
     }
+#endif
     res = fclass->transform_frame (filter, &in_frame, &out_frame);
 
     gst_video_frame_unmap (&out_frame);