Commit c7f50640 authored by Seungha Yang's avatar Seungha Yang 🐑

wip

parent 56b0ced0
Pipeline #67723 failed with stages
in 85 minutes and 36 seconds
......@@ -542,6 +542,12 @@ _drm_rgba_fourcc_from_info (GstVideoInfo * info, int plane,
*out_format = plane == 0 ? GST_GL_R16 : GST_GL_RG16;
return plane == 0 ? DRM_FORMAT_R16 : DRM_FORMAT_RG1616;
case GST_VIDEO_FORMAT_I420_10LE:
case GST_VIDEO_FORMAT_I420_10BE:
case GST_VIDEO_FORMAT_I420_12LE:
case GST_VIDEO_FORMAT_I420_12BE:
return DRM_FORMAT_R16;
default:
GST_ERROR ("Unsupported format for DMABuf.");
return -1;
......
......@@ -117,8 +117,8 @@ static const gfloat from_rgb_bt709_ucoeff[] = {-0.100640f, -0.338688f, 0.439327f
static const gfloat from_rgb_bt709_vcoeff[] = {0.440654f, -0.400285f, -0.040370f};
/* GRAY16 to RGB conversion
* data transferred as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* data transferred as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
* low byte weight as : 255/65535 (similar)
* */
......@@ -181,8 +181,8 @@ static const struct shader_templ templ_REORDER =
};
/* GRAY16 to RGB conversion
* data transferred as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* data transferred as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
* low byte weight as : 255/65535 (similar)
* */
......@@ -957,13 +957,20 @@ _init_supported_formats (GstGLContext * context, gboolean output,
NULL);
#endif
if (!context || (gst_gl_format_is_supported (context, GST_GL_R16) &&
gst_gl_format_is_supported (context, GST_GL_RG16)))
if (!context || gst_gl_format_is_supported (context, GST_GL_R16)) {
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
_append_value_string_list (supported_formats, "P010_10LE", "P016_LE", NULL);
_append_value_string_list (supported_formats, "I420_10LE", "I420_12LE",
NULL);
if (gst_gl_format_is_supported (context, GST_GL_RG16))
_append_value_string_list (supported_formats, "P010_10LE", "P016_LE",
NULL);
#else
_append_value_string_list (supported_formats, "P010_10BE", "P016_BE", NULL);
_append_value_string_list (supported_formats, "I420_10BE", "I420_12BE",
NULL);
if (gst_gl_format_is_supported (context, GST_GL_RG16))
gst_gl_format_is_supported (context, GST_GL_RG16);
#endif
}
}
/* copies the given caps */
......@@ -1565,6 +1572,10 @@ _get_n_textures (GstVideoFormat v_format)
case GST_VIDEO_FORMAT_Y42B:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_I420_10LE:
case GST_VIDEO_FORMAT_I420_10BE:
case GST_VIDEO_FORMAT_I420_12LE:
case GST_VIDEO_FORMAT_I420_12BE:
return 3;
default:
g_assert_not_reached ();
......@@ -1656,6 +1667,10 @@ _YUV_to_RGB (GstGLColorConvert * convert)
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_Y42B:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_I420_10LE:
case GST_VIDEO_FORMAT_I420_10BE:
case GST_VIDEO_FORMAT_I420_12LE:
case GST_VIDEO_FORMAT_I420_12BE:
info->templ = &templ_PLANAR_YUV_to_RGB;
info->frag_body =
g_strdup_printf (templ_PLANAR_YUV_to_RGB_BODY, pixel_order[0],
......
......@@ -88,9 +88,10 @@ struct _GstGLColorConvertClass
* The currently supported formats that can be converted
*/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define COLOR_CONVERT_EXT_FORMATS ", BGR10A2_LE, RGB10A2_LE, P010_10LE, P016_LE"
#define COLOR_CONVERT_EXT_FORMATS \
", BGR10A2_LE, RGB10A2_LE, P010_10LE, P016_LE, I420_10LE, I420_12LE"
#else
#define COLOR_CONVERT_EXT_FORMATS ", P010_10BE, P016_BE"
#define COLOR_CONVERT_EXT_FORMATS ", P010_10BE, P016_BE, I420_10BE, I420_12BE"
#endif
#define GST_GL_COLOR_CONVERT_FORMATS "{ RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, " \
......
......@@ -198,6 +198,10 @@ gst_gl_format_from_video_info (GstGLContext * context, GstVideoInfo * vinfo,
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_I420_10LE:
case GST_VIDEO_FORMAT_I420_10BE:
case GST_VIDEO_FORMAT_I420_12LE:
case GST_VIDEO_FORMAT_I420_12BE:
n_plane_components = 1;
break;
case GST_VIDEO_FORMAT_BGR10A2_LE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment