mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
gl/upload: avoid performing color conversion when there is no need
One such example is when the buffer contains GstGLMemory in the RGBA format https://bugzilla.gnome.org/show_bug.cgi?id=729278
This commit is contained in:
parent
a76832451d
commit
a4f0fbe4c3
1 changed files with 10 additions and 0 deletions
|
@ -273,6 +273,16 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer,
|
|||
mem = gst_buffer_peek_memory (buffer, 0);
|
||||
|
||||
if (gst_is_gl_memory (mem)) {
|
||||
if (GST_VIDEO_INFO_FORMAT (&upload->in_info) == GST_VIDEO_FORMAT_RGBA) {
|
||||
GstMapInfo map_info;
|
||||
|
||||
gst_memory_map (mem, &map_info, GST_MAP_READ | GST_MAP_GL);
|
||||
gst_memory_unmap (mem, &map_info);
|
||||
|
||||
*tex_id = ((GstGLMemory *) mem)->tex_id;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!upload->out_tex)
|
||||
upload->out_tex = (GstGLMemory *) gst_gl_memory_alloc (upload->context,
|
||||
GST_VIDEO_GL_TEXTURE_TYPE_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info),
|
||||
|
|
Loading…
Reference in a new issue