[gtk/matthiasc/color-profile-rebased: 14/15] media: Use the new GL texture constructor
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/color-profile-rebased: 14/15] media: Use the new GL texture constructor
- Date: Sun, 8 May 2022 20:47:15 +0000 (UTC)
commit 12649fee0bf108d7ca957d62f65d10165c38e212
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 8 14:58:20 2022 -0400
media: Use the new GL texture constructor
Use GdkGLTextureFlags in the gstreamer backend
to tell gsk that the buffers are unpremultiplied,
non-linear sRGB.
modules/media/gtkgstsink.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/modules/media/gtkgstsink.c b/modules/media/gtkgstsink.c
index 529952fffc..139df579cc 100644
--- a/modules/media/gtkgstsink.c
+++ b/modules/media/gtkgstsink.c
@@ -291,17 +291,20 @@ gtk_gst_sink_texture_from_buffer (GtkGstSink *self,
GstGLSyncMeta *sync_meta;
sync_meta = gst_buffer_get_gl_sync_meta (buffer);
- if (sync_meta) {
- gst_gl_sync_meta_set_sync_point (sync_meta, self->gst_context);
- gst_gl_sync_meta_wait (sync_meta, self->gst_context);
- }
-
- texture = gdk_gl_texture_new (self->gdk_context,
- *(guint *) frame->data[0],
- frame->info.width,
- frame->info.height,
- (GDestroyNotify) video_frame_free,
- frame);
+ if (sync_meta)
+ {
+ gst_gl_sync_meta_set_sync_point (sync_meta, self->gst_context);
+ gst_gl_sync_meta_wait (sync_meta, self->gst_context);
+ }
+
+ texture = gdk_gl_texture_new_with_color_profile (self->gdk_context,
+ *(guint *) frame->data[0],
+ frame->info.width,
+ frame->info.height,
+ 0, /* Neither premultiplied nor flipped */
+ gdk_color_profile_get_srgb (),
+ (GDestroyNotify) video_frame_free,
+ frame);
*pixel_aspect_ratio = ((double) frame->info.par_n) / ((double) frame->info.par_d);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]