omx: Mark OpenMAX buffers as EGLImage if they contain one
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 13 Mar 2013 09:29:23 +0000 (10:29 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 13 Mar 2013 12:10:28 +0000 (13:10 +0100)
Needs special handling in some places, e.g. because nFilledLen
will always be 0.

omx/gstomx.c
omx/gstomx.h

index 71a9b61..84bac15 100644 (file)
@@ -1575,14 +1575,17 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
       err =
           OMX_UseBuffer (comp->handle, &buf->omx_buf, port->index, buf,
           port->port_def.nBufferSize, l->data);
+      buf->eglimage = FALSE;
     } else if (images) {
       err =
           OMX_UseEGLImage (comp->handle, &buf->omx_buf, port->index, buf,
           l->data);
+      buf->eglimage = TRUE;
     } else {
       err =
           OMX_AllocateBuffer (comp->handle, &buf->omx_buf, port->index, buf,
           port->port_def.nBufferSize);
+      buf->eglimage = FALSE;
     }
 
     if (err != OMX_ErrorNone) {
index eeb2e66..eedb9ef 100644 (file)
@@ -241,6 +241,9 @@ struct _GstOMXBuffer {
 
   /* Cookie of the settings when this buffer was allocated */
   gint settings_cookie;
+
+  /* TRUE if this is an EGLImage */
+  gboolean eglimage;
 };
 
 struct _GstOMXClassData {