VLCMedia.h
/*****************************************************************************
* VLCMedia.h: VLCKit.framework VLCMedia header
*****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2013 Felix Paul Kühne
* Copyright (C) 2007-2013 VLC authors and VideoLAN
* $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>
#import "VLCMediaList.h"
#import "VLCTime.h"
NS_ASSUME_NONNULL_BEGIN
/* Meta Dictionary Keys */
extern NSString *const VLCMetaInformationTitle; /* NSString */
extern NSString *const VLCMetaInformationArtist; /* NSString */
extern NSString *const VLCMetaInformationGenre; /* NSString */
extern NSString *const VLCMetaInformationCopyright; /* NSString */
extern NSString *const VLCMetaInformationAlbum; /* NSString */
extern NSString *const VLCMetaInformationTrackNumber; /* NSString */
extern NSString *const VLCMetaInformationDescription; /* NSString */
extern NSString *const VLCMetaInformationRating; /* NSString */
extern NSString *const VLCMetaInformationDate; /* NSString */
extern NSString *const VLCMetaInformationSetting; /* NSString */
extern NSString *const VLCMetaInformationURL; /* NSString */
extern NSString *const VLCMetaInformationLanguage; /* NSString */
extern NSString *const VLCMetaInformationNowPlaying; /* NSString */
extern NSString *const VLCMetaInformationPublisher; /* NSString */
extern NSString *const VLCMetaInformationEncodedBy; /* NSString */
extern NSString *const VLCMetaInformationArtworkURL; /* NSString */
extern NSString *const VLCMetaInformationArtwork; /* NSImage */
extern NSString *const VLCMetaInformationTrackID; /* NSString */
extern NSString *const VLCMetaInformationTrackTotal; /* NSString */
extern NSString *const VLCMetaInformationDirector; /* NSString */
extern NSString *const VLCMetaInformationSeason; /* NSString */
extern NSString *const VLCMetaInformationEpisode; /* NSString */
extern NSString *const VLCMetaInformationShowName; /* NSString */
extern NSString *const VLCMetaInformationActors; /* NSString */
extern NSString *const VLCMetaInformationAlbumArtist; /* NSString */
extern NSString *const VLCMetaInformationDiscNumber; /* NSString */
/* Notification Messages */
extern NSString *const VLCMediaMetaChanged;
// Forward declarations, supresses compiler error messages
@class VLCMediaList;
@class VLCMedia;
typedef NS_ENUM(NSInteger, VLCMediaState) {
VLCMediaStateNothingSpecial,
VLCMediaStateBuffering,
VLCMediaStatePlaying,
VLCMediaStateError,
};
@protocol VLCMediaDelegate <NSObject>
@optional
- (void)mediaMetaDataDidChange:(VLCMedia *)aMedia;
- (void)mediaDidFinishParsing:(VLCMedia *)aMedia;
@end
@interface VLCMedia : NSObject
/* Factories */
+ (instancetype)mediaWithURL:(NSURL *)anURL;
+ (instancetype)mediaWithPath:(NSString *)aPath;
+ (NSString *)codecNameForFourCC:(uint32_t)fourcc trackType:(NSString *)trackType;
+ (instancetype)mediaAsNodeWithName:(NSString *)aName;
/* Initializers */
- (instancetype)initWithURL:(NSURL *)anURL;
- (instancetype)initWithPath:(NSString *)aPath;
- (instancetype)initAsNodeWithName:(NSString *)aName;
typedef NS_ENUM(NSUInteger, VLCMediaOrientation) {
VLCMediaOrientationTopLeft,
VLCMediaOrientationTopRight,
VLCMediaOrientationBottomLeft,
VLCMediaOrientationBottomRight,
VLCMediaOrientationLeftTop,
VLCMediaOrientationLeftBottom,
VLCMediaOrientationRightTop,
VLCMediaOrientationRightBottom
};
typedef NS_ENUM(NSUInteger, VLCMediaProjection) {
VLCMediaProjectionRectangular,
VLCMediaProjectionEquiRectangular,
VLCMediaProjectionCubemapLayoutStandard = 0x100
};
typedef NS_ENUM(NSUInteger, VLCMediaType) {
VLCMediaTypeUnknown,
VLCMediaTypeFile,
VLCMediaTypeDirectory,
VLCMediaTypeDisc,
VLCMediaTypeStream,
VLCMediaTypePlaylist,
};
@property (readonly) VLCMediaType mediaType;
- (NSComparisonResult)compare:(VLCMedia *)media;
/* Properties */
@property (nonatomic, weak) id<VLCMediaDelegate> delegate;
@property (nonatomic, readwrite, strong) VLCTime * length;
- (VLCTime *)lengthWaitUntilDate:(NSDate *)aDate;
@property (nonatomic, readonly) BOOL isParsed __attribute__((deprecated));
typedef NS_ENUM(unsigned, VLCMediaParsedStatus)
{
VLCMediaParsedStatusInit = 0,
VLCMediaParsedStatusSkipped,
VLCMediaParsedStatusFailed,
VLCMediaParsedStatusDone
};
@property (nonatomic, readonly) VLCMediaParsedStatus parsedStatus;
@property (nonatomic, readonly, strong) NSURL * url;
@property (nonatomic, readonly, strong) VLCMediaList * subitems;
- (NSString *)metadataForKey:(NSString *)key;
- (void)setMetadata:(NSString *)data forKey:(NSString *)key;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL saveMetadata;
@property (nonatomic, readonly, copy) NSDictionary * metaDictionary;
@property (nonatomic, readonly) VLCMediaState state;
@property (NS_NONATOMIC_IOSONLY, getter=isMediaSizeSuitableForDevice, readonly) BOOL mediaSizeSuitableForDevice;
extern NSString *const VLCMediaTracksInformationCodec;
extern NSString *const VLCMediaTracksInformationId;
extern NSString *const VLCMediaTracksInformationType;
extern NSString *const VLCMediaTracksInformationCodecProfile;
extern NSString *const VLCMediaTracksInformationCodecLevel;
extern NSString *const VLCMediaTracksInformationBitrate;
extern NSString *const VLCMediaTracksInformationLanguage;
extern NSString *const VLCMediaTracksInformationDescription;
extern NSString *const VLCMediaTracksInformationAudioChannelsNumber;
extern NSString *const VLCMediaTracksInformationAudioRate;
extern NSString *const VLCMediaTracksInformationVideoHeight;
extern NSString *const VLCMediaTracksInformationVideoWidth;
extern NSString *const VLCMediaTracksInformationVideoOrientation;
extern NSString *const VLCMediaTracksInformationVideoProjection;
extern NSString *const VLCMediaTracksInformationSourceAspectRatio;
extern NSString *const VLCMediaTracksInformationSourceAspectRatioDenominator;
extern NSString *const VLCMediaTracksInformationFrameRate;
extern NSString *const VLCMediaTracksInformationFrameRateDenominator;
extern NSString *const VLCMediaTracksInformationTextEncoding;
extern NSString *const VLCMediaTracksInformationTypeAudio;
extern NSString *const VLCMediaTracksInformationTypeVideo;
extern NSString *const VLCMediaTracksInformationTypeText;
extern NSString *const VLCMediaTracksInformationTypeUnknown;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *tracksInformation;
- (void)parse __attribute__((deprecated));
- (void)synchronousParse __attribute__((deprecated));
enum {
VLCMediaParseLocal = 0x00,
VLCMediaParseNetwork = 0x01,
VLCMediaFetchLocal = 0x02,
VLCMediaFetchNetwork = 0x04,
};
typedef int VLCMediaParsingOptions;
- (int)parseWithOptions:(VLCMediaParsingOptions)options;
- (int)parseWithOptions:(VLCMediaParsingOptions)options timeout:(int)timeoutValue;
- (void)addOptions:(NSDictionary*)options;
- (int)storeCookie:(NSString * _Nonnull)cookie
forHost:(NSString * _Nonnull)host
path:(NSString * _Nonnull)path;
- (void)clearStoredCookies;
@property (NS_NONATOMIC_IOSONLY, readonly, copy, nullable) NSDictionary *stats;
#pragma mark - individual stats
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnInput;
@property (NS_NONATOMIC_IOSONLY, readonly) float inputBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnDemux;
@property (NS_NONATOMIC_IOSONLY, readonly) float demuxBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedVideoBlocks;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedAudioBlocks;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDisplayedPictures;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostPictures;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfPlayedAudioBuffers;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostAudioBuffers;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfSentPackets;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfSentBytes;
@property (NS_NONATOMIC_IOSONLY, readonly) float streamOutputBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfCorruptedDataPackets;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDiscontinuties;
@end
NS_ASSUME_NONNULL_END
-[VLCMedia NS_ENUM]
typedef NS_ENUM(NSUInteger, VLCMediaOrientation)
Definition: VLCMedia.h:173
VLCMedia::numberOfReadBytesOnInput
NSInteger numberOfReadBytesOnInput
Definition: VLCMedia.h:588
VLCMedia::VLCMediaTracksInformationType
NSString *const VLCMediaTracksInformationType
Definition: VLCMedia.h:336
VLCMedia::VLCMediaTracksInformationDescription
NSString *const VLCMediaTracksInformationDescription
Definition: VLCMedia.h:363
-[VLCMedia __attribute__]
(deprecated __attribute__()
VLCMedia::streamOutputBitrate
float streamOutputBitrate
Definition: VLCMedia.h:653
VLCMedia::numberOfPlayedAudioBuffers
NSInteger numberOfPlayedAudioBuffers
Definition: VLCMedia.h:632
VLCMedia::VLCMediaTracksInformationTypeUnknown
NSString *const VLCMediaTracksInformationTypeUnknown
Definition: VLCMedia.h:441
VLCMedia::VLCMediaTracksInformationLanguage
NSString *const VLCMediaTracksInformationLanguage
Definition: VLCMedia.h:358
VLCMedia::VLCMediaTracksInformationBitrate
NSString *const VLCMediaTracksInformationBitrate
Definition: VLCMedia.h:353
VLCMedia::VLCMediaTracksInformationCodecLevel
NSString *const VLCMediaTracksInformationCodecLevel
Definition: VLCMedia.h:347
VLCMedia::VLCMediaTracksInformationFrameRate
NSString *const VLCMediaTracksInformationFrameRate
Definition: VLCMedia.h:413
VLCMedia::VLCMediaTracksInformationCodec
NSString *const VLCMediaTracksInformationCodec
Definition: VLCMedia.h:321
VLCMedia::stats
NSDictionary * stats
Definition: VLCMedia.h:580
VLCMedia::delegate
id< VLCMediaDelegate > delegate
Definition: VLCMedia.h:226
VLCMedia::VLCMediaTracksInformationId
NSString *const VLCMediaTracksInformationId
Definition: VLCMedia.h:327
VLCMedia::VLCMediaTracksInformationTypeText
NSString *const VLCMediaTracksInformationTypeText
Definition: VLCMedia.h:437
VLCMedia::VLCMediaTracksInformationVideoHeight
NSString *const VLCMediaTracksInformationVideoHeight
Definition: VLCMedia.h:380
VLCMedia::demuxBitrate
float demuxBitrate
Definition: VLCMedia.h:604
VLCMedia::saveMetadata
BOOL saveMetadata
Definition: VLCMedia.h:296
VLCMedia::VLCMediaTracksInformationFrameRateDenominator
NSString *const VLCMediaTracksInformationFrameRateDenominator
Definition: VLCMedia.h:418
VLCMedia::mediaSizeSuitableForDevice
BOOL mediaSizeSuitableForDevice
Definition: VLCMedia.h:311
VLCMedia::numberOfDisplayedPictures
NSInteger numberOfDisplayedPictures
Definition: VLCMedia.h:621
VLCMedia::VLCMediaTracksInformationCodecProfile
NSString *const VLCMediaTracksInformationCodecProfile
Definition: VLCMedia.h:342
VLCMedia::tracksInformation
NSArray * tracksInformation
Definition: VLCMedia.h:477
-[VLCMedia NS_ENUM]
typedef NS_ENUM(unsigned, VLCMediaParsedStatus)
Definition: VLCMedia.h:254
VLCMedia::subitems
VLCMediaList * subitems
Definition: VLCMedia.h:274
VLCMedia::VLCMediaTracksInformationSourceAspectRatio
NSString *const VLCMediaTracksInformationSourceAspectRatio
Definition: VLCMedia.h:402
-[VLCMedia NS_ENUM]
typedef NS_ENUM(NSUInteger, VLCMediaType)
Definition: VLCMedia.h:196
VLCMedia::VLCMediaTracksInformationTypeAudio
NSString *const VLCMediaTracksInformationTypeAudio
Definition: VLCMedia.h:429
VLCMedia::numberOfDecodedAudioBlocks
NSInteger numberOfDecodedAudioBlocks
Definition: VLCMedia.h:615
VLCMedia::state
VLCMediaState state
Definition: VLCMedia.h:306
VLCMedia::numberOfLostAudioBuffers
NSInteger numberOfLostAudioBuffers
Definition: VLCMedia.h:637
VLCMediaList
Definition: VLCMediaList.h:67
VLCMedia::VLCMediaTracksInformationAudioChannelsNumber
NSString *const VLCMediaTracksInformationAudioChannelsNumber
Definition: VLCMedia.h:369
VLCMedia::VLCMediaTracksInformationVideoProjection
NSString *const VLCMediaTracksInformationVideoProjection
Definition: VLCMedia.h:396
VLCMedia::numberOfSentPackets
NSInteger numberOfSentPackets
Definition: VLCMedia.h:643
VLCMedia::numberOfLostPictures
NSInteger numberOfLostPictures
Definition: VLCMedia.h:626
VLCMedia::length
VLCTime * length
Definition: VLCMedia.h:233
VLCMedia::inputBitrate
float inputBitrate
Definition: VLCMedia.h:593
-[VLCMedia NS_ENUM]
typedef NS_ENUM(NSUInteger, VLCMediaProjection)
Definition: VLCMedia.h:187
VLCMedia::numberOfReadBytesOnDemux
NSInteger numberOfReadBytesOnDemux
Definition: VLCMedia.h:599
VLCMedia::VLCMediaTracksInformationSourceAspectRatioDenominator
NSString *const VLCMediaTracksInformationSourceAspectRatioDenominator
Definition: VLCMedia.h:407
-[VLCMedia clearStoredCookies]
void clearStoredCookies()
VLCMedia::numberOfCorruptedDataPackets
NSInteger numberOfCorruptedDataPackets
Definition: VLCMedia.h:659
VLCMedia
Definition: VLCMedia.h:112
VLCMedia::VLCMediaTracksInformationTextEncoding
NSString *const VLCMediaTracksInformationTextEncoding
Definition: VLCMedia.h:424
VLCMedia::VLCMediaTracksInformationAudioRate
NSString *const VLCMediaTracksInformationAudioRate
Definition: VLCMedia.h:374
VLCMedia::VLCMediaParsingOptions
int VLCMediaParsingOptions
Definition: VLCMedia.h:510
VLCMedia::metaDictionary
NSDictionary * metaDictionary
Definition: VLCMedia.h:301
VLCMedia::parsedStatus
VLCMediaParsedStatus parsedStatus
Definition: VLCMedia.h:260
VLCMedia::VLCMediaTracksInformationTypeVideo
NSString *const VLCMediaTracksInformationTypeVideo
Definition: VLCMedia.h:433
VLCMedia::numberOfDecodedVideoBlocks
NSInteger numberOfDecodedVideoBlocks
Definition: VLCMedia.h:610
VLCMedia::VLCMediaTracksInformationVideoWidth
NSString *const VLCMediaTracksInformationVideoWidth
Definition: VLCMedia.h:385
VLCMedia::url
NSURL * url
Definition: VLCMedia.h:269
VLCTime
Definition: VLCTime.h:30
VLCMedia::numberOfDiscontinuties
NSInteger numberOfDiscontinuties
Definition: VLCMedia.h:665
VLCMedia::numberOfSentBytes
NSInteger numberOfSentBytes
Definition: VLCMedia.h:648
VLCMedia::VLCMediaTracksInformationVideoOrientation
NSString *const VLCMediaTracksInformationVideoOrientation
Definition: VLCMedia.h:391
VLCMedia::mediaType
VLCMediaType mediaType
Definition: VLCMedia.h:203