Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4f4d1a58
Commit
4f4d1a58
authored
Jul 31, 2010
by
Juho Vähä-Herttua
Committed by
Rémi Denis-Courmont
Jul 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Run mainloop on the main thread on OSX
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
b0ad9149
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
5 deletions
+39
-5
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+39
-5
No files found.
modules/gui/qt4/qt4.cpp
View file @
4f4d1a58
...
@@ -282,6 +282,24 @@ static struct
...
@@ -282,6 +282,24 @@ static struct
* Module callbacks
* Module callbacks
*****************************************************************************/
*****************************************************************************/
#ifdef Q_WS_MAC
/* Used to abort the app.exec() on OSX after libvlc_Quit is called */
#include "../../../src/control/libvlc_internal.h"
/* libvlc_SetExitHandler */
static
void
Abort
(
void
*
obj
)
{
QVLCApp
::
triggerQuit
();
}
#endif
static
void
RegisterIntf
(
vlc_object_t
*
p_this
)
{
playlist_t
*
pl
=
pl_Get
(
p_this
);
var_Create
(
pl
,
"qt4-iface"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
pl
,
"qt4-iface"
,
p_this
);
var_Create
(
pl
,
"window"
,
VLC_VAR_STRING
);
var_SetString
(
pl
,
"window"
,
"qt4,any"
);
}
/* Open Interface */
/* Open Interface */
static
int
Open
(
vlc_object_t
*
p_this
,
bool
isDialogProvider
)
static
int
Open
(
vlc_object_t
*
p_this
,
bool
isDialogProvider
)
{
{
...
@@ -327,6 +345,11 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
...
@@ -327,6 +345,11 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
x11_display
=
display
;
x11_display
=
display
;
#endif
#endif
vlc_sem_init
(
&
ready
,
0
);
vlc_sem_init
(
&
ready
,
0
);
#ifdef Q_WS_MAC
/* Run mainloop on the main thread as Cocoa requires */
libvlc_SetExitHandler
(
p_intf
->
p_libvlc
,
Abort
,
p_intf
);
Thread
(
(
void
*
)
p_intf
);
#else
if
(
vlc_clone
(
&
p_sys
->
thread
,
Thread
,
p_intf
,
VLC_THREAD_PRIORITY_LOW
)
)
if
(
vlc_clone
(
&
p_sys
->
thread
,
Thread
,
p_intf
,
VLC_THREAD_PRIORITY_LOW
)
)
{
{
delete
p_sys
;
delete
p_sys
;
...
@@ -336,19 +359,19 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
...
@@ -336,19 +359,19 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
vlc_mutex_unlock
(
&
one
.
lock
);
vlc_mutex_unlock
(
&
one
.
lock
);
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
#endif
/* */
/* */
vlc_sem_wait
(
&
ready
);
vlc_sem_wait
(
&
ready
);
vlc_sem_destroy
(
&
ready
);
vlc_sem_destroy
(
&
ready
);
#ifndef Q_WS_MAC
if
(
!
p_sys
->
b_isDialogProvider
)
if
(
!
p_sys
->
b_isDialogProvider
)
{
{
playlist_t
*
pl
=
pl_Get
(
p_this
);
RegisterIntf
(
p_this
);
var_Create
(
pl
,
"qt4-iface"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
pl
,
"qt4-iface"
,
p_this
);
var_Create
(
pl
,
"window"
,
VLC_VAR_STRING
);
var_SetString
(
pl
,
"window"
,
"qt4,any"
);
}
}
#endif
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -377,7 +400,9 @@ static void Close( vlc_object_t *p_this )
...
@@ -377,7 +400,9 @@ static void Close( vlc_object_t *p_this )
QVLCApp
::
triggerQuit
();
QVLCApp
::
triggerQuit
();
#ifndef Q_WS_MAC
vlc_join
(
p_sys
->
thread
,
NULL
);
vlc_join
(
p_sys
->
thread
,
NULL
);
#endif
#ifdef Q_WS_X11
#ifdef Q_WS_X11
free
(
x11_display
);
free
(
x11_display
);
x11_display
=
NULL
;
x11_display
=
NULL
;
...
@@ -466,6 +491,15 @@ static void *Thread( void *obj )
...
@@ -466,6 +491,15 @@ static void *Thread( void *obj )
/* */
/* */
vlc_sem_post
(
&
ready
);
vlc_sem_post
(
&
ready
);
#ifdef Q_WS_MAC
/* We took over main thread, register and start here */
if
(
!
p_intf
->
p_sys
->
b_isDialogProvider
)
{
RegisterIntf
(
(
vlc_object_t
*
)
p_intf
);
playlist_Play
(
p_intf
->
p_sys
->
p_playlist
);
}
#endif
/* Last settings */
/* Last settings */
app
.
setQuitOnLastWindowClosed
(
false
);
app
.
setQuitOnLastWindowClosed
(
false
);
...
...
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