When postpone_free_surface is TRUE, the output buffer is not writable,
however the base decoder needs a writable buffer as output buffer,
otherwise it will make a copy of the output buffer. As the underlying
memory is always lockable, so we may set the LOCKABLE flag for this buffer
to avoid buffer copy in the base class.
The refcount of the output buffer is 1 when postpone_free_surface is
FALSE, so needn't set the LOCKABLE flag for this case.
*buffer = gst_buffer_ref (frame->output_buffer);
gst_buffer_replace (&frame->output_buffer, NULL);
gst_video_codec_frame_unref (frame);
+
+ if (thiz->postpone_free_surface)
+ GST_MINI_OBJECT_FLAG_SET (*buffer, GST_MINI_OBJECT_FLAG_LOCKABLE);
+
return GST_FLOW_OK;
}