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
23c70ac8
Commit
23c70ac8
authored
Jan 29, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: Sync the extension's input to their MediaPlayer's input.
parent
716537eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
6 deletions
+39
-6
projects/macosx/framework/Headers/Public/VLCExtension.h
projects/macosx/framework/Headers/Public/VLCExtension.h
+1
-0
projects/macosx/framework/Headers/Public/VLCExtensionsManager.h
...ts/macosx/framework/Headers/Public/VLCExtensionsManager.h
+3
-0
projects/macosx/framework/Sources/VLCExtension.m
projects/macosx/framework/Sources/VLCExtension.m
+0
-1
projects/macosx/framework/Sources/VLCExtensionsManager.m
projects/macosx/framework/Sources/VLCExtensionsManager.m
+35
-5
No files found.
projects/macosx/framework/Headers/Public/VLCExtension.h
View file @
23c70ac8
...
...
@@ -18,4 +18,5 @@
-
(
NSString
*
)
name
;
-
(
NSString
*
)
title
;
@end
projects/macosx/framework/Headers/Public/VLCExtensionsManager.h
View file @
23c70ac8
...
...
@@ -9,9 +9,12 @@
#import <Cocoa/Cocoa.h>
@class
VLCExtension
;
@class
VLCMediaPlayer
;
@interface
VLCExtensionsManager
:
NSObject
{
void
*
instance
;
NSMutableArray
*
_extensions
;
VLCMediaPlayer
*
_player
;
}
+
(
VLCExtensionsManager
*
)
sharedManager
;
-
(
NSArray
*
)
extensions
;
...
...
projects/macosx/framework/Sources/VLCExtension.m
View file @
23c70ac8
...
...
@@ -39,5 +39,4 @@
return
[
NSString
stringWithUTF8String
:
_instance
->
psz_title
];
}
@end
projects/macosx/framework/Sources/VLCExtensionsManager.m
View file @
23c70ac8
...
...
@@ -11,6 +11,7 @@
#import "VLCLibrary.h"
#import "VLCLibVLCBridging.h"
#import <vlc_extensions.h>
#import <vlc_input.h>
#define _instance ((extensions_manager_t *)instance)
...
...
@@ -34,6 +35,9 @@ static VLCExtensionsManager *sharedManager = nil;
module_unneed
(
_instance
,
_instance
->
p_module
);
vlc_object_release
(
_instance
);
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
[
_extensions
release
];
[
super
dealloc
];
}
...
...
@@ -56,21 +60,21 @@ static VLCExtensionsManager *sharedManager = nil;
vlc_object_release
(
libvlc
);
}
NSMutableArray
*
array
=
[
NSMutableArray
array
];
if
(
_extensions
)
return
_extensions
;
_extensions
=
[[
NSMutableArray
alloc
]
init
];
extension_t
*
ext
;
FOREACH_ARRAY
(
ext
,
_instance
->
extensions
)
VLCExtension
*
extension
=
[[
VLCExtension
alloc
]
initWithInstance
:
ext
];
[
array
addObject
:
extension
];
[
_extensions
addObject
:
extension
];
[
extension
release
];
FOREACH_END
()
return
array
;
return
_extensions
;
}
-
(
void
)
runExtension
:(
VLCExtension
*
)
extension
{
extension_t
*
ext
=
[
extension
instance
];
NSLog
(
@"extension_TriggerOnly = %d"
,
extension_TriggerOnly
(
_instance
,
ext
));
NSLog
(
@"extension_IsActivated = %d"
,
extension_IsActivated
(
_instance
,
ext
));
if
(
extension_TriggerOnly
(
_instance
,
ext
))
extension_Trigger
(
_instance
,
ext
);
...
...
@@ -80,4 +84,30 @@ static VLCExtensionsManager *sharedManager = nil;
extension_Activate
(
_instance
,
ext
);
}
}
-
(
void
)
mediaPlayerLikelyChangedInput
{
input_thread_t
*
input
=
_player
?
libvlc_media_player_get_input_thread
([
_player
libVLCMediaPlayer
])
:
NULL
;
for
(
VLCExtension
*
extension
in
_extensions
)
extension_SetInput
(
_instance
,
[
extension
instance
],
input
);
if
(
input
)
vlc_object_release
(
input
);
}
-
(
void
)
setMediaPlayer
:(
VLCMediaPlayer
*
)
player
{
if
(
_player
==
player
)
return
;
NSNotificationCenter
*
center
=
[
NSNotificationCenter
defaultCenter
];
[
center
removeObserver
:
self
name
:
VLCMediaPlayerStateChanged
object
:
_player
];
[
_player
release
];
_player
=
[
player
retain
];
[
self
mediaPlayerLikelyChangedInput
];
if
(
player
)
[
center
addObserver
:
self
selector
:
@selector
(
mediaPlayerLikelyChangedInput
)
name
:
VLCMediaPlayerStateChanged
object
:
_player
];
}
@end
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