VLCMediaPlayer.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. /*****************************************************************************
  2. * VLCMediaPlayer.h: VLCKit.framework VLCMediaPlayer header
  3. *****************************************************************************
  4. * Copyright (C) 2007-2009 Pierre d'Herbemont
  5. * Copyright (C) 2007-2015 VLC authors and VideoLAN
  6. * Copyright (C) 2009-2015 Felix Paul Kühne
  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. #if TARGET_OS_IPHONE
  29. # import <CoreGraphics/CoreGraphics.h>
  30. # import <UIKit/UIKit.h>
  31. #endif
  32. #import "VLCMedia.h"
  33. #import "VLCTime.h"
  34. #import "VLCAudio.h"
  35. #if !TARGET_OS_IPHONE
  36. @class VLCVideoView;
  37. @class VLCVideoLayer;
  38. #endif
  39. @class VLCLibrary;
  40. @class VLCMediaPlayer;
  41. @class VLCRendererItem;
  42. /* Notification Messages */
  43. extern NSString *const VLCMediaPlayerTimeChanged;
  44. extern NSString *const VLCMediaPlayerStateChanged;
  45. extern NSString *const VLCMediaPlayerTitleChanged;
  46. extern NSString *const VLCMediaPlayerChapterChanged;
  47. /**
  48. * VLCMediaPlayerState describes the state of the media player.
  49. */
  50. typedef NS_ENUM(NSInteger, VLCMediaPlayerState)
  51. {
  52. VLCMediaPlayerStateStopped, ///< Player has stopped
  53. VLCMediaPlayerStateOpening, ///< Stream is opening
  54. VLCMediaPlayerStateBuffering, ///< Stream is buffering
  55. VLCMediaPlayerStateEnded, ///< Stream has ended
  56. VLCMediaPlayerStateError, ///< Player has generated an error
  57. VLCMediaPlayerStatePlaying, ///< Stream is playing
  58. VLCMediaPlayerStatePaused, ///< Stream is paused
  59. VLCMediaPlayerStateESAdded ///< Elementary Stream added
  60. };
  61. /**
  62. * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
  63. */
  64. typedef NS_ENUM(unsigned, VLCMediaPlaybackNavigationAction)
  65. {
  66. VLCMediaPlaybackNavigationActionActivate = 0,
  67. VLCMediaPlaybackNavigationActionUp,
  68. VLCMediaPlaybackNavigationActionDown,
  69. VLCMediaPlaybackNavigationActionLeft,
  70. VLCMediaPlaybackNavigationActionRight
  71. };
  72. /**
  73. * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
  74. */
  75. typedef NS_ENUM(NSInteger, VLCDeinterlace)
  76. {
  77. VLCDeinterlaceAuto = -1,
  78. VLCDeinterlaceOn = 1,
  79. VLCDeinterlaceOff = 0
  80. };
  81. /**
  82. * Returns the name of the player state as a string.
  83. * \param state The player state.
  84. * \return A string containing the name of state. If state is not a valid state, returns nil.
  85. */
  86. extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
  87. /**
  88. * Formal protocol declaration for playback delegates. Allows playback messages
  89. * to be trapped by delegated objects.
  90. */
  91. @protocol VLCMediaPlayerDelegate
  92. @optional
  93. /**
  94. * Sent by the default notification center whenever the player's state has changed.
  95. * \details Discussion The value of aNotification is always an VLCMediaPlayerStateChanged notification. You can retrieve
  96. * the VLCMediaPlayer object in question by sending object to aNotification.
  97. */
  98. - (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
  99. /**
  100. * Sent by the default notification center whenever the player's time has changed.
  101. * \details Discussion The value of aNotification is always an VLCMediaPlayerTimeChanged notification. You can retrieve
  102. * the VLCMediaPlayer object in question by sending object to aNotification.
  103. */
  104. - (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
  105. /**
  106. * Sent by the default notification center whenever the player's title has changed (if any).
  107. * \details Discussion The value of aNotification is always an VLCMediaPlayerTitleChanged notification. You can retrieve
  108. * the VLCMediaPlayer object in question by sending object to aNotification.
  109. * \note this is about a title in the navigation sense, not about metadata
  110. */
  111. - (void)mediaPlayerTitleChanged:(NSNotification *)aNotification;
  112. /**
  113. * Sent by the default notification center whenever the player's chapter has changed (if any).
  114. * \details Discussion The value of aNotification is always an VLCMediaPlayerChapterChanged notification. You can retrieve
  115. * the VLCMediaPlayer object in question by sending object to aNotification.
  116. */
  117. - (void)mediaPlayerChapterChanged:(NSNotification *)aNotification;
  118. /**
  119. * Sent by the default notification center whenever a new snapshot is taken.
  120. * \details Discussion The value of aNotification is always an VLCMediaPlayerSnapshotTaken notification. You can retrieve
  121. * the VLCMediaPlayer object in question by sending object to aNotification.
  122. */
  123. - (void)mediaPlayerSnapshot:(NSNotification *)aNotification;
  124. /**
  125. * Sent by the default notification center whenever the player started recording.
  126. * @param player the player who started recording
  127. */
  128. - (void)mediaPlayerStartedRecording:(VLCMediaPlayer *)player;
  129. /**
  130. * Sent by the default notification center whenever the player stopped recording.
  131. * @param player the player who stopped recording
  132. * @param path the path to the file that the player recorded to
  133. */
  134. - (void)mediaPlayer:(VLCMediaPlayer *)player recordingStoppedAtPath:(NSString *)path;
  135. @end
  136. /**
  137. * The player base class needed to do any playback
  138. */
  139. @interface VLCMediaPlayer : NSObject
  140. /**
  141. * the library instance in use by the player instance
  142. */
  143. @property (nonatomic, readonly) VLCLibrary *libraryInstance;
  144. /**
  145. * the delegate object implementing the optional protocol
  146. */
  147. @property (weak, nonatomic) id<VLCMediaPlayerDelegate> delegate;
  148. #if !TARGET_OS_IPHONE
  149. /* Initializers */
  150. /**
  151. * initialize player with a given video view
  152. * \param aVideoView an instance of VLCVideoView
  153. * \note This initializer is for macOS only
  154. */
  155. - (instancetype)initWithVideoView:(VLCVideoView *)aVideoView;
  156. /**
  157. * initialize player with a given video layer
  158. * \param aVideoLayer an instance of VLCVideoLayer
  159. * \note This initializer is for macOS only
  160. */
  161. - (instancetype)initWithVideoLayer:(VLCVideoLayer *)aVideoLayer;
  162. #endif
  163. /**
  164. * initialize player with a given set of options
  165. * \param options an array of private options
  166. * \note This will allocate a new libvlc and VLCLibrary instance, which will have a memory impact
  167. */
  168. - (instancetype)initWithOptions:(NSArray *)options;
  169. /**
  170. * initialize player with a certain libvlc instance and VLCLibrary
  171. * \param playerInstance the libvlc instance
  172. * \param library the library instance
  173. * \note This is an advanced initializer for very specialized environments
  174. */
  175. - (instancetype)initWithLibVLCInstance:(void *)playerInstance andLibrary:(VLCLibrary *)library;
  176. /* Video View Options */
  177. // TODO: Should be it's own object?
  178. #pragma mark -
  179. #pragma mark video functionality
  180. #if !TARGET_OS_IPHONE
  181. /**
  182. * set a video view for rendering
  183. * \param aVideoView instance of VLCVideoView
  184. * \note This setter is macOS only
  185. */
  186. - (void)setVideoView:(VLCVideoView *)aVideoView;
  187. /**
  188. * set a video layer for rendering
  189. * \param aVideoLayer instance of VLCVideoLayer
  190. * \note This setter is macOS only
  191. */
  192. - (void)setVideoLayer:(VLCVideoLayer *)aVideoLayer;
  193. #endif
  194. /**
  195. * set/retrieve a video view for rendering
  196. * This can be any UIView or NSView or instances of VLCVideoView / VLCVideoLayer if running on macOS
  197. */
  198. @property (strong) id drawable; /* The videoView or videoLayer */
  199. /**
  200. * Set/Get current video aspect ratio.
  201. *
  202. * param: psz_aspect new video aspect-ratio or NULL to reset to default
  203. * \note Invalid aspect ratios are ignored.
  204. * \return the video aspect ratio or NULL if unspecified
  205. * (the result must be released with free()).
  206. */
  207. @property (NS_NONATOMIC_IOSONLY) char *videoAspectRatio;
  208. /**
  209. * Set/Get current crop filter geometry.
  210. *
  211. * param: psz_geometry new crop filter geometry (NULL to unset)
  212. * \return the crop filter geometry or NULL if unset
  213. */
  214. @property (NS_NONATOMIC_IOSONLY) char *videoCropGeometry;
  215. /**
  216. * Set/Get the current video scaling factor.
  217. * That is the ratio of the number of pixels on
  218. * screen to the number of pixels in the original decoded video in each
  219. * dimension. Zero is a special value; it will adjust the video to the output
  220. * window/drawable (in windowed mode) or the entire screen.
  221. *
  222. * param: relative scale factor as float
  223. */
  224. @property (nonatomic) float scaleFactor;
  225. /**
  226. * Take a snapshot of the current video.
  227. *
  228. * If width AND height is 0, original size is used.
  229. * If width OR height is 0, original aspect-ratio is preserved.
  230. *
  231. * \param path the path where to save the screenshot to
  232. * \param width the snapshot's width
  233. * \param height the snapshot's height
  234. */
  235. - (void)saveVideoSnapshotAt:(NSString *)path withWidth:(int)width andHeight:(int)height;
  236. /**
  237. * Enable or disable deinterlace filter
  238. *
  239. * \param name of deinterlace filter to use (availability depends on underlying VLC version), NULL to disable.
  240. */
  241. - (void)setDeinterlaceFilter: (NSString *)name;
  242. /**
  243. * Enable or disable deinterlace and specify which filter to use
  244. *
  245. * \param deinterlace mode for deinterlacing: enable, disable or autos
  246. * \param name of deinterlace filter to use (availability depends on underlying VLC version).
  247. */
  248. - (void)setDeinterlace:(VLCDeinterlace)deinterlace withFilter:(NSString *)name;
  249. /**
  250. * Enable or disable adjust video filter (contrast, brightness, hue, saturation, gamma)
  251. *
  252. * \return bool value
  253. */
  254. @property (nonatomic) BOOL adjustFilterEnabled;
  255. /**
  256. * Set/Get the adjust filter's contrast value
  257. *
  258. * \return float value (range: 0-2, default: 1.0)
  259. */
  260. @property (nonatomic) float contrast;
  261. /**
  262. * Set/Get the adjust filter's brightness value
  263. *
  264. * \return float value (range: 0-2, default: 1.0)
  265. */
  266. @property (nonatomic) float brightness;
  267. /**
  268. * Set/Get the adjust filter's hue value
  269. *
  270. * \return float value (range: -180-180, default: 0.)
  271. */
  272. @property (nonatomic) float hue;
  273. /**
  274. * Set/Get the adjust filter's saturation value
  275. *
  276. * \return float value (range: 0-3, default: 1.0)
  277. */
  278. @property (nonatomic) float saturation;
  279. /**
  280. * Set/Get the adjust filter's gamma value
  281. *
  282. * \return float value (range: 0-10, default: 1.0)
  283. */
  284. @property (nonatomic) float gamma;
  285. /**
  286. * Get the requested movie play rate.
  287. * @warning Depending on the underlying media, the requested rate may be
  288. * different from the real playback rate. Due to limitations of some protocols
  289. * this option may not be taken into account at all, if set.
  290. *
  291. * \return movie play rate
  292. */
  293. @property (nonatomic) float rate;
  294. /**
  295. * an audio controller object
  296. * \return instance of VLCAudio
  297. */
  298. @property (nonatomic, readonly, weak) VLCAudio * audio;
  299. /* Video Information */
  300. /**
  301. * Get the current video size
  302. * \return video size as CGSize
  303. */
  304. @property (NS_NONATOMIC_IOSONLY, readonly) CGSize videoSize;
  305. /**
  306. * Does the current media have a video output?
  307. * \note a false return value doesn't mean that the video doesn't have any video
  308. * \note tracks. Those might just be disabled.
  309. * \return current video output status
  310. */
  311. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasVideoOut;
  312. /**
  313. * Frames per second
  314. * \deprecated provided for API compatibility only, to retrieve a media's FPS, use VLCMediaTracksInformationFrameRate.
  315. * \returns 0
  316. */
  317. @property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond __attribute__((deprecated));
  318. #pragma mark -
  319. #pragma mark time
  320. /**
  321. * Sets the current position (or time) of the feed.
  322. * \param value New time to set the current position to. If time is [VLCTime nullTime], 0 is assumed.
  323. */
  324. /**
  325. * Returns the current position (or time) of the feed.
  326. * \return VLCTime object with current time.
  327. */
  328. @property (NS_NONATOMIC_IOSONLY, strong) VLCTime *time;
  329. /**
  330. * Returns the current position (or time) of the feed, inversed if a duration is available
  331. * \return VLCTime object with requested time
  332. * \note VLCTime will be a nullTime if no duration can be calculated for the current input
  333. */
  334. @property (nonatomic, readonly, weak) VLCTime *remainingTime;
  335. #pragma mark -
  336. #pragma mark ES track handling
  337. /**
  338. * Return the current video track index
  339. *
  340. * \return current video track index, -1 if none or no media track
  341. *
  342. * Pass -1 to disable.
  343. */
  344. @property (readwrite) int currentVideoTrackIndex;
  345. /**
  346. * Returns the video track names, usually a language name or a description
  347. * It includes the "Disabled" fake track at index 0.
  348. */
  349. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackNames;
  350. /**
  351. * Returns the video track IDs
  352. * those are needed to set the video index
  353. */
  354. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackIndexes;
  355. /**
  356. * returns the number of video tracks available in the current media
  357. * \return number of tracks
  358. */
  359. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfVideoTracks;
  360. /**
  361. * Return the current video subtitle index
  362. *
  363. * \return current video subtitle index, -1 if none
  364. *
  365. * Pass -1 to disable.
  366. */
  367. @property (readwrite) int currentVideoSubTitleIndex;
  368. /**
  369. * Returns the video subtitle track names, usually a language name or a description
  370. * It includes the "Disabled" fake track at index 0.
  371. */
  372. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesNames;
  373. /**
  374. * Returns the video subtitle track IDs
  375. * those are needed to set the video subtitle index
  376. */
  377. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesIndexes;
  378. /**
  379. * returns the number of SPU tracks available in the current media
  380. * \return number of tracks
  381. */
  382. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfSubtitlesTracks;
  383. /**
  384. * Load and set a specific video subtitle, from a file.
  385. *
  386. * \deprecated use addPlaybackSlave:type:enforce: instead
  387. */
  388. - (BOOL)openVideoSubTitlesFromFile:(NSString *)path __attribute__((deprecated));
  389. /**
  390. * VLCMediaPlaybackNavigationAction describes actions which can be performed to navigate an interactive title
  391. */
  392. typedef NS_ENUM(unsigned, VLCMediaPlaybackSlaveType)
  393. {
  394. VLCMediaPlaybackSlaveTypeSubtitle = 0,
  395. VLCMediaPlaybackSlaveTypeAudio
  396. };
  397. /**
  398. * Add additional input sources to a playing media item
  399. * This way, you can add subtitles or audio files to an existing input stream
  400. * For the user, it will appear as if they were part of the existing stream
  401. * \param slaveURL of the content to be added
  402. * \param slaveType content type
  403. * \param enforceSelection switch to the added accessory content
  404. */
  405. - (int)addPlaybackSlave:(NSURL *)slaveURL type:(VLCMediaPlaybackSlaveType)slaveType enforce:(BOOL)enforceSelection;
  406. /**
  407. * Get the current subtitle delay. Positive values means subtitles are being
  408. * displayed later, negative values earlier.
  409. *
  410. * \return time (in microseconds) the display of subtitles is being delayed
  411. */
  412. @property (readwrite) NSInteger currentVideoSubTitleDelay;
  413. /**
  414. * Chapter selection and enumeration, it is bound
  415. * to a title option.
  416. */
  417. /**
  418. * Return the current chapter index
  419. * \return current chapter index or -1 if there is no chapter
  420. */
  421. @property (readwrite) int currentChapterIndex;
  422. /**
  423. * switch to the previous chapter
  424. */
  425. - (void)previousChapter;
  426. /**
  427. * switch to the next chapter
  428. */
  429. - (void)nextChapter;
  430. /**
  431. * returns the number of chapters for a given title
  432. * \param titleIndex the index of the title you are requesting the chapters for
  433. */
  434. - (int)numberOfChaptersForTitle:(int)titleIndex;
  435. /**
  436. * Chapters of a given title index
  437. * \deprecated Use chapterDescriptionsOfTitle instead
  438. */
  439. - (NSArray *)chaptersForTitleIndex:(int)titleIndex __attribute__((deprecated));
  440. /**
  441. * dictionary value for the user-facing chapter name
  442. */
  443. extern NSString *const VLCChapterDescriptionName;
  444. /**
  445. * dictionary value for the chapter's time offset
  446. */
  447. extern NSString *const VLCChapterDescriptionTimeOffset;
  448. /**
  449. * dictionary value for the chapter's duration
  450. */
  451. extern NSString *const VLCChapterDescriptionDuration;
  452. /**
  453. * chapter descriptions
  454. * an array of all chapters of the given title including information about
  455. * chapter name, time offset and duration
  456. * \note if no title value is provided, information about the chapters of the current title is returned
  457. * \return array describing the titles in details
  458. * \see VLCChapterDescriptionName
  459. * \see VLCChapterDescriptionTimeOffset
  460. * \see VLCChapterDescriptionDuration
  461. */
  462. - (NSArray *)chapterDescriptionsOfTitle:(int)titleIndex;
  463. /**
  464. * Return the current title index
  465. * \return title index currently playing, or -1 if none
  466. */
  467. @property (readwrite) int currentTitleIndex;
  468. /**
  469. * number of titles available for the current media
  470. * \return the number of titles
  471. */
  472. @property (readonly) int numberOfTitles;
  473. /**
  474. * count of titles
  475. * \deprecated Use numberOfTitles instead
  476. */
  477. @property (readonly) NSUInteger countOfTitles __attribute__((deprecated));
  478. /**
  479. * array of available titles
  480. * \deprecated Use titleDescriptions instead
  481. */
  482. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titles __attribute__((deprecated));
  483. /**
  484. * dictionary value for the user-facing title name
  485. */
  486. extern NSString *const VLCTitleDescriptionName;
  487. /**
  488. * dictionary value for the title's duration
  489. */
  490. extern NSString *const VLCTitleDescriptionDuration;
  491. /**
  492. * dictionary value whether the title is a menu or not
  493. */
  494. extern NSString *const VLCTitleDescriptionIsMenu;
  495. /**
  496. * title descriptions
  497. * an array of all titles of the current media including information
  498. * of name, duration and potential menu state
  499. * \return array describing the titles in details
  500. * \see VLCTitleDescriptionName
  501. * \see VLCTitleDescriptionDuration
  502. * \see VLCTitleDescriptionIsMenu
  503. */
  504. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *titleDescriptions;
  505. /**
  506. * the title with the longest duration
  507. * \return int matching the title index
  508. */
  509. @property (readonly) int indexOfLongestTitle;
  510. /* Audio Options */
  511. /**
  512. * Return the current audio track index
  513. *
  514. * \return current audio track index, -1 if none or no media track
  515. *
  516. * Pass -1 to disable.
  517. */
  518. @property (readwrite) int currentAudioTrackIndex;
  519. /**
  520. * Returns the audio track names, usually a language name or a description
  521. * It includes the "Disabled" fake track at index 0.
  522. */
  523. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackNames;
  524. /**
  525. * Returns the audio track IDs
  526. * those are needed to set the video index
  527. */
  528. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackIndexes;
  529. /**
  530. * returns the number of audio tracks available in the current media
  531. * \return number of tracks
  532. */
  533. @property (NS_NONATOMIC_IOSONLY, readonly) int numberOfAudioTracks;
  534. #pragma mark -
  535. #pragma mark audio functionality
  536. /**
  537. * sets / returns the current audio channel
  538. * \return the currently set audio channel
  539. */
  540. @property (NS_NONATOMIC_IOSONLY) int audioChannel;
  541. /**
  542. * Get the current audio delay. Positive values means audio is delayed further,
  543. * negative values less.
  544. *
  545. * \return time (in microseconds) the audio playback is being delayed
  546. */
  547. @property (readwrite) NSInteger currentAudioPlaybackDelay;
  548. #pragma mark -
  549. #pragma mark equalizer
  550. /**
  551. * Get a list of available equalizer profiles
  552. * \note Current versions do not allow the addition of further profiles
  553. * so you need to handle this in your app.
  554. *
  555. * \return array of equalizer profiles
  556. */
  557. @property (weak, readonly) NSArray *equalizerProfiles;
  558. /**
  559. * Re-set the equalizer to a profile retrieved from the list
  560. * \note This doesn't enable the Equalizer automagically
  561. */
  562. - (void)resetEqualizerFromProfile:(unsigned)profile;
  563. /**
  564. * Toggle equalizer state
  565. * param: bool value to enable/disable the equalizer
  566. * \note this can fail, if failed the value will not be changed
  567. * \return current state */
  568. @property (readwrite) BOOL equalizerEnabled;
  569. /**
  570. * Set amplification level
  571. * param: The supplied amplification value will be clamped to the -20.0 to +20.0 range.
  572. * \note this will create and enabled an Equalizer instance if not present
  573. * \return current amplification level */
  574. @property (readwrite) CGFloat preAmplification;
  575. /**
  576. * Number of equalizer bands
  577. * \return the number of equalizer bands available in the current release */
  578. @property (readonly) unsigned numberOfBands;
  579. /**
  580. * frequency of equalizer band
  581. * \param index the band index
  582. * \return frequency of the requested equalizer band */
  583. - (CGFloat)frequencyOfBandAtIndex:(unsigned)index;
  584. /**
  585. * set amplification for band
  586. * \param amplification value (clamped to the -20.0 to +20.0 range)
  587. * \param index of the respective band */
  588. - (void)setAmplification:(CGFloat)amplification forBand:(unsigned)index;
  589. /**
  590. * amplification of band
  591. * \param index of the band
  592. * \return current amplification value (clamped to the -20.0 to +20.0 range) */
  593. - (CGFloat)amplificationOfBand:(unsigned)index;
  594. #pragma mark -
  595. #pragma mark media handling
  596. /* Media Options */
  597. /**
  598. * The currently media instance set to play
  599. */
  600. @property (NS_NONATOMIC_IOSONLY, strong) VLCMedia *media;
  601. #pragma mark -
  602. #pragma mark playback operations
  603. /**
  604. * Plays a media resource using the currently selected media controller (or
  605. * default controller. If feed was paused then the feed resumes at the position
  606. * it was paused in.
  607. */
  608. - (void)play;
  609. /**
  610. * Set the pause state of the feed. Do nothing if already paused.
  611. */
  612. - (void)pause;
  613. /**
  614. * Stop the playing.
  615. */
  616. - (void)stop;
  617. /**
  618. * Advance one frame.
  619. */
  620. - (void)gotoNextFrame;
  621. /**
  622. * Fast forwards through the feed at the standard 1x rate.
  623. */
  624. - (void)fastForward;
  625. /**
  626. * Fast forwards through the feed at the rate specified.
  627. * \param rate Rate at which the feed should be fast forwarded.
  628. */
  629. - (void)fastForwardAtRate:(float)rate;
  630. /**
  631. * Rewinds through the feed at the standard 1x rate.
  632. */
  633. - (void)rewind;
  634. /**
  635. * Rewinds through the feed at the rate specified.
  636. * \param rate Rate at which the feed should be fast rewound.
  637. */
  638. - (void)rewindAtRate:(float)rate;
  639. /**
  640. * Jumps shortly backward in current stream if seeking is supported.
  641. * \param interval to skip, in sec.
  642. */
  643. - (void)jumpBackward:(int)interval;
  644. /**
  645. * Jumps shortly forward in current stream if seeking is supported.
  646. * \param interval to skip, in sec.
  647. */
  648. - (void)jumpForward:(int)interval;
  649. /**
  650. * Jumps shortly backward in current stream if seeking is supported.
  651. */
  652. - (void)extraShortJumpBackward;
  653. /**
  654. * Jumps shortly forward in current stream if seeking is supported.
  655. */
  656. - (void)extraShortJumpForward;
  657. /**
  658. * Jumps shortly backward in current stream if seeking is supported.
  659. */
  660. - (void)shortJumpBackward;
  661. /**
  662. * Jumps shortly forward in current stream if seeking is supported.
  663. */
  664. - (void)shortJumpForward;
  665. /**
  666. * Jumps shortly backward in current stream if seeking is supported.
  667. */
  668. - (void)mediumJumpBackward;
  669. /**
  670. * Jumps shortly forward in current stream if seeking is supported.
  671. */
  672. - (void)mediumJumpForward;
  673. /**
  674. * Jumps shortly backward in current stream if seeking is supported.
  675. */
  676. - (void)longJumpBackward;
  677. /**
  678. * Jumps shortly forward in current stream if seeking is supported.
  679. */
  680. - (void)longJumpForward;
  681. /**
  682. * performs navigation actions on interactive titles
  683. */
  684. - (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
  685. /**
  686. * Updates viewpoint with given values.
  687. * \param yaw view point yaw in degrees ]-180;180]
  688. * \param pitch view point pitch in degrees ]-90;90]
  689. * \param roll view point roll in degrees ]-180;180]
  690. * \param fov field of view in degrees ]0;180[ (default 80.)
  691. * \param absolute if true replace the old viewpoint with the new one. If
  692. * false, increase/decrease it.
  693. * \return NO in case of error, YES otherwise
  694. * \note This will create a viewpoint instance if not present.
  695. */
  696. - (BOOL)updateViewpoint:(float)yaw pitch:(float)pitch roll:(float)roll fov:(float)fov absolute:(BOOL)absolute;
  697. /**
  698. * Get the view point yaw in degrees
  699. *
  700. * \return view point yaw in degrees ]-180;180]
  701. */
  702. @property (nonatomic) float yaw;
  703. /**
  704. * Get the view point pitch in degrees
  705. *
  706. * \return view point pitch in degrees ]-90;90]
  707. */
  708. @property (nonatomic) float pitch;
  709. /**
  710. * Get the view point roll in degrees
  711. *
  712. * \return view point roll in degrees ]-180;180]
  713. */
  714. @property (nonatomic) float roll;
  715. /**
  716. * Set/Get the adjust filter's gamma value
  717. *
  718. * \return field of view in degrees ]0;180[ (default 80.)
  719. */
  720. @property (nonatomic) float fov;
  721. #pragma mark -
  722. #pragma mark playback information
  723. /**
  724. * Playback state flag identifying that the stream is currently playing.
  725. * \return TRUE if the feed is playing, FALSE if otherwise.
  726. */
  727. @property (NS_NONATOMIC_IOSONLY, getter=isPlaying, readonly) BOOL playing;
  728. /**
  729. * Playback state flag identifying wheather the stream will play.
  730. * \return TRUE if the feed is ready for playback, FALSE if otherwise.
  731. */
  732. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL willPlay;
  733. /**
  734. * Playback's current state.
  735. * \see VLCMediaState
  736. */
  737. @property (NS_NONATOMIC_IOSONLY, readonly) VLCMediaPlayerState state;
  738. /**
  739. * Returns the receiver's position in the reading.
  740. * \return movie position as percentage between 0.0 and 1.0.
  741. */
  742. @property (NS_NONATOMIC_IOSONLY) float position;
  743. /**
  744. * Set movie position. This has no effect if playback is not enabled.
  745. * \note movie position as percentage between 0.0 and 1.0.
  746. */
  747. @property (NS_NONATOMIC_IOSONLY, getter=isSeekable, readonly) BOOL seekable;
  748. /**
  749. * property whether the currently playing media can be paused (or not)
  750. * \return BOOL value
  751. */
  752. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL canPause;
  753. /**
  754. * Array of taken snapshots of the current video output
  755. * \return a NSArray of NSString instances containing the names
  756. * \note This property is not available to macOS
  757. */
  758. @property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *snapshots;
  759. #if TARGET_OS_IPHONE
  760. /**
  761. * Get last snapshot available.
  762. * \return an UIImage with the last snapshot available.
  763. * \note return value is nil if there is no snapshot
  764. * \note This property is not available to macOS
  765. */
  766. @property (NS_NONATOMIC_IOSONLY, readonly) UIImage *lastSnapshot;
  767. #else
  768. /**
  769. * Get last snapshot available.
  770. * \return an NSImage with the last snapshot available.
  771. * \note return value is nil if there is no snapshot
  772. * \note This property is not available to iOS and tvOS
  773. */
  774. @property (NS_NONATOMIC_IOSONLY, readonly) NSImage *lastSnapshot;
  775. #endif
  776. /**
  777. * Start recording at given **directory** path
  778. * \param path directory where the recording should go
  779. * \return an BOOL with the success status
  780. */
  781. - (BOOL)startRecordingAtPath:(NSString *)path;
  782. /**
  783. * Stop current recording
  784. * \return an BOOL with the success status
  785. */
  786. - (BOOL)stopRecording;
  787. #pragma mark -
  788. #pragma mark Renderer
  789. /**
  790. * Sets a `VLCRendererItem` to the current media player
  791. * \param item `VLCRendererItem` discovered by `VLCRendererDiscoverer`
  792. * \return `YES` if successful, `NO` otherwise
  793. * \note Must be called before the first call of `play` to take effect
  794. * \see VLCRendererDiscoverer
  795. * \see VLCRendererItem
  796. */
  797. - (BOOL)setRendererItem:(VLCRendererItem *)item;
  798. @end