Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GNOME
gThumb
Commits
b4cfc787
Commit
b4cfc787
authored
Dec 31, 2018
by
Paolo Bacchilega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video viewer: added option to use opengl instead of cairo
parent
7d0cad26
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
25 deletions
+77
-25
data/gschemas/org.gnome.gthumb.gstreamer-tools.gschema.xml
data/gschemas/org.gnome.gthumb.gstreamer-tools.gschema.xml
+3
-0
extensions/gstreamer_tools/data/ui/media-viewer-preferences.ui
...sions/gstreamer_tools/data/ui/media-viewer-preferences.ui
+41
-15
extensions/gstreamer_tools/dlg-media-viewer-preferences.c
extensions/gstreamer_tools/dlg-media-viewer-preferences.c
+7
-7
extensions/gstreamer_tools/gth-media-viewer-page.c
extensions/gstreamer_tools/gth-media-viewer-page.c
+25
-3
extensions/gstreamer_tools/preferences.h
extensions/gstreamer_tools/preferences.h
+1
-0
No files found.
data/gschemas/org.gnome.gthumb.gstreamer-tools.gschema.xml
View file @
b4cfc787
...
...
@@ -25,6 +25,9 @@
<key
name=
"volume"
type=
"i"
>
<default>
100
</default>
</key>
<key
name=
"use-hardware-acceleration"
type=
"b"
>
<default>
false
</default>
</key>
</schema>
</schemalist>
extensions/gstreamer_tools/data/ui/media-viewer-preferences.ui
View file @
b4cfc787
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.
19.0
-->
<!-- Generated with glade 3.
22.1
-->
<interface>
<requires
lib=
"gtk+"
version=
"3.16"
/>
<object
class=
"GtkBox"
id=
"dialog_content"
>
...
...
@@ -7,33 +7,59 @@
<property
name=
"can_focus"
>
False
</property>
<property
name=
"border_width"
>
15
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"spacing"
>
15
</property>
<child>
<object
class=
"GtkLabel"
id=
"label1"
>
<object
class=
"GtkCheckButton"
id=
"use_hardware_acceleration_checkbutton"
>
<property
name=
"label"
translatable=
"yes"
>
Use hardware acceleration
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
_Screenshots location:
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"mnemonic_widget"
>
screenshots_filechooserbutton
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"draw_indicator"
>
True
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
Fals
e
</property>
<property
name=
"fill"
>
Tru
e
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkFileChooserButton"
id=
"screenshots_filechooserbutton"
>
<property
name=
"width_request"
>
300
</property>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"action"
>
select-folder
</property>
<property
name=
"local_only"
>
False
</property>
<property
name=
"title"
translatable=
"yes"
/>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"GtkLabel"
id=
"label1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
_Screenshots location:
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"xalign"
>
0
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkFileChooserButton"
id=
"screenshots_filechooserbutton"
>
<property
name=
"width_request"
>
300
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"action"
>
select-folder
</property>
<property
name=
"local_only"
>
False
</property>
<property
name=
"title"
translatable=
"yes"
/>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
Tru
e
</property>
<property
name=
"expand"
>
Fals
e
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
...
...
extensions/gstreamer_tools/dlg-media-viewer-preferences.c
View file @
b4cfc787
...
...
@@ -39,14 +39,12 @@ update_settings (DialogData *data)
char
*
uri
;
uri
=
gtk_file_chooser_get_uri
(
GTK_FILE_CHOOSER
(
gtk_builder_get_object
(
data
->
builder
,
"screenshots_filechooserbutton"
)));
if
(
uri
==
NULL
)
return
;
if
(
uri
!=
NULL
)
{
_g_settings_set_uri
(
data
->
settings
,
PREF_GSTREAMER_TOOLS_SCREESHOT_LOCATION
,
uri
);
g_free
(
uri
);
}
_g_settings_set_uri
(
data
->
settings
,
PREF_GSTREAMER_TOOLS_SCREESHOT_LOCATION
,
uri
);
g_free
(
uri
);
g_settings_set_boolean
(
data
->
settings
,
PREF_GSTREAMER_USE_HARDWARE_ACCEL
,
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
gtk_builder_get_object
(
data
->
builder
,
"use_hardware_acceleration_checkbutton"
))));
}
...
...
@@ -92,6 +90,8 @@ dlg_media_viewer_preferences (GtkWindow *parent)
gtk_file_chooser_set_uri
(
GTK_FILE_CHOOSER
(
gtk_builder_get_object
(
data
->
builder
,
"screenshots_filechooserbutton"
)),
uri
);
g_free
(
uri
);
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
gtk_builder_get_object
(
data
->
builder
,
"use_hardware_acceleration_checkbutton"
)),
g_settings_get_boolean
(
data
->
settings
,
PREF_GSTREAMER_USE_HARDWARE_ACCEL
));
/* Set the signals handlers. */
g_signal_connect
(
G_OBJECT
(
data
->
dialog
),
...
...
extensions/gstreamer_tools/gth-media-viewer-page.c
View file @
b4cfc787
...
...
@@ -806,8 +806,31 @@ create_playbin (GthMediaViewerPage *self)
return
;
self
->
priv
->
playbin
=
gst_element_factory_make
(
"playbin"
,
"playbin"
);
video_sink
=
gst_element_factory_make
(
"gtksink"
,
NULL
);
g_object_set
(
self
->
priv
->
playbin
,
"video-sink"
,
video_sink
,
NULL
);
settings
=
g_settings_new
(
GTHUMB_GSTREAMER_TOOLS_SCHEMA
);
if
(
g_settings_get_boolean
(
settings
,
PREF_GSTREAMER_USE_HARDWARE_ACCEL
))
{
GstElement
*
video_bin
;
GstElement
*
glupload
;
GstPad
*
pad
;
GstPad
*
ghost_pad
;
/* pipeline taken from GNOME Twitch */
video_sink
=
gst_element_factory_make
(
"gtkglsink"
,
"sink"
);
video_bin
=
gst_bin_new
(
"video_bin"
);
glupload
=
gst_element_factory_make
(
"glupload"
,
NULL
);
gst_bin_add_many
(
GST_BIN
(
video_bin
),
glupload
,
video_sink
,
NULL
);
gst_element_link_many
(
glupload
,
video_sink
,
NULL
);
pad
=
gst_element_get_static_pad
(
glupload
,
"sink"
);
ghost_pad
=
gst_ghost_pad_new
(
"sink"
,
pad
);
gst_pad_set_active
(
ghost_pad
,
TRUE
);
gst_element_add_pad
(
video_bin
,
ghost_pad
);
g_object_set
(
self
->
priv
->
playbin
,
"video-sink"
,
video_bin
,
NULL
);
}
else
{
video_sink
=
gst_element_factory_make
(
"gtksink"
,
"sink"
);
g_object_set
(
self
->
priv
->
playbin
,
"video-sink"
,
video_sink
,
NULL
);
}
g_object_get
(
video_sink
,
"widget"
,
&
self
->
priv
->
video_area
,
NULL
);
gtk_style_context_add_class
(
gtk_widget_get_style_context
(
self
->
priv
->
video_area
),
"video-player"
);
...
...
@@ -847,7 +870,6 @@ create_playbin (GthMediaViewerPage *self)
gtk_stack_add_named
(
GTK_STACK
(
self
->
priv
->
area_box
),
self
->
priv
->
video_area
,
"video-area"
);
gtk_widget_show
(
self
->
priv
->
video_area
);
settings
=
g_settings_new
(
GTHUMB_GSTREAMER_TOOLS_SCHEMA
);
g_object_set
(
self
->
priv
->
playbin
,
"volume"
,
(
double
)
g_settings_get_int
(
settings
,
PREF_GSTREAMER_TOOLS_VOLUME
)
/
100
.
0
,
"force-aspect-ratio"
,
TRUE
,
...
...
extensions/gstreamer_tools/preferences.h
View file @
b4cfc787
...
...
@@ -30,5 +30,6 @@
#define PREF_GSTREAMER_TOOLS_SCREESHOT_LOCATION "screenshot-location"
#define PREF_GSTREAMER_TOOLS_VOLUME "volume"
#define PREF_GSTREAMER_USE_HARDWARE_ACCEL "use-hardware-acceleration"
#endif
/* PREFERENCES_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment