Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Seungha Yang
gst-plugins-base
Commits
4c008895
Commit
4c008895
authored
Feb 04, 2020
by
Matthew Waters
🐨
Committed by
GStreamer Merge Bot
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gldisplay: add support removing a context from the internal list
parent
55e80b55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
gst-libs/gst/gl/gstgldisplay.c
gst-libs/gst/gl/gstgldisplay.c
+43
-0
gst-libs/gst/gl/gstgldisplay.h
gst-libs/gst/gl/gstgldisplay.h
+5
-2
No files found.
gst-libs/gst/gl/gstgldisplay.c
View file @
4c008895
...
...
@@ -874,3 +874,46 @@ out:
return
ret
;
}
/**
* gst_gl_display_remove_context:
* @display: a #GstGLDisplay
* @context: (transfer none): the #GstGLContext to remove
*
* Must be called with the object lock held.
*
* Since: 1.18
*/
void
gst_gl_display_remove_context
(
GstGLDisplay
*
display
,
GstGLContext
*
needle
)
{
GstGLContext
*
context
;
GList
*
prev
=
NULL
,
*
l
;
g_return_if_fail
(
GST_IS_GL_DISPLAY
(
display
));
g_return_if_fail
(
GST_IS_GL_CONTEXT
(
needle
));
l
=
display
->
priv
->
contexts
;
while
(
l
)
{
GWeakRef
*
ref
=
l
->
data
;
context
=
g_weak_ref_get
(
ref
);
if
(
!
context
||
context
==
needle
)
{
/* remove dead contexts */
g_weak_ref_clear
(
l
->
data
);
g_free
(
l
->
data
);
display
->
priv
->
contexts
=
g_list_delete_link
(
display
->
priv
->
contexts
,
l
);
l
=
prev
?
prev
->
next
:
display
->
priv
->
contexts
;
if
(
context
)
{
GST_INFO_OBJECT
(
display
,
"removed context %"
GST_PTR_FORMAT
" from internal list"
,
context
);
return
;
}
else
continue
;
}
}
GST_WARNING_OBJECT
(
display
,
"%"
GST_PTR_FORMAT
" was not found in this "
"display"
,
needle
);
}
gst-libs/gst/gl/gstgldisplay.h
View file @
4c008895
...
...
@@ -141,8 +141,11 @@ GST_GL_API
GstGLContext
*
gst_gl_display_get_gl_context_for_thread
(
GstGLDisplay
*
display
,
GThread
*
thread
);
GST_GL_API
gboolean
gst_gl_display_add_context
(
GstGLDisplay
*
display
,
GstGLContext
*
context
);
gboolean
gst_gl_display_add_context
(
GstGLDisplay
*
display
,
GstGLContext
*
context
);
GST_GL_API
void
gst_gl_display_remove_context
(
GstGLDisplay
*
display
,
GstGLContext
*
context
);
GST_GL_API
GstGLWindow
*
gst_gl_display_create_window
(
GstGLDisplay
*
display
);
...
...
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