glcolorconvert: support RGB16/BGR16 video format upload

https://bugzilla.gnome.org/show_bug.cgi?id=738842
This commit is contained in:
Wang Xin-yu (王昕宇) 2014-10-20 15:02:28 +08:00 committed by Sebastian Dröge
parent 81c5fd3c1e
commit 5eb538f9e2
3 changed files with 10 additions and 1 deletions

View file

@ -650,6 +650,12 @@ _RGB_pixel_order (const gchar * expected, const gchar * wanted)
expect = g_ascii_strdown (expected, -1);
want = g_ascii_strdown (wanted, -1);
if (strcmp (expect, "rgb16") == 0 || strcmp (expect, "bgr16") == 0) {
gchar *temp = expect;
expect = g_strndup (temp, 3);
g_free (temp);
}
/* pad want with 'a's */
if ((len = strlen (want)) < 4) {
gchar *new_want = g_strndup (want, 4);

View file

@ -88,7 +88,7 @@ struct _GstGLColorConvertClass
#define GST_GL_COLOR_CONVERT_FORMATS "{ RGB, RGBx, RGBA, BGR, BGRx, BGRA, xRGB, " \
"xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, " \
"Y41B, NV12, NV21, YUY2, UYVY, AYUV, " \
"GRAY8, GRAY16_LE, GRAY16_BE }"
"GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16 }"
/**
* GST_GL_COLOR_CONVERT_VIDEO_CAPS:

View file

@ -222,6 +222,9 @@ gst_gl_texture_type_from_format (GstGLContext * context,
case GST_VIDEO_FORMAT_BGR:
n_plane_components = 3;
break;
case GST_VIDEO_FORMAT_RGB16:
case GST_VIDEO_FORMAT_BGR16:
return GST_VIDEO_GL_TEXTURE_TYPE_RGB16;
case GST_VIDEO_FORMAT_GRAY16_BE:
case GST_VIDEO_FORMAT_GRAY16_LE:
case GST_VIDEO_FORMAT_YUY2: