diff options
author | Rob Clark <robdclark@gmail.com> | 2017-03-15 09:54:04 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2017-03-27 11:19:16 -0400 |
commit | 961c85f6eb42e4445513044c9944c83a0d9cb324 (patch) | |
tree | 910f4ac4d44599c6e335e7e6625ddff8ca305a34 /common.h | |
parent | 4f4801b2b1f1aa00914f0c79fd3ab5ae8db2d284 (diff) | |
download | kmscube-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.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 */ |