summaryrefslogtreecommitdiff
path: root/common.h
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 /common.h
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 'common.h')
-rw-r--r--common.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/common.h b/common.h
index df07b61..2eceac7 100644
--- a/common.h
+++ b/common.h
@@ -85,9 +85,29 @@ enum mode {
RGBA, /* single-plane RGBA */
NV12_2IMG, /* NV12, handled as two textures and converted to RGB in shader */
NV12_1IMG, /* NV12, imported as planar YUV eglimg */
+ VIDEO, /* video textured cube */
};
const struct egl * init_cube_smooth(const struct gbm *gbm);
const struct egl * init_cube_tex(const struct gbm *gbm, enum mode mode);
+#ifdef HAVE_GST
+
+struct decoder;
+struct decoder * video_init(const struct egl *egl, const struct gbm *gbm, const char *filename);
+EGLImage video_frame(struct decoder *dec);
+void video_deinit(struct decoder *dec);
+
+const struct egl * init_cube_video(const struct gbm *gbm, const char *video);
+
+#else
+static inline const struct egl *
+init_cube_video(const struct gbm *gbm, const char *video)
+{
+ (void)gbm; (void)video;
+ printf("no GStreamer support!\n");
+ return NULL;
+}
+#endif
+
#endif /* _COMMON_H */