};
/* *INDENT-ON* */
- static const EGLint eglglessink_RGBA8888_attribs[] = {
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE
- };
+static const EGLint eglglessink_RGBA8888_attribs[] = {
+ EGL_RED_SIZE, 8,
+ EGL_GREEN_SIZE, 8,
+ EGL_BLUE_SIZE, 8,
+ EGL_ALPHA_SIZE, 8,
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_NONE
+};
/* Input capabilities. */
static GstStaticPadTemplate gst_eglglessink_sink_template_factory =
gsize offset[3];
GstMemory *mem[3] = { NULL, NULL, NULL };
guint n_mem;
+ GstMemoryFlags flags = 0;
memset (stride, 0, sizeof (stride));
memset (offset, 0, sizeof (offset));
+ if (!gst_egl_image_memory_is_mappable ())
+ flags |= GST_MEMORY_FLAG_NOT_MAPPABLE;
+ /* See https://bugzilla.gnome.org/show_bug.cgi?id=695203 */
+ flags |= GST_MEMORY_FLAG_NO_SHARE;
+
gst_video_info_set_format (&info, format, width, height);
switch (format) {
if (mem[0]) {
stride[0] = size / GST_VIDEO_INFO_HEIGHT (&info);
n_mem = 1;
+ GST_MINI_OBJECT_FLAG_SET (mem[0], GST_MEMORY_FLAG_NO_SHARE);
} else {
data = g_slice_new0 (GstEGLGLESImageData);
gst_egl_image_allocator_wrap (GST_EGL_IMAGE_BUFFER_POOL
(eglglessink->pool)->allocator, eglglessink->eglglesctx.display,
image, GST_EGL_IMAGE_MEMORY_TYPE_RGB,
- (gst_egl_image_memory_is_mappable ()? 0 :
- GST_MEMORY_FLAG_NOT_MAPPABLE), size, data,
- (GDestroyNotify) gst_egl_gles_image_data_free);
+ flags, size, data, (GDestroyNotify) gst_egl_gles_image_data_free);
n_mem = 1;
}
break;
if (mem[0]) {
stride[0] = size / GST_VIDEO_INFO_HEIGHT (&info);
n_mem = 1;
+ GST_MINI_OBJECT_FLAG_SET (mem[0], GST_MEMORY_FLAG_NO_SHARE);
} else {
data = g_slice_new0 (GstEGLGLESImageData);
gst_egl_image_allocator_wrap (GST_EGL_IMAGE_BUFFER_POOL
(eglglessink->pool)->allocator, eglglessink->eglglesctx.display,
image, GST_EGL_IMAGE_MEMORY_TYPE_RGB,
- (gst_egl_image_memory_is_mappable ()? 0 :
- GST_MEMORY_FLAG_NOT_MAPPABLE), size, data,
- (GDestroyNotify) gst_egl_gles_image_data_free);
+ flags, size, data, (GDestroyNotify) gst_egl_gles_image_data_free);
n_mem = 1;
}
break;
offset[1] = size[0];
stride[1] = size[1] / GST_VIDEO_INFO_HEIGHT (&info);
n_mem = 2;
+ GST_MINI_OBJECT_FLAG_SET (mem[0], GST_MEMORY_FLAG_NO_SHARE);
+ GST_MINI_OBJECT_FLAG_SET (mem[1], GST_MEMORY_FLAG_NO_SHARE);
} else {
if (mem[0])
gst_memory_unref (mem[0]);
(i ==
0 ? GST_EGL_IMAGE_MEMORY_TYPE_LUMINANCE :
GST_EGL_IMAGE_MEMORY_TYPE_LUMINANCE_ALPHA),
- (gst_egl_image_memory_is_mappable ()? 0 :
- GST_MEMORY_FLAG_NOT_MAPPABLE), size[i], data,
+ flags, size[i], data,
(GDestroyNotify) gst_egl_gles_image_data_free);
}
offset[2] = size[1];
stride[2] = size[2] / GST_VIDEO_INFO_HEIGHT (&info);
n_mem = 3;
+ GST_MINI_OBJECT_FLAG_SET (mem[0], GST_MEMORY_FLAG_NO_SHARE);
+ GST_MINI_OBJECT_FLAG_SET (mem[1], GST_MEMORY_FLAG_NO_SHARE);
+ GST_MINI_OBJECT_FLAG_SET (mem[2], GST_MEMORY_FLAG_NO_SHARE);
} else {
if (mem[0])
gst_memory_unref (mem[0]);
gst_egl_image_allocator_wrap (GST_EGL_IMAGE_BUFFER_POOL
(eglglessink->pool)->allocator, eglglessink->eglglesctx.display,
image, GST_EGL_IMAGE_MEMORY_TYPE_LUMINANCE,
- (gst_egl_image_memory_is_mappable ()? 0 :
- GST_MEMORY_FLAG_NOT_MAPPABLE), size[i], data,
+ flags, size[i], data,
(GDestroyNotify) gst_egl_gles_image_data_free);
}
if (mem[0]) {
stride[0] = size / GST_VIDEO_INFO_HEIGHT (&info);
n_mem = 1;
+ GST_MINI_OBJECT_FLAG_SET (mem[0], GST_MEMORY_FLAG_NO_SHARE);
} else {
data = g_slice_new0 (GstEGLGLESImageData);
gst_egl_image_allocator_wrap (GST_EGL_IMAGE_BUFFER_POOL
(eglglessink->pool)->allocator, eglglessink->eglglesctx.display,
image, GST_EGL_IMAGE_MEMORY_TYPE_RGBA,
- (gst_egl_image_memory_is_mappable ()? 0 :
- GST_MEMORY_FLAG_NOT_MAPPABLE), size, data,
- (GDestroyNotify) gst_egl_gles_image_data_free);
+ flags, size, data, (GDestroyNotify) gst_egl_gles_image_data_free);
n_mem = 1;
}