VLC  4.0.0-dev
vlc_player.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_player.h: player interface
3  *****************************************************************************
4  * Copyright (C) 2018 VLC authors and VideoLAN
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20 
21 #ifndef VLC_PLAYER_H
22 #define VLC_PLAYER_H 1
23 
24 #include <vlc_input.h>
25 #include <vlc_aout.h>
26 
27 /**
28  * @defgroup vlc_player Player
29  * @ingroup input
30  * VLC Player API
31  * @brief
32 @dot
33 digraph player_states {
34  label="Player state diagram";
35  new [style="invis"];
36  started [label="Started" URL="@ref VLC_PLAYER_STATE_STARTED"];
37  playing [label="Playing" URL="@ref VLC_PLAYER_STATE_PLAYING"];
38  paused [label="Paused" URL="@ref VLC_PLAYER_STATE_PAUSED"];
39  stopping [label="Stopping" URL="@ref VLC_PLAYER_STATE_STOPPING"];
40  stopped [label="Stopped" URL="@ref VLC_PLAYER_STATE_STOPPED"];
41  new -> stopped [label="vlc_player_New()" URL="@ref vlc_player_New" fontcolor="green3"];
42  started -> playing [style="dashed" label=<<i>internal transition</i>>];
43  started -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
44  playing -> paused [label="vlc_player_Pause()" URL="@ref vlc_player_Pause" fontcolor="blue"];
45  paused -> playing [label="vlc_player_Resume()" URL="@ref vlc_player_Resume" fontcolor="blue3"];
46  paused -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
47  playing -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
48  stopping -> stopped [style="dashed" label=<<i>internal transition</i>>];
49  stopped -> started [label="vlc_player_Start()" URL="@ref vlc_player_Start" fontcolor="darkgreen"];
50 }
51 @enddot
52  * @{
53  * @file
54  * VLC Player API
55  */
56 
57 /**
58  * @defgroup vlc_player__instance Player instance
59  * @{
60  */
61 
62 /**
63  * Player opaque structure.
64  */
65 typedef struct vlc_player_t vlc_player_t;
66 
67 /**
68  * Player lock type (normal or reentrant)
69  */
71 {
72  /**
73  * Normal lock
74  *
75  * If the player is already locked, subsequent calls to vlc_player_Lock()
76  * will deadlock.
77  */
79 
80  /**
81  * Reentrant lock
82  *
83  * If the player is already locked, subsequent calls to vlc_player_Lock()
84  * will still succeed. To unlock the player, one call to
85  * vlc_player_Unlock() per vlc_player_Lock() is necessary.
86  */
88 };
89 
90 /**
91  * Action when the player is stopped
92  *
93  * @see vlc_player_SetMediaStoppedAction()
94  */
96  /** Continue (or stop if there is no next media), default behavior */
98  /** Pause when reaching the end of file */
100  /** Stop, even if there is a next media to play */
102  /** Exit VLC */
104 };
105 
106 /**
107  * Callbacks for the owner of the player.
108  *
109  * These callbacks are needed to control the player flow (via the
110  * vlc_playlist_t as a owner for example). It can only be set when creating the
111  * player via vlc_player_New().
112  *
113  * All callbacks are called with the player locked (cf. vlc_player_Lock()), and
114  * from any thread (even the current one).
115  */
117 {
118  /**
119  * Called when the player requires a new media
120  *
121  * @note The returned media must be already held with input_item_Hold()
122  *
123  * @param player locked player instance
124  * @param data opaque pointer set from vlc_player_New()
125  * @return the next media to play, held by the callee with input_item_Hold()
126  */
127  input_item_t *(*get_next)(vlc_player_t *player, void *data);
128 };
129 
130 /**
131  * Create a new player instance
132  *
133  * @param parent parent VLC object
134  * @param media_provider pointer to a media_provider structure or NULL, the
135  * structure must be valid during the lifetime of the player
136  * @param media_provider_data opaque data used by provider callbacks
137  * @return a pointer to a valid player instance or NULL in case of error
138  */
140 vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type,
141  const struct vlc_player_media_provider *media_provider,
142  void *media_provider_data);
143 
144 /**
145  * Delete a player instance
146  *
147  * This function stop any playback previously started and wait for their
148  * termination.
149  *
150  * @warning Blocking function if the player state is not STOPPED, don't call it
151  * from an UI thread in that case.
152  *
153  * @param player unlocked player instance created by vlc_player_New()
154  */
155 VLC_API void
157 
158 /**
159  * Lock the player.
160  *
161  * All player functions (except vlc_player_Delete()) need to be called while
162  * the player lock is held.
163  *
164  * @param player unlocked player instance
165  */
166 VLC_API void
168 
169 /**
170  * Unlock the player
171  *
172  * @param player locked player instance
173  */
174 VLC_API void
176 
177 /**
178  * Wait on a condition variable
179  *
180  * This call allow users to use their own condition with the player mutex.
181  *
182  * @param player locked player instance
183  * @param cond external condition
184  */
185 VLC_API void
187 
188 /**
189  * Setup an action when a media is stopped
190  *
191  * @param player locked player instance
192  * @param action action to do when a media is stopped
193  */
194 VLC_API void
196  enum vlc_player_media_stopped_action action);
197 
198 /**
199  * Ask to start in a paused state
200  *
201  * This function can be used before vlc_player_Start()
202  *
203  * @param player locked player instance
204  * @param start_paused true to start in a paused state, false to cancel it
205  */
206 VLC_API void
207 vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused);
208 
209 /**
210  * Enable or disable pause on cork event
211  *
212  * If enabled, the player will automatically pause and resume on cork events.
213  * In that case, cork events won't be propagated via callbacks.
214  * @see vlc_player_cbs.on_cork_changed
215  *
216  * @param player locked player instance
217  * @param enabled true to enable
218  */
219 VLC_API void
220 vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
221 
222 /** @} vlc_player__instance */
223 
224 /**
225  * @defgroup vlc_player__playback Playback control
226  * @{
227  */
228 
229 /**
230  * State of the player
231  *
232  * During a normal playback (no errors), the user is expected to receive all
233  * events in the following order: STARTED, PLAYING, STOPPING, STOPPED.
234  *
235  * @note When playing more than one media in a row, the player stay at the
236  * PLAYING state when doing the transition from the current media to the next
237  * media (that can be gapless). This means that STOPPING, STOPPED states (for
238  * the current media) and STARTED, PLAYING states (for the next one) won't be
239  * sent. Nevertheless, the vlc_player_cbs.on_current_media_changed callback
240  * will be called during this transition.
241  */
242 enum vlc_player_state
243 {
244  /**
245  * The player is stopped
246  *
247  * Initial state, or triggered by an internal transition from the STOPPING
248  * state.
249  */
252  /**
253  * The player is started
254  *
255  * Triggered by vlc_player_Start()
256  */
259  /**
260  * The player is playing
261  *
262  * Triggered by vlc_player_Resume() or by an internal transition from the
263  * STARTED state.
264  */
267  /**
268  * The player is paused
269  *
270  * Triggered by vlc_player_Pause().
271  */
274  /**
275  * The player is stopping
276  *
277  * Triggered by vlc_player_Stop(), vlc_player_SetCurrentMedia() or by an
278  * internal transition (when the media reach the end of file for example).
279  */
281 };
282 
283 /**
284  * Error of the player
285  *
286  * @see vlc_player_GetError()
287  */
288 enum vlc_player_error
289 {
292 };
293 
294 /**
295  * Seek speed type
296  *
297  * @see vlc_player_SeekByPos()
298  * @see vlc_player_SeekByTime()
299  */
301 {
302  /** Do a precise seek */
304  /** Do a fast seek */
306 };
307 
308 /**
309  * Player seek/delay directive
310  *
311  * @see vlc_player_SeekByPos()
312  * @see vlc_player_SeekByTime()
313  * @see vlc_player_SetCategoryDelay()
314  */
316 {
317  /** Given time/position */
319  /** The current position +/- the given time/position */
321 };
322 
323 /**
324  * Menu (VCD/DVD/BD) and viewpoint navigations
325  *
326  * @see vlc_player_Navigate()
327  */
328 enum vlc_player_nav
329 {
330  /** Activate the navigation item selected */
332  /** Select a navigation item above or move the viewpoint up */
334  /** Select a navigation item under or move the viewpoint down */
336  /** Select a navigation item on the left or move the viewpoint left */
338  /** Select a navigation item on the right or move the viewpoint right */
340  /** Activate the popup Menu (for BD) */
342  /** Activate disc Root Menu */
344 };
345 
346 /**
347  * A to B loop state
348  */
350 {
354 };
355 
356 /** Player capability: can seek */
357 #define VLC_PLAYER_CAP_SEEK (1<<0)
358 /** Player capability: can pause */
359 #define VLC_PLAYER_CAP_PAUSE (1<<1)
360 /** Player capability: can change the rate */
361 #define VLC_PLAYER_CAP_CHANGE_RATE (1<<2)
362 /** Player capability: can seek back */
363 #define VLC_PLAYER_CAP_REWIND (1<<3)
365 /** Player teletext key: Red */
366 #define VLC_PLAYER_TELETEXT_KEY_RED ('r' << 16)
367 /** Player teletext key: Green */
368 #define VLC_PLAYER_TELETEXT_KEY_GREEN ('g' << 16)
369 /** Player teletext key: Yellow */
370 #define VLC_PLAYER_TELETEXT_KEY_YELLOW ('y' << 16)
371 /** Player teletext key: Blue */
372 #define VLC_PLAYER_TELETEXT_KEY_BLUE ('b' << 16)
373 /** Player teletext key: Index */
374 #define VLC_PLAYER_TELETEXT_KEY_INDEX ('i' << 16)
376 /**
377  * Set the current media
378  *
379  * This function replaces the current and next medias.
380  *
381  * @note A successful call will always result of
382  * vlc_player_cbs.on_current_media_changed being called. This function is not
383  * blocking. If a media is currently being played, this media will be stopped
384  * and the requested media will be set after.
385  *
386  * @warning This function is either synchronous (if the player state is
387  * STOPPED) or asynchronous. In the later case, vlc_player_GetCurrentMedia()
388  * will return the old media, even after this call, and until the
389  * vlc_player_cbs.on_current_media_changed is called.
390  *
391  * @param player locked player instance
392  * @param media new media to play (will be held by the player)
393  * @return VLC_SUCCESS or a VLC error code
394  */
395 VLC_API int
397 
398 /**
399  * Get the current played media.
400  *
401  * @see vlc_player_cbs.on_current_media_changed
402  *
403  * @param player locked player instance
404  * @return a valid media or NULL (if no media is set)
405  */
408 
409 /**
410  * Helper that hold the current media
411  */
412 static inline input_item_t *
414 {
416  return item ? input_item_Hold(item) : NULL;
417 }
418 
419 /**
420  * Invalidate the next media.
421  *
422  * This function can be used to invalidate the media returned by the
423  * vlc_player_media_provider.get_next callback. This can be used when the next
424  * item from a playlist was changed by the user.
425  *
426  * Calling this function will trigger the
427  * vlc_player_media_provider.get_next callback to be called again.
428  *
429  * @param player locked player instance
430  */
431 VLC_API void
433 
434 /**
435  * Start the playback of the current media.
436  *
437  * @param player locked player instance
438  * @return VLC_SUCCESS or a VLC error code
439  */
440 VLC_API int
442 
443 /**
444  * Stop the playback of the current media
445  *
446  * @note This function is asynchronous. Users should wait on
447  * STOPPED state event to know when the stop is finished.
448  *
449  * @param player locked player instance
450  */
451 VLC_API void
453 
454 /**
455  * Pause the playback
456  *
457  * @param player locked player instance
458  */
459 VLC_API void
461 
462 /**
463  * Resume the playback from a pause
464  *
465  * @param player locked player instance
466  */
467 VLC_API void
469 
470 /**
471  * Pause and display the next video frame
472  *
473  * @param player locked player instance
474  */
475 VLC_API void
477 
478 /**
479  * Get the state of the player
480  *
481  * @note Since all players actions are asynchronous, this function won't
482  * reflect the new state immediately. Wait for the
483  * vlc_players_cbs.on_state_changed event to be notified.
484  *
485  * @see vlc_player_state
486  * @see vlc_player_cbs.on_state_changed
487  *
488  * @param player locked player instance
489  * @return the current player state
490  */
493 
494 /**
495  * Get the error state of the player
496  *
497  * @see vlc_player_cbs.on_capabilities_changed
498  *
499  * @param player locked player instance
500  * @return the current error state
501  */
504 
505 /**
506  * Helper to get the started state
507  */
508 static inline bool
510 {
511  switch (vlc_player_GetState(player))
512  {
516  return true;
517  default:
518  return false;
519  }
520 }
521 
522 /**
523  * Helper to get the paused state
524  */
525 static inline bool
527 {
529 }
530 
531 /**
532  * Helper to toggle the pause state
533  */
534 static inline void
536 {
537  if (vlc_player_IsStarted(player))
538  {
539  if (vlc_player_IsPaused(player))
540  vlc_player_Resume(player);
541  else
542  vlc_player_Pause(player);
543  }
544 }
545 
546 /**
547  * Get the player capabilities
548  *
549  * @see vlc_player_cbs.on_capabilities_changed
550  *
551  * @param player locked player instance
552  * @return the player capabilities, a bitwise mask of @ref VLC_PLAYER_CAP_SEEK,
553  * @ref VLC_PLAYER_CAP_PAUSE, @ref VLC_PLAYER_CAP_CHANGE_RATE, @ref
554  * VLC_PLAYER_CAP_REWIND
555  */
556 VLC_API int
558 
559 /**
560  * Helper to get the seek capability
561  */
562 static inline bool
564 {
566 }
567 
568 /**
569  * Helper to get the pause capability
570  */
571 static inline bool
573 {
575 }
576 
577 /**
578  * Helper to get the change-rate capability
579  */
580 static inline bool
582 {
584 }
585 
586 /**
587  * Helper to get the rewindable capability
588  */
589 static inline bool
591 {
593 }
594 
595 /**
596  * Get the rate of the player
597  *
598  * @see vlc_player_cbs.on_rate_changed
599  *
600  * @param player locked player instance
601  * @return rate of the player (< 1.f is slower, > 1.f is faster)
602  */
603 VLC_API float
605 
606 /**
607  * Change the rate of the player
608  *
609  * @note The rate is saved across several medias
610  *
611  * @param player locked player instance
612  * @param rate new rate (< 1.f is slower, > 1.f is faster)
613  */
614 VLC_API void
615 vlc_player_ChangeRate(vlc_player_t *player, float rate);
616 
617 /**
618  * Increment the rate of the player (faster)
619  *
620  * @param player locked player instance
621  */
622 VLC_API void
624 
625 /**
626  * Decrement the rate of the player (Slower)
627  *
628  * @param player locked player instance
629  */
630 VLC_API void
632 
633 /**
634  * Get the length of the current media
635  *
636  * @note A started and playing media doesn't have necessarily a valid length.
637  *
638  * @see vlc_player_cbs.on_length_changed
639  *
640  * @param player locked player instance
641  * @return a valid length or VLC_TICK_INVALID (if no media is set,
642  * playback is not yet started or in case of error)
643  */
646 
647 /**
648  * Get the time of the current media
649  *
650  * @note A started and playing media doesn't have necessarily a valid time.
651  *
652  * @see vlc_player_cbs.on_position_changed
653  *
654  * @param player locked player instance
655  * @return a valid time or VLC_TICK_INVALID (if no media is set, the media
656  * doesn't have any time, if playback is not yet started or in case of error)
657  */
660 
661 /**
662  * Get the position of the current media
663  *
664  * @see vlc_player_cbs.on_position_changed
665  *
666  * @param player locked player instance
667  * @return a valid position in the range [0.f;1.f] or -1.f (if no media is
668  * set,if playback is not yet started or in case of error)
669  */
670 VLC_API float
672 
673 /**
674  * Seek the current media by position
675  *
676  * @note This function can be called before vlc_player_Start() in order to set
677  * a starting position.
678  *
679  * @param player locked player instance
680  * @param position position in the range [0.f;1.f]
681  * @param speed precise of fast
682  * @param whence absolute or relative
683  */
684 VLC_API void
685 vlc_player_SeekByPos(vlc_player_t *player, float position,
686  enum vlc_player_seek_speed speed,
687  enum vlc_player_whence whence);
688 
689 /**
690  * Seek the current media by time
691  *
692  * @note This function can be called before vlc_player_Start() in order to set
693  * a starting position.
694  *
695  * @warning This function has an effect only if the media has a valid length.
696  *
697  * @param player locked player instance
698  * @param time a time in the range [0;length]
699  * @param speed precise of fast
700  * @param whence absolute or relative
701  */
702 VLC_API void
704  enum vlc_player_seek_speed speed,
705  enum vlc_player_whence whence);
706 
707 /**
708  * Helper to set the absolute position precisely
709  */
710 static inline void
711 vlc_player_SetPosition(vlc_player_t *player, float position)
712 {
715 }
716 
717 /**
718  * Helper to set the absolute position fast
719  */
720 static inline void
721 vlc_player_SetPositionFast(vlc_player_t *player, float position)
722 {
723  vlc_player_SeekByPos(player, position, VLC_PLAYER_SEEK_FAST,
725 }
726 
727 /**
728  * Helper to jump the position precisely
729  */
730 static inline void
731 vlc_player_JumpPos(vlc_player_t *player, float jumppos)
732 {
733  /* No fask seek for jumps. Indeed, jumps can seek to the current position
734  * if not precise enough or if the jump value is too small. */
737 }
738 
739 /**
740  * Helper to set the absolute time precisely
741  */
742 static inline void
744 {
747 }
748 
749 /**
750  * Helper to set the absolute time fast
751  */
752 static inline void
754 {
757 }
758 
759 /**
760  * Helper to jump the time precisely
761  */
762 static inline void
764 {
765  /* No fask seek for jumps. Indeed, jumps can seek to the current position
766  * if not precise enough or if the jump value is too small. */
769 }
770 
771 /**
772  * Display the player position on the vout OSD
773  *
774  * @param player locked player instance
775  */
776 VLC_API void
778 
779 /**
780  * Enable A to B loop of the current media
781  *
782  * This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and
783  * VLC_PLAYER_ABLOOP_B to setup an A to B loop. It current the current
784  * time/position when called. The B time must be higher than the A time.
785  *
786  * @param player locked player instance
787  * @return VLC_SUCCESS or a VLC error code
788  */
789 VLC_API int
791 
792 /**
793  * Get the A to B loop status
794  *
795  * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
796  * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
797  * output parameters are valid. If the returned status is
798  * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
799  *
800  * @see vlc_player_cbs.on_atobloop_changed
801  *
802  * @param player locked player instance
803  * @param a_time A time or VLC_TICK_INVALID (if the media doesn't have valid
804  * times)
805  * @param a_pos A position
806  * @param b_time B time or VLC_TICK_INVALID (if the media doesn't have valid
807  * times)
808  * @param b_pos B position
809  * @return A to B loop status
810  */
812 vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, float *a_pos,
813  vlc_tick_t *b_time, float *b_pos);
814 
815 /**
816  * Navigate (for DVD/Bluray menus or viewpoint)
817  *
818  * @param player locked player instance
819  * @param nav navigation key
820  */
821 VLC_API void
823 
824 /**
825  * Update the viewpoint
826  *
827  * @param player locked player instance
828  * @param viewpoint the viewpoint value
829  * @param whence absolute or relative
830  * @return VLC_SUCCESS or a VLC error code
831  */
832 VLC_API void
834  const vlc_viewpoint_t *viewpoint,
835  enum vlc_player_whence whence);
836 
837 /**
838  * Check if the playing is recording
839  *
840  * @see vlc_player_cbs.on_recording_changed
841  *
842  * @param player locked player instance
843  * @return true if the player is recording
844  */
845 VLC_API bool
847 
848 /**
849  * Enable or disable recording for the current media
850  *
851  * @note A successful call will trigger the vlc_player_cbs.on_recording_changed
852  * event.
853  *
854  * @param player locked player instance
855  * @param enabled true to enable recording
856  */
857 VLC_API void
858 vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled);
859 
860 /**
861  * Helper to toggle the recording state
862  */
863 static inline void
865 {
867 }
868 
869 /**
870  * Add an associated (or external) media to the current media
871  *
872  * @param player locked player instance
873  * @param cat AUDIO_ES or SPU_ES
874  * @param uri absolute uri of the external media
875  * @param select true to select the track of this external media
876  * @param notify true to notify the OSD
877  * @param check_ext true to check subtitles extension
878  */
879 VLC_API int
881  enum es_format_category_e cat, const char *uri,
882  bool select, bool notify, bool check_ext);
883 
884 /**
885  * Get the signal quality and strength of the current media
886  *
887  * @param player locked player instance
888  */
889 VLC_API int
890 vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength);
891 
892 /**
893  * Get the statistics of the current media
894  *
895  * @warning The returned pointer becomes invalid when the player is unlocked.
896  * The referenced structure can be safely copied.
897  *
898  * @see vlc_player_cbs.on_statistics_changed
899  *
900  * @param player locked player instance
901  * @return pointer to the player stats structure or NULL
902  */
903 VLC_API const struct input_stats_t *
905 
906 /**
907  * Get the V4L2 object used to do controls
908  *
909  * @param player locked player instance
910  * @return the V4L2 object or NULL if not any. This object must be used with
911  * the player lock held.
912  */
915 
916 /** @} vlc_player__playback */
917 
918 /**
919  * @defgroup vlc_player__titles Title and chapter control
920  * @{
921  */
922 
923 /**
924  * Player chapter structure
925  */
926 struct vlc_player_chapter
927 {
928  /** Chapter name, always valid */
929  const char *name;
930  /** Position of this chapter */
931  vlc_tick_t time;
932 };
933 
934 /** vlc_player_title.flags: The title is a menu. */
935 #define VLC_PLAYER_TITLE_MENU 0x01
936 /** vlc_player_title.flags: The title is interactive. */
937 #define VLC_PLAYER_TITLE_INTERACTIVE 0x02
939 /** Player title structure */
940 struct vlc_player_title
941 {
942  /** Title name, always valid */
943  const char *name;
944  /** Length of the title */
945  vlc_tick_t length;
946  /** Bit flag of @ref VLC_PLAYER_TITLE_MENU and @ref
947  * VLC_PLAYER_TITLE_INTERACTIVE */
948  unsigned flags;
949  /** Number of chapters, can be 0 */
950  size_t chapter_count;
951  /** Array of chapters, can be NULL */
952  const struct vlc_player_chapter *chapters;
953 };
954 
955 /**
956  * Opaque structure representing a list of @ref vlc_player_title.
957  *
958  * @see vlc_player_GetTitleList()
959  * @see vlc_player_title_list_GetCount()
960  * @see vlc_player_title_list_GetAt()
961  */
964 /**
965  * Hold the title list of the player
966  *
967  * This function can be used to pass this title list from a callback to an
968  * other thread.
969  *
970  * @see vlc_player_cbs.on_titles_changed
971  *
972  * @return the same instance
973  */
976 
977 /**
978  * Release of previously held title list
979  */
980 VLC_API void
982 
983 /**
984  * Get the number of title of a list
985  */
986 VLC_API size_t
988 
989 /**
990  * Get the title at a given index
991  *
992  * @param idx index in the range [0; count[
993  * @return a valid title (can't be NULL)
994  */
995 VLC_API const struct vlc_player_title *
997 
998 /**
999  * Get the title list of the current media
1000  *
1001  * @see vlc_player_cbs.on_titles_changed
1002  *
1003  * @param player locked player instance
1004  */
1007 
1008 /**
1009  * Get the selected title index for the current media
1010  *
1011  * @see vlc_player_cbs.on_title_selection_changed
1012  *
1013  * @param player locked player instance
1014  */
1015 VLC_API ssize_t
1017 
1018 /**
1019  * Helper to get the current selected title
1020  */
1021 static inline const struct vlc_player_title *
1025  if (!titles)
1026  return NULL;
1027  ssize_t selected_idx = vlc_player_GetSelectedTitleIdx(player);
1028  if (selected_idx < 0)
1029  return NULL;
1030  return vlc_player_title_list_GetAt(titles, selected_idx);
1031 }
1032 
1033 /**
1034  * Select a title index for the current media
1035  *
1036  * @note A successful call will trigger the
1037  * vlc_player_cbs.on_title_selection_changed event.
1038  *
1039  * @see vlc_player_title_list_GetAt()
1040  * @see vlc_player_title_list_GetCount()
1041  *
1042  * @param player locked player instance
1043  * @param index valid index in the range [0;count[
1044  */
1045 VLC_API void
1046 vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index);
1047 
1048 /**
1049  * Select a title for the current media
1050  *
1051  * @note A successful call will trigger the
1052  * vlc_player_cbs.on_title_selection_changed event.
1053  *
1054  * @see vlc_player_title_list_GetAt()
1055  * @see vlc_player_title_list_GetCount()
1056  *
1057  * @param player locked player instance
1058  * @param title a valid title coming from the vlc_player_title_list
1059  */
1060 VLC_API void
1062  const struct vlc_player_title *title);
1063 
1064 /**
1065  * Select a chapter for the current media
1066  *
1067  * @note A successful call will trigger the
1068  * vlc_player_cbs.on_chapter_selection_changed event.
1069  *
1070  * @param player locked player instance
1071  * @param title the selected title
1072  * @param chapter_idx index from vlc_player_title.chapters
1073  */
1074 VLC_API void
1076  const struct vlc_player_title *title,
1077  size_t chapter_idx);
1078 
1079 /**
1080  * Select the next title for the current media
1081  *
1082  * @see vlc_player_SelectTitleIdx()
1083  */
1084 VLC_API void
1086 
1087 /**
1088  * Select the previous title for the current media
1089  *
1090  * @see vlc_player_SelectTitleIdx()
1091  */
1092 VLC_API void
1094 
1095 /**
1096  * Get the selected chapter index for the current media
1097  *
1098  * @see vlc_player_cbs.on_chapter_selection_changed
1099  *
1100  * @param player locked player instance
1101  */
1102 VLC_API ssize_t
1104 
1105 /**
1106  * Helper to get the current selected chapter
1107  */
1108 static inline const struct vlc_player_chapter *
1111  const struct vlc_player_title *title = vlc_player_GetSelectedTitle(player);
1112  if (!title || !title->chapter_count)
1113  return NULL;
1114  ssize_t chapter_idx = vlc_player_GetSelectedChapterIdx(player);
1115  return chapter_idx >= 0 ? &title->chapters[chapter_idx] : NULL;
1116 }
1117 
1118 /**
1119  * Select a chapter index for the current media
1120  *
1121  * @note A successful call will trigger the
1122  * vlc_player_cbs.on_chaper_selection_changed event.
1123  *
1124  * @see vlc_player_title.chapters
1125  *
1126  * @param player locked player instance
1127  * @param index valid index in the range [0;vlc_player_title.chapter_count[
1128  */
1129 VLC_API void
1130 vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index);
1131 
1132 /**
1133  * Select the next chapter for the current media
1134  *
1135  * @see vlc_player_SelectChapterIdx()
1136  */
1137 VLC_API void
1139 
1140 /**
1141  * Select the previous chapter for the current media
1142  *
1143  * @see vlc_player_SelectChapterIdx()
1144  */
1145 VLC_API void
1147 
1148 /** @} vlc_player__titles */
1149 
1150 /**
1151  * @defgroup vlc_player__programs Program control
1152  * @{
1153  */
1154 
1155 /**
1156  * Player program structure.
1157  */
1158 struct vlc_player_program
1160  /** Id used for vlc_player_SelectProgram() */
1161  int group_id;
1162  /** Program name, always valid */
1163  const char *name;
1164  /** True if the program is selected */
1165  bool selected;
1166  /** True if the program is scrambled */
1167  bool scrambled;
1168 };
1169 
1170 /**
1171  * Duplicate a program
1172  *
1173  * This function can be used to pass a program from a callback to an other
1174  * context.
1175  *
1176  * @see vlc_player_cbs.on_program_list_changed
1177  *
1178  * @return a duplicated program or NULL on allocation error
1179  */
1180 VLC_API struct vlc_player_program *
1181 vlc_player_program_Dup(const struct vlc_player_program *prgm);
1182 
1183 /**
1184  * Delete a duplicated program
1185  */
1186 VLC_API void
1188 
1189 /**
1190  * Get the number of programs
1191  *
1192  * @warning The returned size becomes invalid when the player is unlocked.
1193  *
1194  * @param player locked player instance
1195  * @return number of programs, or 0 (in case of error, or if the media is not
1196  * started)
1197  */
1198 VLC_API size_t
1200 
1201 /**
1202  * Get the program at a specific index
1203  *
1204  * @warning The behaviour is undefined if the index is not valid.
1205  *
1206  * @warning The returned pointer becomes invalid when the player is unlocked.
1207  * The referenced structure can be safely copied with vlc_player_program_Dup().
1208  *
1209  * @param player locked player instance
1210  * @param index valid index in the range [0; count[
1211  * @return a valid program (can't be NULL if vlc_player_GetProgramCount()
1212  * returned a valid count)
1213  */
1214 VLC_API const struct vlc_player_program *
1215 vlc_player_GetProgramAt(vlc_player_t *player, size_t index);
1216 
1217 /**
1218  * Get a program from an ES group identifier
1219  *
1220  * @param player locked player instance
1221  * @param group_id a program ID (retrieved from
1222  * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1223  * @return a valid program or NULL (if the program was terminated by the
1224  * playback thread)
1225  */
1226 VLC_API const struct vlc_player_program *
1228 
1229 /**
1230  * Select a program from an ES group identifier
1231  *
1232  * @param player locked player instance
1233  * @param group_id a program ID (retrieved from
1234  * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1235  */
1236 VLC_API void
1238 
1239 /**
1240  * Select the next program
1241  *
1242  * @param player locked player instance
1243  */
1244 VLC_API void
1246 
1247 /**
1248  * Select the previous program
1249  *
1250  * @param player locked player instance
1251  */
1252 VLC_API void
1254 
1255 /**
1256  * Helper to get the current selected program
1257  */
1258 static inline const struct vlc_player_program *
1261  size_t count = vlc_player_GetProgramCount(player);
1262  for (size_t i = 0; i < count; ++i)
1263  {
1264  const struct vlc_player_program *program =
1265  vlc_player_GetProgramAt(player, i);
1266  assert(program);
1267  if (program->selected)
1268  return program;
1269  }
1270  return NULL;
1271 }
1272 
1273 /** @} vlc_player__programs */
1274 
1275 /**
1276  * @defgroup vlc_player__tracks Tracks control
1277  * @{
1278  */
1279 
1280 /**
1281  * Player selection policy
1282  *
1283  * @see vlc_player_SelectEsId()
1284  */
1287  /**
1288  * Only one track per category is selected. Selecting a track with this
1289  * policy will disable all other tracks for the same category.
1290  */
1292  /**
1293  * Select multiple tracks for one category.
1294  *
1295  * Only one audio track can be selected at a time.
1296  * Two subtitle tracks can be selected simultaneously.
1297  * Multiple video tracks can be selected simultaneously.
1298  */
1300 };
1301 
1302 /**
1303  * Player track structure.
1304  *
1305  * A track is a representation of an ES identifier at a given time. Once the
1306  * player is unlocked, all content except the es_id pointer can be updated.
1307  *
1308  * @see vlc_player_cbs.on_track_list_changed
1309  * @see vlc_player_GetTrack
1310  */
1311 struct vlc_player_track
1313  /** Id used for any player actions, like vlc_player_SelectEsId() */
1314  vlc_es_id_t *es_id;
1315  /** Track name, always valid */
1316  const char *name;
1317  /** Es format */
1318  es_format_t fmt;
1319  /** True if the track is selected */
1320  bool selected;
1321 };
1322 
1323 /**
1324  * Duplicate a track
1325  *
1326  * This function can be used to pass a track from a callback to an other
1327  * context. The es_id will be held by the duplicated track.
1328  *
1329  * @warning The returned track won't be updated if the original one is modified
1330  * by the player.
1331  *
1332  * @see vlc_player_cbs.on_track_list_changed
1333  *
1334  * @return a duplicated track or NULL on allocation error
1335  */
1336 VLC_API struct vlc_player_track *
1337 vlc_player_track_Dup(const struct vlc_player_track *track);
1338 
1339 /**
1340  * Delete a duplicated track
1341  */
1342 VLC_API void
1344 
1345 /**
1346  * Get the number of tracks for an ES category
1347  *
1348  * @warning The returned size becomes invalid when the player is unlocked.
1349  *
1350  * @param player locked player instance
1351  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1352  * @return number of tracks, or 0 (in case of error, or if the media is not
1353  * started)
1354  */
1355 VLC_API size_t
1357 
1358 /**
1359  * Get the track at a specific index for an ES category
1360  *
1361  * @warning The behaviour is undefined if the index is not valid.
1362  *
1363  * @warning The returned pointer becomes invalid when the player is unlocked.
1364  * The referenced structure can be safely copied with vlc_player_track_Dup().
1365  *
1366  * @param player locked player instance
1367  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1368  * @param index valid index in the range [0; count[
1369  * @return a valid track (can't be NULL if vlc_player_GetTrackCount() returned
1370  * a valid count)
1371  */
1372 VLC_API const struct vlc_player_track *
1374  size_t index);
1375 
1376 /**
1377  * Helper to get the video track count
1378  */
1379 static inline size_t
1382  return vlc_player_GetTrackCount(player, VIDEO_ES);
1383 }
1384 
1385 /**
1386  * Helper to get a video track at a specific index
1387  */
1388 static inline const struct vlc_player_track *
1389 vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
1391  return vlc_player_GetTrackAt(player, VIDEO_ES, index);
1392 }
1393 
1394 /**
1395  * Helper to get the audio track count
1396  */
1397 static inline size_t
1400  return vlc_player_GetTrackCount(player, AUDIO_ES);
1401 }
1402 
1403 /**
1404  * Helper to get an audio track at a specific index
1405  */
1406 static inline const struct vlc_player_track *
1407 vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
1409  return vlc_player_GetTrackAt(player, AUDIO_ES, index);
1410 }
1411 
1412 /**
1413  * Helper to get the subtitle track count
1414  */
1415 static inline size_t
1418  return vlc_player_GetTrackCount(player, SPU_ES);
1419 }
1420 
1421 /**
1422  * Helper to get a subtitle track at a specific index
1423  */
1424 static inline const struct vlc_player_track *
1425 vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
1427  return vlc_player_GetTrackAt(player, SPU_ES, index);
1428 }
1429 
1430 /**
1431  * Get a track from an ES identifier
1432  *
1433  * @warning The returned pointer becomes invalid when the player is unlocked.
1434  * The referenced structure can be safely copied with vlc_player_track_Dup().
1435  *
1436  * @param player locked player instance
1437  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1438  * vlc_player_GetTrackAt())
1439  * @return a valid player track or NULL (if the track was terminated by the
1440  * playback thread)
1441  */
1442 VLC_API const struct vlc_player_track *
1444 
1445 /**
1446  * Get and the video output used by a ES identifier
1447  *
1448  * @warning A same vout can be associated with multiple ES during the lifetime
1449  * of the player. The information returned by this function becomes invalid
1450  * when the player is unlocked. The returned vout doesn't need to be released,
1451  * but must be held with vout_Hold() if it is accessed after the player is
1452  * unlocked.
1453  *
1454  * @param player locked player instance
1455  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1456  * vlc_player_GetTrackAt())
1457  * @param order if not null, the order of the vout
1458  * @return a valid vout or NULL (if the track is disabled, it it's not a video
1459  * or spu track, or if the vout failed to start)
1460  */
1463  enum vlc_vout_order *order);
1464 
1465 /**
1466  * Get the ES identifier of a video output
1467  *
1468  * @warning A same vout can be associated with multiple ES during the lifetime
1469  * of the player. The information returned by this function becomes invalid
1470  * when the player is unlocked. The returned es_id doesn't need to be released,
1471  * but must be held with vlc_es_id_Hold() if it accessed after the player is
1472  * unlocked.
1473  *
1474  * @param player locked player instance
1475  * @param vout vout (can't be NULL)
1476  * @return a valid ES identifier or NULL (if the vout is stopped)
1477  */
1480 
1481 /**
1482  * Helper to get the selected track from an ES category
1483  *
1484  * @warning The player can have more than one selected track for a same ES
1485  * category. This function will only return the first selected one. Use
1486  * vlc_player_GetTrackAt() and vlc_player_GetTrackCount() to iterate through
1487  * several selected tracks.
1488  */
1489 static inline const struct vlc_player_track *
1492  size_t count = vlc_player_GetTrackCount(player, cat);
1493  for (size_t i = 0; i < count; ++i)
1494  {
1495  const struct vlc_player_track *track =
1496  vlc_player_GetTrackAt(player, cat, i);
1497  assert(track);
1498  if (track->selected)
1499  return track;
1500  }
1501  return NULL;
1502 }
1503 
1504 /**
1505  * Select a track from an ES identifier
1506  *
1507  * @note A successful call will trigger the
1508  * vlc_player_cbs.on_track_selection_changed event.
1509  *
1510  * @param player locked player instance
1511  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1512  * vlc_player_GetTrackAt())
1513  * @param policy exclusive or simultaneous
1514  * @return the number of track selected for es_id category
1515  */
1516 VLC_API unsigned
1518  enum vlc_player_select_policy policy);
1519 
1520 
1521 /**
1522  * Helper to select a track
1523  */
1524 static inline unsigned
1526  const struct vlc_player_track *track,
1527  enum vlc_player_select_policy policy)
1528 {
1529  return vlc_player_SelectEsId(player, track->es_id, policy);
1530 }
1531 
1532 /**
1533  * Select multiple tracks from a list of ES identifiers.
1534  *
1535  * Any tracks of the category, not referenced in the list will be unselected.
1536  *
1537  * @warning there is no guarantee all requested tracks will be selected. The
1538  * behaviour is undefined if the list is not null-terminated.
1539  *
1540  * @note A successful call will trigger the
1541  * vlc_player_cbs.on_track_selection_changed event for each track that has
1542  * its selection state changed.
1543  *
1544  * @see VLC_PLAYER_SELECT_SIMULTANEOUS
1545  *
1546  * @param player locked player instance
1547  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1548  * @param es_id_list a null-terminated list of ES identifiers. es_ids not
1549  * corresponding to the category will be ignored.
1550  * (ES IDs can be retrieved from vlc_player_cbs.on_track_list_changed or
1551  * vlc_player_GetTrackAt())
1552  * @return the number of track selected for that category
1553  */
1554 VLC_API unsigned
1556  enum es_format_category_e cat,
1557  vlc_es_id_t *const es_id_list[]);
1558 
1559 /**
1560  * Select the next track
1561  *
1562  * If the last track is already selected, a call to this function will disable
1563  * this last track. And a second call will select the first track.
1564  *
1565  * @warning This function has no effects if there are several tracks selected
1566  * for a same category. Therefore the default policy is
1567  * VLC_PLAYER_SELECT_EXCLUSIVE.
1568  *
1569  * @param player locked player instance
1570  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1571  */
1572 VLC_API void
1574  enum es_format_category_e cat);
1575 
1576 /**
1577  * Select the Previous track
1578  *
1579  * If the first track is already selected, a call to this function will disable
1580  * this first track. And a second call will select the last track.
1581  *
1582  * @warning This function has no effects if there are several tracks selected
1583  * for a same category. Therefore the default policy is
1584  * VLC_PLAYER_SELECT_EXCLUSIVE.
1585  *
1586  * @param player locked player instance
1587  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1588  */
1589 VLC_API void
1591  enum es_format_category_e cat);
1592 
1593 /**
1594  * Unselect a track from an ES identifier
1595  *
1596  * @warning Other tracks of the same category won't be touched.
1597  *
1598  * @note A successful call will trigger the
1599  * vlc_player_cbs.on_track_selection_changed event.
1600  *
1601  * @param player locked player instance
1602  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1603  * vlc_player_GetTrackAt())
1604  */
1605 VLC_API void
1607 
1608 /**
1609  * Helper to unselect a track
1610  */
1611 static inline void
1613  const struct vlc_player_track *track)
1614 {
1615  vlc_player_UnselectEsId(player, track->es_id);
1616 }
1617 
1618 /**
1619  * Helper to unselect all tracks from an ES category
1620  */
1621 static inline void
1624 {
1625  size_t count = vlc_player_GetTrackCount(player, cat);
1626  for (size_t i = 0; i < count; ++i)
1627  {
1628  const struct vlc_player_track *track =
1629  vlc_player_GetTrackAt(player, cat, i);
1630  assert(track);
1631  if (track->selected)
1632  vlc_player_UnselectTrack(player, track);
1633  }
1634 }
1635 
1636 /**
1637  * Restart a track from an ES identifier
1638  *
1639  * @note A successful call will trigger the
1640  * vlc_player_cbs.on_track_selection_changed event.
1641  *
1642  * @param player locked player instance
1643  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1644  * vlc_player_GetTrackAt())
1645  */
1646 VLC_API void
1648 
1649 /**
1650  * Helper to restart a track
1651  */
1652 static inline void
1654  const struct vlc_player_track *track)
1655 {
1656  vlc_player_RestartEsId(player, track->es_id);
1657 }
1658 
1659 /**
1660  * Helper to restart all selected tracks from an ES category
1661  */
1662 static inline void
1665 {
1666  size_t count = vlc_player_GetTrackCount(player, cat);
1667  for (size_t i = 0; i < count; ++i)
1668  {
1669  const struct vlc_player_track *track =
1670  vlc_player_GetTrackAt(player, cat, i);
1671  assert(track);
1672  if (track->selected)
1673  vlc_player_RestartTrack(player, track);
1674  }
1675 }
1676 
1677 /**
1678  * Select the language for an ES category
1679  *
1680  * @warning The language will only be set for all future played media.
1681  *
1682  * @param player locked player instance
1683  * @param cat AUDIO_ES or SPU_ES
1684  * @param lang comma separated, two or three letters country code, 'any' as a
1685  * fallback or NULL to reset the default state
1686  */
1687 VLC_API void
1689  enum es_format_category_e cat,
1690  const char *lang);
1691 
1692 /**
1693  * Get the language of an ES category
1694  *
1695  * @warning This only reflects the change made by
1696  * vlc_player_SelectCategoryLanguage(). The current playing track doesn't
1697  * necessarily correspond to the returned language.
1698  *
1699  * @see vlc_player_SelectCategoryLanguage
1700  *
1701  * @param player locked player instance
1702  * @param cat AUDIO_ES or SPU_ES
1703  * @return valid language or NULL, need to be freed
1704  */
1705 VLC_API char *
1707  enum es_format_category_e cat);
1708 
1709 /**
1710  * Helper to select the audio language
1711  */
1712 static inline void
1713 vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
1716 }
1717 
1718 /**
1719  * Helper to select the subtitle language
1720  */
1721 static inline void
1722 vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
1725 }
1726 
1727 /**
1728  * Enable or disable a track category
1729  *
1730  * If a track category is disabled, the player won't select any tracks of this
1731  * category automatically or via an user action (vlc_player_SelectTrack()).
1732  *
1733  * @param player locked player instance
1734  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1735  * @param enabled true to enable
1736  */
1737 VLC_API void
1739  enum es_format_category_e cat, bool enabled);
1740 
1741 /**
1742  * Check if a track category is enabled
1743  *
1744  * @param player locked player instance
1745  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1746  */
1747 VLC_API bool
1749  enum es_format_category_e cat);
1750 
1751 /**
1752  * Helper to enable or disable video tracks
1753  */
1754 static inline void
1755 vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
1757  vlc_player_SetTrackCategoryEnabled(player, VIDEO_ES, enabled);
1758 }
1759 
1760 /**
1761  * Helper to check if video tracks are enabled
1762  */
1763 static inline bool
1767 }
1768 
1769 /**
1770  * Helper to enable or disable audio tracks
1771  */
1772 static inline void
1773 vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
1775  vlc_player_SetTrackCategoryEnabled(player, AUDIO_ES, enabled);
1776 }
1777 
1778 /**
1779  * Helper to check if audio tracks are enabled
1780  */
1781 static inline bool
1785 }
1786 
1787 /**
1788  * Helper to enable or disable subtitle tracks
1789  */
1790 static inline void
1791 vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
1793  vlc_player_SetTrackCategoryEnabled(player, SPU_ES, enabled);
1794 }
1795 
1796 /**
1797  * Helper to check if subtitle tracks are enabled
1798  */
1799 static inline bool
1802  return vlc_player_IsTrackCategoryEnabled(player, SPU_ES);
1803 }
1804 
1805 /**
1806  * Helper to toggle subtitles
1807  */
1808 static inline void
1811  bool enabled = !vlc_player_IsSubtitleEnabled(player);
1812  return vlc_player_SetSubtitleEnabled(player, enabled);
1813 }
1814 
1815 /**
1816  * Set the subtitle text scaling factor
1817  *
1818  * @note This function have an effect only if the subtitle track is a text type.
1819  *
1820  * @param player locked player instance
1821  * @param scale factor in the range [10;500] (default: 100)
1822  */
1823 VLC_API void
1824 vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale);
1825 
1826 /**
1827  * Get the subtitle text scaling factor
1828  *
1829  * @param player locked player instance
1830  * @return scale factor
1831  */
1832 VLC_API unsigned
1834 
1835 /** @} vlc_player__tracks */
1836 
1837 /**
1838  * @defgroup vlc_player__tracks_sync Tracks synchronisation (delay)
1839  * @{
1840  */
1841 
1842 /**
1843  * Get the delay of an ES category for the current media
1844  *
1845  * @see vlc_player_cbs.on_category_delay_changed
1846  *
1847  * @param player locked player instance
1848  * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1849  * @return a valid delay or 0
1850  */
1853 
1854 /**
1855  * Set the delay of one category for the current media
1856  *
1857  * @note A successful call will trigger the
1858  * vlc_player_cbs.on_category_delay_changed event.
1859  *
1860  * @warning This has no effect on tracks where the delay was set by
1861  * vlc_player_SetEsIdDelay()
1862  *
1863  * @param player locked player instance
1864  * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1865  * @param delay a valid time
1866  * @param whence absolute or relative
1867  * @return VLC_SUCCESS or VLC_EGENERIC if the category is not handled
1868  */
1869 VLC_API int
1871  vlc_tick_t delay, enum vlc_player_whence whence);
1872 
1873 /**
1874  * Get the delay of a track
1875  *
1876  * @see vlc_player_cbs.on_track_delay_changed
1877  *
1878  * @param player locked player instance
1879  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1880  * vlc_player_GetTrackAt())
1881  * @return a valid delay or INT64_MAX is no delay is set for this track
1882  */
1885 
1886 /**
1887  * Set the delay of one track
1888  *
1889  * @note A successful call will trigger the
1890  * vlc_player_cbs.on_track_delay_changed event.
1891  *
1892  * @warning Setting the delay of one specific track will override previous and
1893  * future changes of delay made by vlc_player_SetCategoryDelay()
1894  *
1895  * @param player locked player instance
1896  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1897  * vlc_player_GetTrackAt())
1898  * @param delay a valid time or INT64_MAX to use default category delay
1899  * @param whence absolute or relative
1900  * @return VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not
1901  * handled (VIDEO_ES not supported yet)
1902  */
1903 VLC_API int
1905  vlc_tick_t delay, enum vlc_player_whence whence);
1906 
1907 /**
1908  * Helper to get the audio delay
1909  */
1910 static inline vlc_tick_t
1913  return vlc_player_GetCategoryDelay(player, AUDIO_ES);
1914 }
1915 
1916 /**
1917  * Helper to set the audio delay
1918  */
1919 static inline void
1921  enum vlc_player_whence whence)
1922 
1923 {
1924  vlc_player_SetCategoryDelay(player, AUDIO_ES, delay, whence);
1925 }
1926 
1927 /**
1928  * Helper to get the subtitle delay
1929  */
1930 static inline vlc_tick_t
1933  return vlc_player_GetCategoryDelay(player, SPU_ES);
1934 }
1935 
1936 /**
1937  * Helper to set the subtitle delay
1938  */
1939 static inline void
1941  enum vlc_player_whence whence)
1942 {
1943  vlc_player_SetCategoryDelay(player, SPU_ES, delay, whence);
1944 }
1945 
1946 /**
1947  * Set the associated subtitle FPS
1948  *
1949  * In order to correct the rate of the associated media according to this FPS
1950  * and the media video FPS.
1951  *
1952  * @note A successful call will trigger the
1953  * vlc_player_cbs.on_associated_subs_fps_changed event.
1954  *
1955  * @warning this function will change the rate of all external subtitle files
1956  * associated with the current media.
1957  *
1958  * @param player locked player instance
1959  * @param fps FPS of the subtitle file
1960  */
1961 VLC_API void
1962 vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps);
1963 
1964 /**
1965  * Get the associated subtitle FPS
1966  *
1967  * @param player locked player instance
1968  * @return fps
1969  */
1970 VLC_API float
1972 
1973 /** @} vlc_player__tracks_sync */
1974 
1975 /**
1976  * @defgroup vlc_player__teletext Teletext control
1977  * @{
1978  */
1979 
1980 /**
1981  * Check if the media has a teletext menu
1982  *
1983  * @see vlc_player_cbs.on_teletext_menu_changed
1984  *
1985  * @param player locked player instance
1986  * @return true if the media has a teletext menu
1987  */
1988 VLC_API bool
1990 
1991 /**
1992  * Enable or disable teletext
1993  *
1994  * This function has an effect only if the player has a teletext menu.
1995  *
1996  * @note A successful call will trigger the
1997  * vlc_player_cbs.on_teletext_enabled_changed event.
1998  *
1999  * @param player locked player instance
2000  * @param enabled true to enable
2001  */
2002 VLC_API void
2003 vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled);
2004 
2005 /**
2006  * Check if teletext is enabled
2007  *
2008  * @see vlc_player_cbs.on_teletext_enabled_changed
2009  *
2010  * @param player locked player instance
2011  */
2012 VLC_API bool
2014 
2015 /**
2016  * Select a teletext page or do an action from a key
2017  *
2018  * This function has an effect only if the player has a teletext menu.
2019  *
2020  * @note Page keys can be the following: @ref VLC_PLAYER_TELETEXT_KEY_RED,
2021  * @ref VLC_PLAYER_TELETEXT_KEY_GREEN, @ref VLC_PLAYER_TELETEXT_KEY_YELLOW,
2022  * @ref VLC_PLAYER_TELETEXT_KEY_BLUE or @ref VLC_PLAYER_TELETEXT_KEY_INDEX.
2023 
2024  * @note A successful call will trigger the
2025  * vlc_player_cbs.on_teletext_page_changed event.
2026  *
2027  * @param player locked player instance
2028  * @param page a page in the range ]0;888] or a valid key
2029  */
2030 VLC_API void
2031 vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page);
2032 
2033 /**
2034  * Get the current teletext page
2035  *
2036  * @see vlc_player_cbs.on_teletext_page_changed
2037  *
2038  * @param player locked player instance
2039  */
2040 VLC_API unsigned
2042 
2043 /**
2044  * Enable or disable teletext transparency
2045  *
2046  * This function has an effect only if the player has a teletext menu.
2047 
2048  * @note A successful call will trigger the
2049  * vlc_player_cbs.on_teletext_transparency_changed event.
2050  *
2051  * @param player locked player instance
2052  * @param enabled true to enable
2053  */
2054 VLC_API void
2055 vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled);
2056 
2057 /**
2058  * Check if teletext is transparent
2059  *
2060  * @param player locked player instance
2061  */
2062 VLC_API bool
2064 
2065 /** @} vlc_player__teletext */
2066 
2067 /**
2068  * @defgroup vlc_player__renderer External renderer control
2069  * @{
2070  */
2071 
2072 /**
2073  * Set the renderer
2074  *
2075  * Valid for the current media and all future ones.
2076  *
2077  * @note A successful call will trigger the vlc_player_cbs.on_renderer_changed
2078  * event.
2079  *
2080  * @param player locked player instance
2081  * @param renderer a valid renderer item or NULL (to disable it), the item will
2082  * be held by the player
2083  */
2084 VLC_API void
2086 
2087 /**
2088  * Get the renderer
2089  *
2090  * @see vlc_player_cbs.on_renderer_changed
2091  *
2092  * @param player locked player instance
2093  * @return the renderer item set by vlc_player_SetRenderer()
2094  */
2097 
2098 /** @} vlc_player__renderer */
2099 
2100 /**
2101  * @defgroup vlc_player__aout Audio output control
2102  * @{
2103  */
2104 
2105 /**
2106  * Player aout listener opaque structure.
2107  *
2108  * This opaque structure is returned by vlc_player_aout_AddListener() and can
2109  * be used to remove the listener via vlc_player_aout_RemoveListener().
2110  */
2111 typedef struct vlc_player_aout_listener_id vlc_player_aout_listener_id;
2113 /**
2114  * Player aout callbacks
2115  *
2116  * Can be registered with vlc_player_aout_AddListener().
2117  *
2118  * @warning To avoid deadlocks, users should never call audio_output_t and
2119  * vlc_player_t functions from these callbacks.
2120  */
2121 struct vlc_player_aout_cbs
2123  /**
2124  * Called when the volume has changed
2125  *
2126  * @see vlc_player_aout_SetVolume()
2127  *
2128  * @param aout the main aout of the player
2129  * @param new_volume volume in the range [0;2.f]
2130  * @param data opaque pointer set by vlc_player_aout_AddListener()
2131  */
2132  void (*on_volume_changed)(audio_output_t *aout, float new_volume,
2133  void *data);
2134 
2135  /**
2136  * Called when the mute state has changed
2137  *
2138  * @see vlc_player_aout_Mute()
2139  *
2140  * @param aout the main aout of the player
2141  * @param new_mute true if muted
2142  * @param data opaque pointer set by vlc_player_aout_AddListener()
2143  */
2144  void (*on_mute_changed)(audio_output_t *aout, bool new_muted,
2145  void *data);
2146 
2147  /**
2148  * Called when the audio device has changed
2149  *
2150  * @param aout the main aout of the player
2151  * @param device the device name
2152  * @param data opaque pointer set by vlc_player_aout_AddListener()
2153  */
2154  void (*on_device_changed)(audio_output_t *aout, const char *device,
2155  void *data);
2156 };
2157 
2158 /**
2159  * Get the audio output
2160  *
2161  * @warning The returned pointer must be released with aout_Release().
2162  *
2163  * @param player player instance
2164  * @return a valid audio_output_t * or NULL (if there is no aouts)
2165  */
2168 
2169 /**
2170  * Add a listener callback for audio output events
2171  *
2172  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2173  * functions.
2174  * @note Every registered callbacks need to be removed by the caller with
2175  * vlc_player_aout_RemoveListener().
2176  *
2177  * @param player player instance
2178  * @param cbs pointer to a vlc_player_aout_cbs structure, the structure must be
2179  * valid during the lifetime of the player
2180  * @param cbs_data opaque pointer used by the callbacks
2181  * @return a valid listener id, or NULL in case of allocation error
2182  */
2183 VLC_API vlc_player_aout_listener_id *
2185  const struct vlc_player_aout_cbs *cbs,
2186  void *cbs_data);
2187 
2188 /**
2189  * Remove a aout listener callback
2190  *
2191  * @param player player instance
2192  * @param listener_id listener id returned by vlc_player_aout_AddListener()
2193  */
2194 VLC_API void
2196  vlc_player_aout_listener_id *listener_id);
2197 
2198 /**
2199  * Get the audio volume
2200  *
2201  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2202  * functions.
2203  *
2204  * @see vlc_player_aout_cbs.on_volume_changed
2205  *
2206  * @param player player instance
2207  * @return volume in the range [0;2.f] or -1.f if there is no audio outputs
2208  * (independent of mute)
2209  */
2210 VLC_API float
2212 
2213 /**
2214  * Set the audio volume
2215  *
2216  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2217  * functions.
2218  *
2219  * @note A successful call will trigger the
2220  * vlc_player_vout_cbs.on_volume_changed event.
2221  *
2222  * @param player player instance
2223  * @param volume volume in the range [0;2.f]
2224  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2225  */
2226 VLC_API int
2227 vlc_player_aout_SetVolume(vlc_player_t *player, float volume);
2228 
2229 /**
2230  * Increment the audio volume
2231  *
2232  * @see vlc_player_aout_SetVolume()
2233  *
2234  * @param player player instance
2235  * @param steps number of "volume-step"
2236  * @param result pointer to store the resulting volume (can be NULL)
2237  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2238  */
2239 VLC_API int
2240 vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result);
2241 
2242 /**
2243  * Helper to decrement the audio volume
2244  */
2245 static inline int
2246 vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
2248  return vlc_player_aout_IncrementVolume(player, -steps, result);
2249 }
2250 
2251 /**
2252  * Check if the audio output is muted
2253  *
2254  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2255  * functions.
2256  *
2257  * @see vlc_player_aout_cbs.on_mute_changed
2258  *
2259  * @param player player instance
2260  * @return 0 if not muted, 1 if muted, -1 if there is no audio outputs
2261  */
2262 VLC_API int
2264 
2265 /**
2266  * Mute or unmute the audio output
2267  *
2268  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2269  * functions.
2270  *
2271  * @note A successful call will trigger the
2272  * vlc_player_aout_cbs.on_mute_changed event.
2273  *
2274  * @param player player instance
2275  * @param mute true to mute
2276  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2277  */
2278 VLC_API int
2279 vlc_player_aout_Mute(vlc_player_t *player, bool mute);
2280 
2281 /**
2282  * Helper to toggle the mute state
2283  */
2284 static inline int
2287  return vlc_player_aout_Mute(player,
2288  !vlc_player_aout_IsMuted(player));
2289 }
2290 
2291 /**
2292  * Enable or disable an audio filter
2293  *
2294  * @see aout_EnableFilter()
2295  *
2296  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2297  */
2298 VLC_API int
2299 vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
2300 
2301 /** @} vlc_player__aout */
2302 
2303 /**
2304  * @defgroup vlc_player__vout Video output control
2305  * @{
2306  */
2307 
2308 /**
2309  * Player vout listener opaque structure.
2310  *
2311  * This opaque structure is returned by vlc_player_vout_AddListener() and can
2312  * be used to remove the listener via vlc_player_vout_RemoveListener().
2313  */
2314 typedef struct vlc_player_vout_listener_id vlc_player_vout_listener_id;
2316 /**
2317  * action of vlc_player_cbs.on_vout_changed callback
2318  */
2323 };
2324 
2325 /**
2326  * Player vout callbacks
2327  *
2328  * Can be registered with vlc_player_vout_AddListener().
2329  *
2330  * @note The state changed from the callbacks can be either applied on the
2331  * player (and all future video outputs), or on a specified video output. The
2332  * state is applied on the player when the vout argument is NULL.
2333  *
2334  * @warning To avoid deadlocks, users should never call vout_thread_t and
2335  * vlc_player_t functions from these callbacks.
2336  */
2337 struct vlc_player_vout_cbs
2339  /**
2340  * Called when the player and/or vout fullscreen state has changed
2341  *
2342  * @see vlc_player_vout_SetFullscreen()
2343  *
2344  * @param vout cf. vlc_player_vout_cbs note
2345  * @param enabled true when fullscreen is enabled
2346  * @param data opaque pointer set by vlc_player_vout_AddListener()
2347  */
2348  void (*on_fullscreen_changed)(vout_thread_t *vout, bool enabled,
2349  void *data);
2350 
2351  /**
2352  * Called when the player and/or vout wallpaper mode has changed
2353  *
2354  * @see vlc_player_vout_SetWallpaperModeEnabled()
2355  *
2356  * @param vout cf. vlc_player_vout_cbs note
2357  * @param enabled true when wallpaper mode is enabled
2358  * @param data opaque pointer set by vlc_player_vout_AddListener()
2359  */
2360  void (*on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled,
2361  void *data);
2362 };
2363 
2364 
2365 /**
2366  * Get and hold the main video output
2367  *
2368  * @warning the returned vout_thread_t * must be released with vout_Release().
2369  * @see vlc_players_cbs.on_vout_changed
2370  *
2371  * @note The player is guaranteed to always hold one valid vout. Only vout
2372  * variables can be changed from this instance. The vout returned before
2373  * playback is not necessarily the same one that will be used for playback.
2374  *
2375  * @param player player instance
2376  * @return a valid vout_thread_t * or NULL, cf. warning
2377  */
2380 
2381 /**
2382  * Get and hold the list of video output
2383  *
2384  * @warning All vout_thread_t * element of the array must be released with
2385  * vout_Release(). The returned array must be freed.
2386  *
2387  * @see vlc_players_cbs.on_vout_changed
2388  *
2389  * @param player player instance
2390  * @param count valid pointer to store the array count
2391  * @return a array of vout_thread_t * or NULL, cf. warning
2392  */
2394 vlc_player_vout_HoldAll(vlc_player_t *player, size_t *count);
2395 
2396 /**
2397  * Add a listener callback for video output events
2398  *
2399  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2400  * functions.
2401  * @note Every registered callbacks need to be removed by the caller with
2402  * vlc_player_vout_RemoveListener().
2403  *
2404  * @param player player instance
2405  * @param cbs pointer to a vlc_player_vout_cbs structure, the structure must be
2406  * valid during the lifetime of the player
2407  * @param cbs_data opaque pointer used by the callbacks
2408  * @return a valid listener id, or NULL in case of allocation error
2409  */
2410 VLC_API vlc_player_vout_listener_id *
2412  const struct vlc_player_vout_cbs *cbs,
2413  void *cbs_data);
2414 
2415 /**
2416  * Remove a vout listener callback
2417  *
2418  * @param player player instance
2419  * @param listener_id listener id returned by vlc_player_vout_AddListener()
2420  */
2421 VLC_API void
2423  vlc_player_vout_listener_id *listener_id);
2424 
2425 /**
2426  * Check if the player is fullscreen
2427  *
2428  * @warning The fullscreen state of the player and all vouts can be different.
2429  *
2430  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2431  * functions.
2432  *
2433  * @see vlc_player_vout_cbs.on_fullscreen_changed
2434  *
2435  * @param player player instance
2436  * @return true if the player is fullscreen
2437  */
2438 VLC_API bool
2440 
2441 /**
2442  * Enable or disable the player fullscreen state
2443  *
2444  * This will have an effect on all current and future vouts.
2445  *
2446  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2447  * functions.
2448  * @note A successful call will trigger the
2449  * vlc_player_vout_cbs.on_fullscreen_changed event.
2450  *
2451  * @param player player instance
2452  * @param enabled true to enable fullscreen
2453  */
2454 VLC_API void
2455 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled);
2456 
2457 /**
2458  * Helper to toggle the player fullscreen state
2459  */
2460 static inline void
2464  !vlc_player_vout_IsFullscreen(player));
2465 }
2466 
2467 /**
2468  * Check if the player has wallpaper-mode enaled
2469  *
2470  * @warning The wallpaper-mode state of the player and all vouts can be
2471  * different.
2472  *
2473  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2474  * functions.
2475  *
2476  * @see vlc_player_vout_cbs.on_wallpaper_mode_changed
2477  *
2478  * @param player player instance
2479  * @return true if the player is fullscreen
2480  */
2481 VLC_API bool
2483 
2484 /**
2485  * Enable or disable the player wallpaper-mode
2486  *
2487  * This will have an effect on all current and future vouts.
2488  *
2489  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2490  * functions.
2491  * @note A successful call will trigger the
2492  * vlc_player_vout_cbs.on_wallpaper_mode_changed event.
2493  *
2494  * @param player player instance
2495  * @param enabled true to enable wallpaper-mode
2496  */
2497 VLC_API void
2499 
2500 /**
2501  * Helper to toggle the player wallpaper-mode state
2502  */
2503 static inline void
2508 }
2509 
2510 /**
2511  * Take a snapshot on all vouts
2512  *
2513  * @param player player instance
2514  */
2515 VLC_API void
2517 
2518 /**
2519  * Display an OSD message on all vouts
2520  *
2521  * @param player player instance
2522  * @param fmt format string
2523  */
2524 VLC_API void
2525 vlc_player_osd_Message(vlc_player_t *player, const char *fmt, ...);
2526 
2527 /** @} vlc_player__vout */
2528 
2529 /**
2530  * @defgroup vlc_player__events Player events
2531  * @{
2532  */
2533 
2534 /**
2535  * Player listener opaque structure.
2536  *
2537  * This opaque structure is returned by vlc_player_AddListener() and can be
2538  * used to remove the listener via vlc_player_RemoveListener().
2539  */
2540 typedef struct vlc_player_listener_id vlc_player_listener_id;
2542 /**
2543  * Action of vlc_player_cbs.on_track_list_changed,
2544  * vlc_player_cbs.on_program_list_changed callbacks
2545  */
2551 };
2552 
2553 /**
2554  * Player callbacks
2555  *
2556  * Can be registered with vlc_player_AddListener().
2557  *
2558  * All callbacks are called with the player locked (cf. vlc_player_Lock()) and
2559  * from any threads (and even synchronously from a vlc_player function in some
2560  * cases). It is safe to call any vlc_player functions from these callbacks
2561  * except vlc_player_Delete().
2562  *
2563  * @warning To avoid deadlocks, users should never call vlc_player functions
2564  * with an external mutex locked and lock this same mutex from a player
2565  * callback.
2566  */
2567 struct vlc_player_cbs
2569  /**
2570  * Called when the current media has changed
2571  *
2572  * @note This can be called from the PLAYING state (when the player plays
2573  * the next media internally) or from the STOPPED state (from
2574  * vlc_player_SetCurrentMedia() or from an internal transition).
2575  *
2576  * @see vlc_player_SetCurrentMedia()
2577  * @see vlc_player_InvalidateNextMedia()
2578  *
2579  * @param player locked player instance
2580  * @param new_media new media currently played or NULL (when there is no
2581  * more media to play)
2582  * @param data opaque pointer set by vlc_player_AddListener()
2583  */
2584  void (*on_current_media_changed)(vlc_player_t *player,
2585  input_item_t *new_media, void *data);
2586 
2587  /**
2588  * Called when the player state has changed
2589  *
2590  * @see vlc_player_state
2591  *
2592  * @param player locked player instance
2593  * @param new_state new player state
2594  * @param data opaque pointer set by vlc_player_AddListener()
2595  */
2596  void (*on_state_changed)(vlc_player_t *player,
2597  enum vlc_player_state new_state, void *data);
2598 
2599  /**
2600  * Called when a media triggered an error
2601  *
2602  * Can be called from any states. When it happens the player will stop
2603  * itself. It is safe to play an other media or event restart the player
2604  * (This will reset the error state).
2605  *
2606  * @param player locked player instance
2607  * @param error player error
2608  * @param data opaque pointer set by vlc_player_AddListener()
2609  */
2610  void (*on_error_changed)(vlc_player_t *player,
2611  enum vlc_player_error error, void *data);
2612 
2613  /**
2614  * Called when the player buffering (or cache) has changed
2615  *
2616  * This event is always called with the 0 and 1 values before a playback
2617  * (in case of success). Values in between depends on the media type.
2618  *
2619  * @param player locked player instance
2620  * @param new_buffering buffering in the range [0:1]
2621  * @param data opaque pointer set by vlc_player_AddListener()
2622  */
2623  void (*on_buffering_changed)(vlc_player_t *player,
2624  float new_buffering, void *data);
2625 
2626  /**
2627  * Called when the player rate has changed
2628  *
2629  * Triggered by vlc_player_ChangeRate(), not sent when the media starts
2630  * with the default rate (1.f)
2631  *
2632  * @param player locked player instance
2633  * @param new_rate player
2634  * @param data opaque pointer set by vlc_player_AddListener()
2635  */
2636  void (*on_rate_changed)(vlc_player_t *player,
2637  float new_rate, void *data);
2638 
2639  /**
2640  * Called when the media capabilities has changed
2641  *
2642  * Always called when the media is opening. Can be called during playback.
2643  *
2644  * @param player locked player instance
2645  * @param old_caps old player capabilities
2646  * @param new_caps new player capabilities
2647  * @param data opaque pointer set by vlc_player_AddListener()
2648  */
2649  void (*on_capabilities_changed)(vlc_player_t *player,
2650  int old_caps, int new_caps, void *data);
2651 
2652  /**
2653  * Called when the player position has changed
2654  *
2655  * @note A started and playing media doesn't have necessarily a valid time.
2656  *
2657  * @param player locked player instance
2658  * @param new_time a valid time or VLC_TICK_INVALID
2659  * @param new_pos a valid position
2660  * @param data opaque pointer set by vlc_player_AddListener()
2661  */
2662  void (*on_position_changed)(vlc_player_t *player,
2663  vlc_tick_t new_time, float new_pos, void *data);
2664 
2665  /**
2666  * Called when the media length has changed
2667  *
2668  * May be called when the media is opening or during playback.
2669  *
2670  * @note A started and playing media doesn't have necessarily a valid length.
2671  *
2672  * @param player locked player instance
2673  * @param new_length a valid time or VLC_TICK_INVALID
2674  * @param data opaque pointer set by vlc_player_AddListener()
2675  */
2676  void (*on_length_changed)(vlc_player_t *player,
2677  vlc_tick_t new_length, void *data);
2678 
2679  /**
2680  * Called when a track is added, removed, or updated
2681  *
2682  * @note The track is only valid from this callback context. Users should
2683  * duplicate this track via vlc_player_track_Dup() if they want to use it
2684  * from an other context.
2685  *
2686  * @param player locked player instance
2687  * @param action added, removed or updated
2688  * @param track valid track
2689  * @param data opaque pointer set by vlc_player_AddListener()
2690  */
2691  void (*on_track_list_changed)(vlc_player_t *player,
2693  const struct vlc_player_track *track, void *data);
2694 
2695  /**
2696  * Called when a new track is selected and/or unselected
2697  *
2698  * @note This event can be called with both unselected_id and selected_id
2699  * valid. This mean that a new track is replacing the old one.
2700  *
2701  * @param player locked player instance
2702  * @param unselected_id valid track id or NULL (when nothing is unselected)
2703  * @param selected_id valid track id or NULL (when nothing is selected)
2704  * @param data opaque pointer set by vlc_player_AddListener()
2705  */
2706  void (*on_track_selection_changed)(vlc_player_t *player,
2707  vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data);
2708 
2709  /**
2710  * Called when a track delay has changed
2711  *
2712  * @param player locked player instance
2713  * @param es_id valid track id
2714  * @param delay a valid delay or INT64_MAX if the delay of this track is
2715  * canceled
2716  */
2717  void (*on_track_delay_changed)(vlc_player_t *player,
2718  vlc_es_id_t *es_id, vlc_tick_t delay, void *data);
2719 
2720  /**
2721  * Called when a new program is added, removed or updated
2722  *
2723  * @note The program is only valid from this callback context. Users should
2724  * duplicate this program via vlc_player_program_Dup() if they want to use
2725  * it from an other context.
2726  *
2727  * @param player locked player instance
2728  * @param action added, removed or updated
2729  * @param prgm valid program
2730  * @param data opaque pointer set by vlc_player_AddListener()
2731  */
2732  void (*on_program_list_changed)(vlc_player_t *player,
2734  const struct vlc_player_program *prgm, void *data);
2735 
2736  /**
2737  * Called when a new program is selected and/or unselected
2738  *
2739  * @note This event can be called with both unselected_id and selected_id
2740  * valid. This mean that a new program is replacing the old one.
2741  *
2742  * @param player locked player instance
2743  * @param unselected_id valid program id or -1 (when nothing is unselected)
2744  * @param selected_id valid program id or -1 (when nothing is selected)
2745  * @param data opaque pointer set by vlc_player_AddListener()
2746  */
2747  void (*on_program_selection_changed)(vlc_player_t *player,
2748  int unselected_id, int selected_id, void *data);
2749 
2750  /**
2751  * Called when the media titles has changed
2752  *
2753  * This event is not called when the opening media doesn't have any titles.
2754  * This title list and all its elements are constant. If an element is to
2755  * be updated, a new list will be sent from this callback.
2756  *
2757  * @note Users should hold this list with vlc_player_title_list_Hold() if
2758  * they want to use it from an other context.
2759  *
2760  * @param player locked player instance
2761  * @param titles valid title list or NULL
2762  * @param data opaque pointer set by vlc_player_AddListener()
2763  */
2764  void (*on_titles_changed)(vlc_player_t *player,
2765  vlc_player_title_list *titles, void *data);
2766 
2767  /**
2768  * Called when a new title is selected
2769  *
2770  * There are no events when a title is unselected. Titles are automatically
2771  * unselected when the title list changes. Titles and indexes are always
2772  * valid inside the vlc_player_title_list sent by
2773  * vlc_player_cbs.on_titles_changed.
2774  *
2775  * @param player locked player instance
2776  * @param new_title new selected title
2777  * @param new_idx index of this title
2778  * @param data opaque pointer set by vlc_player_AddListener()
2779  */
2780  void (*on_title_selection_changed)(vlc_player_t *player,
2781  const struct vlc_player_title *new_title, size_t new_idx, void *data);
2782 
2783  /**
2784  * Called when a new chapter is selected
2785  *
2786  * There are no events when a chapter is unselected. Chapters are
2787  * automatically unselected when the title list changes. Titles, chapters
2788  * and indexes are always valid inside the vlc_player_title_list sent by
2789  * vlc_player_cbs.on_titles_changed.
2790  *
2791  * @param player locked player instance
2792  * @param title selected title
2793  * @param title_idx selected title index
2794  * @param chapter new selected chapter
2795  * @param chapter_idx new selected chapter index
2796  * @param data opaque pointer set by vlc_player_AddListener()
2797  */
2798  void (*on_chapter_selection_changed)(vlc_player_t *player,
2799  const struct vlc_player_title *title, size_t title_idx,
2800  const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx,
2801  void *data);
2802 
2803  /**
2804  * Called when the media has a teletext menu
2805  *
2806  * @param player locked player instance
2807  * @param has_teletext_menu true if the media has a teletext menu
2808  * @param data opaque pointer set by vlc_player_AddListener()
2809  */
2810  void (*on_teletext_menu_changed)(vlc_player_t *player,
2811  bool has_teletext_menu, void *data);
2812 
2813  /**
2814  * Called when teletext is enabled or disabled
2815  *
2816  * @see vlc_player_SetTeletextEnabled()
2817  *
2818  * @param player locked player instance
2819  * @param enabled true if teletext is enabled
2820  * @param data opaque pointer set by vlc_player_AddListener()
2821  */
2822  void (*on_teletext_enabled_changed)(vlc_player_t *player,
2823  bool enabled, void *data);
2824 
2825  /**
2826  * Called when the teletext page has changed
2827  *
2828  * @see vlc_player_SelectTeletextPage()
2829  *
2830  * @param player locked player instance
2831  * @param new_page page in the range ]0;888]
2832  * @param data opaque pointer set by vlc_player_AddListener()
2833  */
2834  void (*on_teletext_page_changed)(vlc_player_t *player,
2835  unsigned new_page, void *data);
2836 
2837  /**
2838  * Called when the teletext transparency has changed
2839  *
2840  * @see vlc_player_SetTeletextTransparency()
2841  *
2842  * @param player locked player instance
2843  * @param enabled true is the teletext overlay is transparent
2844  * @param data opaque pointer set by vlc_player_AddListener()
2845  */
2846  void (*on_teletext_transparency_changed)(vlc_player_t *player,
2847  bool enabled, void *data);
2848 
2849  /**
2850  * Called when the player category delay has changed for the current media
2851  *
2852  * @see vlc_player_SetCategoryDelay()
2853  *
2854  * @param player locked player instance
2855  * @param cat AUDIO_ES or SPU_ES
2856  * @param new_delay audio delay
2857  * @param data opaque pointer set by vlc_player_AddListener()
2858  */
2859  void (*on_category_delay_changed)(vlc_player_t *player,
2860  enum es_format_category_e cat, vlc_tick_t new_delay, void *data);
2861 
2862  /**
2863  * Called when associated subtitle has changed
2864  *
2865  * @see vlc_player_SetAssociatedSubsFPS()
2866  *
2867  * @param player locked player instance
2868  * @param sub_fps subtitle fps
2869  * @param data opaque pointer set by vlc_player_AddListener()
2870  */
2871  void (*on_associated_subs_fps_changed)(vlc_player_t *player,
2872  float subs_fps, void *data);
2873 
2874  /**
2875  * Called when a new renderer item is set
2876  *
2877  * @see vlc_player_SetRenderer()
2878  *
2879  * @param player locked player instance
2880  * @param new_item a valid renderer item or NULL (if unset)
2881  * @param data opaque pointer set by vlc_player_AddListener()
2882  */
2883  void (*on_renderer_changed)(vlc_player_t *player,
2884  vlc_renderer_item_t *new_item, void *data);
2885 
2886  /**
2887  * Called when the player recording state has changed
2888  *
2889  * @see vlc_player_SetRecordingEnabled()
2890  *
2891  * @param player locked player instance
2892  * @param recording true if recording is enabled
2893  * @param data opaque pointer set by vlc_player_AddListener()
2894  */
2895  void (*on_recording_changed)(vlc_player_t *player,
2896  bool recording, void *data);
2897 
2898  /**
2899  * Called when the media signal has changed
2900  *
2901  * @param player locked player instance
2902  * @param new_quality signal quality
2903  * @param new_strength signal strength,
2904  * @param data opaque pointer set by vlc_player_AddListener()
2905  */
2906  void (*on_signal_changed)(vlc_player_t *player,
2907  float quality, float strength, void *data);
2908 
2909  /**
2910  * Called when the player has new statisics
2911  *
2912  * @note The stats structure is only valid from this callback context. It
2913  * can be copied in order to use it from an other context.
2914  *
2915  * @param player locked player instance
2916  * @param stats valid stats, only valid from this context
2917  * @param data opaque pointer set by vlc_player_AddListener()
2918  */
2919  void (*on_statistics_changed)(vlc_player_t *player,
2920  const struct input_stats_t *stats, void *data);
2921 
2922  /**
2923  * Called when the A to B loop has changed
2924  *
2925  * @see vlc_player_SetAtoBLoop()
2926  *
2927  * @param player locked player instance
2928  * @param state A, when only A is set, B when both A and B are set, None by
2929  * default
2930  * @param time valid time or VLC_TICK_INVALID of the current state
2931  * @param pos valid pos of the current state
2932  * @param data opaque pointer set by vlc_player_AddListener()
2933  */
2934  void (*on_atobloop_changed)(vlc_player_t *player,
2935  enum vlc_player_abloop new_state, vlc_tick_t time, float pos,
2936  void *data);
2937 
2938  /**
2939  * Called when media stopped action has changed
2940  *
2941  * @see vlc_player_SetMediaStoppedAction()
2942  *
2943  * @param player locked player instance
2944  * @param new_action action to execute when a media is stopped
2945  * @param data opaque pointer set by vlc_player_AddListener()
2946  */
2947  void (*on_media_stopped_action_changed)(vlc_player_t *player,
2948  enum vlc_player_media_stopped_action new_action, void *data);
2949 
2950  /**
2951  * Called when the media meta has changed
2952  *
2953  * @param player locked player instance
2954  * @param media current media
2955  * @param data opaque pointer set by vlc_player_AddListener()
2956  */
2957  void (*on_media_meta_changed)(vlc_player_t *player,
2958  input_item_t *media, void *data);
2959 
2960  /**
2961  * Called when media epg has changed
2962  *
2963  * @param player locked player instance
2964  * @param media current media
2965  * @param data opaque pointer set by vlc_player_AddListener()
2966  */
2967  void (*on_media_epg_changed)(vlc_player_t *player,
2968  input_item_t *media, void *data);
2969 
2970  /**
2971  * Called when the media has new subitems
2972  *
2973  * @param player locked player instance
2974  * @param media current media
2975  * @param new_subitems node representing all media subitems
2976  * @param data opaque pointer set by vlc_player_AddListener()
2977  */
2978  void (*on_media_subitems_changed)(vlc_player_t *player,
2979  input_item_t *media, input_item_node_t *new_subitems, void *data);
2980 
2981  /**
2982  * Called when a vout is started or stopped
2983  *
2984  * @note In case, several media with only one video track are played
2985  * successively, the same vout instance will be started and stopped several
2986  * time.
2987  *
2988  * @param player locked player instance
2989  * @param action started or stopped
2990  * @param vout vout (can't be NULL)
2991  * @param order vout order
2992  * @param es_id the ES id associated with this vout
2993  * @param data opaque pointer set by vlc_player_AddListener()
2994  */
2995  void (*on_vout_changed)(vlc_player_t *player,
2997  enum vlc_vout_order order, vlc_es_id_t *es_id, void *data);
2998 
2999  /**
3000  * Called when the player is corked
3001  *
3002  * The player can be corked when the audio output loose focus or when a
3003  * renderer was paused from the outside.
3004  *
3005  * @note called only if pause on cork was not set to true (by
3006  * vlc_player_SetPauseOnCork())
3007  * @note a cork_count higher than 0 means the player is corked. In that
3008  * case, the user should pause the player and release all external resource
3009  * needed by the player. A value higher than 1 mean that the player was
3010  * corked more than one time (for different reasons). A value of 0 means
3011  * the player is no longer corked. In that case, the user could resume the
3012  * player.
3013  *
3014  * @param player locked player instance
3015  * @param cork_count 0 for uncorked, > 0 for corked
3016  * @param data opaque pointer set by vlc_player_AddListener()
3017  */
3018  void (*on_cork_changed)(vlc_player_t *player, unsigned cork_count,
3019  void *data);
3020 };
3021 
3022 /**
3023  * Add a listener callback
3024  *
3025  * @note Every registered callbacks need to be removed by the caller with
3026  * vlc_player_RemoveListener().
3027  *
3028  * @param player locked player instance
3029  * @param cbs pointer to a vlc_player_cbs structure, the structure must be
3030  * valid during the lifetime of the player
3031  * @param cbs_data opaque pointer used by the callbacks
3032  * @return a valid listener id, or NULL in case of allocation error
3033  */
3034 VLC_API vlc_player_listener_id *
3036  const struct vlc_player_cbs *cbs, void *cbs_data);
3037 
3038 /**
3039  * Remove a listener callback
3040  *
3041  * @param player locked player instance
3042  * @param listener_id listener id returned by vlc_player_AddListener()
3043  */
3044 VLC_API void
3046  vlc_player_listener_id *listener_id);
3047 
3048 /** @} vlc_player__events */
3049 
3050 /**
3051  * @defgroup vlc_player__timer Player timer
3052  * @{
3053  */
3054 
3055 /**
3056  * Player timer opaque structure.
3057  */
3060 /**
3061  * Player timer point
3062  *
3063  * @see vlc_player_timer_cbs.on_update
3064  */
3067  /** Position in the range [0.0f;1.0] */
3068  float position;
3069  /** Rate of the player */
3070  double rate;
3071  /** Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with
3072  * VLC_TICK_0 to get the original value. */
3073  vlc_tick_t ts;
3074  /** Valid length >= VLC_TICK_0 or VLC_TICK_INVALID */
3075  vlc_tick_t length;
3076  /** System date of this record (always valid), this date can be in the
3077  * future or in the past. The special value of INT64_MAX mean that the
3078  * clock was paused when this point was updated. In that case,
3079  * vlc_player_timer_point_Interpolate() will return the current ts/pos of
3080  * this point (there is nothing to interpolate). */
3081  vlc_tick_t system_date;
3082 };
3083 
3084 /**
3085  * Player smpte timecode
3086  *
3087  * @see vlc_player_timer_smpte_cbs
3088  */
3091  /** Hours [0;n] */
3092  unsigned hours;
3093  /** Minutes [0;59] */
3094  unsigned minutes;
3095  /** Seconds [0;59] */
3096  unsigned seconds;
3097  /** Frame number [0;n] */
3098  unsigned frames;
3099  /** Maximum number of digits needed to display the frame number */
3100  unsigned frame_resolution;
3101  /** True if the source is NTSC 29.97fps or 59.94fps DF */
3102  bool drop_frame;
3103 };
3104 
3105 /**
3106  * Player timer callbacks
3107  *
3108  * @see vlc_player_AddTimer
3109  */
3110 struct vlc_player_timer_cbs
3112  /**
3113  * Called when the state or the time changed.
3114  *
3115  * Get notified when the time is updated by the input or output source. The
3116  * input source is the 'demux' or the 'access_demux'. The output source are
3117  * audio and video outputs: an update is received each time a video frame
3118  * is displayed or an audio sample is written. The delay between each
3119  * updates may depend on the input and source type (it can be every 5ms,
3120  * 30ms, 1s or 10s...). The user of this timer may need to update the
3121  * position at a higher frequency from its own mainloop via
3122  * vlc_player_timer_point_Interpolate().
3123  *
3124  * @warning The player is not locked from this callback. It is forbidden
3125  * to call any player functions from here.
3126  *
3127  * @param value always valid, the time corresponding to the state
3128  * @param data opaque pointer set by vlc_player_AddTimer()
3129  */
3130  void (*on_update)(const struct vlc_player_timer_point *value, void *data);
3132  /**
3133  * The player is paused or a discontinuity occurred, likely caused by seek
3134  * from the user or because the playback is stopped. The player user should
3135  * stop its "interpolate" timer.
3136  *
3137  * @param system_date system date of this event, only valid when paused. It
3138  * can be used to interpolate the last updated point to this date in order
3139  * to get the last paused ts/position.
3140  * @param data opaque pointer set by vlc_player_AddTimer()
3141  */
3142  void (*on_discontinuity)(vlc_tick_t system_date, void *data);
3143 };
3144 
3145 /**
3146  * Player smpte timer callbacks
3147  *
3148  * @see vlc_player_AddSmpteTimer
3149  */
3152  /**
3153  * Called when a new frame is displayed
3154 
3155  * @warning The player is not locked from this callback. It is forbidden
3156  * to call any player functions from here.
3157  *
3158  * @param tc always valid, the timecode corresponding to the frame just
3159  * displayed
3160  * @param data opaque pointer set by vlc_player_AddTimer()
3161  */
3162  void (*on_update)(const struct vlc_player_timer_smpte_timecode *tc,
3163  void *data);
3164 };
3165 
3166 /**
3167  * Add a timer in order to get times updates
3168  *
3169  * @param player player instance (locked or not)
3170  * @param min_period corresponds to the minimum period between each updates,
3171  * use it to avoid flood from too many source updates, set it to
3172  * VLC_TICK_INVALID to receive all updates.
3173  * @param cbs pointer to a vlc_player_timer_cbs structure, the structure must
3174  * be valid during the lifetime of the player
3175  * @param cbs_data opaque pointer used by the callbacks
3176  * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3177  * error
3178  */
3180 vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period,
3181  const struct vlc_player_timer_cbs *cbs, void *data);
3182 
3183 /**
3184  * Add a smpte timer in order to get accurate video frame updates
3185  *
3186  * @param player player instance (locked or not)
3187  * @param cbs pointer to a vlc_player_timer_smpte_cbs structure, the structure must
3188  * be valid during the lifetime of the player
3189  * @param cbs_data opaque pointer used by the callbacks
3190  * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3191  * error
3192  */
3195  const struct vlc_player_timer_smpte_cbs *cbs,
3196  void *data);
3197 
3198 /**
3199  * Remove a player timer
3200  *
3201  * @param player player instance (locked or not)
3202  * @param timer timer created by vlc_player_AddTimer()
3203  */
3204 VLC_API void
3206 
3207 /**
3208  * Interpolate the last timer value to now
3209  *
3210  * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3211  * callback
3212  * @param system_now current system date
3213  * @param player_rate rate of the player
3214  * @param out_ts pointer where to set the interpolated ts, subtract this time
3215  * with VLC_TICK_0 to get the original value.
3216  * @param out_pos pointer where to set the interpolated position
3217  * @return VLC_SUCCESS in case of success, an error in the interpolated ts is
3218  * negative (could happen during the buffering step)
3219  */
3220 VLC_API int
3222  vlc_tick_t system_now,
3223  vlc_tick_t *out_ts, float *out_pos);
3224 
3225 /**
3226  * Get the date of the next interval
3227  *
3228  * Can be used to setup an UI timer in order to update some widgets at specific
3229  * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3230  * time widget when the media reaches a new second.
3231  *
3232  * @note The media time doesn't necessarily correspond to the system time, that
3233  * is why this function is needed and use the rate of the current point.
3234  *
3235  * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3236  * @param system_now current system date
3237  * @param interpolated_ts ts returned by vlc_player_timer_point_Interpolate()
3238  * with the same system now
3239  * @param next_interval next interval
3240  * @return the absolute system date of the next interval
3241  */
3244  vlc_tick_t system_now,
3245  vlc_tick_t interpolated_ts,
3246  vlc_tick_t next_interval);
3247 
3248 /** @} vlc_player__timer */
3249 
3250 /** @} vlc_player */
3251 
3252 #endif
void vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index)
Select a chapter index for the current media.
Definition: player.c:872
static void vlc_player_SetTime(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time precisely.
Definition: vlc_player.h:744
void vlc_player_program_Delete(struct vlc_player_program *prgm)
Delete a duplicated program.
Definition: track.c:82
int vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result)
Increment the audio volume.
Definition: aout.c:147
Stop, even if there is a next media to play.
Definition: vlc_player.h:102
void vlc_player_aout_RemoveListener(vlc_player_t *player, vlc_player_aout_listener_id *listener_id)
Remove a aout listener callback.
Definition: aout.c:71
Pause when reaching the end of file.
Definition: vlc_player.h:100
#define VLC_PLAYER_CAP_PAUSE
Player capability: can pause.
Definition: vlc_player.h:360
Player timer point.
Definition: vlc_player.h:3066
vlc_player_nav
Menu (VCD/DVD/BD) and viewpoint navigations.
Definition: vlc_player.h:329
Given time/position.
Definition: vlc_player.h:319
Exit VLC.
Definition: vlc_player.h:104
static input_item_t * vlc_player_HoldCurrentMedia(vlc_player_t *player)
Helper that hold the current media.
Definition: vlc_player.h:414
vlc_tick_t vlc_player_GetEsIdDelay(vlc_player_t *player, vlc_es_id_t *es_id)
Get the delay of a track.
Definition: player.c:1687
static vlc_tick_t vlc_player_GetSubtitleDelay(vlc_player_t *player)
Helper to get the subtitle delay.
Definition: vlc_player.h:1932
void vlc_player_SelectTitle(vlc_player_t *player, const struct vlc_player_title *title)
Select a title for the current media.
Definition: player.c:819
vlc_tick_t vlc_player_GetCategoryDelay(vlc_player_t *player, enum es_format_category_e cat)
Get the delay of an ES category for the current media.
Definition: player.c:1634
static bool vlc_player_IsStarted(vlc_player_t *player)
Helper to get the started state.
Definition: vlc_player.h:510
static void vlc_player_TogglePause(vlc_player_t *player)
Helper to toggle the pause state.
Definition: vlc_player.h:536
void vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused)
Ask to start in a paused state.
Definition: player.c:1181
Definition: vlc_es.h:604
float vlc_player_GetRate(vlc_player_t *player)
Get the rate of the player.
Definition: player.c:1249
Definition: player.h:201
vlc_renderer_item_t * vlc_player_GetRenderer(vlc_player_t *player)
Get the renderer.
Definition: player.c:1434
Definition: vlc_player.h:353
void vlc_player_SeekByPos(vlc_player_t *player, float position, enum vlc_player_seek_speed speed, enum vlc_player_whence whence)
Seek the current media by position.
Definition: player.c:1365
Definition: vlc_player.h:2551
static void vlc_player_JumpPos(vlc_player_t *player, float jumppos)
Helper to jump the position precisely.
Definition: vlc_player.h:732
enum vlc_player_state vlc_player_GetState(vlc_player_t *player)
Get the state of the player.
Definition: player.c:1228
void vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index)
Select a title index for the current media.
Definition: player.c:810
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:77
int vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add)
Enable or disable an audio filter.
Definition: aout.c:183
Activate the popup Menu (for BD)
Definition: vlc_player.h:342
const struct vlc_player_program * vlc_player_GetProgram(vlc_player_t *player, int group_id)
Get a program from an ES group identifier.
Definition: player.c:265
const struct vlc_player_track * vlc_player_GetTrack(vlc_player_t *player, vlc_es_id_t *es_id)
Get a track from an ES identifier.
Definition: player.c:386
static void vlc_player_ToggleSubtitle(vlc_player_t *player)
Helper to toggle subtitles.
Definition: vlc_player.h:1810
Player vout callbacks.
Definition: vlc_player.h:2338
void vlc_player_ChangeRate(vlc_player_t *player, float rate)
Change the rate of the player.
Definition: player.c:1259
void vlc_player_SelectChapter(vlc_player_t *player, const struct vlc_player_title *title, size_t chapter_idx)
Select a chapter for the current media.
Definition: player.c:828
bool vlc_player_vout_IsWallpaperModeEnabled(vlc_player_t *player)
Check if the player has wallpaper-mode enaled.
Definition: vout.c:186
vout_thread_t * vlc_player_vout_Hold(vlc_player_t *player)
Get and hold the main video output.
Definition: vout.c:43
void vlc_player_SetMediaStoppedAction(vlc_player_t *player, enum vlc_player_media_stopped_action action)
Setup an action when a media is stopped.
Definition: player.c:1170
void vlc_player_SelectProgram(vlc_player_t *player, int group_id)
Select a program from an ES group identifier.
Definition: player.c:278
void vlc_player_SetTrackCategoryEnabled(vlc_player_t *player, enum es_format_category_e cat, bool enabled)
Enable or disable a track category.
Definition: player.c:1708
int vlc_player_aout_IsMuted(vlc_player_t *player)
Check if the audio output is muted.
Definition: aout.c:159
static void vlc_player_RestartTrackCategory(vlc_player_t *player, enum es_format_category_e cat)
Helper to restart all selected tracks from an ES category.
Definition: vlc_player.h:1664
Definition: vlc_player.h:292
Definition: vlc_input_item.h:191
int vlc_player_AddAssociatedMedia(vlc_player_t *player, enum es_format_category_e cat, const char *uri, bool select, bool notify, bool check_ext)
Add an associated (or external) media to the current media.
Definition: player.c:1016
void vlc_player_SetRenderer(vlc_player_t *player, vlc_renderer_item_t *renderer)
Set the renderer.
Definition: player.c:1414
unsigned vlc_player_GetTeletextPage(vlc_player_t *player)
Get the current teletext page.
Definition: player.c:767
void vlc_player_NextVideoFrame(vlc_player_t *player)
Pause and display the next video frame.
Definition: player.c:1216
static void vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable subtitle tracks.
Definition: vlc_player.h:1792
static bool vlc_player_IsVideoEnabled(vlc_player_t *player)
Helper to check if video tracks are enabled.
Definition: vlc_player.h:1765
vlc_tick_t system_date
System date of this record (always valid), this date can be in the future or in the past...
Definition: vlc_player.h:3082
void vlc_player_SelectNextProgram(vlc_player_t *player)
Select the next program.
Definition: player.c:331
static void vlc_player_UnselectTrackCategory(vlc_player_t *player, enum es_format_category_e cat)
Helper to unselect all tracks from an ES category.
Definition: vlc_player.h:1623
size_t chapter_count
Number of chapters, can be 0.
Definition: vlc_player.h:951
Do a precise seek.
Definition: vlc_player.h:304
#define VLC_DEPRECATED
Deprecated functions or compound members annotation.
Definition: vlc_common.h:119
void vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Restart a track from an ES identifier.
Definition: player.c:663
Activate disc Root Menu.
Definition: vlc_player.h:344
Definition: player.h:129
static void vlc_player_SetTimeFast(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time fast.
Definition: vlc_player.h:754
Player aout callbacks.
Definition: vlc_player.h:2122
static bool vlc_player_CanChangeRate(vlc_player_t *player)
Helper to get the change-rate capability.
Definition: vlc_player.h:582
void vlc_player_Stop(vlc_player_t *player)
Stop the playback of the current media.
Definition: player.c:1152
The player is paused.
Definition: vlc_player.h:273
void vlc_player_SelectCategoryLanguage(vlc_player_t *player, enum es_format_category_e cat, const char *lang)
Select the language for an ES category.
Definition: player.c:672
void vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled)
Enable or disable teletext.
Definition: player.c:707
enum vlc_player_abloop vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, float *a_pos, vlc_tick_t *b_time, float *b_pos)
Get the A to B loop status.
Definition: player.c:1498
Player smpte timer callbacks.
Definition: vlc_player.h:3151
void vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page)
Select a teletext page or do an action from a key.
Definition: player.c:720
const struct vlc_player_chapter * chapters
Array of chapters, can be NULL.
Definition: vlc_player.h:953
const struct input_stats_t * vlc_player_GetStatistics(vlc_player_t *player)
Get the statistics of the current media.
Definition: player.c:1764
static bool vlc_player_CanPause(vlc_player_t *player)
Helper to get the pause capability.
Definition: vlc_player.h:573
static bool vlc_player_CanRewind(vlc_player_t *player)
Helper to get the rewindable capability.
Definition: vlc_player.h:591
Definition: vlc_player.h:291
int vlc_player_GetCapabilities(vlc_player_t *player)
Get the player capabilities.
Definition: player.c:1242
Player track structure.
Definition: vlc_player.h:1312
vlc_tick_t vlc_player_timer_point_GetNextIntervalDate(const struct vlc_player_timer_point *point, vlc_tick_t system_now, vlc_tick_t interpolated_ts, vlc_tick_t next_interval)
Get the date of the next interval.
Definition: timer.c:504
The player is started.
Definition: vlc_player.h:258
void vlc_player_vout_RemoveListener(vlc_player_t *player, vlc_player_vout_listener_id *listener_id)
Remove a vout listener callback.
Definition: vout.c:89
vlc_player_timer_id * vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period, const struct vlc_player_timer_cbs *cbs, void *data)
Add a timer in order to get times updates.
Definition: timer.c:407
vlc_es_id_t * es_id
Id used for any player actions, like vlc_player_SelectEsId()
Definition: vlc_player.h:1315
vlc_player_error
Error of the player.
Definition: vlc_player.h:289
Player smpte timecode.
Definition: vlc_player.h:3090
Player timer callbacks.
Definition: vlc_player.h:3111
int vlc_player_Start(vlc_player_t *player)
Start the playback of the current media.
Definition: player.c:1103
Activate the navigation item selected.
Definition: vlc_player.h:332
enum vlc_player_error vlc_player_GetError(vlc_player_t *player)
Get the error state of the player.
Definition: player.c:1235
Definition: vlc_es.h:605
static void vlc_player_RestartTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to restart a track.
Definition: vlc_player.h:1654
static const struct vlc_player_track * vlc_player_GetSelectedTrack(vlc_player_t *player, enum es_format_category_e cat)
Helper to get the selected track from an ES category.
Definition: vlc_player.h:1491
void vlc_player_SelectNextTrack(vlc_player_t *player, enum es_format_category_e cat)
Select the next track.
Definition: player.c:636
static size_t vlc_player_GetAudioTrackCount(vlc_player_t *player)
Helper to get the audio track count.
Definition: vlc_player.h:1399
vlc_player_seek_speed
Seek speed type.
Definition: vlc_player.h:301
void vlc_player_track_Delete(struct vlc_player_track *track)
Delete a duplicated track.
Definition: track.c:148
static size_t vlc_player_GetSubtitleTrackCount(vlc_player_t *player)
Helper to get the subtitle track count.
Definition: vlc_player.h:1417
vout_thread_t ** vlc_player_vout_HoldAll(vlc_player_t *player, size_t *count)
Get and hold the list of video output.
Definition: vout.c:50
size_t vlc_player_GetProgramCount(vlc_player_t *player)
Get the number of programs.
Definition: player.c:245
Definition: renderer_discovery.c:34
Definition: vlc_player.h:352
es_format_category_e
ES Categories.
Definition: vlc_es.h:600
vlc_player_list_action
Action of vlc_player_cbs.on_track_list_changed, vlc_player_cbs.on_program_list_changed callbacks...
Definition: vlc_player.h:2547
static const struct vlc_player_program * vlc_player_GetSelectedProgram(vlc_player_t *player)
Helper to get the current selected program.
Definition: vlc_player.h:1260
static void vlc_player_JumpTime(vlc_player_t *player, vlc_tick_t jumptime)
Helper to jump the time precisely.
Definition: vlc_player.h:764
void vlc_player_vout_Snapshot(vlc_player_t *player)
Take a snapshot on all vouts.
Definition: vout.c:200
void vlc_player_DisplayPosition(vlc_player_t *player)
Display the player position on the vout OSD.
Definition: player.c:1353
static bool vlc_player_IsSubtitleEnabled(vlc_player_t *player)
Helper to check if subtitle tracks are enabled.
Definition: vlc_player.h:1801
void vlc_player_Lock(vlc_player_t *player)
Lock the player.
Definition: player.c:908
int vlc_player_timer_point_Interpolate(const struct vlc_player_timer_point *point, vlc_tick_t system_now, vlc_tick_t *out_ts, float *out_pos)
Interpolate the last timer value to now.
Definition: timer.c:463
Player program structure.
Definition: vlc_player.h:1159
void vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled)
Enable or disable teletext transparency.
Definition: player.c:734
void vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
Enable or disable the player fullscreen state.
Definition: vout.c:178
Definition: player.h:122
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45
vlc_player_select_policy
Player selection policy.
Definition: vlc_player.h:1286
static vlc_tick_t vlc_player_GetAudioDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition: vlc_player.h:1912
Select a navigation item above or move the viewpoint up.
Definition: vlc_player.h:334
int vlc_player_SetAtoBLoop(vlc_player_t *player, enum vlc_player_abloop abloop)
Enable A to B loop of the current media.
Definition: player.c:1441
static bool vlc_player_IsAudioEnabled(vlc_player_t *player)
Helper to check if audio tracks are enabled.
Definition: vlc_player.h:1783
vlc_player_abloop
A to B loop state.
Definition: vlc_player.h:350
vlc_player_media_stopped_action
Action when the player is stopped.
Definition: vlc_player.h:96
vlc_player_whence
Player seek/delay directive.
Definition: vlc_player.h:316
unsigned vlc_player_SelectEsIdList(vlc_player_t *player, enum es_format_category_e cat, vlc_es_id_t *const es_id_list[])
Select multiple tracks from a list of ES identifiers.
Definition: player.c:435
void vlc_player_RemoveTimer(vlc_player_t *player, vlc_player_timer_id *timer)
Remove a player timer.
Definition: timer.c:451
Definition: player.h:47
void vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps)
Set the associated subtitle FPS.
Definition: player.c:1071
#define VLC_PLAYER_CAP_SEEK
Player capability: can seek.
Definition: vlc_player.h:358
void vlc_player_Pause(vlc_player_t *player)
Pause the playback.
Definition: player.c:1204
#define VLC_PLAYER_CAP_CHANGE_RATE
Player capability: can change the rate.
Definition: vlc_player.h:362
vlc_player_lock_type
Player lock type (normal or reentrant)
Definition: vlc_player.h:71
static void vlc_player_ToggleRecording(vlc_player_t *player)
Helper to toggle the recording state.
Definition: vlc_player.h:865
static const struct vlc_player_chapter * vlc_player_GetSelectedChapter(vlc_player_t *player)
Helper to get the current selected chapter.
Definition: vlc_player.h:1110
Definition: player.h:115
void vlc_player_SeekByTime(vlc_player_t *player, vlc_tick_t time, enum vlc_player_seek_speed speed, enum vlc_player_whence whence)
Seek the current media by time.
Definition: player.c:1390
Viewpoints.
Definition: vlc_viewpoint.h:41
bool vlc_player_vout_IsFullscreen(vlc_player_t *player)
Check if the player is fullscreen.
Definition: vout.c:101
Definition: vlc_es.h:603
The player is stopping.
Definition: vlc_player.h:281
static void vlc_player_SetPosition(vlc_player_t *player, float position)
Helper to set the absolute position precisely.
Definition: vlc_player.h:712
static void vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
Helper to select the audio language.
Definition: vlc_player.h:1714
Definition: vlc_es.h:617
const struct vlc_player_track * vlc_player_GetTrackAt(vlc_player_t *player, enum es_format_category_e cat, size_t index)
Get the track at a specific index for an ES category.
Definition: player.c:356
void vlc_player_DecrementRate(vlc_player_t *player)
Decrement the rate of the player (Slower)
Definition: player.c:1310
float vlc_player_aout_GetVolume(vlc_player_t *player)
Get the audio volume.
Definition: aout.c:123
Player callbacks.
Definition: vlc_player.h:2568
static void vlc_player_UnselectTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to unselect a track.
Definition: vlc_player.h:1613
int vlc_player_aout_SetVolume(vlc_player_t *player, float volume)
Set the audio volume.
Definition: aout.c:135
Select a navigation item on the right or move the viewpoint right.
Definition: vlc_player.h:340
Player chapter structure.
Definition: vlc_player.h:927
size_t count
Definition: core.c:402
Video output thread descriptor.
Definition: vlc_vout.h:60
void vlc_player_InvalidateNextMedia(vlc_player_t *player)
Invalidate the next media.
Definition: player.c:1090
void vlc_player_SelectNextChapter(vlc_player_t *player)
Select the next chapter for the current media.
Definition: player.c:884
vlc_player_title_list * vlc_player_title_list_Hold(vlc_player_title_list *titles)
Hold the title list of the player.
Definition: title.c:31
unsigned vlc_player_SelectEsId(vlc_player_t *player, vlc_es_id_t *es_id, enum vlc_player_select_policy policy)
Select a track from an ES identifier.
Definition: player.c:525
audio_output_t * vlc_player_aout_Hold(vlc_player_t *player)
Get the audio output.
Definition: aout.c:44
static const struct vlc_player_track * vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
Helper to get a video track at a specific index.
Definition: vlc_player.h:1390
void vlc_player_SelectPrevTrack(vlc_player_t *player, enum es_format_category_e cat)
Select the Previous track.
Definition: player.c:643
int vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength)
Get the signal quality and strength of the current media.
Definition: player.c:1749
#define VLC_PLAYER_CAP_REWIND
Player capability: can seek back.
Definition: vlc_player.h:364
vlc_player_timer_id * vlc_player_AddSmpteTimer(vlc_player_t *player, const struct vlc_player_timer_smpte_cbs *cbs, void *data)
Add a smpte timer in order to get accurate video frame updates.
Definition: timer.c:429
static const struct vlc_player_track * vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
Helper to get a subtitle track at a specific index.
Definition: vlc_player.h:1426
Player title structure.
Definition: vlc_player.h:941
void vlc_player_Unlock(vlc_player_t *player)
Unlock the player.
Definition: player.c:922
const struct vlc_player_title * vlc_player_title_list_GetAt(vlc_player_title_list *titles, size_t idx)
Get the title at a given index.
Definition: title.c:164
Opaque structure representing an ES (Elementary Stream) track.
Definition: es_out.c:88
bool vlc_player_IsRecording(vlc_player_t *player)
Check if the playing is recording.
Definition: player.c:1577
const char name[16]
Definition: httpd.c:1236
pthread_cond_t vlc_cond_t
Condition variable.
Definition: vlc_threads.h:290
Reentrant lock.
Definition: vlc_player.h:88
struct vlc_player_track * vlc_player_track_Dup(const struct vlc_player_track *track)
Duplicate a track.
Definition: track.c:156
vlc_tick_t vlc_player_GetLength(vlc_player_t *player)
Get the length of the current media.
Definition: player.c:1316
vlc_tick_t vlc_player_GetTime(vlc_player_t *player)
Get the time of the current media.
Definition: player.c:1323
float vlc_player_GetAssociatedSubsFPS(vlc_player_t *player)
Get the associated subtitle FPS.
Definition: player.c:1083
Audio output modules interface.
vlc_vout_order
vout or spu_channel order
Definition: vlc_vout.h:78
vlc_player_vout_listener_id * vlc_player_vout_AddListener(vlc_player_t *player, const struct vlc_player_vout_cbs *cbs, void *cbs_data)
Add a listener callback for video output events.
Definition: vout.c:68
static void vlc_player_SetSubtitleDelay(vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
Helper to set the subtitle delay.
Definition: vlc_player.h:1941
Definition: vlc_player.h:2322
#define VLC_API
Definition: fourcc_gen.c:31
Audio output object.
Definition: vlc_aout.h:140
Definition: vlc_player.h:2549
vlc_es_id_t * vlc_player_GetEsIdFromVout(vlc_player_t *player, vout_thread_t *vout)
Get the ES identifier of a video output.
Definition: player.c:409
Select multiple tracks for one category.
Definition: vlc_player.h:1300
int vlc_player_SetCurrentMedia(vlc_player_t *player, input_item_t *media)
Set the current media.
Definition: player.c:965
void vlc_player_SelectPrevTitle(vlc_player_t *player)
Select the previous title for the current media.
Definition: player.c:850
int group_id
Id used for vlc_player_SelectProgram()
Definition: vlc_player.h:1162
Definition: player.h:143
void vlc_player_RemoveListener(vlc_player_t *player, vlc_player_listener_id *listener_id)
Remove a listener callback.
Definition: player.c:954
input_item_t * vlc_player_GetCurrentMedia(vlc_player_t *player)
Get the current played media.
Definition: player.c:1008
vlc_player_t * vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type, const struct vlc_player_media_provider *media_provider, void *media_provider_data)
Create a new player instance.
Definition: player.c:1887
bool vlc_player_IsTeletextEnabled(vlc_player_t *player)
Check if teletext is enabled.
Definition: player.c:755
void vlc_player_UpdateViewpoint(vlc_player_t *player, const vlc_viewpoint_t *viewpoint, enum vlc_player_whence whence)
Update the viewpoint.
Definition: player.c:1559
vlc_object_t * vlc_player_GetV4l2Object(vlc_player_t *player)
Get the V4L2 object used to do controls.
Definition: player.c:1817
static void vlc_player_SetAudioDelay(vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
Helper to set the audio delay.
Definition: vlc_player.h:1921
void vlc_player_SelectPrevProgram(vlc_player_t *player)
Select the previous program.
Definition: player.c:337
Normal lock.
Definition: vlc_player.h:79
static const struct vlc_player_track * vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
Helper to get an audio track at a specific index.
Definition: vlc_player.h:1408
static void vlc_player_vout_ToggleFullscreen(vlc_player_t *player)
Helper to toggle the player fullscreen state.
Definition: vlc_player.h:2462
static void vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
Helper to select the subtitle language.
Definition: vlc_player.h:1723
void vlc_player_CondWait(vlc_player_t *player, vlc_cond_t *cond)
Wait on a condition variable.
Definition: player.c:928
static size_t vlc_player_GetVideoTrackCount(vlc_player_t *player)
Helper to get the video track count.
Definition: vlc_player.h:1381
int vlc_player_aout_Mute(vlc_player_t *player, bool mute)
Mute or unmute the audio output.
Definition: aout.c:171
const struct vlc_player_program * vlc_player_GetProgramAt(vlc_player_t *player, size_t index)
Get the program at a specific index.
Definition: player.c:253
void vlc_player_SelectPrevChapter(vlc_player_t *player)
Select the previous chapter for the current media.
Definition: player.c:896
void vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Unselect a track from an ES identifier.
Definition: player.c:650
size_t vlc_player_GetTrackCount(vlc_player_t *player, enum es_format_category_e cat)
Get the number of tracks for an ES category.
Definition: player.c:343
Do a fast seek.
Definition: vlc_player.h:306
vlc_player_state
State of the player.
Definition: vlc_player.h:243
Only one track per category is selected.
Definition: vlc_player.h:1292
static int vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
Helper to decrement the audio volume.
Definition: vlc_player.h:2247
Definition: vlc_input_item.h:504
The current position +/- the given time/position.
Definition: vlc_player.h:321
The player is stopped.
Definition: vlc_player.h:251
void vlc_player_IncrementRate(vlc_player_t *player)
Increment the rate of the player (faster)
Definition: player.c:1304
Input thread interface.
Continue (or stop if there is no next media), default behavior.
Definition: vlc_player.h:98
void vlc_player_SelectNextTitle(vlc_player_t *player)
Select the next title for the current media.
Definition: player.c:838
void vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale)
Set the subtitle text scaling factor.
Definition: player.c:1736
The player is playing.
Definition: vlc_player.h:266
static bool vlc_player_CanSeek(vlc_player_t *player)
Helper to get the seek capability.
Definition: vlc_player.h:564
void vlc_player_title_list_Release(vlc_player_title_list *titles)
Release of previously held title list.
Definition: title.c:38
static void vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable audio tracks.
Definition: vlc_player.h:1774
Definition: vlc_player.h:2323
void vlc_player_Delete(vlc_player_t *player)
Delete a player instance.
Definition: player.c:1849
static unsigned vlc_player_SelectTrack(vlc_player_t *player, const struct vlc_player_track *track, enum vlc_player_select_policy policy)
Helper to select a track.
Definition: vlc_player.h:1526
bool vlc_player_IsTrackCategoryEnabled(vlc_player_t *player, enum es_format_category_e cat)
Check if a track category is enabled.
Definition: player.c:1728
vlc_player_vout_action
action of vlc_player_cbs.on_vout_changed callback
Definition: vlc_player.h:2320
static void vlc_player_SetPositionFast(vlc_player_t *player, float position)
Helper to set the absolute position fast.
Definition: vlc_player.h:722
bool vlc_player_IsTeletextTransparent(vlc_player_t *player)
Check if teletext is transparent.
Definition: player.c:774
static bool vlc_player_IsPaused(vlc_player_t *player)
Helper to get the paused state.
Definition: vlc_player.h:527
void vlc_player_Resume(vlc_player_t *player)
Resume the playback from a pause.
Definition: player.c:1210
VLC object common members.
Definition: vlc_objects.h:43
unsigned vlc_player_GetSubtitleTextScale(vlc_player_t *player)
Get the subtitle text scaling factor.
Definition: player.c:1743
size_t vlc_player_title_list_GetCount(vlc_player_title_list *titles)
Get the number of title of a list.
Definition: title.c:171
static int vlc_player_aout_ToggleMute(vlc_player_t *player)
Helper to toggle the mute state.
Definition: vlc_player.h:2286
static void vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable video tracks.
Definition: vlc_player.h:1756
Select a navigation item under or move the viewpoint down.
Definition: vlc_player.h:336
bool selected
True if the track is selected.
Definition: vlc_player.h:1321
bool selected
True if the program is selected.
Definition: vlc_player.h:1166
static void vlc_player_vout_ToggleWallpaperMode(vlc_player_t *player)
Helper to toggle the player wallpaper-mode state.
Definition: vlc_player.h:2505
char * vlc_player_GetCategoryLanguage(vlc_player_t *player, enum es_format_category_e cat)
Get the language of an ES category.
Definition: player.c:691
void vlc_player_osd_Message(vlc_player_t *player, const char *fmt,...)
Display an OSD message on all vouts.
Definition: osd.c:88
ssize_t vlc_player_GetSelectedChapterIdx(vlc_player_t *player)
Get the selected chapter index for the current media.
Definition: player.c:862
int vlc_player_SetEsIdDelay(vlc_player_t *player, vlc_es_id_t *es_id, vlc_tick_t delay, enum vlc_player_whence whence)
Set the delay of one track.
Definition: player.c:1647
vlc_player_aout_listener_id * vlc_player_aout_AddListener(vlc_player_t *player, const struct vlc_player_aout_cbs *cbs, void *cbs_data)
Add a listener callback for audio output events.
Definition: aout.c:50
int vlc_player_SetCategoryDelay(vlc_player_t *player, enum es_format_category_e cat, vlc_tick_t delay, enum vlc_player_whence whence)
Set the delay of one category for the current media.
Definition: player.c:1600
input_item_t * input_item_Hold(input_item_t *p_item)
Holds an input item, i.e.
Definition: item.c:468
vout_thread_t * vlc_player_GetEsIdVout(vlc_player_t *player, vlc_es_id_t *es_id, enum vlc_vout_order *order)
Get and the video output used by a ES identifier.
Definition: player.c:394
float vlc_player_GetPosition(vlc_player_t *player)
Get the position of the current media.
Definition: player.c:1334
Callbacks for the owner of the player.
Definition: vlc_player.h:117
struct vlc_player_program * vlc_player_program_Dup(const struct vlc_player_program *prgm)
Duplicate a program.
Definition: track.c:69
vlc_player_listener_id * vlc_player_AddListener(vlc_player_t *player, const struct vlc_player_cbs *cbs, void *cbs_data)
Add a listener callback.
Definition: player.c:935
static const struct vlc_player_title * vlc_player_GetSelectedTitle(vlc_player_t *player)
Helper to get the current selected title.
Definition: vlc_player.h:1023
Definition: vlc_player.h:2550
bool vlc_player_HasTeletextMenu(vlc_player_t *player)
Check if the media has a teletext menu.
Definition: player.c:748
void vlc_player_Navigate(vlc_player_t *player, enum vlc_player_nav nav)
Navigate (for DVD/Bluray menus or viewpoint)
Definition: player.c:1521
vlc_player_title_list * vlc_player_GetTitleList(vlc_player_t *player)
Get the title list of the current media.
Definition: player.c:781
void vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled)
Enable or disable recording for the current media.
Definition: player.c:1585
void vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled)
Enable or disable pause on cork event.
Definition: player.c:1772
Select a navigation item on the left or move the viewpoint left.
Definition: vlc_player.h:338
Definition: vlc_player.h:354
ssize_t vlc_player_GetSelectedTitleIdx(vlc_player_t *player)
Get the selected title index for the current media.
Definition: player.c:788
void vlc_player_vout_SetWallpaperModeEnabled(vlc_player_t *player, bool enabled)
Enable or disable the player wallpaper-mode.
Definition: vout.c:192