#pragma GCC optimize ("gnu89-inline")
#endif
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
#include <gst/egl/egl.h>
+#endif
#if defined (USE_OMX_TARGET_RPI) && defined(__GNUC__)
#pragma GCC reset_options
GST_DEBUG_OBJECT (self, "Opened decoder");
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
GST_DEBUG_OBJECT (self, "Opening EGL renderer");
self->egl_render =
gst_omx_component_new (GST_OBJECT_CAST (self), klass->cdata.core_name,
GST_DEBUG_OBJECT (self, "Shutting down decoder");
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
state = gst_omx_component_get_state (self->egl_render, 0);
if (state > OMX_StateLoaded || state == OMX_StateInvalid) {
if (state > OMX_StateIdle) {
gst_omx_component_free (self->dec);
self->dec = NULL;
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
self->egl_in_port = NULL;
self->egl_out_port = NULL;
if (self->egl_render)
gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, TRUE);
if (self->dec_out_port)
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
if (self->egl_in_port)
gst_omx_port_set_flushing (self->egl_in_port, 5 * GST_SECOND, TRUE);
if (self->egl_out_port)
GstVideoCodecState *state =
gst_video_decoder_get_output_state (GST_VIDEO_DECODER (self));
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
port = self->eglimage ? self->egl_out_port : self->dec_out_port;
#else
port = self->dec_out_port;
add_videometa = gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_META);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
eglimage = self->eglimage && (allocator
&& g_strcmp0 (allocator->mem_type, GST_EGL_IMAGE_MEMORY_TYPE) == 0);
#else
GST_DEBUG_OBJECT (self, "No pool available, not negotiated yet");
}
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
/* Will retry without EGLImage */
if (self->eglimage && !eglimage) {
GST_DEBUG_OBJECT (self,
self->out_port_pool =
gst_omx_buffer_pool_new (GST_ELEMENT_CAST (self), self->dec, port);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
if (eglimage) {
GList *buffers = NULL;
GList *images = NULL;
gst_object_unref (self->out_port_pool);
self->out_port_pool = NULL;
}
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
err =
gst_omx_port_deallocate_buffers (self->
eglimage ? self->egl_out_port : self->dec_out_port);
/* At this point the decoder output port is disabled */
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
{
OMX_STATETYPE egl_state;
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
enable_port:
#endif
err = gst_omx_video_dec_allocate_output_buffers (self);
GstClockTimeDiff deadline;
OMX_ERRORTYPE err;
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
port = self->eglimage ? self->egl_out_port : self->dec_out_port;
#else
port = self->dec_out_port;
gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, TRUE);
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
gst_omx_port_set_flushing (self->egl_in_port, 5 * GST_SECOND, TRUE);
gst_omx_port_set_flushing (self->egl_out_port, 5 * GST_SECOND, TRUE);
#endif
if (gst_omx_component_get_state (self->dec, 0) > OMX_StateIdle)
gst_omx_component_set_state (self->dec, OMX_StateIdle);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
if (gst_omx_component_get_state (self->egl_render, 0) > OMX_StateIdle)
gst_omx_component_set_state (self->egl_render, OMX_StateIdle);
#endif
g_mutex_unlock (&self->drain_lock);
gst_omx_component_get_state (self->dec, 5 * GST_SECOND);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
gst_omx_component_get_state (self->egl_render, 1 * GST_SECOND);
#endif
}
if (needs_disable && is_format_change) {
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
GstOMXPort *out_port =
self->eglimage ? self->egl_out_port : self->dec_out_port;
#else
return FALSE;
needs_disable = FALSE;
} else {
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
if (self->eglimage) {
OMX_STATETYPE egl_state;
gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, TRUE);
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
gst_omx_port_set_flushing (self->egl_in_port, 5 * GST_SECOND, TRUE);
gst_omx_port_set_flushing (self->egl_out_port, 5 * GST_SECOND, TRUE);
#endif
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, FALSE);
gst_omx_port_populate (self->dec_out_port);
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
gst_omx_port_set_flushing (self->egl_in_port, 5 * GST_SECOND, FALSE);
gst_omx_port_set_flushing (self->egl_out_port, 5 * GST_SECOND, FALSE);
#endif
GstBufferPool *pool;
GstStructure *config;
-#ifdef USE_OMX_TARGET_RPI
+#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_EGL)
{
GstCaps *caps;
gint i, n;