[gthumb] gstreamer: use gtksink if gtkglsink could not be created
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] gstreamer: use gtksink if gtkglsink could not be created
- Date: Sat, 22 May 2021 08:27:39 +0000 (UTC)
commit 871b5a144008cad17aebba3308291672e9114de5
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri May 21 09:15:05 2021 +0200
gstreamer: use gtksink if gtkglsink could not be created
extensions/gstreamer_tools/gth-media-viewer-page.c | 26 ++++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c
b/extensions/gstreamer_tools/gth-media-viewer-page.c
index 8e7ee0a0..5a2eda46 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -833,6 +833,7 @@ static void
create_playbin (GthMediaViewerPage *self)
{
GstElement *scaletempo;
+ gboolean sink_created;
GstBus *bus;
if (self->priv->playbin != NULL)
@@ -844,18 +845,29 @@ create_playbin (GthMediaViewerPage *self)
if (scaletempo != NULL)
g_object_set (self->priv->playbin, "audio-filter", scaletempo, NULL);
+ sink_created = FALSE;
if (g_settings_get_boolean (self->priv->settings, PREF_GSTREAMER_USE_HARDWARE_ACCEL)) {
- GstElement *glsinkbin;
GstElement *gtkglsink;
- glsinkbin = gst_element_factory_make ("glsinkbin", "");
gtkglsink = gst_element_factory_make ("gtkglsink", "sink");
- g_object_set (glsinkbin, "sink", gtkglsink, NULL);
- g_object_set (self->priv->playbin, "video-sink", glsinkbin, NULL);
-
- g_object_get (gtkglsink, "widget", &self->priv->video_area, NULL);
+ if (gtkglsink != NULL) {
+ GstElement *glsinkbin;
+
+ glsinkbin = gst_element_factory_make ("glsinkbin", "");
+ if (glsinkbin != NULL) {
+ g_object_set (glsinkbin,
+ "enable-last-sample", TRUE,
+ "sink", gtkglsink,
+ NULL);
+ g_object_set (self->priv->playbin, "video-sink", glsinkbin, NULL);
+ g_object_get (gtkglsink, "widget", &self->priv->video_area, NULL);
+
+ sink_created = TRUE;
+ }
+ }
}
- else {
+
+ if (! sink_created) {
GstElement *gtksink;
gtksink = gst_element_factory_make ("gtksink", "sink");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]