VLCMediaPlayer.h 26 KB

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