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
1c6b5a27
Commit
1c6b5a27
authored
Sep 20, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/intf.m: Fix Mac OS X interface.
parent
515bdc8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
+36
-6
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+36
-6
No files found.
modules/gui/macosx/intf.m
View file @
1c6b5a27
...
@@ -57,6 +57,31 @@
...
@@ -57,6 +57,31 @@
*****************************************************************************/
*****************************************************************************/
static
void
Run
(
intf_thread_t
*
p_intf
);
static
void
Run
(
intf_thread_t
*
p_intf
);
/* Quick hack */
/*****************************************************************************
* VLCApplication implementation (this hack is really disgusting now,
* feel free to fix.)
*****************************************************************************/
@interface
VLCApplication
:
NSApplication
{
libvlc_int_t
*
o_libvlc
;
}
-
(
void
)
setVLC
:
(
libvlc_int_t
*
)
p_libvlc
;
@end
@implementation
VLCApplication
-
(
void
)
setVLC
:
(
libvlc_int_t
*
)
p_libvlc
{
o_libvlc
=
p_libvlc
;
}
-
(
void
)
terminate
:
(
id
)
sender
{
vlc_object_kill
(
o_libvlc
);
[
super
terminate
:
sender
];
}
@end
/*****************************************************************************
/*****************************************************************************
* OpenIntf: initialize interface
* OpenIntf: initialize interface
*****************************************************************************/
*****************************************************************************/
...
@@ -74,16 +99,11 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
...
@@ -74,16 +99,11 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
p_intf
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
p_intf
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
/* Put Cocoa into multithread mode as soon as possible.
* http://developer.apple.com/techpubs/macosx/Cocoa/
* TasksAndConcepts/ProgrammingTopics/Multithreading/index.html
* This thread does absolutely nothing at all. */
//[NSThread detachNewThreadSelector:@selector(self) toTarget:[NSString string] withObject:nil];
p_intf
->
p_sys
->
o_sendport
=
[[
NSPort
port
]
retain
];
p_intf
->
p_sys
->
o_sendport
=
[[
NSPort
port
]
retain
];
p_intf
->
p_sys
->
p_sub
=
msg_Subscribe
(
p_intf
,
MSG_QUEUE_NORMAL
);
p_intf
->
p_sys
->
p_sub
=
msg_Subscribe
(
p_intf
,
MSG_QUEUE_NORMAL
);
p_intf
->
b_play
=
VLC_TRUE
;
p_intf
->
b_play
=
VLC_TRUE
;
p_intf
->
pf_run
=
Run
;
p_intf
->
pf_run
=
Run
;
p_intf
->
b_should_run_on_first_thread
=
VLC_TRUE
;
return
(
0
);
return
(
0
);
}
}
...
@@ -125,6 +145,14 @@ static void Run( intf_thread_t *p_intf )
...
@@ -125,6 +145,14 @@ static void Run( intf_thread_t *p_intf )
sigaddset
(
&
set
,
SIGTERM
);
sigaddset
(
&
set
,
SIGTERM
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
NULL
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
NULL
);
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
/* Install a jmpbuffer to where we can go back before the NSApp exit
* see applicationWillTerminate: */
/* We need that code to run on main thread */
[
VLCApplication
sharedApplication
];
[
NSApp
setVLC
:
p_intf
->
p_libvlc
];
[[
VLCMain
sharedInstance
]
setIntf
:
p_intf
];
[[
VLCMain
sharedInstance
]
setIntf
:
p_intf
];
[
NSBundle
loadNibNamed
:
@"MainMenu"
owner
:
NSApp
];
[
NSBundle
loadNibNamed
:
@"MainMenu"
owner
:
NSApp
];
...
@@ -132,6 +160,8 @@ static void Run( intf_thread_t *p_intf )
...
@@ -132,6 +160,8 @@ static void Run( intf_thread_t *p_intf )
* see applicationWillTerminate: */
* see applicationWillTerminate: */
if
(
setjmp
(
jmpbuffer
)
==
0
)
if
(
setjmp
(
jmpbuffer
)
==
0
)
[
NSApp
run
];
[
NSApp
run
];
[
o_pool
release
];
}
}
int
ExecuteOnMainThread
(
id
target
,
SEL
sel
,
void
*
p_arg
)
int
ExecuteOnMainThread
(
id
target
,
SEL
sel
,
void
*
p_arg
)
...
...
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