Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
06da9937
Commit
06da9937
authored
Dec 19, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal_macosx: modernize coding style and remove useless includes
parent
ba45dbbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
52 deletions
+39
-52
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
+2
-2
modules/gui/minimal_macosx/intf.h
modules/gui/minimal_macosx/intf.h
+4
-9
modules/gui/minimal_macosx/intf.m
modules/gui/minimal_macosx/intf.m
+33
-41
No files found.
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
View file @
06da9937
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
/*****************************************************************************
/*****************************************************************************
* Preamble
* Preamble
*****************************************************************************/
*****************************************************************************/
#i
nclude
"intf.h"
#i
mport
"intf.h"
#i
nclude
"VLCMinimalVoutWindow.h"
#i
mport
"VLCMinimalVoutWindow.h"
#import <Cocoa/Cocoa.h>
#import <Cocoa/Cocoa.h>
...
...
modules/gui/minimal_macosx/intf.h
View file @
06da9937
...
@@ -25,17 +25,12 @@
...
@@ -25,17 +25,12 @@
*****************************************************************************/
*****************************************************************************/
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# i
nclude
"config.h"
# i
mport
"config.h"
#endif
#endif
#include <vlc_common.h>
#import <Cocoa/Cocoa.h>
#include <vlc_interface.h>
#import <vlc_common.h>
#include <vlc_playlist.h>
#import <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_input.h>
#include <Cocoa/Cocoa.h>
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
...
...
modules/gui/minimal_macosx/intf.m
View file @
06da9937
...
@@ -27,44 +27,36 @@
...
@@ -27,44 +27,36 @@
/*****************************************************************************
/*****************************************************************************
*
Preamble
*
Preamble
*****************************************************************************/
*****************************************************************************/
#i
nclude
<stdlib
.
h
>
/* malloc(), free() */
#i
mport
<
stdlib
.
h
>
/*
malloc
()
,
free
()
*/
#i
nclude
<sys
/
param
.
h
>
/* for MAXPATHLEN */
#i
mport
<
sys
/
param
.
h
>
/*
for
MAXPATHLEN
*/
#i
nclude
<string
.
h
>
#i
mport
<
string
.
h
>
#ifdef
HAVE
_
CONFIG
_
H
#ifdef
HAVE
_
CONFIG
_
H
# i
nclude
"config.h"
#
i
mport
"config.h"
#endif
#endif
#include
<vlc
_common
.
h
>
#import
<
vlc
_
playlist
.
h
>
#import
<
vlc
_
vout
_
window
.
h
>
#include
<vlc
_keys
.
h
>
#import
"intf.h"
#include
<vlc
_input
.
h
>
#import
<vlc
_interface
.
h
>
#include
<vlc
_vout_window
.
h
>
#import
<intf
.
h
>
#import
"VLCMinimalVoutWindow.h"
#import
"VLCMinimalVoutWindow.h"
/*****************************************************************************
/*****************************************************************************
*
Local
prototypes
.
*
Local
prototypes
.
*****************************************************************************/
*****************************************************************************/
static void Run (
intf_thread_t *p_intf
);
static
void
Run
(
intf
_
thread
_
t
*
p
_
intf
)
;
/*****************************************************************************
/*****************************************************************************
*
OpenIntf
:
initialize
interface
*
OpenIntf
:
initialize
interface
*****************************************************************************/
*****************************************************************************/
int OpenIntf (
vlc_object_t *p_this
)
int
OpenIntf
(
vlc
_
object
_
t
*
p
_
this
)
{
{
intf
_
thread
_
t
*
p
_
intf
=
(
intf
_
thread
_
t
*
)
p
_
this
;
intf
_
thread
_
t
*
p
_
intf
=
(
intf
_
thread
_
t
*
)
p
_
this
;
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
p
_
intf
->
p
_
sys
=
malloc
(
sizeof
(
intf
_
sys
_
t
))
;
if( p_intf->p_sys == NULL )
if
(
p
_
intf
->
p
_
sys
==
NULL
)
{
return
VLC
_
ENOMEM
;
return
VLC
_
ENOMEM
;
}
memset(
p_intf->p_sys, 0, sizeof( *p_intf->p_sys )
);
memset
(
p
_
intf
->
p
_
sys
,
0
,
sizeof
(*p_intf->p_sys)
);
Run(p_intf);
Run(p_intf);
...
@@ -74,11 +66,11 @@ int OpenIntf ( vlc_object_t *p_this )
...
@@ -74,11 +66,11 @@ int OpenIntf ( vlc_object_t *p_this )
/*****************************************************************************
/*****************************************************************************
* CloseIntf: destroy interface
* CloseIntf: destroy interface
*****************************************************************************/
*****************************************************************************/
void CloseIntf (
vlc_object_t *p_this
)
void CloseIntf (
vlc_object_t *p_this
)
{
{
intf_thread_t *p_intf = (intf_thread_t*)
p
_
this
;
intf_thread_t *p_intf = (intf_thread_t*)
p
_
this
;
free(
p_intf->p_sys
);
free
(
p
_
intf
->
p
_
sys
)
;
}
}
/*
Dock
Connection
*/
/*
Dock
Connection
*/
...
@@ -88,29 +80,29 @@ typedef struct CPSProcessSerNum
...
@@ -88,29 +80,29 @@ typedef struct CPSProcessSerNum
UInt32
hi
;
UInt32
hi
;
}
CPSProcessSerNum
;
}
CPSProcessSerNum
;
extern OSErr CPSGetCurrentProcess(
CPSProcessSerNum *psn);
extern
OSErr
CPSGetCurrentProcess
(
CPSProcessSerNum
*
psn
)
;
extern OSErr CPSEnableForegroundOperation(
CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern
OSErr
CPSEnableForegroundOperation
(
CPSProcessSerNum
*
psn
,
UInt32
_
arg2
,
UInt32
_
arg3
,
UInt32
_
arg4
,
UInt32
_
arg5
)
;
extern OSErr CPSSetFrontProcess(
CPSProcessSerNum *psn);
extern
OSErr
CPSSetFrontProcess
(
CPSProcessSerNum
*
psn
)
;
/*****************************************************************************
/*****************************************************************************
*
KillerThread
:
Thread
that
kill
the
application
*
KillerThread
:
Thread
that
kill
the
application
*****************************************************************************/
*****************************************************************************/
static void * KillerThread(
void *user_data
)
static
void
*
KillerThread
(
void
*
user
_
data
)
{
{
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
intf
_
thread
_
t
*
p
_
intf
=
user
_
data
;
intf
_
thread
_
t
*
p
_
intf
=
user
_
data
;
vlc_mutex_init(
&
p_intf->p_sys->lock
);
vlc
_
mutex
_
init
(
&
p
_
intf
->
p
_
sys
->
lock
)
;
vlc_cond_init(
&
p_intf->p_sys->wait
);
vlc
_
cond
_
init
(
&
p
_
intf
->
p
_
sys
->
wait
)
;
vlc_mutex_lock (
&
p_intf->p_sys->lock
);
vlc
_
mutex
_
lock
(
&
p
_
intf
->
p
_
sys
->
lock
)
;
while(
vlc_object_alive( p_intf )
)
while
(
vlc
_
object
_
alive
(
p
_
intf
)
)
vlc_cond_wait(
&
p_intf->p_sys->wait,
&
p_intf->p_sys->lock
);
vlc
_
cond
_
wait
(
&
p
_
intf
->
p
_
sys
->
wait
,
&
p
_
intf
->
p
_
sys
->
lock
)
;
vlc_mutex_unlock(
&
p_intf->p_sys->lock
);
vlc
_
mutex
_
unlock
(
&
p
_
intf
->
p
_
sys
->
lock
)
;
vlc_mutex_destroy(
&
p_intf->p_sys->lock
);
vlc
_
mutex
_
destroy
(
&
p
_
intf
->
p
_
sys
->
lock
)
;
vlc_cond_destroy(
&
p_intf->p_sys->wait
);
vlc
_
cond
_
destroy
(
&
p
_
intf
->
p
_
sys
->
wait
)
;
/*
We
are
dead
,
terminate
*/
/*
We
are
dead
,
terminate
*/
[
NSApp
terminate
:
nil
]
;
[
NSApp
terminate
:
nil
]
;
...
@@ -121,7 +113,7 @@ static void * KillerThread( void *user_data )
...
@@ -121,7 +113,7 @@ static void * KillerThread( void *user_data )
/*****************************************************************************
/*****************************************************************************
*
Run
:
main
loop
*
Run
:
main
loop
*****************************************************************************/
*****************************************************************************/
static void Run(
intf_thread_t *p_intf
)
static
void
Run
(
intf
_
thread
_
t
*
p
_
intf
)
{
{
sigset
_
t
set
;
sigset
_
t
set
;
...
@@ -129,13 +121,13 @@ static void Run( intf_thread_t *p_intf )
...
@@ -129,13 +121,13 @@ static void Run( intf_thread_t *p_intf )
*
VLC
overrides
SIGTERM
which
is
sent
by
the
"force quit"
*
VLC
overrides
SIGTERM
which
is
sent
by
the
"force quit"
*
menu
item
to
make
sure
deamon
mode
quits
gracefully
,
so
*
menu
item
to
make
sure
deamon
mode
quits
gracefully
,
so
*
we
un
-
override
SIGTERM
here
.
*/
*
we
un
-
override
SIGTERM
here
.
*/
sigemptyset(
&
set
);
sigemptyset
(
&
set
)
;
sigaddset(
&
set, SIGTERM
);
sigaddset
(
&
set
,
SIGTERM
)
;
pthread_sigmask(
SIG_UNBLOCK,
&
set, NULL
);
pthread
_
sigmask
(
SIG
_
UNBLOCK
,
&
set
,
NULL
)
;
/*
Setup
a
thread
that
will
monitor
the
module
killing
*/
/*
Setup
a
thread
that
will
monitor
the
module
killing
*/
pthread
_
t
killer
_
thread
;
pthread
_
t
killer
_
thread
;
pthread_create(
&
killer_thread, NULL, KillerThread, p_intf
);
pthread
_
create
(
&
killer
_
thread
,
NULL
,
KillerThread
,
p
_
intf
)
;
CPSProcessSerNum
PSN
;
CPSProcessSerNum
PSN
;
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
...
@@ -146,7 +138,7 @@ static void Run( intf_thread_t *p_intf )
...
@@ -146,7 +138,7 @@ static void Run( intf_thread_t *p_intf )
[
NSApplication
sharedApplication
]
;
[
NSApplication
sharedApplication
]
;
[
NSApp
run
]
;
[
NSApp
run
]
;
pthread_join(
killer_thread, NULL
);
pthread
_
join
(
killer
_
thread
,
NULL
)
;
[
pool
release
]
;
[
pool
release
]
;
}
}
...
@@ -192,7 +184,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
...
@@ -192,7 +184,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
return
VLC
_
EGENERIC
;
return
VLC
_
EGENERIC
;
}
}
switch(i_query) {
switch
(
i
_
query
)
{
case
VOUT
_
WINDOW
_
SET
_
STATE
:
case
VOUT
_
WINDOW
_
SET
_
STATE
:
{
{
unsigned
i
_
state
=
va
_
arg
(
args
,
unsigned
)
;
unsigned
i
_
state
=
va
_
arg
(
args
,
unsigned
)
;
...
...
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