Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
rygel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
136
Issues
136
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
rygel
Commits
0a8d3437
Commit
0a8d3437
authored
Jul 12, 2020
by
Jens Georg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: Add play/pause to space key
For fullscreen renderer
parent
2f6d9639
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
examples/fullscreen-renderer.c
examples/fullscreen-renderer.c
+26
-2
No files found.
examples/fullscreen-renderer.c
View file @
0a8d3437
...
...
@@ -130,13 +130,37 @@ static gboolean on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
return
TRUE
;
}
static
void
toggle_play_pause
(
GstElement
*
element
)
{
GstStateChangeReturn
ret
;
GstState
current
=
GST_STATE_NULL
,
pending
=
GST_STATE_NULL
;
ret
=
gst_element_get_state
(
element
,
&
current
,
&
pending
,
GST_CLOCK_TIME_NONE
);
if
(
ret
!=
GST_STATE_CHANGE_SUCCESS
)
return
;
if
(
current
==
GST_STATE_PAUSED
)
{
gst_element_set_state
(
element
,
GST_STATE_PLAYING
);
}
if
(
current
==
GST_STATE_PLAYING
)
{
gst_element_set_state
(
element
,
GST_STATE_PAUSED
);
}
}
static
gboolean
on_key_released
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
)
GdkEvent
*
event
,
gpointer
user_data
)
{
GdkEventKey
*
key_event
=
(
GdkEventKey
*
)
event
;
MainData
*
data
=
(
MainData
*
)
user_data
;
switch
(
key_event
->
keyval
)
{
case
GDK_KEY_space
:
toggle_play_pause
(
data
->
playbin
);
return
FALSE
;
case
GDK_KEY_Escape
:
case
GDK_KEY_q
:
case
GDK_KEY_Q
:
...
...
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