VLCMediaPlayer.h
/*****************************************************************************
* VLCMediaPlayer.h: VLCKit.framework VLCMediaPlayer header
*****************************************************************************
* Copyright (C) 2007-2009 Pierre d'Herbemont
* Copyright (C) 2007-2015 VLC authors and VideoLAN
* Copyright (C) 2009-2015 Felix Paul Kühne
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
* Felix Paul Kühne <fkuehne # videolan.org>
* Soomin Lee <TheHungryBu # gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
# import <CoreGraphics/CoreGraphics.h>
# import <UIKit/UIKit.h>
#endif
#import "VLCMedia.h"
#import "VLCTime.h"
#import "VLCAudio.h"
#if !TARGET_OS_IPHONE
@class VLCVideoView;
@class VLCVideoLayer;
#endif
@class VLCLibrary;
/* Notification Messages */
extern NSString *const VLCMediaPlayerTimeChanged;
extern NSString *const VLCMediaPlayerStateChanged;
extern NSString *const VLCMediaPlayerTitleChanged;
extern NSString *const VLCMediaPlayerChapterChanged;
typedef NS_ENUM(NSInteger, VLCMediaPlayerState)
{
VLCMediaPlayerStateStopped,
VLCMediaPlayerStateOpening,
VLCMediaPlayerStateBuffering,
VLCMediaPlayerStateEnded,
VLCMediaPlayerStateError,
VLCMediaPlayerStatePlaying,
VLCMediaPlayerStatePaused
};
typedef NS_ENUM(unsigned, VLCMediaPlaybackNavigationAction)
{
VLCMediaPlaybackNavigationActionActivate = 0,
VLCMediaPlaybackNavigationActionUp,
VLCMediaPlaybackNavigationActionDown,
VLCMediaPlaybackNavigationActionLeft,
VLCMediaPlaybackNavigationActionRight
};
extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
@protocol VLCMediaPlayerDelegate
@optional
- (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
- (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
- (void)mediaPlayerTitleChanged:(NSNotification *)aNotification;
- (void)mediaPlayerChapterChanged:(NSNotification *)aNotification;
#if TARGET_OS_PHONE
- (void)mediaPlayerSnapshot:(NSNotification *)aNotification;
#endif
@end
@interface VLCMediaPlayer : NSObject
@property (nonatomic, readonly) VLCLibrary *libraryInstance;
@property (weak, nonatomic) id<VLCMediaPlayerDelegate> delegate;
#if !TARGET_OS_IPHONE
/* Initializers */
- (instancetype)initWithVideoView:(VLCVideoView *)aVideoView;
- (instancetype)initWithVideoLayer:(VLCVideoLayer *)aVideoLayer;
#endif
- (instancetype)initWithOptions:(NSArray *)options;
- (instancetype)initWithLibVLCInstance:(void *)playerInstance andLibrary:(VLCLibrary *)library;
/* Video View Options */
// TODO: Should be it's own object?
#pragma mark -
#pragma mark video functionality
#if !TARGET_OS_IPHONE
- (void)setVideoView:(VLCVideoView *)aVideoView;
- (void)setVideoLayer:(VLCVideoLayer *)aVideoLayer;
#endif
@property (strong) id drawable; /* The videoView or videoLayer */
@property (NS_NONATOMIC_IOSONLY) char *videoAspectRatio;
@property (NS_NONATOMIC_IOSONLY) char *videoCropGeometry;
@property (nonatomic) float scaleFactor;
- (void)saveVideoSnapshotAt:(NSString *)path withWidth:(int)width andHeight:(int)height;
- (void)setDeinterlaceFilter: (NSString *)name;
@property (nonatomic) BOOL adjustFilterEnabled;
@property (nonatomic) float contrast;
@property (nonatomic) float brightness;
@property (nonatomic) float hue;
@property (nonatomic) float saturation;
@property (nonatomic) float gamma;
@property (nonatomic) float rate;
@property (nonatomic, readonly, weak) VLCAudio * audio;
/* Video Information */
@property (NS_NONATOMIC_IOSONLY, readonly) CGSize videoSize;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasVideoOut;
@property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond __attribute__((deprecated));
#pragma mark -
#pragma mark time
@property (NS_NONATOMIC_IOSONLY, strong) VLCTime *time;
@property (nonatomic, readonly, weak) VLCTime *remainingTime;
#pragma mark -
#pragma mark ES track handling
@property (readwrite) int currentVideoTrackIndex;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfVideoTracks;
@property (readwrite) int currentVideoSubTitleIndex;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfSubtitlesTracks;
- (BOOL)openVideoSubTitlesFromFile:(NSString *)path __attribute__((deprecated));
typedef NS_ENUM(unsigned, VLCMediaPlaybackSlaveType)
{
VLCMediaPlaybackSlaveTypeSubtitle = 0,
VLCMediaPlaybackSlaveTypeAudio
};
- (int)addPlaybackSlave:(NSURL *)slaveURL type:(VLCMediaPlaybackSlaveType)slaveType enforce:(BOOL)enforceSelection;
@property (readwrite) NSInteger currentVideoSubTitleDelay;
@property (readwrite) int currentChapterIndex;
- (void)previousChapter;
- (void)nextChapter;
- (int)numberOfChaptersForTitle:(int)titleIndex;
- (NSArray *)chaptersForTitleIndex:(int)titleIndex __attribute__((deprecated));
extern NSString *const VLCChapterDescriptionName;
extern NSString *const VLCChapterDescriptionTimeOffset;
extern NSString *const VLCChapterDescriptionDuration;
- (NSArray *)chapterDescriptionsOfTitle:(int)titleIndex;
@property (readwrite) int currentTitleIndex;
@property (readonly) int numberOfTitles;
@property (readonly) NSUInteger countOfTitles __attribute__((deprecated));
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titles __attribute__((deprecated));
extern NSString *const VLCTitleDescriptionName;
extern NSString *const VLCTitleDescriptionDuration;
extern NSString *const VLCTitleDescriptionIsMenu;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titleDescriptions;
@property (readonly) int indexOfLongestTitle;
/* Audio Options */
@property (readwrite) int currentAudioTrackIndex;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfAudioTracks;
#pragma mark -
#pragma mark audio functionality
@property (NS_NONATOMIC_IOSONLY) int audioChannel;
@property (readwrite) NSInteger currentAudioPlaybackDelay;
#pragma mark -
#pragma mark equalizer
@property (weak, readonly) NSArray *equalizerProfiles;
- (void)resetEqualizerFromProfile:(unsigned)profile;
@property (readwrite) BOOL equalizerEnabled;
@property (readwrite) CGFloat preAmplification;
@property (readonly) unsigned numberOfBands;
- (CGFloat)frequencyOfBandAtIndex:(unsigned)index;
- (void)setAmplification:(CGFloat)amplification forBand:(unsigned)index;
- (CGFloat)amplificationOfBand:(unsigned)index;
#pragma mark -
#pragma mark media handling
/* Media Options */
@property (NS_NONATOMIC_IOSONLY, strong) VLCMedia *media;
#pragma mark -
#pragma mark playback operations
- (void)play;
- (void)pause;
- (void)stop;
- (void)gotoNextFrame;
- (void)fastForward;
- (void)fastForwardAtRate:(float)rate;
- (void)rewind;
- (void)rewindAtRate:(float)rate;
- (void)jumpBackward:(int)interval;
- (void)jumpForward:(int)interval;
- (void)extraShortJumpBackward;
- (void)extraShortJumpForward;
- (void)shortJumpBackward;
- (void)shortJumpForward;
- (void)mediumJumpBackward;
- (void)mediumJumpForward;
- (void)longJumpBackward;
- (void)longJumpForward;
- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
- (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute;
#pragma mark -
#pragma mark playback information
@property (NS_NONATOMIC_IOSONLY, getter=isPlaying, readonly) BOOL playing;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL willPlay;
@property (NS_NONATOMIC_IOSONLY, readonly) VLCMediaPlayerState state;
@property (NS_NONATOMIC_IOSONLY) float position;
@property (NS_NONATOMIC_IOSONLY, getter=isSeekable, readonly) BOOL seekable;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL canPause;
#if TARGET_OS_IPHONE
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *snapshots;
@property (NS_NONATOMIC_IOSONLY, readonly) UIImage *lastSnapshot;
#endif
@end
VLCMediaPlayer::position
float position
Definition: VLCMediaPlayer.h:791
VLCMediaPlayer::contrast
float contrast
Definition: VLCMediaPlayer.h:260
VLCMediaPlayer::media
VLCMedia * media
Definition: VLCMediaPlayer.h:650
VLCVideoView
Definition: VLCVideoView.h:31
-[VLCMediaPlayer shortJumpForward]
void shortJumpForward()
-[VLCMediaPlayer shortJumpBackward]
void shortJumpBackward()
VLCMediaPlayer::videoCropGeometry
char * videoCropGeometry
Definition: VLCMediaPlayer.h:217
VLCMediaPlayer::currentVideoSubTitleIndex
int currentVideoSubTitleIndex
Definition: VLCMediaPlayer.h:382
VLCMediaPlayer::numberOfBands
unsigned numberOfBands
Definition: VLCMediaPlayer.h:623
VLCMediaPlayer::audio
VLCAudio * audio
Definition: VLCMediaPlayer.h:300
VLCMediaPlayer::numberOfSubtitlesTracks
int numberOfSubtitlesTracks
Definition: VLCMediaPlayer.h:400
VLCMediaPlayer::playing
BOOL playing
Definition: VLCMediaPlayer.h:773
VLCMediaPlayer::remainingTime
VLCTime * remainingTime
Definition: VLCMediaPlayer.h:343
VLCMediaPlayer::numberOfAudioTracks
int numberOfAudioTracks
Definition: VLCMediaPlayer.h:570
VLCMediaPlayer::adjustFilterEnabled
BOOL adjustFilterEnabled
Definition: VLCMediaPlayer.h:254
VLCMediaPlayer::currentChapterIndex
int currentChapterIndex
Definition: VLCMediaPlayer.h:445
VLCMediaPlayerDelegate-p
Definition: VLCMediaPlayer.h:87
VLCMediaPlayer::numberOfTitles
int numberOfTitles
Definition: VLCMediaPlayer.h:500
-[VLCMediaPlayer gotoNextFrame]
void gotoNextFrame()
-[VLCMediaPlayer extraShortJumpBackward]
void extraShortJumpBackward()
-[VLCMediaPlayer stop]
void stop()
-[VLCMediaPlayer previousChapter]
void previousChapter()
VLCMediaPlayer::libraryInstance
VLCLibrary * libraryInstance
Definition: VLCMediaPlayer.h:139
VLCMediaPlayer::gamma
float gamma
Definition: VLCMediaPlayer.h:284
-[VLCMediaPlayer NS_ENUM]
typedef NS_ENUM(unsigned, VLCMediaPlaybackSlaveType)
Definition: VLCMediaPlayer.h:412
VLCMediaPlayer::audioTrackNames
NSArray * audioTrackNames
Definition: VLCMediaPlayer.h:558
VLCMediaPlayer::scaleFactor
float scaleFactor
Definition: VLCMediaPlayer.h:228
VLCMediaPlayer::VLCTitleDescriptionIsMenu
NSString *const VLCTitleDescriptionIsMenu
Definition: VLCMediaPlayer.h:524
VLCMediaPlayer::currentVideoSubTitleDelay
NSInteger currentVideoSubTitleDelay
Definition: VLCMediaPlayer.h:434
VLCMediaPlayer::currentTitleIndex
int currentTitleIndex
Definition: VLCMediaPlayer.h:495
VLCMediaPlayer::drawable
id drawable
Definition: VLCMediaPlayer.h:199
VLCMediaPlayer::delegate
id< VLCMediaPlayerDelegate > delegate
Definition: VLCMediaPlayer.h:143
VLCMediaPlayer::hasVideoOut
BOOL hasVideoOut
Definition: VLCMediaPlayer.h:315
VLCLibrary
Definition: VLCLibrary.h:41
VLCMediaPlayer::videoTrackNames
NSArray * videoTrackNames
Definition: VLCMediaPlayer.h:361
VLCMediaPlayer::time
VLCTime * time
Definition: VLCMediaPlayer.h:336
VLCMediaPlayer::hue
float hue
Definition: VLCMediaPlayer.h:272
VLCMediaPlayer::titleDescriptions
NSArray * titleDescriptions
Definition: VLCMediaPlayer.h:535
VLCMediaPlayer::saturation
float saturation
Definition: VLCMediaPlayer.h:278
VLCMediaPlayer::videoSubTitlesNames
NSArray * videoSubTitlesNames
Definition: VLCMediaPlayer.h:388
-[VLCMediaPlayer play]
void play()
-[VLCMediaPlayer longJumpForward]
void longJumpForward()
VLCMediaPlayer::currentVideoTrackIndex
int currentVideoTrackIndex
Definition: VLCMediaPlayer.h:355
VLCMediaPlayer::VLCTitleDescriptionName
NSString *const VLCTitleDescriptionName
Definition: VLCMediaPlayer.h:516
VLCMediaPlayer::audioChannel
int audioChannel
Definition: VLCMediaPlayer.h:579
VLCMediaPlayer::VLCTitleDescriptionDuration
NSString *const VLCTitleDescriptionDuration
Definition: VLCMediaPlayer.h:520
-[VLCMediaPlayer extraShortJumpForward]
void extraShortJumpForward()
VLCMediaPlayer::currentAudioTrackIndex
int currentAudioTrackIndex
Definition: VLCMediaPlayer.h:552
VLCMediaPlayer::videoAspectRatio
char * videoAspectRatio
Definition: VLCMediaPlayer.h:209
VLCMediaPlayer
Definition: VLCMediaPlayer.h:134
VLCMediaPlayer::state
VLCMediaPlayerState state
Definition: VLCMediaPlayer.h:785
VLCMediaPlayer::videoSize
CGSize videoSize
Definition: VLCMediaPlayer.h:307
VLCVideoLayer
Definition: VLCVideoLayer.h:30
VLCMediaPlayer::brightness
float brightness
Definition: VLCMediaPlayer.h:266
VLCMediaPlayer::preAmplification
CGFloat preAmplification
Definition: VLCMediaPlayer.h:618
-[VLCMediaPlayer rewind]
void rewind()
-[VLCMediaPlayer nextChapter]
void nextChapter()
VLCMediaPlayer::rate
float rate
Definition: VLCMediaPlayer.h:294
-[VLCMediaPlayer mediumJumpBackward]
void mediumJumpBackward()
VLCMedia
Definition: VLCMedia.h:112
VLCMediaPlayer::videoTrackIndexes
NSArray * videoTrackIndexes
Definition: VLCMediaPlayer.h:367
VLCMediaPlayer::equalizerProfiles
NSArray * equalizerProfiles
Definition: VLCMediaPlayer.h:599
VLCAudio
Definition: VLCAudio.h:36
-[VLCMediaPlayer pause]
void pause()
VLCMediaPlayer::videoSubTitlesIndexes
NSArray * videoSubTitlesIndexes
Definition: VLCMediaPlayer.h:394
VLCMediaPlayer::indexOfLongestTitle
int indexOfLongestTitle
Definition: VLCMediaPlayer.h:541
VLCMediaPlayer::equalizerEnabled
BOOL equalizerEnabled
Definition: VLCMediaPlayer.h:611
VLCMediaPlayer::currentAudioPlaybackDelay
NSInteger currentAudioPlaybackDelay
Definition: VLCMediaPlayer.h:587
-[VLCMediaPlayer __attribute__]
float framesPerSecond __attribute__((deprecated))
VLCMediaPlayer::canPause
BOOL canPause
Definition: VLCMediaPlayer.h:803
VLCMediaPlayer::audioTrackIndexes
NSArray * audioTrackIndexes
Definition: VLCMediaPlayer.h:564
VLCMediaPlayer::VLCChapterDescriptionDuration
NSString *const VLCChapterDescriptionDuration
Definition: VLCMediaPlayer.h:477
VLCMediaPlayer::VLCChapterDescriptionTimeOffset
NSString *const VLCChapterDescriptionTimeOffset
Definition: VLCMediaPlayer.h:473
VLCMediaPlayer::willPlay
BOOL willPlay
Definition: VLCMediaPlayer.h:779
VLCMediaPlayer::seekable
BOOL seekable
Definition: VLCMediaPlayer.h:797
-[VLCMediaPlayer longJumpBackward]
void longJumpBackward()
VLCTime
Definition: VLCTime.h:30
-[VLCMediaPlayer fastForward]
void fastForward()
VLCMediaPlayer::VLCChapterDescriptionName
NSString *const VLCChapterDescriptionName
Definition: VLCMediaPlayer.h:469
-[VLCMediaPlayer mediumJumpForward]
void mediumJumpForward()
VLCMediaPlayer::numberOfVideoTracks
int numberOfVideoTracks
Definition: VLCMediaPlayer.h:373