mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
vtdec: add support for zerocopy decoding with GLES 3.x
It seems that Red/RG textures aren't supported anymore for zerocopy decoding with GLES 3.x. Instead use Luminance/Luminance Alpha textures which are.
This commit is contained in:
parent
989200820d
commit
9a325f4a09
1 changed files with 14 additions and 2 deletions
|
@ -182,8 +182,15 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data)
|
|||
case GST_VIDEO_FORMAT_NV12: {
|
||||
GstVideoGLTextureType textype;
|
||||
GLenum texifmt, texfmt;
|
||||
gint gl_major;
|
||||
|
||||
textype = gst_gl_texture_type_from_format (cache->ctx, GST_VIDEO_FORMAT_NV12, 0);
|
||||
gst_gl_context_get_gl_version (context, &gl_major, NULL);
|
||||
if (gl_major >= 3) {
|
||||
/* apple went backwards when choosing a pixel format for this */
|
||||
textype = GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE;
|
||||
} else {
|
||||
textype = gst_gl_texture_type_from_format (cache->ctx, GST_VIDEO_FORMAT_NV12, 0);
|
||||
}
|
||||
texifmt = gst_gl_format_from_gl_texture_type (textype);
|
||||
texfmt = gst_gl_sized_gl_format_from_gl_format_type (cache->ctx, texifmt, GL_UNSIGNED_BYTE);
|
||||
|
||||
|
@ -206,7 +213,12 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data)
|
|||
(GstGLAllocationParams *) params));
|
||||
gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
|
||||
|
||||
textype = gst_gl_texture_type_from_format (cache->ctx, GST_VIDEO_FORMAT_NV12, 1);
|
||||
if (gl_major >= 3) {
|
||||
/* apple went backwards when choosing a pixel format for this */
|
||||
textype = GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA;
|
||||
} else {
|
||||
textype = gst_gl_texture_type_from_format (cache->ctx, GST_VIDEO_FORMAT_NV12, 0);
|
||||
}
|
||||
texifmt = gst_gl_format_from_gl_texture_type (textype);
|
||||
texfmt = gst_gl_sized_gl_format_from_gl_format_type (cache->ctx, texifmt, GL_UNSIGNED_BYTE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue