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
cfdb9009
Commit
cfdb9009
authored
Aug 26, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Get rid of the vlc_object_find().
parent
bacfecb2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
44 deletions
+59
-44
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/embeddedwindow.m
+1
-1
modules/gui/macosx/equalizer.m
modules/gui/macosx/equalizer.m
+10
-18
modules/gui/macosx/extended.m
modules/gui/macosx/extended.m
+10
-19
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+6
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+31
-5
modules/gui/macosx/vout.m
modules/gui/macosx/vout.m
+1
-1
No files found.
modules/gui/macosx/embeddedwindow.m
View file @
cfdb9009
...
...
@@ -388,7 +388,7 @@
NSScreen
*
screen
;
NSRect
screen_rect
;
NSRect
rect
;
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
getVout
(
);
BOOL
blackout_other_displays
=
config_GetInt
(
VLCIntf
,
"macosx-black"
);
screen
=
[
NSScreen
screenWithDisplayID
:(
CGDirectDisplayID
)
var_GetInteger
(
p_vout
,
"video-device"
)];
...
...
modules/gui/macosx/equalizer.m
View file @
cfdb9009
...
...
@@ -49,9 +49,8 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
{
char
*
psz_parser
,
*
psz_string
;
int
i
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
p_object
;
aout_instance_t
*
p_aout
=
getAout
();
vlc_object_t
*
p_object
=
VLC_OBJECT
(
p_aout
);
if
(
!
p_object
)
{
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -115,8 +114,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
char
*
psz_name
)
{
char
*
psz_parser
,
*
psz_string
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -171,8 +169,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
bool
b_2p
;
int
i
;
bool
b_enabled
=
GetFiltersStatus
(
p_intf
,
(
char
*
)
"equalizer"
);
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -227,8 +224,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
-
(
IBAction
)
bandSliderUpdated
:(
id
)
sender
{
intf_thread_t
*
p_intf
=
VLCIntf
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -264,8 +260,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
{
intf_thread_t
*
p_intf
=
VLCIntf
;
int
i
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -309,8 +304,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
intf_thread_t
*
p_intf
=
VLCIntf
;
float
f_preamp
=
[
sender
floatValue
]
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -348,9 +342,8 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
{
intf_thread_t
*
p_intf
=
VLCIntf
;
bool
b_2p
=
[
sender
state
]
?
true
:
false
;
vlc_object_t
*
p_object
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
p_object
;
aout_instance_t
*
p_aout
=
getAout
();
vlc_object_t
*
p_object
=
VLC_OBJECT
(
p_aout
);
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
p_intf
);
...
...
@@ -376,8 +369,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
-
(
void
)
awakeFromNib
{
int
i
;
vlc_object_t
*
p_object
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
vlc_object_t
*
p_object
=
VLC_OBJECT
(
getAout
());
if
(
p_object
==
NULL
)
p_object
=
(
vlc_object_t
*
)
pl_Hold
(
VLCIntf
);
...
...
modules/gui/macosx/extended.m
View file @
cfdb9009
...
...
@@ -31,6 +31,7 @@
#import <vlc_aout.h>
#import <vlc_vout.h>
#import <vlc_interface.h>
#import <vlc_playlist.h>
/*****************************************************************************
* VLCExtended implementation
...
...
@@ -108,7 +109,7 @@ static VLCExtended *_o_sharedInstance = nil;
/* set the adjust-filter-sliders to the values from the prefs and enable
* them, if wanted */
char
*
psz_vfilters
;
intf_thread_t
*
p_intf
=
VLCIntf
;
intf_thread_t
*
p_intf
=
VLCIntf
;
psz_vfilters
=
config_GetPsz
(
p_intf
,
"vout-filter"
);
/* set the video-filter-checkboxes to the correct values */
if
(
psz_vfilters
)
...
...
@@ -322,7 +323,7 @@ static VLCExtended *_o_sharedInstance = nil;
{
/* read-out the sliders' values and apply them */
intf_thread_t
*
p_intf
=
VLCIntf
;
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
getVout
(
);
vlc_object_t
*
p_filter
;
if
(
p_vout
==
NULL
)
...
...
@@ -356,7 +357,7 @@ static VLCExtended *_o_sharedInstance = nil;
else
{
msg_Dbg
(
p_intf
,
"we found a vout to adjust, let's look for the filter"
);
p_filter
=
(
vlc_object_t
*
)
vlc_object_find_name
(
p_intf
,
"adjust"
,
FIND_ANYWHERE
);
p_filter
=
vlc_object_find_name
(
p_intf
,
"adjust"
,
FIND_ANYWHERE
);
if
(
!
p_filter
)
{
...
...
@@ -409,7 +410,7 @@ static VLCExtended *_o_sharedInstance = nil;
NSArray
*
o_windows
=
[
NSApp
orderedWindows
];
NSEnumerator
*
o_enumerator
=
[
o_windows
objectEnumerator
];
playlist_t
*
p_playlist
=
pl_Hold
(
VLCIntf
);
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
getVout
(
);
vout_thread_t
*
p_real_vout
;
val
.
f_float
=
[
o_sld_opaque
floatValue
]
/
100
;
...
...
@@ -453,7 +454,7 @@ static VLCExtended *_o_sharedInstance = nil;
{
/* read-out the slider's value and apply it */
intf_thread_t
*
p_intf
=
VLCIntf
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
aout_instance_t
*
p_aout
=
getAout
(
);
if
(
p_aout
!=
NULL
)
{
...
...
@@ -592,8 +593,7 @@ static VLCExtended *_o_sharedInstance = nil;
config_PutPsz
(
p_intf
,
"vout-filter"
,
psz_string
);
/* Try to set on the fly */
p_vout
=
(
vout_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
p_vout
=
getVout
();
if
(
p_vout
)
{
var_SetString
(
p_vout
,
"vout-filter"
,
psz_string
);
...
...
@@ -659,8 +659,7 @@ static VLCExtended *_o_sharedInstance = nil;
config_PutPsz
(
p_intf
,
"video-filter"
,
psz_string
);
/* Try to set on the fly */
p_vout
=
(
vout_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
p_vout
=
getVout
();
if
(
p_vout
)
{
var_SetString
(
p_vout
,
"video-filter"
,
psz_string
);
...
...
@@ -679,8 +678,7 @@ static VLCExtended *_o_sharedInstance = nil;
char
*
psz_parser
,
*
psz_string
;
intf_thread_t
*
p_intf
=
VLCIntf
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
aout_instance_t
*
p_aout
=
getAout
();
if
(
p_aout
)
{
...
...
@@ -737,14 +735,7 @@ static VLCExtended *_o_sharedInstance = nil;
}
else
{
var_SetString
(
p_aout
,
"audio-filter"
,
psz_string
);
int
i
=
0
;
while
(
i
<
p_aout
->
i_nb_inputs
)
{
p_aout
->
pp_inputs
[
i
]
->
b_restart
=
true
;
i
=
(
i
+
1
);
}
vlc_object_release
(
p_aout
);
aout_EnableFilter
(
p_aout
,
psz_string
,
false
);
}
free
(
psz_string
);
...
...
modules/gui/macosx/intf.h
View file @
cfdb9009
...
...
@@ -54,6 +54,12 @@ unsigned int CocoaKeyToVLC( unichar i_key );
@"/System/Library/CoreServices/SystemVersion.plist"] \
objectForKey: @"ProductVersion"] floatValue]
// You need to release those objects after use
input_thread_t
*
getInput
(
void
);
vout_thread_t
*
getVout
(
void
);
aout_instance_t
*
getAout
(
void
);
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
...
...
modules/gui/macosx/intf.m
View file @
cfdb9009
...
...
@@ -278,6 +278,34 @@ bool checkProgressPanel (void *priv)
[
o_pool
release
];
}
#pragma mark -
#pragma mark Helpers
input_thread_t
*
getInput
(
void
)
{
intf_thread_t
*
p_intf
=
VLCIntf
;
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_playlist
);
pl_Release
(
p_playlist
);
return
p_input
;
}
vout_thread_t
*
getVout
(
void
)
{
input_thread_t
*
p_input
=
getInput
();
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
vlc_object_release
(
p_input
);
return
p_vout
;
}
aout_instance_t
*
getAout
(
void
)
{
input_thread_t
*
p_input
=
getInput
();
aout_instance_t
*
p_aout
=
input_GetAout
(
p_input
);
vlc_object_release
(
p_input
);
return
p_aout
;
}
#pragma mark -
#pragma mark Private
...
...
@@ -1935,11 +1963,9 @@ end:
-
(
void
)
refreshVoutDeviceMenu
:(
NSNotification
*
)
o_notification
{
int
x
,
y
=
0
;
vout_thread_t
*
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
if
(
!
p_vout
)
int
x
,
y
=
0
;
vout_thread_t
*
p_vout
=
getVout
();
if
(
!
p_vout
)
return
;
/* clean the menu before adding new entries */
...
...
modules/gui/macosx/vout.m
View file @
cfdb9009
...
...
@@ -290,7 +290,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if
(
!
p_vout
)
return
;
p_input
=
vlc_object_find
(
p_vout
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
p_input
=
getInput
(
);
if
(
!
p_input
)
return
;
...
...
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