summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Xin-yu (王昕宇) <comicfans44@gmail.com>2014-10-20 15:02:28 +0800
committerSebastian Dröge <sebastian@centricular.com>2014-10-20 12:55:39 +0200
commit5eb538f9e2eb22867d30a67215ad6007012e8ebf (patch)
tree48cec4e3aaafffb61593259a2f6abd5eed8b6091
parent81c5fd3c1e96967f06aa9a78ca02bbcf314fefa3 (diff)
glcolorconvert: support RGB16/BGR16 video format upload
https://bugzilla.gnome.org/show_bug.cgi?id=738842
-rw-r--r--gst-libs/gst/gl/gstglcolorconvert.c6
-rw-r--r--gst-libs/gst/gl/gstglcolorconvert.h2
-rw-r--r--gst-libs/gst/gl/gstglmemory.c3
3 files changed, 10 insertions, 1 deletions
diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
index 3dfbe7555..fd89ceb0f 100644
--- a/gst-libs/gst/gl/gstglcolorconvert.c
+++ b/gst-libs/gst/gl/gstglcolorconvert.c
@@ -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);
diff --git a/gst-libs/gst/gl/gstglcolorconvert.h b/gst-libs/gst/gl/gstglcolorconvert.h
index 9b905c77b..aa94eb109 100644
--- a/gst-libs/gst/gl/gstglcolorconvert.h
+++ b/gst-libs/gst/gl/gstglcolorconvert.h
@@ -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:
diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c
index e0b274f29..064af6e4b 100644
--- a/gst-libs/gst/gl/gstglmemory.c
+++ b/gst-libs/gst/gl/gstglmemory.c
@@ -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: