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
5870b4cf
Commit
5870b4cf
authored
Jan 02, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCMediaPlayer: Expose -setVideoLayer: and -initWithVideoLayer:.
parent
66304ec7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
40 deletions
+56
-40
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
+4
-4
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
+52
-36
No files found.
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
View file @
5870b4cf
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#import <Cocoa/Cocoa.h>
#import <Cocoa/Cocoa.h>
#import "VLCMedia.h"
#import "VLCMedia.h"
#import "VLCVideoView.h"
#import "VLCVideoView.h"
#import "VLCVideoLayer.h"
#import "VLCTime.h"
#import "VLCTime.h"
/* Notification Messages */
/* Notification Messages */
...
@@ -70,7 +71,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -70,7 +71,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
@interface
VLCMediaPlayer
:
NSObject
@interface
VLCMediaPlayer
:
NSObject
{
{
id
delegate
;
//< Object delegate
id
delegate
;
//< Object delegate
VLCVideoView
*
videoView
;
//< NSView instance where media is rendered to
void
*
instance
;
// Internal
void
*
instance
;
// Internal
VLCMedia
*
media
;
//< Current media being played
VLCMedia
*
media
;
//< Current media being played
...
@@ -81,6 +81,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -81,6 +81,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/* Initializers */
/* Initializers */
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
;
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
;
-
(
id
)
initWithVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
;
/* Properties */
/* Properties */
-
(
void
)
setDelegate
:(
id
)
value
;
-
(
void
)
setDelegate
:(
id
)
value
;
...
@@ -89,9 +90,8 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -89,9 +90,8 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/* Video View Options */
/* Video View Options */
// TODO: Should be it's own object?
// TODO: Should be it's own object?
// TODO: use VLCVideoView instead of NSView
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
aVideoView
;
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
value
;
-
(
void
)
setVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
;
-
(
VLCVideoView
*
)
videoView
;
-
(
void
)
setFullscreen
:(
BOOL
)
value
;
-
(
void
)
setFullscreen
:(
BOOL
)
value
;
-
(
BOOL
)
fullscreen
;
-
(
BOOL
)
fullscreen
;
...
...
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
View file @
5870b4cf
...
@@ -112,6 +112,9 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -112,6 +112,9 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
// TODO: Documentation
// TODO: Documentation
@interface
VLCMediaPlayer
(
Private
)
@interface
VLCMediaPlayer
(
Private
)
-
(
id
)
initWithDrawable
:(
id
)
aDrawable
;
-
(
void
)
setDrawable
:(
id
)
aDrawable
;
-
(
void
)
registerObservers
;
-
(
void
)
registerObservers
;
-
(
void
)
unregisterObservers
;
-
(
void
)
unregisterObservers
;
-
(
void
)
mediaPlayerTimeChanged
:(
NSNumber
*
)
newTime
;
-
(
void
)
mediaPlayerTimeChanged
:(
NSNumber
*
)
newTime
;
...
@@ -123,34 +126,17 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -123,34 +126,17 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
-
(
id
)
init
-
(
id
)
init
{
{
return
[
self
initWith
VideoView
:
nil
];
return
[
self
initWith
Drawable
:
nil
];
}
}
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
{
{
if
(
self
=
[
super
init
])
return
[
self
initWithDrawable
:
aVideoView
];
{
}
[
VLCMediaPlayer
setKeys
:[
NSArray
arrayWithObject
:
@"state"
]
triggerChangeNotificationsForDependentKey
:
@"playing"
];
[
VLCMediaPlayer
setKeys
:[
NSArray
arrayWithObjects
:
@"state"
,
@"media"
,
nil
]
triggerChangeNotificationsForDependentKey
:
@"seekable"
];
delegate
=
nil
;
media
=
nil
;
cachedTime
=
[[
VLCTime
nullTime
]
retain
];
position
=
0
.
0
f
;
cachedState
=
VLCMediaPlayerStateStopped
;
// Create a media instance, it doesn't matter what library we start off with
// it will change depending on the media descriptor provided to the media
// instance
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
instance
=
(
void
*
)
libvlc_media_instance_new
([
VLCLibrary
sharedInstance
],
&
ex
);
catch_exception
(
&
ex
);
[
self
registerObservers
];
[
self
setVideoView
:
aVideoView
];
-
(
id
)
initWithVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
}
{
return
self
;
return
[
self
initWithDrawable
:
aVideoLayer
]
;
}
}
-
(
void
)
release
-
(
void
)
release
...
@@ -193,22 +179,14 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -193,22 +179,14 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
return
delegate
;
return
delegate
;
}
}
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
value
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
aVideoView
{
{
videoView
=
value
;
[
self
setDrawable
:
aVideoView
];
// Make sure that this instance has been associated with the drawing canvas.
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_instance_set_drawable
((
libvlc_media_instance_t
*
)
instance
,
(
libvlc_drawable_t
)
videoView
,
&
ex
);
catch_exception
(
&
ex
);
}
}
-
(
VLCVideoView
*
)
videoView
-
(
void
)
setVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
{
{
return
videoView
;
[
self
setDrawable
:
aVideoLayer
]
;
}
}
-
(
void
)
setFullscreen
:(
BOOL
)
value
-
(
void
)
setFullscreen
:(
BOOL
)
value
...
@@ -554,6 +532,44 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
...
@@ -554,6 +532,44 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
@end
@end
@implementation
VLCMediaPlayer
(
Private
)
@implementation
VLCMediaPlayer
(
Private
)
-
(
id
)
initWithDrawable
:(
id
)
aDrawable
{
if
(
self
=
[
super
init
])
{
[
VLCMediaPlayer
setKeys
:[
NSArray
arrayWithObject
:
@"state"
]
triggerChangeNotificationsForDependentKey
:
@"playing"
];
[
VLCMediaPlayer
setKeys
:[
NSArray
arrayWithObjects
:
@"state"
,
@"media"
,
nil
]
triggerChangeNotificationsForDependentKey
:
@"seekable"
];
delegate
=
nil
;
media
=
nil
;
cachedTime
=
[[
VLCTime
nullTime
]
retain
];
position
=
0
.
0
f
;
cachedState
=
VLCMediaPlayerStateStopped
;
// Create a media instance, it doesn't matter what library we start off with
// it will change depending on the media descriptor provided to the media
// instance
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
instance
=
(
void
*
)
libvlc_media_instance_new
([
VLCLibrary
sharedInstance
],
&
ex
);
catch_exception
(
&
ex
);
[
self
registerObservers
];
[
self
setDrawable
:
aDrawable
];
}
return
self
;
}
-
(
void
)
setDrawable
:(
id
)
aDrawable
{
// Make sure that this instance has been associated with the drawing canvas.
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_instance_set_drawable
((
libvlc_media_instance_t
*
)
instance
,
(
libvlc_drawable_t
)
aDrawable
,
&
ex
);
catch_exception
(
&
ex
);
}
-
(
void
)
registerObservers
-
(
void
)
registerObservers
{
{
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
...
...
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