Commit 43c0ccd9 authored by James Dumay's avatar James Dumay Committed by Felix Paul Kühne

convert to modern objective-c

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 2043edbf
......@@ -27,10 +27,10 @@
struct extension_t *_instance;
}
- (id)initWithInstance:(struct extension_t *)instance; // FIXME: Should be internal
- (struct extension_t *)instance; // FIXME: Should be internal
- (instancetype)initWithInstance:(struct extension_t *)instance NS_DESIGNATED_INITIALIZER; // FIXME: Should be internal
@property (NS_NONATOMIC_IOSONLY, readonly) struct extension_t *instance; // FIXME: Should be internal
- (NSString *)name;
- (NSString *)title;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *name;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *title;
@end
......@@ -32,7 +32,7 @@
void *_previousInput;
}
+ (VLCExtensionsManager *)sharedManager;
- (NSArray *)extensions;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *extensions;
- (void)runExtension:(VLCExtension *)extension;
@property (readwrite, strong) VLCMediaPlayer *mediaPlayer;
......
......@@ -52,7 +52,7 @@
* \param a NSArray with NSString instance containing the options
* \return the individual library instance
*/
- (id)initWithOptions:(NSArray*)options;
- (instancetype)initWithOptions:(NSArray*)options NS_DESIGNATED_INITIALIZER;
/**
* Returns the library's version
......
......@@ -61,13 +61,12 @@ extern NSString *const VLCMediaMetaChanged; //< Notification message for when t
@class VLCMediaList;
@class VLCMedia;
enum {
typedef NS_ENUM(NSInteger, VLCMediaState) {
VLCMediaStateNothingSpecial, //< Nothing
VLCMediaStateBuffering, //< Stream is buffering
VLCMediaStatePlaying, //< Stream is playing
VLCMediaStateError, //< Can't be played because an error occurred
};
typedef NSInteger VLCMediaState;
/**
* Informal protocol declaration for VLCMedia delegates. Allows data changes to be
......@@ -130,7 +129,7 @@ typedef NSInteger VLCMediaState;
* \return A new VLCMedia object, only if there were no errors. This object will be automatically released.
* \see initWithMediaURL
*/
+ (id)mediaWithURL:(NSURL *)anURL;
+ (instancetype)mediaWithURL:(NSURL *)anURL;
/**
* Manufactures a new VLCMedia object using the path specified.
......@@ -138,7 +137,7 @@ typedef NSInteger VLCMediaState;
* \return A new VLCMedia object, only if there were no errors. This object will be automatically released.
* \see initWithPath
*/
+ (id)mediaWithPath:(NSString *)aPath;
+ (instancetype)mediaWithPath:(NSString *)aPath;
/**
* TODO
......@@ -147,7 +146,7 @@ typedef NSInteger VLCMediaState;
* will be automatically released.
* \see initAsNodeWithName
*/
+ (id)mediaAsNodeWithName:(NSString *)aName;
+ (instancetype)mediaAsNodeWithName:(NSString *)aName;
/* Initializers */
/**
......@@ -155,21 +154,21 @@ typedef NSInteger VLCMediaState;
* \param aPath Path to media to be accessed.
* \return A new VLCMedia object, only if there were no errors.
*/
- (id)initWithURL:(NSURL *)anURL;
- (instancetype)initWithURL:(NSURL *)anURL NS_DESIGNATED_INITIALIZER;
/**
* Initializes a new VLCMedia object to use the specified path.
* \param aPath Path to media to be accessed.
* \return A new VLCMedia object, only if there were no errors.
*/
- (id)initWithPath:(NSString *)aPath;
- (instancetype)initWithPath:(NSString *)aPath;
/**
* TODO
* \param aName TODO
* \return A new VLCMedia object, only if there were no errors.
*/
- (id)initAsNodeWithName:(NSString *)aName;
- (instancetype)initAsNodeWithName:(NSString *)aName NS_DESIGNATED_INITIALIZER;
/**
* Returns an NSComparisonResult value that indicates the lexical ordering of
......@@ -240,7 +239,7 @@ typedef NSInteger VLCMediaState;
* Save the previously changed metadata
* \return true if saving was successful
*/
- (BOOL)saveMetadata;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL saveMetadata;
/**
* The receiver's meta data as a NSDictionary object.
......@@ -255,7 +254,7 @@ typedef NSInteger VLCMediaState;
/**
* returns a bool whether is the media is expected to play fluently on this
* device or not. It always returns YES on a Mac.*/
- (BOOL)isMediaSizeSuitableForDevice;
@property (NS_NONATOMIC_IOSONLY, getter=isMediaSizeSuitableForDevice, readonly) BOOL mediaSizeSuitableForDevice;
/**
* Tracks information NSDictionary Possible Keys
......@@ -383,7 +382,7 @@ extern NSString *const VLCMediaTracksInformationTypeUnknown;
* \see VLCMediaTracksInformationTextEncoding
*/
- (NSArray *)tracksInformation;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *tracksInformation;
/**
* Start asynchronously to parse the media.
......@@ -417,7 +416,7 @@ extern NSString *const VLCMediaTracksInformationTypeUnknown;
* Returns a NSDictionary with NSNumbers for values.
*
*/
- (NSDictionary*) stats;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSDictionary *stats;
#pragma mark - individual stats
......@@ -425,83 +424,83 @@ extern NSString *const VLCMediaTracksInformationTypeUnknown;
* returns the number of bytes read by the current input module
* \return a NSInteger with the raw number of bytes
*/
- (NSInteger)numberOfReadBytesOnInput;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnInput;
/**
* returns the current input bitrate. may be 0 if the buffer is full
* \return a float of the current input bitrate
*/
- (float)inputBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) float inputBitrate;
/**
* returns the number of bytes read by the current demux module
* \return a NSInteger with the raw number of bytes
*/
- (NSInteger)numberOfReadBytesOnDemux;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnDemux;
/**
* returns the current demux bitrate. may be 0 if the buffer is empty
* \return a float of the current demux bitrate
*/
- (float)demuxBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) float demuxBitrate;
/**
* returns the total number of decoded video blocks in the current media session
* \return a NSInteger with the total number of decoded blocks
*/
- (NSInteger)numberOfDecodedVideoBlocks;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedVideoBlocks;
/**
* returns the total number of decoded audio blocks in the current media session
* \return a NSInteger with the total number of decoded blocks
*/
- (NSInteger)numberOfDecodedAudioBlocks;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedAudioBlocks;
/**
* returns the total number of displayed pictures during the current media session
* \return a NSInteger with the total number of displayed pictures
*/
- (NSInteger)numberOfDisplayedPictures;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDisplayedPictures;
/**
* returns the total number of pictures lost during the current media session
* \return a NSInteger with the total number of lost pictures
*/
- (NSInteger)numberOfLostPictures;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostPictures;
/**
* returns the total number of played audio buffers during the current media session
* \return a NSInteger with the total number of played audio buffers
*/
- (NSInteger)numberOfPlayedAudioBuffers;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfPlayedAudioBuffers;
/**
* returns the total number of audio buffers lost during the current media session
* \return a NSInteger with the total number of displayed pictures
*/
- (NSInteger)numberOfLostAudioBuffers;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostAudioBuffers;
/**
* returns the total number of packets sent during the current media session
* \return a NSInteger with the total number of sent packets
*/
- (NSInteger)numberOfSentPackets;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfSentPackets;
/**
* returns the total number of raw bytes sent during the current media session
* \return a NSInteger with the total number of sent bytes
*/
- (NSInteger)numberOfSentBytes;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfSentBytes;
/**
* returns the current bitrate of sent bytes
* \return a float of the current bitrate of sent bits
*/
- (float)streamOutputBitrate;
@property (NS_NONATOMIC_IOSONLY, readonly) float streamOutputBitrate;
/**
* returns the total number of corrupted data packets during current sout session
* \note value is 0 on non-stream-output operations
* \return a NSInteger with the total number of corrupted data packets
*/
- (NSInteger)numberOfCorruptedDataPackets;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfCorruptedDataPackets;
/**
* returns the total number of discontinuties during current sout session
* \note value is 0 on non-stream-output operations
* \return a NSInteger with the total number of discontinuties
*/
- (NSInteger)numberOfDiscontinuties;
@property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDiscontinuties;
@end
......@@ -51,7 +51,7 @@
* \param aSerchName Name of the service for this VLCMediaDiscoverer object.
* \returns Newly created media discoverer.
*/
- (id)initWithName:(NSString *)aServiceName;
- (instancetype)initWithName:(NSString *)aServiceName NS_DESIGNATED_INITIALIZER;
/**
* TODO: Documentation VLCMediaDiscoverer.discoveredMedia
......
......@@ -35,7 +35,7 @@
}
/* Factories */
+ (id)sharedMediaLibrary;
+ (VLCMediaLibrary*)sharedMediaLibrary;
/* Properties */
@property (nonatomic, readonly, strong) VLCMediaList * allMedia;
......
......@@ -53,7 +53,7 @@ extern NSString *const VLCMediaListItemDeleted;
*/
@interface VLCMediaList : NSObject
- (id)initWithArray:(NSArray *)array;
- (instancetype)initWithArray:(NSArray *)array;
/* Operations */
/**
......
......@@ -48,7 +48,7 @@ typedef NS_ENUM(NSInteger, VLCRepeatMode) {
@property (readwrite) VLCMedia *rootMedia;
@property (readonly) VLCMediaPlayer *mediaPlayer;
- (id)initWithOptions:(NSArray *)options;
- (instancetype)initWithOptions:(NSArray *)options NS_DESIGNATED_INITIALIZER;
/**
* Basic play, pause and stop are here. For other methods, use the mediaPlayer.
......@@ -61,8 +61,8 @@ typedef NS_ENUM(NSInteger, VLCRepeatMode) {
* previous, next, play item at index
* \returns YES on success, NO if there is no such item
*/
- (BOOL)next;
- (BOOL)previous;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL next;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL previous;
- (BOOL)playItemAtIndex:(int)index;
/**
......
......@@ -46,7 +46,7 @@ extern NSString *const VLCMediaPlayerStateChanged;
/**
* VLCMediaPlayerState describes the state of the media player.
*/
enum
typedef NS_ENUM(NSInteger, VLCMediaPlayerState)
{
VLCMediaPlayerStateStopped, //< Player has stopped
VLCMediaPlayerStateOpening, //< Stream is opening
......@@ -56,7 +56,6 @@ enum
VLCMediaPlayerStatePlaying, //< Stream is playing
VLCMediaPlayerStatePaused //< Stream is paused
};
typedef NSInteger VLCMediaPlayerState;
/**
* Returns the name of the player state as a string.
......@@ -97,10 +96,10 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
#if !TARGET_OS_IPHONE
/* Initializers */
- (id)initWithVideoView:(VLCVideoView *)aVideoView;
- (id)initWithVideoLayer:(VLCVideoLayer *)aVideoLayer;
- (instancetype)initWithVideoView:(VLCVideoView *)aVideoView;
- (instancetype)initWithVideoLayer:(VLCVideoLayer *)aVideoLayer;
#endif
- (id)initWithOptions:(NSArray *)options;
- (instancetype)initWithOptions:(NSArray *)options;
/* Video View Options */
// TODO: Should be it's own object?
......@@ -123,8 +122,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* \return the video aspect ratio or NULL if unspecified
* (the result must be released with free()).
*/
- (void)setVideoAspectRatio:(char *)value;
- (char *)videoAspectRatio;
@property (NS_NONATOMIC_IOSONLY) char *videoAspectRatio;
/**
* Set/Get current crop filter geometry.
......@@ -132,8 +130,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* \param psz_geometry new crop filter geometry (NULL to unset)
* \return the crop filter geometry or NULL if unset
*/
- (void)setVideoCropGeometry:(char *)value;
- (char *)videoCropGeometry;
@property (NS_NONATOMIC_IOSONLY) char *videoCropGeometry;
/**
* Set/Get the current video scaling factor.
......@@ -220,7 +217,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Get the current video size
* \return video size as CGSize
*/
- (CGSize)videoSize;
@property (NS_NONATOMIC_IOSONLY, readonly) CGSize videoSize;
/**
* Does the current media have a video output?
......@@ -228,13 +225,13 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* \note tracks. Those might just be disabled.
* \return current video output status
*/
- (BOOL)hasVideoOut;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasVideoOut;
/**
* Frames per second
* \return current media's frames per second value
*/
- (float)framesPerSecond;
@property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond;
#pragma mark -
#pragma mark time
......@@ -243,13 +240,12 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Sets the current position (or time) of the feed.
* \param value New time to set the current position to. If time is [VLCTime nullTime], 0 is assumed.
*/
- (void)setTime:(VLCTime *)value;
/**
* Returns the current position (or time) of the feed.
* \return VLCTIme object with current time.
*/
- (VLCTime *)time;
@property (NS_NONATOMIC_IOSONLY, strong) VLCTime *time;
@property (nonatomic, readonly, weak) VLCTime *remainingTime;
......@@ -277,13 +273,13 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Returns the video track names, usually a language name or a description
* It includes the "Disabled" fake track at index 0.
*/
- (NSArray *)videoTrackNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackNames;
/**
* Returns the video track IDs
* those are needed to set the video index
*/
- (NSArray *)videoTrackIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackIndexes;
/**
* Return the video tracks
......@@ -306,13 +302,13 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Returns the video subtitle track names, usually a language name or a description
* It includes the "Disabled" fake track at index 0.
*/
- (NSArray *)videoSubTitlesNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesNames;
/**
* Returns the video subtitle track IDs
* those are needed to set the video subtitle index
*/
- (NSArray *)videoSubTitlesIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesIndexes;
/**
* Return the video subtitle tracks
......@@ -357,7 +353,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* \return NSNotFound if none is set.
*/
@property (readwrite) NSUInteger currentTitleIndex;
- (NSArray *)titles;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titles;
/* Audio Options */
......@@ -375,13 +371,13 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Returns the audio track names, usually a language name or a description
* It includes the "Disabled" fake track at index 0.
*/
- (NSArray *)audioTrackNames;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackNames;
/**
* Returns the audio track IDs
* those are needed to set the video index
*/
- (NSArray *)audioTrackIndexes;
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackIndexes;
/**
* Return the audio tracks
......@@ -393,8 +389,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
#pragma mark -
#pragma mark audio functionality
- (void)setAudioChannel:(int)value;
- (int)audioChannel;
@property (NS_NONATOMIC_IOSONLY) int audioChannel;
/**
* Get the current audio delay. Positive values means audio is delayed further,
......@@ -461,8 +456,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
#pragma mark media handling
/* Media Options */
- (void)setMedia:(VLCMedia *)value;
- (VLCMedia *)media;
@property (NS_NONATOMIC_IOSONLY, strong) VLCMedia *media;
#pragma mark -
#pragma mark playback operations
......@@ -472,7 +466,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* it was paused in.
* \return A Boolean determining whether the stream was played or not.
*/
- (BOOL)play;
-(BOOL)play;
/**
* Toggle's the pause state of the feed.
......@@ -569,33 +563,32 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
* Playback state flag identifying that the stream is currently playing.
* \return TRUE if the feed is playing, FALSE if otherwise.
*/
- (BOOL)isPlaying;
@property (NS_NONATOMIC_IOSONLY, getter=isPlaying, readonly) BOOL playing;
/**
* Playback state flag identifying wheather the stream will play.
* \return TRUE if the feed is ready for playback, FALSE if otherwise.
*/
- (BOOL)willPlay;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL willPlay;
/**
* Playback's current state.
* \see VLCMediaState
*/
- (VLCMediaPlayerState)state;
@property (NS_NONATOMIC_IOSONLY, readonly) VLCMediaPlayerState state;
/**
* Returns the receiver's position in the reading.
* \return movie position as percentage between 0.0 and 1.0.
*/
- (float)position;
@property (NS_NONATOMIC_IOSONLY) float position;
/**
* Set movie position. This has no effect if playback is not enabled.
* \param movie position as percentage between 0.0 and 1.0.
*/
- (void)setPosition:(float)newPosition;
- (BOOL)isSeekable;
@property (NS_NONATOMIC_IOSONLY, getter=isSeekable, readonly) BOOL seekable;
- (BOOL)canPause;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL canPause;
@end
......@@ -30,13 +30,13 @@ extern NSString * VLCDefaultStreamOutputRTP;
NSMutableDictionary * options;
}
- (id)initWithOptionDictionary:(NSDictionary *)dictionary;
+ (id)streamOutputWithOptionDictionary:(NSDictionary *)dictionary;
- (instancetype)initWithOptionDictionary:(NSDictionary *)dictionary NS_DESIGNATED_INITIALIZER;
+ (instancetype)streamOutputWithOptionDictionary:(NSDictionary *)dictionary;
+ (id)rtpBroadcastStreamOutputWithSAPAnnounce:(NSString *)announceName;
+ (id)rtpBroadcastStreamOutput;
+ (id)ipodStreamOutputWithFilePath:(NSString *)filePath;
+ (id)streamOutputWithFilePath:(NSString *)filePath;
+ (instancetype)streamOutputWithFilePath:(NSString *)filePath;
+ (id)mpeg2StreamOutputWithFilePath:(NSString *)filePath;
+ (id)mpeg4StreamOutputWithFilePath:(NSString *)filePath;
......
......@@ -29,9 +29,8 @@
@interface VLCStreamSession : VLCMediaPlayer
+ (id)streamSession;
+ (instancetype)streamSession;
@property (nonatomic, strong) VLCMedia * media;
@property (nonatomic, strong) VLCStreamOutput * streamOutput;
@property (nonatomic, readonly) BOOL isComplete;
@property (nonatomic, readonly) NSUInteger reattemptedConnections;
......
......@@ -35,8 +35,8 @@
+ (VLCTime *)timeWithInt:(int)aInt;
/* Initializers */
- (id)initWithNumber:(NSNumber *)aNumber;
- (id)initWithInt:(int)aInt;
- (instancetype)initWithNumber:(NSNumber *)aNumber NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithInt:(int)aInt NS_DESIGNATED_INITIALIZER;
/* Properties */
@property (nonatomic, readonly) NSNumber * value; //< Holds, in milliseconds, the VLCTime value
......
......@@ -45,12 +45,12 @@ NSString *const VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
return instance;
}
- (id)init
- (instancetype)init
{
return nil;
}
- (id)initWithMediaPlayer:(VLCMediaPlayer *)mediaPlayer
- (instancetype)initWithMediaPlayer:(VLCMediaPlayer *)mediaPlayer
{
self = [super init];
if (!self)
......
......@@ -29,7 +29,7 @@
return [NSString stringWithFormat:@"VLC Extension %@", [self name]];
}
- (id)initWithInstance:(struct extension_t *)instance
- (instancetype)initWithInstance:(struct extension_t *)instance
{
self = [super init];
if (!self)
......@@ -45,12 +45,12 @@
- (NSString *)name
{
return [NSString stringWithUTF8String:_instance->psz_name];
return @(_instance->psz_name);
}
- (NSString *)title
{
return [NSString stringWithUTF8String:_instance->psz_title];
return @(_instance->psz_title);
}
@end
......@@ -60,7 +60,7 @@ static VLCLibrary * sharedLibrary = nil;
return [self sharedLibrary].instance;
}
- (id)init
- (instancetype)init
{
if (self = [super init]) {
[self prepareInstanceWithOptions:nil];
......@@ -68,7 +68,7 @@ static VLCLibrary * sharedLibrary = nil;
return self;
}
- (id)initWithOptions:(NSArray*)options
- (instancetype)initWithOptions:(NSArray*)options
{
if (self = [super init]) {
[self prepareInstanceWithOptions:options];
......
......@@ -168,27 +168,27 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
*/
@implementation VLCMedia
+ (id)mediaWithURL:(NSURL *)anURL;
+ (instancetype)mediaWithURL:(NSURL *)anURL;
{
return [[VLCMedia alloc] initWithURL:anURL];
}
+ (id)mediaWithPath:(NSString *)aPath;
+ (instancetype)mediaWithPath:(NSString *)aPath;
{
return [[VLCMedia alloc] initWithPath:aPath];
}
+ (id)mediaAsNodeWithName:(NSString *)aName;
+ (instancetype)mediaAsNodeWithName:(NSString *)aName;
{
return [[VLCMedia alloc] initAsNodeWithName:aName];
}
- (id)initWithPath:(NSString *)aPath
- (instancetype)initWithPath:(NSString *)aPath
{
return [self initWithURL:[NSURL fileURLWithPath:aPath isDirectory:NO]];
}
- (id)initWithURL:(NSURL *)anURL
- (instancetype)initWithURL:(NSURL *)anURL
{
if (self = [super init]) {
VLCLibrary *library = [VLCLibrary sharedLibrary];
......@@ -203,7 +203,7 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
return self;
}
- (id)initAsNodeWithName:(NSString *)aName
- (instancetype)initAsNodeWithName:(NSString *)aName
{
if (self = [super init]) {
p_md = libvlc_media_new_as_node([VLCLibrary sharedInstance], [aName UTF8String]);
......@@ -655,7 +655,7 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
if (!returnValue)
return NULL;
NSString *actualReturnValue = [NSString stringWithUTF8String:returnValue];
NSString *actualReturnValue = @(returnValue);
free(returnValue);
return actualReturnValue;
......@@ -809,7 +809,7 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
if (!art)
[(NSMutableDictionary *)_metaDictionary removeObjectForKey:@"artwork"];
else
[(NSMutableDictionary *)_metaDictionary setObject:art forKey:@"artwork"];
((NSMutableDictionary *)_metaDictionary)[@"artwork"] = art;
}
#endif
......
......@@ -85,7 +85,7 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use
return availableMediaDiscoverer;
}
- (id)initWithName:(NSString *)aServiceName
- (instancetype)initWithName:(NSString *)aServiceName
{
if (self = [super init]) {
localizedName = nil;
......
......@@ -38,7 +38,7 @@
@implementation VLCMediaLibrary
+ (id)sharedMediaLibrary
+ (VLCMediaLibrary*)sharedMediaLibrary
{
static VLCMediaLibrary * sharedMediaLibrary = nil;
static dispatch_once_t onceToken;
......@@ -50,7 +50,7 @@
return sharedMediaLibrary;
}
- (id)init
- (instancetype)init
{
if (self = [super init]) {
mlib = libvlc_media_library_new( [VLCLibrary sharedInstance]);
......
......@@ -82,7 +82,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
@end
@implementation VLCMediaList
- (id)init
- (instancetype)init
{
if (self = [super init]) {
// Create a new libvlc media list instance
......@@ -96,7 +96,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
return self;
}
- (id)initWithArray:(NSArray *)array
- (instancetype)initWithArray:(NSArray *)array
{
if (self = [self init]) {
/* do something useful with the provided array */
......
......@@ -41,7 +41,7 @@
@implementation VLCMediaListPlayer
- (id)initWithOptions:(NSArray *)options
- (instancetype)initWithOptions:(NSArray *)options
{
if (self = [super init]) {
_mediaPlayer = [[VLCMediaPlayer alloc] initWithOptions:options];
......@@ -53,7 +53,7 @@
}
- (id)init
- (instancetype)init
{
return [self initWithOptions:nil];
}
......
......@@ -186,34 +186,34 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
}
/* Constructor */