glupload/colorconvert: only copy timestamps if the input buffer != output
This commit is contained in:
parent
63366be8ad
commit
f58b5b65f1
@ -190,6 +190,9 @@ gst_gl_color_convert_element_prepare_output_buffer (GstBaseTransform * bt,
|
|||||||
|
|
||||||
*outbuf = gst_gl_color_convert_perform (convert->convert, inbuf);
|
*outbuf = gst_gl_color_convert_perform (convert->convert, inbuf);
|
||||||
|
|
||||||
|
/* basetransform doesn't unref if they're the same */
|
||||||
|
if (inbuf == *outbuf)
|
||||||
|
gst_buffer_unref (*outbuf);
|
||||||
if (*outbuf)
|
if (*outbuf)
|
||||||
gst_buffer_copy_into (*outbuf, inbuf,
|
gst_buffer_copy_into (*outbuf, inbuf,
|
||||||
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
|
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
|
||||||
|
@ -236,13 +236,12 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,
|
|||||||
|
|
||||||
ret = gst_gl_upload_perform_with_buffer (upload->upload, buffer, outbuf);
|
ret = gst_gl_upload_perform_with_buffer (upload->upload, buffer, outbuf);
|
||||||
|
|
||||||
if (*outbuf)
|
|
||||||
gst_buffer_copy_into (*outbuf, buffer,
|
|
||||||
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
|
|
||||||
|
|
||||||
/* basetransform doesn't unref if they're the same */
|
/* basetransform doesn't unref if they're the same */
|
||||||
if (buffer == *outbuf)
|
if (buffer == *outbuf)
|
||||||
gst_buffer_unref (*outbuf);
|
gst_buffer_unref (*outbuf);
|
||||||
|
else if (*outbuf)
|
||||||
|
gst_buffer_copy_into (*outbuf, buffer,
|
||||||
|
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
|
||||||
|
|
||||||
return ret == GST_GL_UPLOAD_DONE ? GST_FLOW_OK : GST_FLOW_ERROR;
|
return ret == GST_GL_UPLOAD_DONE ? GST_FLOW_OK : GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user