Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Seungha Yang
gst-plugins-base
Commits
f58914b9
Commit
f58914b9
authored
Mar 05, 2020
by
Matthew Waters
🐨
Committed by
GStreamer Merge Bot
Mar 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gl/wayland: use wayland's roundtrip_queue()
There's no need to roll our own anymore
parent
0739fafd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
77 deletions
+4
-77
gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
+4
-4
gst-libs/gst/gl/wayland/wayland_event_source.c
gst-libs/gst/gl/wayland/wayland_event_source.c
+0
-69
gst-libs/gst/gl/wayland/wayland_event_source.h
gst-libs/gst/gl/wayland/wayland_event_source.h
+0
-4
No files found.
gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
View file @
f58914b9
...
...
@@ -554,8 +554,8 @@ gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error)
wl_registry_add_listener
(
window_egl
->
display
.
registry
,
&
registry_listener
,
window_egl
);
if
(
gst_gl_wl_display_roundtrip_queue
(
window_egl
->
display
.
display
,
display
->
display
,
window_egl
->
window
.
queue
)
<
0
)
{
if
(
wl_display_roundtrip_queue
(
display
->
display
,
window_egl
->
window
.
queue
)
<
0
)
{
g_set_error
(
error
,
GST_GL_WINDOW_ERROR
,
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE
,
"Failed to perform a wayland roundtrip"
);
...
...
@@ -610,8 +610,8 @@ _roundtrip_async (GstGLWindow * window)
create_surfaces
(
window_egl
);
if
(
gst_gl_wl_display_roundtrip_queue
(
window_egl
->
display
.
display
,
display
->
display
,
window_egl
->
window
.
queue
)
<
0
)
if
(
wl_display_roundtrip_queue
(
display
->
display
,
window_egl
->
window
.
queue
)
<
0
)
GST_WARNING_OBJECT
(
window
,
"failed a roundtrip"
);
}
...
...
gst-libs/gst/gl/wayland/wayland_event_source.c
View file @
f58914b9
...
...
@@ -54,75 +54,6 @@ init_debug (void)
}
}
static
void
sync_callback
(
void
*
data
,
struct
wl_callback
*
callback
,
uint32_t
serial
)
{
gboolean
*
done
=
data
;
GST_TRACE
(
"roundtrip done. callback:%p"
,
callback
);
*
done
=
TRUE
;
wl_callback_destroy
(
callback
);
}
static
const
struct
wl_callback_listener
sync_listener
=
{
sync_callback
};
/* only thread safe iff called on the same thread @queue is being dispatched on.
* Otherwise, two prepare_read{_queue}()'s can be indicated for the same
* queue and dispatch{_queue}() may be called for different threads which
* will cause deadlocks as no guarantees for thread-safety are given when
* pumping the same queue from multiple threads.
* As a concrete example, if the wayland event source (below) for a @queue is
* running on a certain thread, then this function must only be called in that
* thread (with that @queue). */
/* @sync_display is the wl_display that is used to create the sync object and
* may be a proxy wrapper.
* @dispatch_display must not be a proxy wrapper.
* @queue can be NULL. */
gint
gst_gl_wl_display_roundtrip_queue
(
struct
wl_display
*
sync_display
,
struct
wl_display
*
dispatch_display
,
struct
wl_event_queue
*
queue
)
{
struct
wl_callback
*
callback
;
gboolean
done
=
FALSE
;
gint
ret
=
0
;
init_debug
();
GST_TRACE
(
"roundtrip start for dpy %p and queue %p"
,
dispatch_display
,
queue
);
if
(
!
(
callback
=
wl_display_sync
(
sync_display
)))
{
GST_WARNING
(
"creating sync callback failed"
);
return
-
1
;
}
GST_TRACE
(
"create roundtrip callback %p"
,
callback
);
wl_callback_add_listener
(
callback
,
&
sync_listener
,
&
done
);
if
(
queue
)
{
while
(
!
done
&&
ret
>=
0
)
{
ret
=
wl_display_dispatch_queue
(
dispatch_display
,
queue
);
GST_TRACE
(
"dispatch ret: %i, errno: (%i, 0x%x)
\'
%s
\'
"
,
ret
,
errno
,
errno
,
g_strerror
(
errno
));
}
}
else
{
while
(
!
done
&&
ret
>=
0
)
{
ret
=
wl_display_dispatch
(
dispatch_display
);
GST_TRACE
(
"dispatch ret: %i, errno: (%i, 0x%x)
\'
%s
\'
"
,
ret
,
errno
,
errno
,
g_strerror
(
errno
));
}
}
if
(
ret
==
-
1
&&
!
done
)
wl_callback_destroy
(
callback
);
GST_DEBUG
(
"roundtrip done for dpy %p and queue %p. ret %i, "
"errno: (%i, 0x%x)
\'
%s
\'
"
,
dispatch_display
,
queue
,
ret
,
errno
,
errno
,
g_strerror
(
errno
));
return
ret
;
}
typedef
struct
_WaylandEventSource
{
GSource
source
;
...
...
gst-libs/gst/gl/wayland/wayland_event_source.h
View file @
f58914b9
...
...
@@ -36,8 +36,4 @@
GSource
*
wayland_event_source_new
(
struct
wl_display
*
display
,
struct
wl_event_queue
*
queue
);
G_GNUC_INTERNAL
gint
gst_gl_wl_display_roundtrip_queue
(
struct
wl_display
*
sync_display
,
struct
wl_display
*
dispatch_display
,
struct
wl_event_queue
*
queue
);
#endif
/* __WAYLAND_EVENT_SOURCE_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