summaryrefslogtreecommitdiff
path: root/modules/omx/omx.h
diff options
context:
space:
mode:
authorJonathan Sieber <jonathan_sieber@yahoo.de>2017-04-06 18:36:58 +0200
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-04-06 18:36:58 +0200
commitae1f6ea602a5b206f61e678b5249c01abe7cb7df (patch)
tree37e5ccc2647ae745fa3d8adcc12fec93efcdc60a /modules/omx/omx.h
parent6a9ccd80ef607eb3600c98ef5692e552d1b7302f (diff)
Video Display Support for Raspberry Pi (#228)
* Adding a new video display module for the Raspberry Pi... * Made it work with libomxil-bellagio - Fixed framing woes with vidconv() :) * Some Attention to the build system, Automatically use libomx-bellagio or RPi OMX API Introduces USE_OMX_RPI and USE_OMX_BELLAGIO in mk/modules.mk use sys_usleep() Removed pthread mutexes, they are not needed anymore
Diffstat (limited to 'modules/omx/omx.h')
-rw-r--r--modules/omx/omx.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/omx/omx.h b/modules/omx/omx.h
new file mode 100644
index 0000000..5ca49bf
--- /dev/null
+++ b/modules/omx/omx.h
@@ -0,0 +1,49 @@
+/**
+ * @file omx.h Raspberry Pi VideoCoreIV OpenMAX interface
+ *
+ * Copyright (C) 2016 - 2017 Creytiv.com
+ * Copyright (C) 2016 - 2017 Jonathan Sieber
+ */
+
+#ifdef RASPBERRY_PI
+#include <IL/OMX_Core.h>
+#include <IL/OMX_Video.h>
+#include <IL/OMX_Broadcom.h>
+#else
+#include <OMX_Core.h>
+#include <OMX_Component.h>
+#include <OMX_Video.h>
+
+#define OMX_VERSION 0x01010101
+#define OMX_ERROR_NONE 0
+#endif
+
+#include <pthread.h>
+#include <stdint.h>
+#include <string.h>
+
+/* Needed for usleep to appear */
+#define _BSD_SOURCE
+#include <unistd.h>
+
+struct omx_state {
+ pthread_mutex_t omx_mutex;
+
+ OMX_HANDLETYPE video_render;
+ OMX_BUFFERHEADERTYPE** buffers;
+ int num_buffers;
+ int current_buffer;
+
+ int width, height;
+};
+
+int omx_init(struct omx_state* st);
+void omx_deinit(struct omx_state* st);
+
+int omx_display_input_buffer(struct omx_state* st,
+ void** pbuf, uint32_t* plen);
+int omx_display_flush_buffer(struct omx_state* st);
+
+int omx_display_enable(struct omx_state* st,
+ int width, int height, int stride);
+void omx_display_disable(struct omx_state* st);