VLCMedia.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. /*****************************************************************************
  2. * VLCMedia.h: VLCKit.framework VLCMedia header
  3. *****************************************************************************
  4. * Copyright (C) 2007 Pierre d'Herbemont
  5. * Copyright (C) 2013 Felix Paul Kühne
  6. * Copyright (C) 2007-2013 VLC authors and VideoLAN
  7. * $Id$
  8. *
  9. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  10. * Felix Paul Kühne <fkuehne # videolan.org>
  11. * Soomin Lee <TheHungryBu # gmail.com>
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU Lesser General Public License as published by
  15. * the Free Software Foundation; either version 2.1 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public License
  24. * along with this program; if not, write to the Free Software Foundation,
  25. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  26. *****************************************************************************/
  27. #import <Foundation/Foundation.h>
  28. #import "VLCMediaList.h"
  29. #import "VLCTime.h"
  30. NS_ASSUME_NONNULL_BEGIN
  31. /* Meta Dictionary Keys */
  32. /**
  33. * Standard dictionary keys for retreiving meta data.
  34. */
  35. OBJC_VISIBLE OBJC_EXTERN
  36. NSString *const VLCMetaInformationTitle; /* NSString */
  37. OBJC_VISIBLE OBJC_EXTERN
  38. NSString *const VLCMetaInformationArtist; /* NSString */
  39. OBJC_VISIBLE OBJC_EXTERN
  40. NSString *const VLCMetaInformationGenre; /* NSString */
  41. OBJC_VISIBLE OBJC_EXTERN
  42. NSString *const VLCMetaInformationCopyright; /* NSString */
  43. OBJC_VISIBLE OBJC_EXTERN
  44. NSString *const VLCMetaInformationAlbum; /* NSString */
  45. OBJC_VISIBLE OBJC_EXTERN
  46. NSString *const VLCMetaInformationTrackNumber; /* NSString */
  47. OBJC_VISIBLE OBJC_EXTERN
  48. NSString *const VLCMetaInformationDescription; /* NSString */
  49. OBJC_VISIBLE OBJC_EXTERN
  50. NSString *const VLCMetaInformationRating; /* NSString */
  51. OBJC_VISIBLE OBJC_EXTERN
  52. NSString *const VLCMetaInformationDate; /* NSString */
  53. OBJC_VISIBLE OBJC_EXTERN
  54. NSString *const VLCMetaInformationSetting; /* NSString */
  55. OBJC_VISIBLE OBJC_EXTERN
  56. NSString *const VLCMetaInformationURL; /* NSString */
  57. OBJC_VISIBLE OBJC_EXTERN
  58. NSString *const VLCMetaInformationLanguage; /* NSString */
  59. OBJC_VISIBLE OBJC_EXTERN
  60. NSString *const VLCMetaInformationNowPlaying; /* NSString */
  61. OBJC_VISIBLE OBJC_EXTERN
  62. NSString *const VLCMetaInformationPublisher; /* NSString */
  63. OBJC_VISIBLE OBJC_EXTERN
  64. NSString *const VLCMetaInformationEncodedBy; /* NSString */
  65. OBJC_VISIBLE OBJC_EXTERN
  66. NSString *const VLCMetaInformationArtworkURL; /* NSString */
  67. OBJC_VISIBLE OBJC_EXTERN
  68. NSString *const VLCMetaInformationArtwork; /* NSImage */
  69. OBJC_VISIBLE OBJC_EXTERN
  70. NSString *const VLCMetaInformationTrackID; /* NSString */
  71. OBJC_VISIBLE OBJC_EXTERN
  72. NSString *const VLCMetaInformationTrackTotal; /* NSString */
  73. OBJC_VISIBLE OBJC_EXTERN
  74. NSString *const VLCMetaInformationDirector; /* NSString */
  75. OBJC_VISIBLE OBJC_EXTERN
  76. NSString *const VLCMetaInformationSeason; /* NSString */
  77. OBJC_VISIBLE OBJC_EXTERN
  78. NSString *const VLCMetaInformationEpisode; /* NSString */
  79. OBJC_VISIBLE OBJC_EXTERN
  80. NSString *const VLCMetaInformationShowName; /* NSString */
  81. OBJC_VISIBLE OBJC_EXTERN
  82. NSString *const VLCMetaInformationActors; /* NSString */
  83. OBJC_VISIBLE OBJC_EXTERN
  84. NSString *const VLCMetaInformationAlbumArtist; /* NSString */
  85. OBJC_VISIBLE OBJC_EXTERN
  86. NSString *const VLCMetaInformationDiscNumber; /* NSString */
  87. /* Notification Messages */
  88. /**
  89. * Available notification messages.
  90. */
  91. OBJC_VISIBLE OBJC_EXTERN
  92. NSString *const VLCMediaMetaChanged; ///< Notification message for when the media's meta data has changed
  93. // Forward declarations, supresses compiler error messages
  94. @class VLCMediaList;
  95. @class VLCMedia;
  96. typedef NS_ENUM(NSInteger, VLCMediaState) {
  97. VLCMediaStateNothingSpecial, ///< Nothing
  98. VLCMediaStateBuffering, ///< Stream is buffering
  99. VLCMediaStatePlaying, ///< Stream is playing
  100. VLCMediaStateError, ///< Can't be played because an error occurred
  101. };
  102. /**
  103. * Informal protocol declaration for VLCMedia delegates. Allows data changes to be
  104. * trapped.
  105. */
  106. @protocol VLCMediaDelegate <NSObject>
  107. @optional
  108. /**
  109. * Delegate method called whenever the media's meta data was changed for whatever reason
  110. * \note this is called more often than mediaDidFinishParsing, so it may be less efficient
  111. * \param aMedia The media resource whose meta data has been changed.
  112. */
  113. - (void)mediaMetaDataDidChange:(VLCMedia *)aMedia;
  114. /**
  115. * Delegate method called whenever the media was parsed.
  116. * \param aMedia The media resource whose meta data has been changed.
  117. */
  118. - (void)mediaDidFinishParsing:(VLCMedia *)aMedia;
  119. @end
  120. /**
  121. * Defines files and streams as a managed object. Each media object can be
  122. * administered seperately. VLCMediaPlayer or VLCMediaList must be used
  123. * to execute the appropriate playback functions.
  124. * \see VLCMediaPlayer
  125. * \see VLCMediaList
  126. */
  127. OBJC_VISIBLE
  128. @interface VLCMedia : NSObject
  129. /* Factories */
  130. /**
  131. * Manufactures a new VLCMedia object using the URL specified.
  132. * \param anURL URL to media to be accessed.
  133. * \return A new VLCMedia object, only if there were no errors. This object will be automatically released.
  134. * \see initWithMediaURL
  135. */
  136. + (instancetype)mediaWithURL:(NSURL *)anURL;
  137. /**
  138. * Manufactures a new VLCMedia object using the path specified.
  139. * \param aPath Path to the media to be accessed.
  140. * \return A new VLCMedia object, only if there were no errors. This object will be automatically released.
  141. * \see initWithPath
  142. */
  143. + (instancetype)mediaWithPath:(NSString *)aPath;
  144. /**
  145. * convienience method to return a user-readable codec name for the given FourCC
  146. * \param fourcc the FourCC to process
  147. * \param trackType a VLC track type if known to speed-up the name search
  148. * \return a NSString containing the codec name if recognized, else an empty string
  149. */
  150. + (NSString *)codecNameForFourCC:(uint32_t)fourcc trackType:(NSString *)trackType;
  151. /**
  152. * TODO
  153. * \param aName TODO
  154. * \return a new VLCMedia object, only if there were no errors. This object
  155. * will be automatically released.
  156. * \see initAsNodeWithName
  157. */
  158. + (instancetype)mediaAsNodeWithName:(NSString *)aName;
  159. /* Initializers */
  160. /**
  161. * Initializes a new VLCMedia object to use the specified URL.
  162. * \param anURL the URL to media to be accessed.
  163. * \return A new VLCMedia object, only if there were no errors.
  164. */
  165. - (instancetype)initWithURL:(NSURL *)anURL;
  166. /**
  167. * Initializes a new VLCMedia object to use the specified path.
  168. * \param aPath Path to media to be accessed.
  169. * \return A new VLCMedia object, only if there were no errors.
  170. */
  171. - (instancetype)initWithPath:(NSString *)aPath;
  172. /**
  173. * Initializes a new VLCMedia object to use an input stream.
  174. *
  175. * \note By default, NSStream instances that are not file-based are non-seekable,
  176. * you may subclass NSInputStream whose instances are capable of seeking through a stream.
  177. * This subclass must allow setting NSStreamFileCurrentOffsetKey property.
  178. * \note VLCMedia will open stream if it is not already opened, and will close eventually.
  179. * You can't pass an already closed input stream.
  180. * \param stream Input stream for media to be accessed.
  181. * \return A new VLCMedia object, only if there were no errors.
  182. */
  183. - (instancetype)initWithStream:(NSInputStream *)stream;
  184. /**
  185. * TODO
  186. * \param aName TODO
  187. * \return A new VLCMedia object, only if there were no errors.
  188. */
  189. - (instancetype)initAsNodeWithName:(NSString *)aName;
  190. /**
  191. * list of possible media orientation.
  192. */
  193. typedef NS_ENUM(NSUInteger, VLCMediaOrientation) {
  194. VLCMediaOrientationTopLeft,
  195. VLCMediaOrientationTopRight,
  196. VLCMediaOrientationBottomLeft,
  197. VLCMediaOrientationBottomRight,
  198. VLCMediaOrientationLeftTop,
  199. VLCMediaOrientationLeftBottom,
  200. VLCMediaOrientationRightTop,
  201. VLCMediaOrientationRightBottom
  202. };
  203. /**
  204. * list of possible media projection.
  205. */
  206. typedef NS_ENUM(NSUInteger, VLCMediaProjection) {
  207. VLCMediaProjectionRectangular,
  208. VLCMediaProjectionEquiRectangular,
  209. VLCMediaProjectionCubemapLayoutStandard = 0x100
  210. };
  211. /**
  212. * list of possible media types that could be returned by "mediaType"
  213. */
  214. typedef NS_ENUM(NSUInteger, VLCMediaType) {
  215. VLCMediaTypeUnknown,
  216. VLCMediaTypeFile,
  217. VLCMediaTypeDirectory,
  218. VLCMediaTypeDisc,
  219. VLCMediaTypeStream,
  220. VLCMediaTypePlaylist,
  221. };
  222. /**
  223. * media type
  224. * \return returns the type of a media (VLCMediaType)
  225. */
  226. @property (readonly) VLCMediaType mediaType;
  227. /**
  228. * Returns an NSComparisonResult value that indicates the lexical ordering of
  229. * the receiver and a given meda.
  230. * \param media The media with which to compare with the receiver.
  231. * \return NSOrderedAscending if the URL of the receiver precedes media in
  232. * lexical ordering, NSOrderedSame if the URL of the receiver and media are
  233. * equivalent in lexical value, and NSOrderedDescending if the URL of the
  234. * receiver follows media. If media is nil, returns NSOrderedDescending.
  235. */
  236. - (NSComparisonResult)compare:(VLCMedia *)media;
  237. /* Properties */
  238. /**
  239. * Receiver's delegate.
  240. */
  241. @property (nonatomic, weak) id<VLCMediaDelegate> delegate;
  242. /**
  243. * A VLCTime object describing the length of the media resource, only if it is
  244. * available. Use lengthWaitUntilDate: to wait for a specified length of time.
  245. * \see lengthWaitUntilDate
  246. */
  247. @property (nonatomic, readwrite, strong) VLCTime * length;
  248. /**
  249. * Returns a VLCTime object describing the length of the media resource,
  250. * however, this is a blocking operation and will wait until the preparsing is
  251. * completed before returning anything.
  252. * \param aDate Time for operation to wait until, if there are no results
  253. * before specified date then nil is returned.
  254. * \return The length of the media resource, nil if it couldn't wait for it.
  255. */
  256. - (VLCTime *)lengthWaitUntilDate:(NSDate *)aDate;
  257. /**
  258. * list of possible parsed states returnable by parsedStatus
  259. */
  260. typedef NS_ENUM(unsigned, VLCMediaParsedStatus)
  261. {
  262. VLCMediaParsedStatusInit = 0,
  263. VLCMediaParsedStatusSkipped,
  264. VLCMediaParsedStatusFailed,
  265. VLCMediaParsedStatusTimeout,
  266. VLCMediaParsedStatusDone
  267. };
  268. /**
  269. * \return Returns the parse status of the media
  270. */
  271. @property (nonatomic, readonly) VLCMediaParsedStatus parsedStatus;
  272. /**
  273. * The URL for the receiver's media resource.
  274. */
  275. @property (nonatomic, readonly, strong) NSURL * url;
  276. /**
  277. * The receiver's sub list.
  278. */
  279. @property (nonatomic, readonly, strong) VLCMediaList * subitems;
  280. /**
  281. * get meta property for key
  282. * \note for performance reasons, fetching the metaDictionary will be faster!
  283. * \see metaDictionary
  284. * \see dictionary keys above
  285. */
  286. - (NSString *)metadataForKey:(NSString *)key;
  287. /**
  288. * set meta property for key
  289. * \param data the metadata to set as NSString
  290. * \param key the metadata key
  291. * \see dictionary keys above
  292. */
  293. - (void)setMetadata:(NSString *)data forKey:(NSString *)key;
  294. /**
  295. * Save the previously changed metadata
  296. * \return true if saving was successful
  297. */
  298. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL saveMetadata;
  299. /**
  300. * The receiver's meta data as a NSDictionary object.
  301. */
  302. @property (nonatomic, readonly, copy) NSDictionary * metaDictionary;
  303. /**
  304. * The receiver's state, such as Playing, Error, NothingSpecial, Buffering.
  305. */
  306. @property (nonatomic, readonly) VLCMediaState state;
  307. /**
  308. * returns a bool whether is the media is expected to play fluently on this
  309. * device or not. It always returns YES on a Mac.*/
  310. @property (NS_NONATOMIC_IOSONLY, getter=isMediaSizeSuitableForDevice, readonly) BOOL mediaSizeSuitableForDevice;
  311. /**
  312. * Tracks information NSDictionary Possible Keys
  313. */
  314. /**
  315. * Codec information
  316. * \note returns a NSNumber
  317. */
  318. OBJC_VISIBLE OBJC_EXTERN
  319. NSString *const VLCMediaTracksInformationCodec;
  320. /**
  321. * tracks information ID
  322. * \note returns a NSNumber
  323. */
  324. OBJC_VISIBLE OBJC_EXTERN
  325. NSString *const VLCMediaTracksInformationId;
  326. /**
  327. * track information type
  328. * \note returns a NSString
  329. * \see VLCMediaTracksInformationTypeAudio
  330. * \see VLCMediaTracksInformationTypeVideo
  331. * \see VLCMediaTracksInformationTypeText
  332. * \see VLCMediaTracksInformationTypeUnknown
  333. */
  334. OBJC_VISIBLE OBJC_EXTERN
  335. NSString *const VLCMediaTracksInformationType;
  336. /**
  337. * codec profile
  338. * \note returns a NSNumber
  339. */
  340. OBJC_VISIBLE OBJC_EXTERN
  341. NSString *const VLCMediaTracksInformationCodecProfile;
  342. /**
  343. * codec level
  344. * \note returns a NSNumber
  345. */
  346. OBJC_VISIBLE OBJC_EXTERN
  347. NSString *const VLCMediaTracksInformationCodecLevel;
  348. /**
  349. * track bitrate
  350. * \note returns the bitrate as NSNumber
  351. */
  352. OBJC_VISIBLE OBJC_EXTERN
  353. NSString *const VLCMediaTracksInformationBitrate;
  354. /**
  355. * track language
  356. * \note returns the language as NSString
  357. */
  358. OBJC_VISIBLE OBJC_EXTERN
  359. NSString *const VLCMediaTracksInformationLanguage;
  360. /**
  361. * track description
  362. * \note returns the description as NSString
  363. */
  364. OBJC_VISIBLE OBJC_EXTERN
  365. NSString *const VLCMediaTracksInformationDescription;
  366. /**
  367. * number of audio channels of a given track
  368. * \note returns the audio channel number as NSNumber
  369. */
  370. OBJC_VISIBLE OBJC_EXTERN
  371. NSString *const VLCMediaTracksInformationAudioChannelsNumber;
  372. /**
  373. * audio rate
  374. * \note returns the audio rate as NSNumber
  375. */
  376. OBJC_VISIBLE OBJC_EXTERN
  377. NSString *const VLCMediaTracksInformationAudioRate;
  378. /**
  379. * video track height
  380. * \note returns the height as NSNumber
  381. */
  382. OBJC_VISIBLE OBJC_EXTERN
  383. NSString *const VLCMediaTracksInformationVideoHeight;
  384. /**
  385. * video track width
  386. * \note the width as NSNumber
  387. */
  388. OBJC_VISIBLE OBJC_EXTERN
  389. NSString *const VLCMediaTracksInformationVideoWidth;
  390. /**
  391. * video track orientation
  392. * \note returns the orientation as NSNumber
  393. */
  394. OBJC_VISIBLE OBJC_EXTERN
  395. NSString *const VLCMediaTracksInformationVideoOrientation;
  396. /**
  397. * video track projection
  398. * \note the projection as NSNumber
  399. */
  400. OBJC_VISIBLE OBJC_EXTERN
  401. NSString *const VLCMediaTracksInformationVideoProjection;
  402. /**
  403. * source aspect ratio
  404. * \note returns the source aspect ratio as NSNumber
  405. */
  406. OBJC_VISIBLE OBJC_EXTERN
  407. NSString *const VLCMediaTracksInformationSourceAspectRatio;
  408. /**
  409. * source aspect ratio denominator
  410. * \note returns the source aspect ratio denominator as NSNumber
  411. */
  412. OBJC_VISIBLE OBJC_EXTERN
  413. NSString *const VLCMediaTracksInformationSourceAspectRatioDenominator;
  414. /**
  415. * frame rate
  416. * \note returns the frame rate as NSNumber
  417. */
  418. OBJC_VISIBLE OBJC_EXTERN
  419. NSString *const VLCMediaTracksInformationFrameRate;
  420. /**
  421. * frame rate denominator
  422. * \note returns the frame rate denominator as NSNumber
  423. */
  424. OBJC_VISIBLE OBJC_EXTERN
  425. NSString *const VLCMediaTracksInformationFrameRateDenominator;
  426. /**
  427. * text encoding
  428. * \note returns the text encoding as NSString
  429. */
  430. OBJC_VISIBLE OBJC_EXTERN
  431. NSString *const VLCMediaTracksInformationTextEncoding;
  432. /**
  433. * audio track information NSDictionary value for VLCMediaTracksInformationType
  434. */
  435. OBJC_VISIBLE OBJC_EXTERN
  436. NSString *const VLCMediaTracksInformationTypeAudio;
  437. /**
  438. * video track information NSDictionary value for VLCMediaTracksInformationType
  439. */
  440. OBJC_VISIBLE OBJC_EXTERN
  441. NSString *const VLCMediaTracksInformationTypeVideo;
  442. /**
  443. * text / subtitles track information NSDictionary value for VLCMediaTracksInformationType
  444. */
  445. OBJC_VISIBLE OBJC_EXTERN
  446. NSString *const VLCMediaTracksInformationTypeText;
  447. /**
  448. * unknown track information NSDictionary value for VLCMediaTracksInformationType
  449. */
  450. OBJC_VISIBLE OBJC_EXTERN
  451. NSString *const VLCMediaTracksInformationTypeUnknown;
  452. /**
  453. * Returns the tracks information.
  454. *
  455. * This is an array of NSDictionary representing each track.
  456. * It can contain the following keys:
  457. *
  458. * \see VLCMediaTracksInformationCodec
  459. * \see VLCMediaTracksInformationId
  460. * \see VLCMediaTracksInformationType
  461. *
  462. * \see VLCMediaTracksInformationCodecProfile
  463. * \see VLCMediaTracksInformationCodecLevel
  464. *
  465. * \see VLCMediaTracksInformationBitrate
  466. * \see VLCMediaTracksInformationLanguage
  467. * \see VLCMediaTracksInformationDescription
  468. *
  469. * \see VLCMediaTracksInformationAudioChannelsNumber
  470. * \see VLCMediaTracksInformationAudioRate
  471. *
  472. * \see VLCMediaTracksInformationVideoHeight
  473. * \see VLCMediaTracksInformationVideoWidth
  474. * \see VLCMediaTracksInformationVideoOrientation
  475. * \see VLCMediaTracksInformationVideoProjection
  476. *
  477. * \see VLCMediaTracksInformationSourceAspectRatio
  478. * \see VLCMediaTracksInformationSourceAspectRatioDenominator
  479. *
  480. * \see VLCMediaTracksInformationFrameRate
  481. * \see VLCMediaTracksInformationFrameRateDenominator
  482. *
  483. * \see VLCMediaTracksInformationTextEncoding
  484. */
  485. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *tracksInformation;
  486. enum {
  487. VLCMediaParseLocal = 0x00, ///< Parse media if it's a local file
  488. VLCMediaParseNetwork = 0x01, ///< Parse media even if it's a network file
  489. VLCMediaFetchLocal = 0x02, ///< Fetch meta and covert art using local resources
  490. VLCMediaFetchNetwork = 0x04, ///< Fetch meta and covert art using network resources
  491. VLCMediaDoInteract = 0x08, ///< Interact with the user when preparsing this item (and not its sub items). Set this flag in order to receive a callback when the input is asking for credentials.
  492. };
  493. /**
  494. * enum of available options for use with parseWithOptions
  495. * \note you may pipe multiple values for the single parameter
  496. */
  497. typedef int VLCMediaParsingOptions;
  498. /**
  499. * triggers an asynchronous parse of the media item
  500. * using the given options
  501. * \param options the option mask based on VLCMediaParsingOptions
  502. * \see VLCMediaParsingOptions
  503. * \return an int. 0 on success, -1 in case of error
  504. * \note listen to the "parsed" key value or the mediaDidFinishParsing:
  505. * delegate method to be notified about parsing results. Those triggers
  506. * will _NOT_ be raised if parsing fails and this method returns an error.
  507. */
  508. - (int)parseWithOptions:(VLCMediaParsingOptions)options;
  509. /**
  510. * triggers an asynchronous parse of the media item
  511. * using the given options
  512. * \param options the option mask based on VLCMediaParsingOptions
  513. * \param timeoutValue a time-out value in milliseconds (-1 for default, 0 for infinite)
  514. * \see VLCMediaParsingOptions
  515. * \return an int. 0 on success, -1 in case of error
  516. * \note listen to the "parsed" key value or the mediaDidFinishParsing:
  517. * delegate method to be notified about parsing results. Those triggers
  518. * will _NOT_ be raised if parsing fails and this method returns an error.
  519. */
  520. - (int)parseWithOptions:(VLCMediaParsingOptions)options timeout:(int)timeoutValue;
  521. /**
  522. * Stop the parsing of the media
  523. *
  524. * When the media parsing is stopped, the mediaDidFinishParsing will
  525. * be sent with the VLCMediaParsedStatusTimeout status.
  526. */
  527. - (void)parseStop;
  528. /**
  529. * Add options to the media, that will be used to determine how
  530. * VLCMediaPlayer will read the media. This allow to use VLC advanced
  531. * reading/streaming options in a per-media basis
  532. *
  533. * The options are detailed in vlc --long-help, for instance "--sout-all"
  534. * And on the web: http://wiki.videolan.org/VLC_command-line_help
  535. */
  536. - (void)addOption:(NSString *)option;
  537. - (void)addOptions:(NSDictionary*)options;
  538. /**
  539. * Parse a value of an incoming Set-Cookie header (see RFC 6265) and append the
  540. * cookie to the stored cookies if appropriate. The "secure" attribute can be added
  541. * to cookie to limit the scope of the cookie to secured channels (https).
  542. *
  543. * \note must be called before the first call of play() to
  544. * take effect. The cookie storage is only used for http/https.
  545. * \warning This method will never succeed on macOS, but requires iOS or tvOS
  546. *
  547. * \param cookie header field value of Set-Cookie: "name=value<;attributes>"
  548. * \param host host to which the cookie will be sent
  549. * \param path scope of the cookie
  550. *
  551. * \return 0 on success, -1 on error.
  552. */
  553. - (int)storeCookie:(NSString * _Nonnull)cookie
  554. forHost:(NSString * _Nonnull)host
  555. path:(NSString * _Nonnull)path;
  556. /**
  557. * Clear the stored cookies of a media.
  558. *
  559. * \note must be called before the first call of play() to
  560. * take effect. The cookie jar is only used for http/https.
  561. * \warning This method will never succeed on macOS, but requires iOS or tvOS
  562. */
  563. - (void)clearStoredCookies;
  564. /**
  565. * Getter for statistics information
  566. * Returns a NSDictionary with NSNumbers for values.
  567. *
  568. */
  569. @property (NS_NONATOMIC_IOSONLY, readonly, copy, nullable) NSDictionary *stats;
  570. #pragma mark - individual stats
  571. /**
  572. * returns the number of bytes read by the current input module
  573. * \return a NSInteger with the raw number of bytes
  574. */
  575. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnInput;
  576. /**
  577. * returns the current input bitrate. may be 0 if the buffer is full
  578. * \return a float of the current input bitrate
  579. */
  580. @property (NS_NONATOMIC_IOSONLY, readonly) float inputBitrate;
  581. /**
  582. * returns the number of bytes read by the current demux module
  583. * \return a NSInteger with the raw number of bytes
  584. */
  585. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfReadBytesOnDemux;
  586. /**
  587. * returns the current demux bitrate. may be 0 if the buffer is empty
  588. * \return a float of the current demux bitrate
  589. */
  590. @property (NS_NONATOMIC_IOSONLY, readonly) float demuxBitrate;
  591. /**
  592. * returns the total number of decoded video blocks in the current media session
  593. * \return a NSInteger with the total number of decoded blocks
  594. */
  595. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedVideoBlocks;
  596. /**
  597. * returns the total number of decoded audio blocks in the current media session
  598. * \return a NSInteger with the total number of decoded blocks
  599. */
  600. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDecodedAudioBlocks;
  601. /**
  602. * returns the total number of displayed pictures during the current media session
  603. * \return a NSInteger with the total number of displayed pictures
  604. */
  605. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDisplayedPictures;
  606. /**
  607. * returns the total number of pictures lost during the current media session
  608. * \return a NSInteger with the total number of lost pictures
  609. */
  610. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostPictures;
  611. /**
  612. * returns the total number of played audio buffers during the current media session
  613. * \return a NSInteger with the total number of played audio buffers
  614. */
  615. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfPlayedAudioBuffers;
  616. /**
  617. * returns the total number of audio buffers lost during the current media session
  618. * \return a NSInteger with the total number of displayed pictures
  619. */
  620. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfLostAudioBuffers;
  621. /**
  622. * returns the total number of corrupted data packets during current sout session
  623. * \note value is 0 on non-stream-output operations
  624. * \return a NSInteger with the total number of corrupted data packets
  625. */
  626. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfCorruptedDataPackets;
  627. /**
  628. * returns the total number of discontinuties during current sout session
  629. * \note value is 0 on non-stream-output operations
  630. * \return a NSInteger with the total number of discontinuties
  631. */
  632. @property (NS_NONATOMIC_IOSONLY, readonly) NSInteger numberOfDiscontinuties;
  633. @end
  634. NS_ASSUME_NONNULL_END