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
096ebc37
Commit
096ebc37
authored
Jan 07, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework: Implement -canPause and the various setRate related functions.
parent
79179c9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
13 deletions
+46
-13
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
+7
-6
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
+39
-7
No files found.
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
View file @
096ebc37
...
...
@@ -104,8 +104,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
-
(
void
)
setVideoTeleText
:(
int
)
value
;
-
(
int
)
videoTeleText
;
-
(
void
)
setRate
:(
int
)
value
;
-
(
int
)
rate
;
@property
float
rate
;
/* Video Information */
-
(
NSSize
)
videoSize
;
...
...
@@ -157,24 +156,24 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/**
* Fast forwards through the feed at the standard 1x rate.
*/
//
- (void)fastForward;
-
(
void
)
fastForward
;
/**
* Fast forwards through the feed at the rate specified.
* \param rate Rate at which the feed should be fast forwarded.
*/
//- (void)fastForwardAtRate:(in
t)rate;
-
(
void
)
fastForwardAtRate
:(
floa
t
)
rate
;
/**
* Rewinds through the feed at the standard 1x rate.
*/
//
- (void)rewind;
-
(
void
)
rewind
;
/**
* Rewinds through the feed at the rate specified.
* \param rate Rate at which the feed should be fast rewound.
*/
//- (void)rewindAtRate:(in
t)rate;
-
(
void
)
rewindAtRate
:(
floa
t
)
rate
;
/* Playback Information */
/**
...
...
@@ -204,4 +203,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
-
(
BOOL
)
isSeekable
;
-
(
BOOL
)
canPause
;
@end
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
View file @
096ebc37
...
...
@@ -59,6 +59,7 @@ static void HandleMediaInstanceVolumeChanged(const libvlc_event_t * event, void
static
void
HandleMediaTimeChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
withMethod:
@selector
(
mediaPlayerTimeChanged
:)
withArgumentAsObject:
[
NSNumber
numberWithLongLong
:
event
->
u
.
media_instance_time_changed
.
new_time
]];
...
...
@@ -82,7 +83,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self
static
void
HandleMediaInstanceStateChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
VLCMediaPlayerState
newState
;
if
(
event
->
type
==
libvlc_MediaInstancePlayed
)
newState
=
VLCMediaPlayerStatePlaying
;
else
if
(
event
->
type
==
libvlc_MediaInstancePaused
)
...
...
@@ -128,14 +129,22 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
+
(
NSSet
*
)
keyPathsForValuesAffectingValueForKey
:(
NSString
*
)
key
{
static
NSDictionary
*
dict
=
nil
;
NSSet
*
superKeyPaths
;
if
(
!
dict
)
{
dict
=
[[
NSDictionary
dictionaryWithObjectsAndKeys
:
[
NSSet
setWithObject
:
@"state"
],
@"playing"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"seekable"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"canPause"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"description"
,
nil
]
retain
];
}
if
(
(
superKeyPaths
=
[
super
keyPathsForValuesAffectingValueForKey
:
key
])
)
{
NSMutableSet
*
ret
=
[
NSMutableSet
setWithSet
:[
dict
objectForKey
:
key
]];
[
ret
unionSet
:
superKeyPaths
];
return
ret
;
}
return
[
dict
objectForKey
:
key
];
}
...
...
@@ -261,12 +270,12 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
return
result
;
}
-
(
void
)
setRate
:(
in
t
)
value
-
(
void
)
setRate
:(
floa
t
)
value
{
libvlc_media_instance_set_rate
(
instance
,
value
,
NULL
);
}
-
(
in
t
)
rate
-
(
floa
t
)
rate
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
...
...
@@ -467,10 +476,25 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
// TODO: Should we pause this or destroy the media instance so that it appears as being "stopped"?
}
//- (void)fastForward;
//- (void)fastForwardAtRate:(int)rate;
//- (void)rewind;
//- (void)rewindAtRate:(int)rate;
-
(
void
)
fastForward
{
[
self
fastForwardAtRate
:
2
.
0
];
}
-
(
void
)
fastForwardAtRate
:(
float
)
rate
{
[
self
setRate
:
rate
];
}
-
(
void
)
rewind
{
[
self
rewindAtRate
:
2
.
0
];
}
-
(
void
)
rewindAtRate
:(
float
)
rate
{
[
self
setRate
:
-
rate
];
}
-
(
BOOL
)
isPlaying
{
...
...
@@ -531,6 +555,14 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
return
ret
;
}
-
(
BOOL
)
canPause
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
BOOL
ret
=
libvlc_media_instance_can_pause
(
instance
,
&
ex
);
catch_exception
(
&
ex
);
return
ret
;
}
@end
@implementation
VLCMediaPlayer
(
Private
)
...
...
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