summaryrefslogtreecommitdiff
path: root/cube-tex.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-03-15 09:54:04 -0400
committerRob Clark <robdclark@gmail.com>2017-03-27 11:19:16 -0400
commit961c85f6eb42e4445513044c9944c83a0d9cb324 (patch)
tree910f4ac4d44599c6e335e7e6625ddff8ca305a34 /cube-tex.c
parent4f4801b2b1f1aa00914f0c79fd3ab5ae8db2d284 (diff)
downloadkmscube-961c85f6eb42e4445513044c9944c83a0d9cb324.tar.gz
add video cube
Uses gstreamer for a simple decoder. If decoder can give us dma-buf's directly, we'll directly use that as a texture (zero copy), otherwise memcpy into a buffer from gbm. This should work with both hw and sw decoders. Probably room for improvement. And the interface between gl and the decoder is pretty simple so I suppose other decoders would be possible. (But hopefully they could already be supported via gstreamer.) Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'cube-tex.c')
-rw-r--r--cube-tex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cube-tex.c b/cube-tex.c
index 427da75..b11023f 100644
--- a/cube-tex.c
+++ b/cube-tex.c
@@ -46,7 +46,7 @@ struct {
GLuint tex[2];
} gl;
-static const struct egl *egl = &gl.egl;
+const struct egl *egl = &gl.egl;
static const GLfloat vVertices[] = {
// front
@@ -81,7 +81,7 @@ static const GLfloat vVertices[] = {
+1.0f, -1.0f, +1.0f,
};
-static const GLfloat vTexCoords[] = {
+GLfloat vTexCoords[] = {
//front
1.0f, 1.0f,
0.0f, 1.0f,
@@ -443,6 +443,7 @@ static int init_tex(enum mode mode)
case NV12_1IMG:
return init_tex_nv12_1img();
case SMOOTH:
+ case VIDEO:
assert(!"unreachable");
return -1;
}