GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
GstVideoFilterClass *fclass;
#ifdef USE_TBM
- GstMapFlags out_map_flags = GST_MAP_WRITE;
+ GstMapFlags map_flags;
#endif
if (G_UNLIKELY (!filter->negotiated))
if (fclass->transform_frame) {
GstVideoFrame in_frame, out_frame;
- if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf,
- GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
+#ifdef USE_TBM
+ map_flags = GST_MAP_READ;
+ if (filter->in_info.finfo->format != GST_VIDEO_FORMAT_SN12 &&
+ filter->in_info.finfo->format != GST_VIDEO_FORMAT_SR32)
+ map_flags |= GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
+
+ GST_LOG_OBJECT (trans, "IN format %d, flags 0x%x",
+ filter->in_info.finfo->format, map_flags);
+
+ if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf, map_flags))
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;
+ map_flags = GST_MAP_WRITE;
+ if (filter->out_info.finfo->format != GST_VIDEO_FORMAT_SN12 &&
+ filter->out_info.finfo->format != GST_VIDEO_FORMAT_SR32)
+ map_flags |= GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
- if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
- out_map_flags)) {
+ GST_LOG_OBJECT (trans, "OUT format %d, flags 0x%x",
+ filter->out_info.finfo->format, map_flags);
+
+ if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf, map_flags)) {
gst_video_frame_unmap (&in_frame);
goto invalid_buffer;
- }
+ }
#else
+ if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf,
+ GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
+ goto invalid_buffer;
+
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);