#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0')
#endif
+#ifndef DRM_FORMAT_R16
+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ')
+#endif
+
+#ifndef DRM_FORMAT_GR1616
+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2')
+#endif
+
+#ifndef DRM_FORMAT_RG1616
+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2')
+#endif
+
#ifndef EGL_LINUX_DMA_BUF_EXT
#define EGL_LINUX_DMA_BUF_EXT 0x3270
#endif
*out_format = GST_GL_RGB10_A2;
return DRM_FORMAT_RGBA1010102;
+ case GST_VIDEO_FORMAT_P010_10LE:
+ *out_format = plane == 0 ? GST_GL_R16 : GST_GL_RG16;
+ return plane == 0 ? DRM_FORMAT_R16 : DRM_FORMAT_GR1616;
+
+ case GST_VIDEO_FORMAT_P010_10BE:
+ *out_format = plane == 0 ? GST_GL_R16 : GST_GL_RG16;
+ return plane == 0 ? DRM_FORMAT_R16 : DRM_FORMAT_RG1616;
+
default:
GST_ERROR ("Unsupported format for DMABuf.");
return -1;
_append_value_string_list (supported_formats, "BGR10A2_LE", "RGB10A2_LE",
NULL);
#endif
+
+ if (!context || (gst_gl_format_is_supported (context, GST_GL_R16) &&
+ gst_gl_format_is_supported (context, GST_GL_RG16)))
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+ _append_value_string_list (supported_formats, "P010_10LE", NULL);
+#else
+ _append_value_string_list (supported_formats, "P010_10BE", NULL);
+#endif
}
/* copies the given caps */
return 1;
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
+ case GST_VIDEO_FORMAT_P010_10LE:
+ case GST_VIDEO_FORMAT_P010_10BE:
return 2;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_Y444:
info->shader_tex_names[1] = "UVtex";
break;
}
+ case GST_VIDEO_FORMAT_P010_10LE:
+ case GST_VIDEO_FORMAT_P010_10BE:
+ {
+ info->templ = &templ_SEMI_PLANAR_to_RGB;
+ info->frag_body =
+ g_strdup_printf (templ_SEMI_PLANAR_to_RGB_BODY, 'r', 'g',
+ pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
+ info->shader_tex_names[0] = "Ytex";
+ info->shader_tex_names[1] = "UVtex";
+ break;
+ }
default:
break;
}
* The currently supported formats that can be converted
*/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define COLOR_CONVERT_EXT_FORMATS ", BGR10A2_LE, RGB10A2_LE"
+#define COLOR_CONVERT_EXT_FORMATS ", BGR10A2_LE, RGB10A2_LE, P010_10LE"
#else
-#define COLOR_CONVERT_EXT_FORMATS ""
+#define COLOR_CONVERT_EXT_FORMATS ", P010_10BE"
#endif
#define GST_GL_COLOR_CONVERT_FORMATS "{ RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, " \
case GST_GL_LUMINANCE_ALPHA:
case GST_GL_RG:
case GST_GL_RG8:
+ case GST_GL_RG16:
return 2;
case GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE:
case GST_VIDEO_GL_TEXTURE_TYPE_R:
case GST_GL_ALPHA:
case GST_GL_RED:
case GST_GL_R8:
+ case GST_GL_R16:
return 1;
default:
return 0;
case GST_VIDEO_FORMAT_BGR10A2_LE:
case GST_VIDEO_FORMAT_RGB10A2_LE:
return GST_GL_RGB10_A2;
+ case GST_VIDEO_FORMAT_P010_10LE:
+ case GST_VIDEO_FORMAT_P010_10BE:
+ return plane == 0 ? GST_GL_R16 : GST_GL_RG16;
default:
n_plane_components = 4;
g_assert_not_reached ();
if (!USING_GLES3 (context) && USING_GLES2 (context) && ext_texture_rg)
return GST_GL_RG;
return GST_GL_RG8;
+ case GL_UNSIGNED_SHORT:
+ return GST_GL_RG16;
}
break;
case GST_GL_RED:
if (!USING_GLES3 (context) && USING_GLES2 (context) && ext_texture_rg)
return GST_GL_RED;
return GST_GL_R8;
+ case GL_UNSIGNED_SHORT:
+ return GST_GL_R16;
}
break;
case GST_GL_RGBA8:
case GST_GL_DEPTH_COMPONENT16:
case GST_GL_DEPTH24_STENCIL8:
case GST_GL_RGB10_A2:
+ case GST_GL_R16:
+ case GST_GL_RG16:
return format;
default:
g_critical ("Unknown GL format 0x%x type 0x%x provided", format, type);
*unsized_format = GST_GL_RGBA;
*gl_type = GL_UNSIGNED_INT_2_10_10_10_REV;
break;
+ case GST_GL_R16:
+ *unsized_format = GST_GL_RED;
+ *gl_type = GL_UNSIGNED_SHORT;
+ break;
+ case GST_GL_RG16:
+ *unsized_format = GST_GL_RG;
+ *gl_type = GL_UNSIGNED_SHORT;
+ break;
default:
g_critical ("Unknown GL format 0x%x provided", format);
*unsized_format = format;
|| USING_GLES3 (context)
|| gst_gl_context_check_feature (context,
"GL_OES_required_internalformat");
+ case GST_GL_R16:
+ case GST_GL_RG16:
+ return gst_gl_context_check_gl_version (context,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3, 3, 0)
+ || (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 1)
+ && gst_gl_context_check_feature (context, "GL_EXT_texture_norm16"));
default:
g_assert_not_reached ();
return FALSE;
* a 8-bit component for stencil informat.
* @GST_GL_RGBA10_A2: Four components of bit depth 10, 10, 10 and 2 stored in the
* R, G, B and A texture components respectively.
+ * @GST_GL_R16: Single 16-bit component stored in the R texture component
+ * @GST_GL_RG16: Two 16-bit components stored in the R and G texture components
*/
typedef enum
{
GST_GL_DEPTH24_STENCIL8 = 0x88F0,
GST_GL_RGB10_A2 = 0x8059,
+
+ GST_GL_R16 = 0x822A,
+ GST_GL_RG16 = 0x822C,
} GstGLFormat;
GST_GL_API
* List of video formats that are supported by #GstGLMemory
*/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define MEMORY_VIDEO_EXT_FORMATS ", BGR10A2_LE, RGB10A2_LE"
+#define MEMORY_VIDEO_EXT_FORMATS ", BGR10A2_LE, RGB10A2_LE, P010_10LE"
#else
-#define MEMORY_VIDEO_EXT_FORMATS ""
+#define MEMORY_VIDEO_EXT_FORMATS ", P010_10BE"
#endif
#define GST_GL_MEMORY_VIDEO_FORMATS_STR \