gst_buffer_add_video_meta_full (buffer, 0, format, width, height,
mem->n_textures, offset, stride);
+ if (!default_map_video) {
+ default_map_video = meta->map;
+ default_unmap_video = meta->unmap;
+ }
+
meta->map = eglglessink->eglglesctx.eglimage_video_map;
meta->unmap = eglglessink->eglglesctx.eglimage_video_unmap;
GST_DEBUG_CATEGORY_STATIC (eglgles_platform_wrapper);
#define GST_CAT_DEFAULT eglgles_platform_wrapper
+PlatformMapVideo default_map_video;
+PlatformUnmapVideo default_unmap_video;
+
/* XXX: Likely to be removed */
gboolean
platform_wrapper_init (void)
GstEGLImageMemory *mem;
GstVideoInfo vinfo;
- g_return_val_if_fail (gst_buffer_n_memory (meta->buffer) == 1, FALSE);
+ if (gst_buffer_n_memory (meta->buffer) != 1)
+ return default_map_video (meta, plane, info, data, stride, flags);
gmem = gst_buffer_peek_memory (meta->buffer, 0);
- g_return_val_if_fail (strcmp (gmem->allocator->mem_type,
- GST_EGL_IMAGE_MEMORY_NAME) == 0, FALSE);
+ if (strcmp (gmem->allocator->mem_type, GST_EGL_IMAGE_MEMORY_NAME) != 0)
+ return default_map_video (meta, plane, info, data, stride, flags);
mem = GST_EGL_IMAGE_MEMORY ((gmem->parent ? gmem->parent : gmem));
EGL_NONE
};
- g_return_val_if_fail (gst_buffer_n_memory (meta->buffer) == 1, FALSE);
+ if (gst_buffer_n_memory (meta->buffer) != 1)
+ return default_unmap_video (meta, plane, info);
gmem = gst_buffer_peek_memory (meta->buffer, 0);
- g_return_val_if_fail (strcmp (gmem->allocator->mem_type,
- GST_EGL_IMAGE_MEMORY_NAME) == 0, FALSE);
+ if (strcmp (gmem->allocator->mem_type, GST_EGL_IMAGE_MEMORY_NAME) != 0)
+ return default_unmap_video (meta, plane, info);
+
mem = GST_EGL_IMAGE_MEMORY ((gmem->parent ? gmem->parent : gmem));
g_mutex_lock (&mem->lock);
typedef gboolean (*PlatformMapVideo) (GstVideoMeta *meta, guint plane, GstMapInfo *info, gpointer *data, gint * stride, GstMapFlags flags);
typedef gboolean (*PlatformUnmapVideo) (GstVideoMeta *meta, guint plane, GstMapInfo *info);
+extern PlatformMapVideo default_map_video;
+extern PlatformUnmapVideo default_unmap_video;
+
gboolean platform_can_map_eglimage (GstMemoryMapFunction *map, GstMemoryUnmapFunction *unmap, PlatformMapVideo *video_map, PlatformUnmapVideo *video_unmap);
gboolean platform_has_custom_eglimage_alloc (void);
gboolean platform_alloc_eglimage (EGLDisplay display, EGLContext context, GLint format, GLint type, gint width, gint height, GLuint tex_id, EGLImageKHR *image, gpointer *image_platform_data);