Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
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
Hide 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 @@
#import <Cocoa/Cocoa.h>
#import "VLCMedia.h"
#import "VLCVideoView.h"
#import "VLCVideoLayer.h"
#import "VLCTime.h"
/* Notification Messages */
...
...
@@ -70,7 +71,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
@interface
VLCMediaPlayer
:
NSObject
{
id
delegate
;
//< Object delegate
VLCVideoView
*
videoView
;
//< NSView instance where media is rendered to
void
*
instance
;
// Internal
VLCMedia
*
media
;
//< Current media being played
...
...
@@ -81,6 +81,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/* Initializers */
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
;
-
(
id
)
initWithVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
;
/* Properties */
-
(
void
)
setDelegate
:(
id
)
value
;
...
...
@@ -89,9 +90,8 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/* Video View Options */
// TODO: Should be it's own object?
// TODO: use VLCVideoView instead of NSView
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
value
;
-
(
VLCVideoView
*
)
videoView
;
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
aVideoView
;
-
(
void
)
setVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
;
-
(
void
)
setFullscreen
:(
BOOL
)
value
;
-
(
BOOL
)
fullscreen
;
...
...
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
View file @
5870b4cf
...
...
@@ -112,6 +112,9 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
// TODO: Documentation
@interface
VLCMediaPlayer
(
Private
)
-
(
id
)
initWithDrawable
:(
id
)
aDrawable
;
-
(
void
)
setDrawable
:(
id
)
aDrawable
;
-
(
void
)
registerObservers
;
-
(
void
)
unregisterObservers
;
-
(
void
)
mediaPlayerTimeChanged
:(
NSNumber
*
)
newTime
;
...
...
@@ -123,34 +126,17 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
-
(
id
)
init
{
return
[
self
initWith
VideoView
:
nil
];
return
[
self
initWith
Drawable
:
nil
];
}
-
(
id
)
initWithVideoView
:(
VLCVideoView
*
)
aVideoView
{
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
;
return
[
self
initWithDrawable
:
aVideoView
];
}
// 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
];
}
return
self
;
-
(
id
)
initWithVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
{
return
[
self
initWithDrawable
:
aVideoLayer
];
}
-
(
void
)
release
...
...
@@ -193,22 +179,14 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
return
delegate
;
}
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
value
{
videoView
=
value
;
// 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
);
-
(
void
)
setVideoView
:(
VLCVideoView
*
)
aVideoView
{
[
self
setDrawable
:
aVideoView
];
}
-
(
VLCVideoView
*
)
videoView
-
(
void
)
setVideoLayer
:(
VLCVideoLayer
*
)
aVideoLayer
{
return
videoView
;
[
self
setDrawable
:
aVideoLayer
]
;
}
-
(
void
)
setFullscreen
:(
BOOL
)
value
...
...
@@ -554,6 +532,44 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
@end
@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
{
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