Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc-gpu
Commits
b7cce616
Commit
b7cce616
authored
Oct 01, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hildon: partially fix vout window provider thread safety
parent
ae57a467
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
28 deletions
+29
-28
modules/gui/maemo/maemo.c
modules/gui/maemo/maemo.c
+29
-26
modules/gui/maemo/maemo.h
modules/gui/maemo/maemo.h
+0
-2
No files found.
modules/gui/maemo/maemo.c
View file @
b7cce616
...
...
@@ -74,6 +74,14 @@ vlc_module_begin();
set_callbacks
(
OpenWindow
,
CloseWindow
);
vlc_module_end
();
static
struct
{
vlc_mutex_t
lock
;
vlc_cond_t
wait
;
intf_thread_t
*
intf
;
bool
enabled
;
}
wnd_req
=
{
VLC_STATIC_MUTEX
,
PTHREAD_COND_INITIALIZER
,
NULL
,
false
};
/*****************************************************************************
* Module callbacks
*****************************************************************************/
...
...
@@ -95,9 +103,9 @@ static int Open( vlc_object_t *p_this )
p_intf
->
p_sys
->
p_main_window
=
NULL
;
p_intf
->
p_sys
->
p_video_window
=
NULL
;
wnd_req
.
enabled
=
true
;
/* ^no need to lock, interfacesare started before video outputs */
vlc_spin_init
(
&
p_intf
->
p_sys
->
event_lock
);
vlc_mutex_init
(
&
p_intf
->
p_sys
->
p_video_mutex
);
vlc_cond_init
(
&
p_intf
->
p_sys
->
p_video_cond
);
return
VLC_SUCCESS
;
}
...
...
@@ -246,6 +254,7 @@ static void Run( intf_thread_t *p_intf )
var_DelCallback
(
p_intf
->
p_sys
->
p_playlist
,
"activity"
,
activity_cb
,
p_intf
);
/* FIXME: we need to wait for vout to clean up... */
assert
(
!
p_intf
->
p_sys
->
p_vout
);
/* too late */
gtk_object_destroy
(
GTK_OBJECT
(
window
)
);
}
...
...
@@ -264,27 +273,27 @@ static gboolean should_die( gpointer data )
static
int
OpenWindow
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
intf_thread_t
*
intf
;
if
(
wnd
->
cfg
->
is_standalone
)
if
(
wnd
->
cfg
->
is_standalone
||
!
wnd_req
.
enabled
)
return
VLC_EGENERIC
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
vlc_object_find_name
(
obj
,
"maemo"
,
FIND_ANYWHERE
);
if
(
intf
==
NULL
)
{
msg_Err
(
obj
,
"Maemo interface not found"
);
return
VLC_EGENERIC
;
/* Maemo not in use */
}
/* FIXME it should NOT be needed */
vout_thread_t
*
vout
=
vlc_object_find
(
obj
,
VLC_OBJECT_VOUT
,
FIND_PARENT
);
if
(
!
vout
)
return
VLC_EGENERIC
;
vlc_mutex_lock
(
&
wnd_req
.
lock
);
while
((
intf
=
wnd_req
.
intf
)
==
NULL
)
vlc_cond_wait
(
&
wnd_req
.
wait
,
&
wnd_req
.
lock
);
wnd
->
handle
.
xid
=
request_video
(
intf
,
vout
);
if
(
!
wnd
->
handle
.
xid
)
{
vlc_mutex_unlock
(
&
wnd_req
.
lock
);
vlc_object_release
(
vout
);
if
(
!
wnd
->
handle
.
xid
)
return
VLC_EGENERIC
;
}
vlc_object_release
(
vout
);
msg_Dbg
(
intf
,
"Using handle %"
PRIu32
,
wnd
->
handle
.
xid
);
...
...
@@ -322,8 +331,9 @@ static void CloseWindow (vlc_object_t *obj)
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
wnd
->
sys
;
vlc_mutex_lock
(
&
wnd_req
.
lock
);
release_video
(
intf
);
vlc_
object_release
(
intf
);
vlc_
mutex_unlock
(
&
wnd_req
.
lock
);
}
static
uint32_t
request_video
(
intf_thread_t
*
p_intf
,
vout_thread_t
*
p_nvout
)
...
...
@@ -334,16 +344,6 @@ static uint32_t request_video( intf_thread_t *p_intf, vout_thread_t *p_nvout )
return
0
;
}
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_video_mutex
);
mutex_cleanup_push
(
&
p_intf
->
p_sys
->
p_video_mutex
);
// We wait until the p_video_window is set
while
(
p_intf
->
p_sys
->
p_video_window
==
NULL
)
vlc_cond_wait
(
&
p_intf
->
p_sys
->
p_video_cond
,
&
p_intf
->
p_sys
->
p_video_mutex
);
vlc_cleanup_run
();
p_intf
->
p_sys
->
p_vout
=
vlc_object_hold
(
p_nvout
);
return
GDK_WINDOW_XID
(
p_intf
->
p_sys
->
p_video_window
->
window
);
}
...
...
@@ -368,7 +368,10 @@ static gboolean video_widget_ready( gpointer data )
p_intf
->
p_sys
->
p_video_window
=
video
;
gtk_widget_grab_focus
(
video
);
vlc_cond_signal
(
&
p_intf
->
p_sys
->
p_video_cond
);
vlc_mutex_lock
(
&
wnd_req
.
lock
);
wnd_req
.
intf
=
p_intf
;
vlc_cond_signal
(
&
wnd_req
.
wait
);
vlc_mutex_unlock
(
&
wnd_req
.
lock
);
// We rewind the input
if
(
p_intf
->
p_sys
->
p_input
)
...
...
modules/gui/maemo/maemo.h
View file @
b7cce616
...
...
@@ -47,6 +47,4 @@ struct intf_sys_t
GtkWidget
*
p_video_window
;
vout_thread_t
*
p_vout
;
vlc_cond_t
p_video_cond
;
vlc_mutex_t
p_video_mutex
;
};
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