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  */
251 
252  /**
253  * The player is started
254  *
255  * Triggered by vlc_player_Start()
256  */
258 
259  /**
260  * The player is playing
261  *
262  * Triggered by vlc_player_Resume() or by an internal transition from the
263  * STARTED state.
264  */
266 
267  /**
268  * The player is paused
269  *
270  * Triggered by vlc_player_Pause().
271  */
273 
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)
364 
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)
375 
377 {
381 };
382 
383 /**
384  * Set the current media
385  *
386  * This function replaces the current and next medias.
387  *
388  * @note A successful call will always result of
389  * vlc_player_cbs.on_current_media_changed being called. This function is not
390  * blocking. If a media is currently being played, this media will be stopped
391  * and the requested media will be set after.
392  *
393  * @warning This function is either synchronous (if the player state is
394  * STOPPED) or asynchronous. In the later case, vlc_player_GetCurrentMedia()
395  * will return the old media, even after this call, and until the
396  * vlc_player_cbs.on_current_media_changed is called.
397  *
398  * @param player locked player instance
399  * @param media new media to play (will be held by the player)
400  * @return VLC_SUCCESS or a VLC error code
401  */
402 VLC_API int
404 
405 /**
406  * Get the current played media.
407  *
408  * @see vlc_player_cbs.on_current_media_changed
409  *
410  * @param player locked player instance
411  * @return a valid media or NULL (if no media is set)
412  */
415 
416 /**
417  * Helper that hold the current media
418  */
419 static inline input_item_t *
421 {
423  return item ? input_item_Hold(item) : NULL;
424 }
425 
426 /**
427  * Invalidate the next media.
428  *
429  * This function can be used to invalidate the media returned by the
430  * vlc_player_media_provider.get_next callback. This can be used when the next
431  * item from a playlist was changed by the user.
432  *
433  * Calling this function will trigger the
434  * vlc_player_media_provider.get_next callback to be called again.
435  *
436  * @param player locked player instance
437  */
438 VLC_API void
440 
441 /**
442  * Start the playback of the current media.
443  *
444  * @param player locked player instance
445  * @return VLC_SUCCESS or a VLC error code
446  */
447 VLC_API int
449 
450 /**
451  * Stop the playback of the current media
452  *
453  * @note This function is asynchronous. In case of success, the user should wait
454  * for the STOPPED state event to know when the stop is finished.
455  *
456  * @param player locked player instance
457  * @return VLC_SUCCESS if the player is being stopped, VLC_EGENERIC otherwise
458  * (no-op)
459  */
460 VLC_API int
462 
463 /**
464  * Pause the playback
465  *
466  * @param player locked player instance
467  */
468 VLC_API void
470 
471 /**
472  * Resume the playback from a pause
473  *
474  * @param player locked player instance
475  */
476 VLC_API void
478 
479 /**
480  * Pause and display the next video frame
481  *
482  * @param player locked player instance
483  */
484 VLC_API void
486 
487 /**
488  * Get the state of the player
489  *
490  * @note Since all players actions are asynchronous, this function won't
491  * reflect the new state immediately. Wait for the
492  * vlc_players_cbs.on_state_changed event to be notified.
493  *
494  * @see vlc_player_state
495  * @see vlc_player_cbs.on_state_changed
496  *
497  * @param player locked player instance
498  * @return the current player state
499  */
502 
503 /**
504  * Get the error state of the player
505  *
506  * @see vlc_player_cbs.on_capabilities_changed
507  *
508  * @param player locked player instance
509  * @return the current error state
510  */
513 
514 /**
515  * Helper to get the started state
516  */
517 static inline bool
519 {
520  switch (vlc_player_GetState(player))
521  {
525  return true;
526  default:
527  return false;
528  }
529 }
530 
531 /**
532  * Helper to get the paused state
533  */
534 static inline bool
536 {
538 }
539 
540 /**
541  * Helper to toggle the pause state
542  */
543 static inline void
545 {
546  if (vlc_player_IsStarted(player))
547  {
548  if (vlc_player_IsPaused(player))
549  vlc_player_Resume(player);
550  else
551  vlc_player_Pause(player);
552  }
553 }
554 
555 /**
556  * Get the player capabilities
557  *
558  * @see vlc_player_cbs.on_capabilities_changed
559  *
560  * @param player locked player instance
561  * @return the player capabilities, a bitwise mask of @ref VLC_PLAYER_CAP_SEEK,
562  * @ref VLC_PLAYER_CAP_PAUSE, @ref VLC_PLAYER_CAP_CHANGE_RATE, @ref
563  * VLC_PLAYER_CAP_REWIND
564  */
565 VLC_API int
567 
568 /**
569  * Helper to get the seek capability
570  */
571 static inline bool
573 {
575 }
576 
577 /**
578  * Helper to get the pause capability
579  */
580 static inline bool
582 {
584 }
585 
586 /**
587  * Helper to get the change-rate capability
588  */
589 static inline bool
591 {
593 }
594 
595 /**
596  * Helper to get the rewindable capability
597  */
598 static inline bool
600 {
602 }
603 
604 /**
605  * Get the rate of the player
606  *
607  * @see vlc_player_cbs.on_rate_changed
608  *
609  * @param player locked player instance
610  * @return rate of the player (< 1.f is slower, > 1.f is faster)
611  */
612 VLC_API float
614 
615 /**
616  * Change the rate of the player
617  *
618  * @note The rate is saved across several medias
619  *
620  * @param player locked player instance
621  * @param rate new rate (< 1.f is slower, > 1.f is faster)
622  */
623 VLC_API void
624 vlc_player_ChangeRate(vlc_player_t *player, float rate);
625 
626 /**
627  * Increment the rate of the player (faster)
628  *
629  * @param player locked player instance
630  */
631 VLC_API void
633 
634 /**
635  * Decrement the rate of the player (Slower)
636  *
637  * @param player locked player instance
638  */
639 VLC_API void
641 
642 /**
643  * Get the length of the current media
644  *
645  * @note A started and playing media doesn't have necessarily a valid length.
646  *
647  * @see vlc_player_cbs.on_length_changed
648  *
649  * @param player locked player instance
650  * @return a valid length or VLC_TICK_INVALID (if no media is set,
651  * playback is not yet started or in case of error)
652  */
655 
656 /**
657  * Get the time of the current media
658  *
659  * @note A started and playing media doesn't have necessarily a valid time.
660  *
661  * @see vlc_player_cbs.on_position_changed
662  *
663  * @param player locked player instance
664  * @return a valid time or VLC_TICK_INVALID (if no media is set, the media
665  * doesn't have any time, if playback is not yet started or in case of error)
666  */
669 
670 /**
671  * Get the position of the current media
672  *
673  * @see vlc_player_cbs.on_position_changed
674  *
675  * @param player locked player instance
676  * @return a valid position in the range [0.f;1.f] or -1.f (if no media is
677  * set,if playback is not yet started or in case of error)
678  */
679 VLC_API float
681 
682 /**
683  * Seek the current media by position
684  *
685  * @note This function can be called before vlc_player_Start() in order to set
686  * a starting position.
687  *
688  * @param player locked player instance
689  * @param position position in the range [0.f;1.f]
690  * @param speed precise of fast
691  * @param whence absolute or relative
692  */
693 VLC_API void
694 vlc_player_SeekByPos(vlc_player_t *player, float position,
695  enum vlc_player_seek_speed speed,
696  enum vlc_player_whence whence);
697 
698 /**
699  * Seek the current media by time
700  *
701  * @note This function can be called before vlc_player_Start() in order to set
702  * a starting position.
703  *
704  * @warning This function has an effect only if the media has a valid length.
705  *
706  * @param player locked player instance
707  * @param time a time in the range [0;length]
708  * @param speed precise of fast
709  * @param whence absolute or relative
710  */
711 VLC_API void
713  enum vlc_player_seek_speed speed,
714  enum vlc_player_whence whence);
715 
716 /**
717  * Helper to set the absolute position precisely
718  */
719 static inline void
720 vlc_player_SetPosition(vlc_player_t *player, float position)
721 {
724 }
725 
726 /**
727  * Helper to set the absolute position fast
728  */
729 static inline void
730 vlc_player_SetPositionFast(vlc_player_t *player, float position)
731 {
732  vlc_player_SeekByPos(player, position, VLC_PLAYER_SEEK_FAST,
734 }
735 
736 /**
737  * Helper to jump the position precisely
738  */
739 static inline void
740 vlc_player_JumpPos(vlc_player_t *player, float jumppos)
741 {
742  /* No fask seek for jumps. Indeed, jumps can seek to the current position
743  * if not precise enough or if the jump value is too small. */
746 }
747 
748 /**
749  * Helper to set the absolute time precisely
750  */
751 static inline void
753 {
756 }
757 
758 /**
759  * Helper to set the absolute time fast
760  */
761 static inline void
763 {
766 }
767 
768 /**
769  * Helper to jump the time precisely
770  */
771 static inline void
773 {
774  /* No fask seek for jumps. Indeed, jumps can seek to the current position
775  * if not precise enough or if the jump value is too small. */
778 }
779 
780 /**
781  * Display the player position on the vout OSD
782  *
783  * @param player locked player instance
784  */
785 VLC_API void
787 
788 /**
789  * Enable A to B loop of the current media
790  *
791  * This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and
792  * VLC_PLAYER_ABLOOP_B to setup an A to B loop. It current the current
793  * time/position when called. The B time must be higher than the A time.
794  *
795  * @param player locked player instance
796  * @return VLC_SUCCESS or a VLC error code
797  */
798 VLC_API int
800 
801 /**
802  * Get the A to B loop status
803  *
804  * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
805  * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
806  * output parameters are valid. If the returned status is
807  * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
808  *
809  * @see vlc_player_cbs.on_atobloop_changed
810  *
811  * @param player locked player instance
812  * @param a_time A time or VLC_TICK_INVALID (if the media doesn't have valid
813  * times)
814  * @param a_pos A position
815  * @param b_time B time or VLC_TICK_INVALID (if the media doesn't have valid
816  * times)
817  * @param b_pos B position
818  * @return A to B loop status
819  */
821 vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, float *a_pos,
822  vlc_tick_t *b_time, float *b_pos);
823 
824 /**
825  * Navigate (for DVD/Bluray menus or viewpoint)
826  *
827  * @param player locked player instance
828  * @param nav navigation key
829  */
830 VLC_API void
832 
833 /**
834  * Update the viewpoint
835  *
836  * @param player locked player instance
837  * @param viewpoint the viewpoint value
838  * @param whence absolute or relative
839  * @return VLC_SUCCESS or a VLC error code
840  */
841 VLC_API void
843  const vlc_viewpoint_t *viewpoint,
844  enum vlc_player_whence whence);
845 
846 /**
847  * Check if the playing is recording
848  *
849  * @see vlc_player_cbs.on_recording_changed
850  *
851  * @param player locked player instance
852  * @return true if the player is recording
853  */
854 VLC_API bool
856 
857 /**
858  * Enable or disable recording for the current media
859  *
860  * @note A successful call will trigger the vlc_player_cbs.on_recording_changed
861  * event.
862  *
863  * @param player locked player instance
864  * @param enabled true to enable recording
865  */
866 VLC_API void
867 vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled);
868 
869 /**
870  * Helper to toggle the recording state
871  */
872 static inline void
874 {
876 }
877 
878 /**
879  * Add an associated (or external) media to the current media
880  *
881  * @param player locked player instance
882  * @param cat SPU_ES or UNKNOWN_ES
883  * @param uri absolute uri of the external media
884  * @param select true to select the track of this external media
885  * @param notify true to notify the OSD
886  * @param check_ext true to check subtitles extension
887  */
888 VLC_API int
890  enum es_format_category_e cat, const char *uri,
891  bool select, bool notify, bool check_ext);
892 
893 /**
894  * Get the signal quality and strength of the current media
895  *
896  * @param player locked player instance
897  */
898 VLC_API int
899 vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength);
900 
901 /**
902  * Get the statistics of the current media
903  *
904  * @warning The returned pointer becomes invalid when the player is unlocked.
905  * The referenced structure can be safely copied.
906  *
907  * @see vlc_player_cbs.on_statistics_changed
908  *
909  * @param player locked player instance
910  * @return pointer to the player stats structure or NULL
911  */
912 VLC_API const struct input_stats_t *
914 
915 /**
916  * Restore the previous playback position of the current media
917  */
918 VLC_API void
920 
921 /**
922  * Get the V4L2 object used to do controls
923  *
924  * @param player locked player instance
925  * @return the V4L2 object or NULL if not any. This object must be used with
926  * the player lock held.
927  */
930 
931 /** @} vlc_player__playback */
932 
933 /**
934  * @defgroup vlc_player__titles Title and chapter control
935  * @{
936  */
937 
938 /**
939  * Player chapter structure
940  */
941 struct vlc_player_chapter
942 {
943  /** Chapter name, always valid */
944  const char *name;
945  /** Position of this chapter */
947 };
948 
949 /** vlc_player_title.flags: The title is a menu. */
950 #define VLC_PLAYER_TITLE_MENU 0x01
951 /** vlc_player_title.flags: The title is interactive. */
952 #define VLC_PLAYER_TITLE_INTERACTIVE 0x02
953 
954 /** Player title structure */
955 struct vlc_player_title
956 {
957  /** Title name, always valid */
958  const char *name;
959  /** Length of the title */
961  /** Bit flag of @ref VLC_PLAYER_TITLE_MENU and @ref
962  * VLC_PLAYER_TITLE_INTERACTIVE */
963  unsigned flags;
964  /** Number of chapters, can be 0 */
965  size_t chapter_count;
966  /** Array of chapters, can be NULL */
967  const struct vlc_player_chapter *chapters;
968 };
969 
970 /**
971  * Opaque structure representing a list of @ref vlc_player_title.
972  *
973  * @see vlc_player_GetTitleList()
974  * @see vlc_player_title_list_GetCount()
975  * @see vlc_player_title_list_GetAt()
976  */
978 
979 /**
980  * Hold the title list of the player
981  *
982  * This function can be used to pass this title list from a callback to an
983  * other thread.
984  *
985  * @see vlc_player_cbs.on_titles_changed
986  *
987  * @return the same instance
988  */
991 
992 /**
993  * Release of previously held title list
994  */
995 VLC_API void
997 
998 /**
999  * Get the number of title of a list
1000  */
1001 VLC_API size_t
1003 
1004 /**
1005  * Get the title at a given index
1006  *
1007  * @param idx index in the range [0; count[
1008  * @return a valid title (can't be NULL)
1009  */
1010 VLC_API const struct vlc_player_title *
1012 
1013 /**
1014  * Get the title list of the current media
1015  *
1016  * @see vlc_player_cbs.on_titles_changed
1017  *
1018  * @param player locked player instance
1019  */
1022 
1023 /**
1024  * Get the selected title index for the current media
1025  *
1026  * @see vlc_player_cbs.on_title_selection_changed
1027  *
1028  * @param player locked player instance
1029  */
1030 VLC_API ssize_t
1032 
1033 /**
1034  * Helper to get the current selected title
1035  */
1036 static inline const struct vlc_player_title *
1040  if (!titles)
1041  return NULL;
1042  ssize_t selected_idx = vlc_player_GetSelectedTitleIdx(player);
1043  if (selected_idx < 0)
1044  return NULL;
1045  return vlc_player_title_list_GetAt(titles, selected_idx);
1046 }
1047 
1048 /**
1049  * Select a title index 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 index valid index in the range [0;count[
1059  */
1060 VLC_API void
1061 vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index);
1062 
1063 /**
1064  * Select a title for the current media
1065  *
1066  * @note A successful call will trigger the
1067  * vlc_player_cbs.on_title_selection_changed event.
1068  *
1069  * @see vlc_player_title_list_GetAt()
1070  * @see vlc_player_title_list_GetCount()
1071  *
1072  * @param player locked player instance
1073  * @param title a valid title coming from the vlc_player_title_list
1074  */
1075 VLC_API void
1077  const struct vlc_player_title *title);
1078 
1079 /**
1080  * Select a chapter for the current media
1081  *
1082  * @note A successful call will trigger the
1083  * vlc_player_cbs.on_chapter_selection_changed event.
1084  *
1085  * @param player locked player instance
1086  * @param title the selected title
1087  * @param chapter_idx index from vlc_player_title.chapters
1088  */
1089 VLC_API void
1091  const struct vlc_player_title *title,
1092  size_t chapter_idx);
1093 
1094 /**
1095  * Select the next title for the current media
1096  *
1097  * @see vlc_player_SelectTitleIdx()
1098  */
1099 VLC_API void
1101 
1102 /**
1103  * Select the previous title for the current media
1104  *
1105  * @see vlc_player_SelectTitleIdx()
1106  */
1107 VLC_API void
1109 
1110 /**
1111  * Get the selected chapter index for the current media
1112  *
1113  * @see vlc_player_cbs.on_chapter_selection_changed
1114  *
1115  * @param player locked player instance
1116  */
1117 VLC_API ssize_t
1119 
1120 /**
1121  * Helper to get the current selected chapter
1122  */
1123 static inline const struct vlc_player_chapter *
1126  const struct vlc_player_title *title = vlc_player_GetSelectedTitle(player);
1127  if (!title || !title->chapter_count)
1128  return NULL;
1129  ssize_t chapter_idx = vlc_player_GetSelectedChapterIdx(player);
1130  return chapter_idx >= 0 ? &title->chapters[chapter_idx] : NULL;
1131 }
1132 
1133 /**
1134  * Select a chapter index for the current media
1135  *
1136  * @note A successful call will trigger the
1137  * vlc_player_cbs.on_chaper_selection_changed event.
1138  *
1139  * @see vlc_player_title.chapters
1140  *
1141  * @param player locked player instance
1142  * @param index valid index in the range [0;vlc_player_title.chapter_count[
1143  */
1144 VLC_API void
1145 vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index);
1146 
1147 /**
1148  * Select the next chapter for the current media
1149  *
1150  * @see vlc_player_SelectChapterIdx()
1151  */
1152 VLC_API void
1154 
1155 /**
1156  * Select the previous chapter for the current media
1157  *
1158  * @see vlc_player_SelectChapterIdx()
1159  */
1160 VLC_API void
1162 
1163 /** @} vlc_player__titles */
1164 
1165 /**
1166  * @defgroup vlc_player__programs Program control
1167  * @{
1168  */
1169 
1170 /**
1171  * Player program structure.
1172  */
1173 struct vlc_player_program
1175  /** Id used for vlc_player_SelectProgram() */
1176  int group_id;
1177  /** Program name, always valid */
1178  const char *name;
1179  /** True if the program is selected */
1180  bool selected;
1181  /** True if the program is scrambled */
1182  bool scrambled;
1183 };
1184 
1185 /**
1186  * Duplicate a program
1187  *
1188  * This function can be used to pass a program from a callback to an other
1189  * context.
1190  *
1191  * @see vlc_player_cbs.on_program_list_changed
1192  *
1193  * @return a duplicated program or NULL on allocation error
1194  */
1195 VLC_API struct vlc_player_program *
1196 vlc_player_program_Dup(const struct vlc_player_program *prgm);
1197 
1198 /**
1199  * Delete a duplicated program
1200  */
1201 VLC_API void
1203 
1204 /**
1205  * Get the number of programs
1206  *
1207  * @warning The returned size becomes invalid when the player is unlocked.
1208  *
1209  * @param player locked player instance
1210  * @return number of programs, or 0 (in case of error, or if the media is not
1211  * started)
1212  */
1213 VLC_API size_t
1215 
1216 /**
1217  * Get the program at a specific index
1218  *
1219  * @warning The behaviour is undefined if the index is not valid.
1220  *
1221  * @warning The returned pointer becomes invalid when the player is unlocked.
1222  * The referenced structure can be safely copied with vlc_player_program_Dup().
1223  *
1224  * @param player locked player instance
1225  * @param index valid index in the range [0; count[
1226  * @return a valid program (can't be NULL if vlc_player_GetProgramCount()
1227  * returned a valid count)
1228  */
1229 VLC_API const struct vlc_player_program *
1230 vlc_player_GetProgramAt(vlc_player_t *player, size_t index);
1231 
1232 /**
1233  * Get a program from an ES group identifier
1234  *
1235  * @param player locked player instance
1236  * @param group_id a program ID (retrieved from
1237  * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1238  * @return a valid program or NULL (if the program was terminated by the
1239  * playback thread)
1240  */
1241 VLC_API const struct vlc_player_program *
1243 
1244 /**
1245  * Select a program from an ES group identifier
1246  *
1247  * This function can be used to pre-select a program by its id before starting
1248  * the player. It has only effect for the current media. It can also be used
1249  * when the player is already started.
1250  *
1251  * @note Selecting a non-existing program will cause the player to no select
1252  * any programs. Therefore, all tracks will be disabled.
1253  *
1254  * @param player locked player instance
1255  * @param group_id a program ID (retrieved from
1256  * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1257  */
1258 VLC_API void
1260 
1261 /**
1262  * Select the next program
1263  *
1264  * @param player locked player instance
1265  */
1266 VLC_API void
1268 
1269 /**
1270  * Select the previous program
1271  *
1272  * @param player locked player instance
1273  */
1274 VLC_API void
1276 
1277 /**
1278  * Helper to get the current selected program
1279  */
1280 static inline const struct vlc_player_program *
1283  size_t count = vlc_player_GetProgramCount(player);
1284  for (size_t i = 0; i < count; ++i)
1285  {
1286  const struct vlc_player_program *program =
1287  vlc_player_GetProgramAt(player, i);
1288  assert(program);
1289  if (program->selected)
1290  return program;
1291  }
1292  return NULL;
1293 }
1294 
1295 /** @} vlc_player__programs */
1296 
1297 /**
1298  * @defgroup vlc_player__tracks Tracks control
1299  * @{
1300  */
1301 
1302 /**
1303  * Player selection policy
1304  *
1305  * @see vlc_player_SelectEsId()
1306  */
1309  /**
1310  * Only one track per category is selected. Selecting a track with this
1311  * policy will disable all other tracks for the same category.
1312  */
1314  /**
1315  * Select multiple tracks for one category.
1316  *
1317  * Only one audio track can be selected at a time.
1318  * Two subtitle tracks can be selected simultaneously.
1319  * Multiple video tracks can be selected simultaneously.
1320  */
1322 };
1323 
1324 /**
1325  * Player track structure.
1326  *
1327  * A track is a representation of an ES identifier at a given time. Once the
1328  * player is unlocked, all content except the es_id pointer can be updated.
1329  *
1330  * @see vlc_player_cbs.on_track_list_changed
1331  * @see vlc_player_GetTrack
1332  */
1333 struct vlc_player_track
1335  /** Id used for any player actions, like vlc_player_SelectEsId() */
1336  vlc_es_id_t *es_id;
1337  /** Track name, always valid */
1338  const char *name;
1339  /** Es format */
1340  es_format_t fmt;
1341  /** True if the track is selected */
1342  bool selected;
1343 };
1344 
1345 /**
1346  * Duplicate a track
1347  *
1348  * This function can be used to pass a track from a callback to an other
1349  * context. The es_id will be held by the duplicated track.
1350  *
1351  * @warning The returned track won't be updated if the original one is modified
1352  * by the player.
1353  *
1354  * @see vlc_player_cbs.on_track_list_changed
1355  *
1356  * @return a duplicated track or NULL on allocation error
1357  */
1358 VLC_API struct vlc_player_track *
1359 vlc_player_track_Dup(const struct vlc_player_track *track);
1360 
1361 /**
1362  * Delete a duplicated track
1363  */
1364 VLC_API void
1366 
1367 /**
1368  * Get the number of tracks for an ES category
1369  *
1370  * @warning The returned size becomes invalid when the player is unlocked.
1371  *
1372  * @param player locked player instance
1373  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1374  * @return number of tracks, or 0 (in case of error, or if the media is not
1375  * started)
1376  */
1377 VLC_API size_t
1379 
1380 /**
1381  * Get the track at a specific index for an ES category
1382  *
1383  * @warning The behaviour is undefined if the index is not valid.
1384  *
1385  * @warning The returned pointer becomes invalid when the player is unlocked.
1386  * The referenced structure can be safely copied with vlc_player_track_Dup().
1387  *
1388  * @param player locked player instance
1389  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1390  * @param index valid index in the range [0; count[
1391  * @return a valid track (can't be NULL if vlc_player_GetTrackCount() returned
1392  * a valid count)
1393  */
1394 VLC_API const struct vlc_player_track *
1396  size_t index);
1397 
1398 /**
1399  * Helper to get the video track count
1400  */
1401 static inline size_t
1404  return vlc_player_GetTrackCount(player, VIDEO_ES);
1405 }
1406 
1407 /**
1408  * Helper to get a video track at a specific index
1409  */
1410 static inline const struct vlc_player_track *
1411 vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
1413  return vlc_player_GetTrackAt(player, VIDEO_ES, index);
1414 }
1415 
1416 /**
1417  * Helper to get the audio track count
1418  */
1419 static inline size_t
1422  return vlc_player_GetTrackCount(player, AUDIO_ES);
1423 }
1424 
1425 /**
1426  * Helper to get an audio track at a specific index
1427  */
1428 static inline const struct vlc_player_track *
1429 vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
1431  return vlc_player_GetTrackAt(player, AUDIO_ES, index);
1432 }
1433 
1434 /**
1435  * Helper to get the subtitle track count
1436  */
1437 static inline size_t
1440  return vlc_player_GetTrackCount(player, SPU_ES);
1441 }
1442 
1443 /**
1444  * Helper to get a subtitle track at a specific index
1445  */
1446 static inline const struct vlc_player_track *
1447 vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
1449  return vlc_player_GetTrackAt(player, SPU_ES, index);
1450 }
1451 
1452 /**
1453  * Get a track from an ES identifier
1454  *
1455  * @warning The returned pointer becomes invalid when the player is unlocked.
1456  * The referenced structure can be safely copied with vlc_player_track_Dup().
1457  *
1458  * @param player locked player instance
1459  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1460  * vlc_player_GetTrackAt())
1461  * @return a valid player track or NULL (if the track was terminated by the
1462  * playback thread)
1463  */
1464 VLC_API const struct vlc_player_track *
1466 
1467 /**
1468  * Get and the video output used by a ES identifier
1469  *
1470  * @warning A same vout can be associated with multiple ES during the lifetime
1471  * of the player. The information returned by this function becomes invalid
1472  * when the player is unlocked. The returned vout doesn't need to be released,
1473  * but must be held with vout_Hold() if it is accessed after the player is
1474  * unlocked.
1475  *
1476  * @param player locked player instance
1477  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1478  * vlc_player_GetTrackAt())
1479  * @param order if not null, the order of the vout
1480  * @return a valid vout or NULL (if the track is disabled, it it's not a video
1481  * or spu track, or if the vout failed to start)
1482  */
1485  enum vlc_vout_order *order);
1486 
1487 /**
1488  * Get the ES identifier of a video output
1489  *
1490  * @warning A same vout can be associated with multiple ES during the lifetime
1491  * of the player. The information returned by this function becomes invalid
1492  * when the player is unlocked. The returned es_id doesn't need to be released,
1493  * but must be held with vlc_es_id_Hold() if it accessed after the player is
1494  * unlocked.
1495  *
1496  * @param player locked player instance
1497  * @param vout vout (can't be NULL)
1498  * @return a valid ES identifier or NULL (if the vout is stopped)
1499  */
1502 
1503 /**
1504  * Helper to get the selected track from an ES category
1505  *
1506  * @warning The player can have more than one selected track for a same ES
1507  * category. This function will only return the first selected one. Use
1508  * vlc_player_GetTrackAt() and vlc_player_GetTrackCount() to iterate through
1509  * several selected tracks.
1510  */
1511 static inline const struct vlc_player_track *
1514  size_t count = vlc_player_GetTrackCount(player, cat);
1515  for (size_t i = 0; i < count; ++i)
1516  {
1517  const struct vlc_player_track *track =
1518  vlc_player_GetTrackAt(player, cat, i);
1519  assert(track);
1520  if (track->selected)
1521  return track;
1522  }
1523  return NULL;
1524 }
1525 
1526 /**
1527  * Select tracks by their string identifier
1528  *
1529  * This function can be used to pre-select a list of tracks before starting the
1530  * player. It has only effect for the current media. It can also be used when
1531  * the player is already started.
1532 
1533  * 'str_ids' can contain more than one track id, delimited with ','. "" or any
1534  * invalid track id will cause the player to unselect all tracks of that
1535  * category. NULL will disable the preference for newer tracks without
1536  * unselecting any current tracks.
1537  *
1538  * Example:
1539  * - (VIDEO_ES, "video/1,video/2") will select these 2 video tracks. If there
1540  * is only one video track with the id "video/0", no tracks will be selected.
1541  * - (SPU_ES, "${slave_url_md5sum}/spu/0) will select one spu added by an input
1542  * slave with the corresponding url.
1543  *
1544  * @note The string identifier of a track can be found via vlc_es_id_GetStrId().
1545  *
1546  * @param player locked player instance
1547  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1548  * @param str_ids list of string identifier or NULL
1549  */
1550 VLC_API void
1552  enum es_format_category_e cat,
1553  const char *str_ids);
1554 
1555 /**
1556  * Select a track from an ES identifier
1557  *
1558  * @note A successful call will trigger the
1559  * vlc_player_cbs.on_track_selection_changed event.
1560  *
1561  * @param player locked player instance
1562  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1563  * vlc_player_GetTrackAt())
1564  * @param policy exclusive or simultaneous
1565  * @return the number of track selected for es_id category
1566  */
1567 VLC_API unsigned
1569  enum vlc_player_select_policy policy);
1570 
1571 
1572 /**
1573  * Helper to select a track
1574  */
1575 static inline unsigned
1577  const struct vlc_player_track *track,
1578  enum vlc_player_select_policy policy)
1579 {
1580  return vlc_player_SelectEsId(player, track->es_id, policy);
1581 }
1582 
1583 /**
1584  * Select multiple tracks from a list of ES identifiers.
1585  *
1586  * Any tracks of the category, not referenced in the list will be unselected.
1587  *
1588  * @warning there is no guarantee all requested tracks will be selected. The
1589  * behaviour is undefined if the list is not null-terminated.
1590  *
1591  * @note A successful call will trigger the
1592  * vlc_player_cbs.on_track_selection_changed event for each track that has
1593  * its selection state changed.
1594  *
1595  * @see VLC_PLAYER_SELECT_SIMULTANEOUS
1596  *
1597  * @param player locked player instance
1598  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1599  * @param es_id_list a null-terminated list of ES identifiers. es_ids not
1600  * corresponding to the category will be ignored.
1601  * (ES IDs can be retrieved from vlc_player_cbs.on_track_list_changed or
1602  * vlc_player_GetTrackAt())
1603  * @return the number of track selected for that category
1604  */
1605 VLC_API unsigned
1607  enum es_format_category_e cat,
1608  vlc_es_id_t *const es_id_list[]);
1609 
1610 /**
1611  * Select the next track
1612  *
1613  * If the last track is already selected, a call to this function will disable
1614  * this last track. And a second call will select the first track.
1615  *
1616  * @warning This function has no effects if there are several tracks selected
1617  * for a same category. Therefore the default policy is
1618  * VLC_PLAYER_SELECT_EXCLUSIVE.
1619  *
1620  * @param player locked player instance
1621  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1622  */
1623 VLC_API void
1625  enum es_format_category_e cat);
1626 
1627 /**
1628  * Select the Previous track
1629  *
1630  * If the first track is already selected, a call to this function will disable
1631  * this first track. And a second call will select the last track.
1632  *
1633  * @warning This function has no effects if there are several tracks selected
1634  * for a same category. Therefore the default policy is
1635  * VLC_PLAYER_SELECT_EXCLUSIVE.
1636  *
1637  * @param player locked player instance
1638  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1639  */
1640 VLC_API void
1642  enum es_format_category_e cat);
1643 
1644 /**
1645  * Unselect a track from an ES identifier
1646  *
1647  * @warning Other tracks of the same category won't be touched.
1648  *
1649  * @note A successful call will trigger the
1650  * vlc_player_cbs.on_track_selection_changed event.
1651  *
1652  * @param player locked player instance
1653  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1654  * vlc_player_GetTrackAt())
1655  */
1656 VLC_API void
1658 
1659 /**
1660  * Helper to unselect a track
1661  */
1662 static inline void
1664  const struct vlc_player_track *track)
1665 {
1666  vlc_player_UnselectEsId(player, track->es_id);
1667 }
1668 
1669 /**
1670  * Helper to unselect all tracks from an ES category
1671  */
1672 static inline void
1675 {
1676  size_t count = vlc_player_GetTrackCount(player, cat);
1677  for (size_t i = 0; i < count; ++i)
1678  {
1679  const struct vlc_player_track *track =
1680  vlc_player_GetTrackAt(player, cat, i);
1681  assert(track);
1682  if (track->selected)
1683  vlc_player_UnselectTrack(player, track);
1684  }
1685 }
1686 
1687 /**
1688  * Restart a track from an ES identifier
1689  *
1690  * @note A successful call will trigger the
1691  * vlc_player_cbs.on_track_selection_changed event.
1692  *
1693  * @param player locked player instance
1694  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1695  * vlc_player_GetTrackAt())
1696  */
1697 VLC_API void
1699 
1700 /**
1701  * Helper to restart a track
1702  */
1703 static inline void
1705  const struct vlc_player_track *track)
1706 {
1707  vlc_player_RestartEsId(player, track->es_id);
1708 }
1709 
1710 /**
1711  * Helper to restart all selected tracks from an ES category
1712  */
1713 static inline void
1716 {
1717  size_t count = vlc_player_GetTrackCount(player, cat);
1718  for (size_t i = 0; i < count; ++i)
1719  {
1720  const struct vlc_player_track *track =
1721  vlc_player_GetTrackAt(player, cat, i);
1722  assert(track);
1723  if (track->selected)
1724  vlc_player_RestartTrack(player, track);
1725  }
1726 }
1727 
1728 /**
1729  * Select the language for an ES category
1730  *
1731  * @warning The language will only be set for all future played media.
1732  *
1733  * @param player locked player instance
1734  * @param cat AUDIO_ES or SPU_ES
1735  * @param lang comma separated, two or three letters country code, 'any' as a
1736  * fallback or NULL to reset the default state
1737  */
1738 VLC_API void
1740  enum es_format_category_e cat,
1741  const char *lang);
1742 
1743 /**
1744  * Get the language of an ES category
1745  *
1746  * @warning This only reflects the change made by
1747  * vlc_player_SelectCategoryLanguage(). The current playing track doesn't
1748  * necessarily correspond to the returned language.
1749  *
1750  * @see vlc_player_SelectCategoryLanguage
1751  *
1752  * @param player locked player instance
1753  * @param cat AUDIO_ES or SPU_ES
1754  * @return valid language or NULL, need to be freed
1755  */
1756 VLC_API char *
1758  enum es_format_category_e cat);
1759 
1760 /**
1761  * Helper to select the audio language
1762  */
1763 static inline void
1764 vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
1767 }
1768 
1769 /**
1770  * Helper to select the subtitle language
1771  */
1772 static inline void
1773 vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
1776 }
1777 
1778 /**
1779  * Enable or disable a track category
1780  *
1781  * If a track category is disabled, the player won't select any tracks of this
1782  * category automatically or via an user action (vlc_player_SelectTrack()).
1783  *
1784  * @param player locked player instance
1785  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1786  * @param enabled true to enable
1787  */
1788 VLC_API void
1790  enum es_format_category_e cat, bool enabled);
1791 
1792 /**
1793  * Check if a track category is enabled
1794  *
1795  * @param player locked player instance
1796  * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1797  */
1798 VLC_API bool
1800  enum es_format_category_e cat);
1801 
1802 /**
1803  * Helper to enable or disable video tracks
1804  */
1805 static inline void
1806 vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
1808  vlc_player_SetTrackCategoryEnabled(player, VIDEO_ES, enabled);
1809 }
1810 
1811 /**
1812  * Helper to check if video tracks are enabled
1813  */
1814 static inline bool
1818 }
1819 
1820 /**
1821  * Helper to enable or disable audio tracks
1822  */
1823 static inline void
1824 vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
1826  vlc_player_SetTrackCategoryEnabled(player, AUDIO_ES, enabled);
1827 }
1828 
1829 /**
1830  * Helper to check if audio tracks are enabled
1831  */
1832 static inline bool
1836 }
1837 
1838 /**
1839  * Helper to enable or disable subtitle tracks
1840  */
1841 static inline void
1842 vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
1844  vlc_player_SetTrackCategoryEnabled(player, SPU_ES, enabled);
1845 }
1846 
1847 /**
1848  * Helper to check if subtitle tracks are enabled
1849  */
1850 static inline bool
1853  return vlc_player_IsTrackCategoryEnabled(player, SPU_ES);
1854 }
1855 
1856 /**
1857  * Helper to toggle subtitles
1858  */
1859 static inline void
1862  bool enabled = !vlc_player_IsSubtitleEnabled(player);
1863  vlc_player_SetSubtitleEnabled(player, enabled);
1864 }
1865 
1866 /**
1867  * Set the subtitle text scaling factor
1868  *
1869  * @note This function have an effect only if the subtitle track is a text type.
1870  *
1871  * @param player locked player instance
1872  * @param scale factor in the range [10;500] (default: 100)
1873  */
1874 VLC_API void
1875 vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale);
1876 
1877 /**
1878  * Get the subtitle text scaling factor
1879  *
1880  * @param player locked player instance
1881  * @return scale factor
1882  */
1883 VLC_API unsigned
1885 
1886 /** @} vlc_player__tracks */
1887 
1888 /**
1889  * @defgroup vlc_player__tracks_sync Tracks synchronisation (delay)
1890  * @{
1891  */
1892 
1893 /**
1894  * Get the delay of an ES category for the current media
1895  *
1896  * @see vlc_player_cbs.on_category_delay_changed
1897  *
1898  * @param player locked player instance
1899  * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1900  * @return a valid delay or 0
1901  */
1904 
1905 /**
1906  * Set the delay of one category for the current media
1907  *
1908  * @note A successful call will trigger the
1909  * vlc_player_cbs.on_category_delay_changed event.
1910  *
1911  * @warning This has no effect on tracks where the delay was set by
1912  * vlc_player_SetEsIdDelay()
1913  *
1914  * @param player locked player instance
1915  * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1916  * @param delay a valid time
1917  * @param whence absolute or relative
1918  * @return VLC_SUCCESS or VLC_EGENERIC if the category is not handled
1919  */
1920 VLC_API int
1922  vlc_tick_t delay, enum vlc_player_whence whence);
1923 
1924 /**
1925  * Get the delay of a track
1926  *
1927  * @see vlc_player_cbs.on_track_delay_changed
1928  *
1929  * @param player locked player instance
1930  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1931  * vlc_player_GetTrackAt())
1932  * @return a valid delay or INT64_MAX is no delay is set for this track
1933  */
1936 
1937 /**
1938  * Set the delay of one track
1939  *
1940  * @note A successful call will trigger the
1941  * vlc_player_cbs.on_track_delay_changed event.
1942  *
1943  * @warning Setting the delay of one specific track will override previous and
1944  * future changes of delay made by vlc_player_SetCategoryDelay()
1945  *
1946  * @param player locked player instance
1947  * @param id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1948  * vlc_player_GetTrackAt())
1949  * @param delay a valid time or INT64_MAX to use default category delay
1950  * @param whence absolute or relative
1951  * @return VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not
1952  * handled (VIDEO_ES not supported yet)
1953  */
1954 VLC_API int
1956  vlc_tick_t delay, enum vlc_player_whence whence);
1957 
1958 /**
1959  * Helper to get the audio delay
1960  */
1961 static inline vlc_tick_t
1964  return vlc_player_GetCategoryDelay(player, AUDIO_ES);
1965 }
1966 
1967 /**
1968  * Helper to set the audio delay
1969  */
1970 static inline void
1972  enum vlc_player_whence whence)
1973 
1974 {
1975  vlc_player_SetCategoryDelay(player, AUDIO_ES, delay, whence);
1976 }
1977 
1978 /**
1979  * Helper to get the subtitle delay
1980  */
1981 static inline vlc_tick_t
1984  return vlc_player_GetCategoryDelay(player, SPU_ES);
1985 }
1986 
1987 /**
1988  * Helper to set the subtitle delay
1989  */
1990 static inline void
1992  enum vlc_player_whence whence)
1993 {
1994  vlc_player_SetCategoryDelay(player, SPU_ES, delay, whence);
1995 }
1996 
1997 /**
1998  * Set the associated subtitle FPS
1999  *
2000  * In order to correct the rate of the associated media according to this FPS
2001  * and the media video FPS.
2002  *
2003  * @note A successful call will trigger the
2004  * vlc_player_cbs.on_associated_subs_fps_changed event.
2005  *
2006  * @warning this function will change the rate of all external subtitle files
2007  * associated with the current media.
2008  *
2009  * @param player locked player instance
2010  * @param fps FPS of the subtitle file
2011  */
2012 VLC_API void
2013 vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps);
2014 
2015 /**
2016  * Get the associated subtitle FPS
2017  *
2018  * @param player locked player instance
2019  * @return fps
2020  */
2021 VLC_API float
2023 
2024 /** @} vlc_player__tracks_sync */
2025 
2026 /**
2027  * @defgroup vlc_player__teletext Teletext control
2028  * @{
2029  */
2030 
2031 /**
2032  * Check if the media has a teletext menu
2033  *
2034  * @see vlc_player_cbs.on_teletext_menu_changed
2035  *
2036  * @param player locked player instance
2037  * @return true if the media has a teletext menu
2038  */
2039 VLC_API bool
2041 
2042 /**
2043  * Enable or disable teletext
2044  *
2045  * This function has an effect only if the player has a teletext menu.
2046  *
2047  * @note A successful call will trigger the
2048  * vlc_player_cbs.on_teletext_enabled_changed event.
2049  *
2050  * @param player locked player instance
2051  * @param enabled true to enable
2052  */
2053 VLC_API void
2054 vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled);
2055 
2056 /**
2057  * Check if teletext is enabled
2058  *
2059  * @see vlc_player_cbs.on_teletext_enabled_changed
2060  *
2061  * @param player locked player instance
2062  */
2063 VLC_API bool
2065 
2066 /**
2067  * Select a teletext page or do an action from a key
2068  *
2069  * This function has an effect only if the player has a teletext menu.
2070  *
2071  * @note Page keys can be the following: @ref VLC_PLAYER_TELETEXT_KEY_RED,
2072  * @ref VLC_PLAYER_TELETEXT_KEY_GREEN, @ref VLC_PLAYER_TELETEXT_KEY_YELLOW,
2073  * @ref VLC_PLAYER_TELETEXT_KEY_BLUE or @ref VLC_PLAYER_TELETEXT_KEY_INDEX.
2074 
2075  * @note A successful call will trigger the
2076  * vlc_player_cbs.on_teletext_page_changed event.
2077  *
2078  * @param player locked player instance
2079  * @param page a page in the range ]0;888] or a valid key
2080  */
2081 VLC_API void
2082 vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page);
2083 
2084 /**
2085  * Get the current teletext page
2086  *
2087  * @see vlc_player_cbs.on_teletext_page_changed
2088  *
2089  * @param player locked player instance
2090  */
2091 VLC_API unsigned
2093 
2094 /**
2095  * Enable or disable teletext transparency
2096  *
2097  * This function has an effect only if the player has a teletext menu.
2098 
2099  * @note A successful call will trigger the
2100  * vlc_player_cbs.on_teletext_transparency_changed event.
2101  *
2102  * @param player locked player instance
2103  * @param enabled true to enable
2104  */
2105 VLC_API void
2106 vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled);
2107 
2108 /**
2109  * Check if teletext is transparent
2110  *
2111  * @param player locked player instance
2112  */
2113 VLC_API bool
2115 
2116 /** @} vlc_player__teletext */
2117 
2118 /**
2119  * @defgroup vlc_player__renderer External renderer control
2120  * @{
2121  */
2122 
2123 /**
2124  * Set the renderer
2125  *
2126  * Valid for the current media and all future ones.
2127  *
2128  * @note A successful call will trigger the vlc_player_cbs.on_renderer_changed
2129  * event.
2130  *
2131  * @param player locked player instance
2132  * @param renderer a valid renderer item or NULL (to disable it), the item will
2133  * be held by the player
2134  */
2135 VLC_API void
2137 
2138 /**
2139  * Get the renderer
2140  *
2141  * @see vlc_player_cbs.on_renderer_changed
2142  *
2143  * @param player locked player instance
2144  * @return the renderer item set by vlc_player_SetRenderer()
2145  */
2148 
2149 /** @} vlc_player__renderer */
2150 
2151 /**
2152  * @defgroup vlc_player__metadata Metadata callbacks
2153  * @{
2154  */
2155 
2156 /**
2157  * Player metadata listener opaque structure.
2158  *
2159  * This opaque structure is returned by vlc_player_AddMetadataListener() and
2160  * can be used to remove the listener via
2161  * vlc_player_RemoveMetadataListener().
2162  */
2165 /**
2166  * Player metadata option
2167  */
2170  /**
2171  * Ask for momentary loudness measurement
2172  *
2173  * Very low CPU usage.
2174  * @see vlc_player_metadata_cbs.on_momentary_loudness_changed
2175  */
2178  /**
2179  * Ask for all loudness measurements
2180  *
2181  * High CPU usage.
2182  * @see vlc_player_metadata_cbs.on_loudness_changed
2183  */
2185 };
2186 
2187 /**
2188  * Player metadata callbacks
2189  *
2190  * Can be registered with vlc_player_AddMetadataListener().
2191  *
2192  * @warning To avoid deadlocks, users should never call vlc_player_t functions
2193  * from these callbacks.
2194  */
2197  /**
2198  * Called when the momentary loudness measurement have changed
2199  *
2200  * @see VLC_PLAYER_METADATA_LOUDNESS_MOMEMTARY
2201  *
2202  * Only sent when audio is playing, approximately every 400ms (but can be
2203  * higher, depending on the input sample size).
2204  *
2205  * @param date Absolute date of the measurement. It is most likely in the
2206  * future (0 to 2seconds) depending on the audio output buffer size.
2207  * @param momentary_loudness Momentary loudness
2208  * @param data opaque pointer set by vlc_player_AddMetadataListener()
2209  */
2211  double momentary_loudness,
2212  void *data);
2213 
2214  /**
2215  * Called when loudness measurements have changed
2216  *
2217  * @see VLC_PLAYER_METADATA_LOUDNESS_FULL
2218  *
2219  * Only sent when audio is playing, approximately every 400ms (but can be
2220  * higher, depending on the input sample size).
2221  *
2222  * @param date Absolute date of the measurement. It is most likely in the
2223  * future (0 to 2seconds) depending on the audio output buffer size.
2224  * @param loudness loudness measurement
2225  * @param data opaque pointer set by vlc_player_AddMetadataListener()
2226  */
2227  void (*on_loudness_changed)(vlc_tick_t date,
2228  const struct vlc_audio_loudness *loudness,
2229  void *data);
2230 };
2231 
2232 /**
2233  * Add a metadata listener
2234  *
2235  * @note Every registered loudness meter need to be removed by the caller with
2236  * vlc_player_RemoveMetadataListener().
2237  *
2238  * @param player locked player instance
2239  * @param cbs pointer to a vlc_player_metadata_cbs union, the
2240  * structure must be valid during the lifetime of the player
2241  * @param cbs_data opaque pointer used by the callbacks
2242  * @return a valid listener id, or NULL in case of error (plugin missing)
2243  */
2246  enum vlc_player_metadata_option option,
2247  const union vlc_player_metadata_cbs *cbs,
2248  void *cbs_data);
2249 
2250 /**
2251  * Remove a metadata listener
2252  *
2253  * @param player player instance
2254  * @param listener_id listener id returned by vlc_player_AddMetadataListener()
2255  */
2256 VLC_API void
2258  vlc_player_metadata_listener_id *listener_id);
2259 
2260 
2261 /** @} vlc_player__metadata */
2262 
2263 /**
2264  * @defgroup vlc_player__aout Audio output control
2265  * @{
2266  */
2267 
2268 /**
2269  * Player aout listener opaque structure.
2270  *
2271  * This opaque structure is returned by vlc_player_aout_AddListener() and can
2272  * be used to remove the listener via vlc_player_aout_RemoveListener().
2273  */
2276 /**
2277  * Player aout callbacks
2278  *
2279  * Can be registered with vlc_player_aout_AddListener().
2280  *
2281  * @warning To avoid deadlocks, users should never call audio_output_t and
2282  * vlc_player_t functions from these callbacks.
2283  */
2284 struct vlc_player_aout_cbs
2286  /**
2287  * Called when the volume has changed
2288  *
2289  * @see vlc_player_aout_SetVolume()
2290  *
2291  * @param aout the main aout of the player
2292  * @param new_volume volume in the range [0;2.f]
2293  * @param data opaque pointer set by vlc_player_aout_AddListener()
2294  */
2295  void (*on_volume_changed)(audio_output_t *aout, float new_volume,
2296  void *data);
2297 
2298  /**
2299  * Called when the mute state has changed
2300  *
2301  * @see vlc_player_aout_Mute()
2302  *
2303  * @param aout the main aout of the player
2304  * @param new_mute true if muted
2305  * @param data opaque pointer set by vlc_player_aout_AddListener()
2306  */
2307  void (*on_mute_changed)(audio_output_t *aout, bool new_muted,
2308  void *data);
2309 
2310  /**
2311  * Called when the audio device has changed
2312  *
2313  * @param aout the main aout of the player
2314  * @param device the device name
2315  * @param data opaque pointer set by vlc_player_aout_AddListener()
2316  */
2317  void (*on_device_changed)(audio_output_t *aout, const char *device,
2318  void *data);
2319 };
2320 
2321 /**
2322  * Get the audio output
2323  *
2324  * @warning The returned pointer must be released with aout_Release().
2325  *
2326  * @param player player instance
2327  * @return a valid audio_output_t * or NULL (if there is no aouts)
2328  */
2331 
2332 /**
2333  * Reset the main audio output
2334  *
2335  * @warning The main aout can only by reset if it is not currently used by any
2336  * decoders (before any play).
2337  *
2338  * @param player player instance
2339  */
2340 VLC_API void
2342 
2343 /**
2344  * Add a listener callback for audio output events
2345  *
2346  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2347  * functions.
2348  * @note Every registered callbacks need to be removed by the caller with
2349  * vlc_player_aout_RemoveListener().
2350  *
2351  * @param player player instance
2352  * @param cbs pointer to a vlc_player_aout_cbs structure, the structure must be
2353  * valid during the lifetime of the player
2354  * @param cbs_data opaque pointer used by the callbacks
2355  * @return a valid listener id, or NULL in case of allocation error
2356  */
2359  const struct vlc_player_aout_cbs *cbs,
2360  void *cbs_data);
2361 
2362 /**
2363  * Remove a aout listener callback
2364  *
2365  * @param player player instance
2366  * @param listener_id listener id returned by vlc_player_aout_AddListener()
2367  */
2368 VLC_API void
2370  vlc_player_aout_listener_id *listener_id);
2371 
2372 /**
2373  * Get the audio volume
2374  *
2375  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2376  * functions.
2377  *
2378  * @see vlc_player_aout_cbs.on_volume_changed
2379  *
2380  * @param player player instance
2381  * @return volume in the range [0;2.f] or -1.f if there is no audio outputs
2382  * (independent of mute)
2383  */
2384 VLC_API float
2386 
2387 /**
2388  * Set the audio volume
2389  *
2390  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2391  * functions.
2392  *
2393  * @note A successful call will trigger the
2394  * vlc_player_vout_cbs.on_volume_changed event.
2395  *
2396  * @param player player instance
2397  * @param volume volume in the range [0;2.f]
2398  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2399  */
2400 VLC_API int
2401 vlc_player_aout_SetVolume(vlc_player_t *player, float volume);
2402 
2403 /**
2404  * Increment the audio volume
2405  *
2406  * @see vlc_player_aout_SetVolume()
2407  *
2408  * @param player player instance
2409  * @param steps number of "volume-step"
2410  * @param result pointer to store the resulting volume (can be NULL)
2411  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2412  */
2413 VLC_API int
2414 vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result);
2415 
2416 /**
2417  * Helper to decrement the audio volume
2418  */
2419 static inline int
2420 vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
2422  return vlc_player_aout_IncrementVolume(player, -steps, result);
2423 }
2424 
2425 /**
2426  * Check if the audio output is muted
2427  *
2428  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2429  * functions.
2430  *
2431  * @see vlc_player_aout_cbs.on_mute_changed
2432  *
2433  * @param player player instance
2434  * @return 0 if not muted, 1 if muted, -1 if there is no audio outputs
2435  */
2436 VLC_API int
2438 
2439 /**
2440  * Mute or unmute the audio output
2441  *
2442  * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2443  * functions.
2444  *
2445  * @note A successful call will trigger the
2446  * vlc_player_aout_cbs.on_mute_changed event.
2447  *
2448  * @param player player instance
2449  * @param mute true to mute
2450  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2451  */
2452 VLC_API int
2453 vlc_player_aout_Mute(vlc_player_t *player, bool mute);
2454 
2455 /**
2456  * Helper to toggle the mute state
2457  */
2458 static inline int
2461  return vlc_player_aout_Mute(player,
2462  !vlc_player_aout_IsMuted(player));
2463 }
2464 
2465 /**
2466  * Enable or disable an audio filter
2467  *
2468  * @see aout_EnableFilter()
2469  *
2470  * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2471  */
2472 VLC_API int
2473 vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
2474 
2475 /** @} vlc_player__aout */
2476 
2477 /**
2478  * @defgroup vlc_player__vout Video output control
2479  * @{
2480  */
2481 
2482 /**
2483  * Player vout listener opaque structure.
2484  *
2485  * This opaque structure is returned by vlc_player_vout_AddListener() and can
2486  * be used to remove the listener via vlc_player_vout_RemoveListener().
2487  */
2490 /**
2491  * action of vlc_player_cbs.on_vout_changed callback
2492  */
2497 };
2498 
2499 /**
2500  * Player vout callbacks
2501  *
2502  * Can be registered with vlc_player_vout_AddListener().
2503  *
2504  * @note The state changed from the callbacks can be either applied on the
2505  * player (and all future video outputs), or on a specified video output. The
2506  * state is applied on the player when the vout argument is NULL.
2507  *
2508  * @warning To avoid deadlocks, users should never call vout_thread_t and
2509  * vlc_player_t functions from these callbacks.
2510  */
2511 struct vlc_player_vout_cbs
2513  /**
2514  * Called when the player and/or vout fullscreen state has changed
2515  *
2516  * @see vlc_player_vout_SetFullscreen()
2517  *
2518  * @param vout cf. vlc_player_vout_cbs note
2519  * @param enabled true when fullscreen is enabled
2520  * @param data opaque pointer set by vlc_player_vout_AddListener()
2521  */
2522  void (*on_fullscreen_changed)(vout_thread_t *vout, bool enabled,
2523  void *data);
2524 
2525  /**
2526  * Called when the player and/or vout wallpaper mode has changed
2527  *
2528  * @see vlc_player_vout_SetWallpaperModeEnabled()
2529  *
2530  * @param vout cf. vlc_player_vout_cbs note
2531  * @param enabled true when wallpaper mode is enabled
2532  * @param data opaque pointer set by vlc_player_vout_AddListener()
2533  */
2534  void (*on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled,
2535  void *data);
2536 };
2537 
2538 
2539 /**
2540  * Get and hold the main video output
2541  *
2542  * @warning the returned vout_thread_t * must be released with vout_Release().
2543  * @see vlc_players_cbs.on_vout_changed
2544  *
2545  * @note The player is guaranteed to always hold one valid vout. Only vout
2546  * variables can be changed from this instance. The vout returned before
2547  * playback is not necessarily the same one that will be used for playback.
2548  *
2549  * @param player player instance
2550  * @return a valid vout_thread_t * or NULL, cf. warning
2551  */
2554 
2555 /**
2556  * Get and hold the list of video output
2557  *
2558  * @warning All vout_thread_t * element of the array must be released with
2559  * vout_Release(). The returned array must be freed.
2560  *
2561  * @see vlc_players_cbs.on_vout_changed
2562  *
2563  * @param player player instance
2564  * @param count valid pointer to store the array count
2565  * @return a array of vout_thread_t * or NULL, cf. warning
2566  */
2568 vlc_player_vout_HoldAll(vlc_player_t *player, size_t *count);
2569 
2570 /**
2571  * Add a listener callback for video output events
2572  *
2573  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2574  * functions.
2575  * @note Every registered callbacks need to be removed by the caller with
2576  * vlc_player_vout_RemoveListener().
2577  *
2578  * @param player player instance
2579  * @param cbs pointer to a vlc_player_vout_cbs structure, the structure must be
2580  * valid during the lifetime of the player
2581  * @param cbs_data opaque pointer used by the callbacks
2582  * @return a valid listener id, or NULL in case of allocation error
2583  */
2586  const struct vlc_player_vout_cbs *cbs,
2587  void *cbs_data);
2588 
2589 /**
2590  * Remove a vout listener callback
2591  *
2592  * @param player player instance
2593  * @param listener_id listener id returned by vlc_player_vout_AddListener()
2594  */
2595 VLC_API void
2597  vlc_player_vout_listener_id *listener_id);
2598 
2599 /**
2600  * Check if the player is fullscreen
2601  *
2602  * @warning The fullscreen state of the player and all vouts can be different.
2603  *
2604  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2605  * functions.
2606  *
2607  * @see vlc_player_vout_cbs.on_fullscreen_changed
2608  *
2609  * @param player player instance
2610  * @return true if the player is fullscreen
2611  */
2612 VLC_API bool
2614 
2615 /**
2616  * Enable or disable the player fullscreen state
2617  *
2618  * This will have an effect on all current and future vouts.
2619  *
2620  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2621  * functions.
2622  * @note A successful call will trigger the
2623  * vlc_player_vout_cbs.on_fullscreen_changed event.
2624  *
2625  * @param player player instance
2626  * @param enabled true to enable fullscreen
2627  */
2628 VLC_API void
2629 vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled);
2630 
2631 /**
2632  * Helper to toggle the player fullscreen state
2633  */
2634 static inline void
2638  !vlc_player_vout_IsFullscreen(player));
2639 }
2640 
2641 /**
2642  * Check if the player has wallpaper-mode enaled
2643  *
2644  * @warning The wallpaper-mode state of the player and all vouts can be
2645  * different.
2646  *
2647  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2648  * functions.
2649  *
2650  * @see vlc_player_vout_cbs.on_wallpaper_mode_changed
2651  *
2652  * @param player player instance
2653  * @return true if the player is fullscreen
2654  */
2655 VLC_API bool
2657 
2658 /**
2659  * Enable or disable the player wallpaper-mode
2660  *
2661  * This will have an effect on all current and future vouts.
2662  *
2663  * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2664  * functions.
2665  * @note A successful call will trigger the
2666  * vlc_player_vout_cbs.on_wallpaper_mode_changed event.
2667  *
2668  * @param player player instance
2669  * @param enabled true to enable wallpaper-mode
2670  */
2671 VLC_API void
2673 
2674 /**
2675  * Helper to toggle the player wallpaper-mode state
2676  */
2677 static inline void
2682 }
2683 
2684 /**
2685  * Take a snapshot on all vouts
2686  *
2687  * @param player player instance
2688  */
2689 VLC_API void
2691 
2692 /**
2693  * Display an OSD message on all vouts
2694  *
2695  * @param player player instance
2696  * @param fmt format string
2697  */
2698 VLC_API void
2699 vlc_player_osd_Message(vlc_player_t *player, const char *fmt, ...);
2700 
2701 /** @} vlc_player__vout */
2702 
2703 /**
2704  * @defgroup vlc_player__events Player events
2705  * @{
2706  */
2707 
2708 /**
2709  * Player listener opaque structure.
2710  *
2711  * This opaque structure is returned by vlc_player_AddListener() and can be
2712  * used to remove the listener via vlc_player_RemoveListener().
2713  */
2716 /**
2717  * Action of vlc_player_cbs.on_track_list_changed,
2718  * vlc_player_cbs.on_program_list_changed callbacks
2719  */
2725 };
2726 
2727 /**
2728  * Player callbacks
2729  *
2730  * Can be registered with vlc_player_AddListener().
2731  *
2732  * All callbacks are called with the player locked (cf. vlc_player_Lock()) and
2733  * from any threads (and even synchronously from a vlc_player function in some
2734  * cases). It is safe to call any vlc_player functions from these callbacks
2735  * except vlc_player_Delete().
2736  *
2737  * @warning To avoid deadlocks, users should never call vlc_player functions
2738  * with an external mutex locked and lock this same mutex from a player
2739  * callback.
2740  */
2741 struct vlc_player_cbs
2743  /**
2744  * Called when the current media has changed
2745  *
2746  * @note This can be called from the PLAYING state (when the player plays
2747  * the next media internally) or from the STOPPED state (from
2748  * vlc_player_SetCurrentMedia() or from an internal transition).
2749  *
2750  * @see vlc_player_SetCurrentMedia()
2751  * @see vlc_player_InvalidateNextMedia()
2752  *
2753  * @param player locked player instance
2754  * @param new_media new media currently played or NULL (when there is no
2755  * more media to play)
2756  * @param data opaque pointer set by vlc_player_AddListener()
2757  */
2758  void (*on_current_media_changed)(vlc_player_t *player,
2759  input_item_t *new_media, void *data);
2760 
2761  /**
2762  * Called when the player state has changed
2763  *
2764  * @see vlc_player_state
2765  *
2766  * @param player locked player instance
2767  * @param new_state new player state
2768  * @param data opaque pointer set by vlc_player_AddListener()
2769  */
2770  void (*on_state_changed)(vlc_player_t *player,
2771  enum vlc_player_state new_state, void *data);
2772 
2773  /**
2774  * Called when a media triggered an error
2775  *
2776  * Can be called from any states. When it happens the player will stop
2777  * itself. It is safe to play an other media or event restart the player
2778  * (This will reset the error state).
2779  *
2780  * @param player locked player instance
2781  * @param error player error
2782  * @param data opaque pointer set by vlc_player_AddListener()
2783  */
2784  void (*on_error_changed)(vlc_player_t *player,
2785  enum vlc_player_error error, void *data);
2786 
2787  /**
2788  * Called when the player buffering (or cache) has changed
2789  *
2790  * This event is always called with the 0 and 1 values before a playback
2791  * (in case of success). Values in between depends on the media type.
2792  *
2793  * @param player locked player instance
2794  * @param new_buffering buffering in the range [0:1]
2795  * @param data opaque pointer set by vlc_player_AddListener()
2796  */
2797  void (*on_buffering_changed)(vlc_player_t *player,
2798  float new_buffering, void *data);
2799 
2800  /**
2801  * Called when the player rate has changed
2802  *
2803  * Triggered by vlc_player_ChangeRate(), not sent when the media starts
2804  * with the default rate (1.f)
2805  *
2806  * @param player locked player instance
2807  * @param new_rate player
2808  * @param data opaque pointer set by vlc_player_AddListener()
2809  */
2810  void (*on_rate_changed)(vlc_player_t *player,
2811  float new_rate, void *data);
2812 
2813  /**
2814  * Called when the media capabilities has changed
2815  *
2816  * Always called when the media is opening. Can be called during playback.
2817  *
2818  * @param player locked player instance
2819  * @param old_caps old player capabilities
2820  * @param new_caps new player capabilities
2821  * @param data opaque pointer set by vlc_player_AddListener()
2822  */
2823  void (*on_capabilities_changed)(vlc_player_t *player,
2824  int old_caps, int new_caps, void *data);
2825 
2826  /**
2827  * Called when the player position has changed
2828  *
2829  * @note A started and playing media doesn't have necessarily a valid time.
2830  *
2831  * @param player locked player instance
2832  * @param new_time a valid time or VLC_TICK_INVALID
2833  * @param new_pos a valid position
2834  * @param data opaque pointer set by vlc_player_AddListener()
2835  */
2836  void (*on_position_changed)(vlc_player_t *player,
2837  vlc_tick_t new_time, float new_pos, void *data);
2838 
2839  /**
2840  * Called when the media length has changed
2841  *
2842  * May be called when the media is opening or during playback.
2843  *
2844  * @note A started and playing media doesn't have necessarily a valid length.
2845  *
2846  * @param player locked player instance
2847  * @param new_length a valid time or VLC_TICK_INVALID
2848  * @param data opaque pointer set by vlc_player_AddListener()
2849  */
2850  void (*on_length_changed)(vlc_player_t *player,
2851  vlc_tick_t new_length, void *data);
2852 
2853  /**
2854  * Called when a track is added, removed, or updated
2855  *
2856  * @note The track is only valid from this callback context. Users should
2857  * duplicate this track via vlc_player_track_Dup() if they want to use it
2858  * from an other context.
2859  *
2860  * @param player locked player instance
2861  * @param action added, removed or updated
2862  * @param track valid track
2863  * @param data opaque pointer set by vlc_player_AddListener()
2864  */
2865  void (*on_track_list_changed)(vlc_player_t *player,
2867  const struct vlc_player_track *track, void *data);
2868 
2869  /**
2870  * Called when a new track is selected and/or unselected
2871  *
2872  * @note This event can be called with both unselected_id and selected_id
2873  * valid. This mean that a new track is replacing the old one.
2874  *
2875  * @param player locked player instance
2876  * @param unselected_id valid track id or NULL (when nothing is unselected)
2877  * @param selected_id valid track id or NULL (when nothing is selected)
2878  * @param data opaque pointer set by vlc_player_AddListener()
2879  */
2880  void (*on_track_selection_changed)(vlc_player_t *player,
2881  vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data);
2882 
2883  /**
2884  * Called when a track delay has changed
2885  *
2886  * @param player locked player instance
2887  * @param es_id valid track id
2888  * @param delay a valid delay or INT64_MAX if the delay of this track is
2889  * canceled
2890  */
2891  void (*on_track_delay_changed)(vlc_player_t *player,
2892  vlc_es_id_t *es_id, vlc_tick_t delay, void *data);
2893 
2894  /**
2895  * Called when a new program is added, removed or updated
2896  *
2897  * @note The program is only valid from this callback context. Users should
2898  * duplicate this program via vlc_player_program_Dup() if they want to use
2899  * it from an other context.
2900  *
2901  * @param player locked player instance
2902  * @param action added, removed or updated
2903  * @param prgm valid program
2904  * @param data opaque pointer set by vlc_player_AddListener()
2905  */
2906  void (*on_program_list_changed)(vlc_player_t *player,
2908  const struct vlc_player_program *prgm, void *data);
2909 
2910  /**
2911  * Called when a new program is selected and/or unselected
2912  *
2913  * @note This event can be called with both unselected_id and selected_id
2914  * valid. This mean that a new program is replacing the old one.
2915  *
2916  * @param player locked player instance
2917  * @param unselected_id valid program id or -1 (when nothing is unselected)
2918  * @param selected_id valid program id or -1 (when nothing is selected)
2919  * @param data opaque pointer set by vlc_player_AddListener()
2920  */
2922  int unselected_id, int selected_id, void *data);
2923 
2924  /**
2925  * Called when the media titles has changed
2926  *
2927  * This event is not called when the opening media doesn't have any titles.
2928  * This title list and all its elements are constant. If an element is to
2929  * be updated, a new list will be sent from this callback.
2930  *
2931  * @note Users should hold this list with vlc_player_title_list_Hold() if
2932  * they want to use it from an other context.
2933  *
2934  * @param player locked player instance
2935  * @param titles valid title list or NULL
2936  * @param data opaque pointer set by vlc_player_AddListener()
2937  */
2938  void (*on_titles_changed)(vlc_player_t *player,
2939  vlc_player_title_list *titles, void *data);
2940 
2941  /**
2942  * Called when a new title is selected
2943  *
2944  * There are no events when a title is unselected. Titles are automatically
2945  * unselected when the title list changes. Titles and indexes are always
2946  * valid inside the vlc_player_title_list sent by
2947  * vlc_player_cbs.on_titles_changed.
2948  *
2949  * @param player locked player instance
2950  * @param new_title new selected title
2951  * @param new_idx index of this title
2952  * @param data opaque pointer set by vlc_player_AddListener()
2953  */
2954  void (*on_title_selection_changed)(vlc_player_t *player,
2955  const struct vlc_player_title *new_title, size_t new_idx, void *data);
2956 
2957  /**
2958  * Called when a new chapter is selected
2959  *
2960  * There are no events when a chapter is unselected. Chapters are
2961  * automatically unselected when the title list changes. Titles, chapters
2962  * and indexes are always valid inside the vlc_player_title_list sent by
2963  * vlc_player_cbs.on_titles_changed.
2964  *
2965  * @param player locked player instance
2966  * @param title selected title
2967  * @param title_idx selected title index
2968  * @param chapter new selected chapter
2969  * @param chapter_idx new selected chapter index
2970  * @param data opaque pointer set by vlc_player_AddListener()
2971  */
2973  const struct vlc_player_title *title, size_t title_idx,
2974  const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx,
2975  void *data);
2976 
2977  /**
2978  * Called when the media has a teletext menu
2979  *
2980  * @param player locked player instance
2981  * @param has_teletext_menu true if the media has a teletext menu
2982  * @param data opaque pointer set by vlc_player_AddListener()
2983  */
2984  void (*on_teletext_menu_changed)(vlc_player_t *player,
2985  bool has_teletext_menu, void *data);
2986 
2987  /**
2988  * Called when teletext is enabled or disabled
2989  *
2990  * @see vlc_player_SetTeletextEnabled()
2991  *
2992  * @param player locked player instance
2993  * @param enabled true if teletext is enabled
2994  * @param data opaque pointer set by vlc_player_AddListener()
2995  */
2996  void (*on_teletext_enabled_changed)(vlc_player_t *player,
2997  bool enabled, void *data);
2998 
2999  /**
3000  * Called when the teletext page has changed
3001  *
3002  * @see vlc_player_SelectTeletextPage()
3003  *
3004  * @param player locked player instance
3005  * @param new_page page in the range ]0;888]
3006  * @param data opaque pointer set by vlc_player_AddListener()
3007  */
3008  void (*on_teletext_page_changed)(vlc_player_t *player,
3009  unsigned new_page, void *data);
3010 
3011  /**
3012  * Called when the teletext transparency has changed
3013  *
3014  * @see vlc_player_SetTeletextTransparency()
3015  *
3016  * @param player locked player instance
3017  * @param enabled true is the teletext overlay is transparent
3018  * @param data opaque pointer set by vlc_player_AddListener()
3019  */
3021  bool enabled, void *data);
3022 
3023  /**
3024  * Called when the player category delay has changed for the current media
3025  *
3026  * @see vlc_player_SetCategoryDelay()
3027  *
3028  * @param player locked player instance
3029  * @param cat AUDIO_ES or SPU_ES
3030  * @param new_delay audio delay
3031  * @param data opaque pointer set by vlc_player_AddListener()
3032  */
3033  void (*on_category_delay_changed)(vlc_player_t *player,
3034  enum es_format_category_e cat, vlc_tick_t new_delay, void *data);
3035 
3036  /**
3037  * Called when associated subtitle has changed
3038  *
3039  * @see vlc_player_SetAssociatedSubsFPS()
3040  *
3041  * @param player locked player instance
3042  * @param sub_fps subtitle fps
3043  * @param data opaque pointer set by vlc_player_AddListener()
3044  */
3046  float subs_fps, void *data);
3047 
3048  /**
3049  * Called when a new renderer item is set
3050  *
3051  * @see vlc_player_SetRenderer()
3052  *
3053  * @param player locked player instance
3054  * @param new_item a valid renderer item or NULL (if unset)
3055  * @param data opaque pointer set by vlc_player_AddListener()
3056  */
3057  void (*on_renderer_changed)(vlc_player_t *player,
3058  vlc_renderer_item_t *new_item, void *data);
3059 
3060  /**
3061  * Called when the player recording state has changed
3062  *
3063  * @see vlc_player_SetRecordingEnabled()
3064  *
3065  * @param player locked player instance
3066  * @param recording true if recording is enabled
3067  * @param data opaque pointer set by vlc_player_AddListener()
3068  */
3069  void (*on_recording_changed)(vlc_player_t *player,
3070  bool recording, void *data);
3071 
3072  /**
3073  * Called when the media signal has changed
3074  *
3075  * @param player locked player instance
3076  * @param new_quality signal quality
3077  * @param new_strength signal strength,
3078  * @param data opaque pointer set by vlc_player_AddListener()
3079  */
3080  void (*on_signal_changed)(vlc_player_t *player,
3081  float quality, float strength, void *data);
3082 
3083  /**
3084  * Called when the player has new statisics
3085  *
3086  * @note The stats structure is only valid from this callback context. It
3087  * can be copied in order to use it from an other context.
3088  *
3089  * @param player locked player instance
3090  * @param stats valid stats, only valid from this context
3091  * @param data opaque pointer set by vlc_player_AddListener()
3092  */
3093  void (*on_statistics_changed)(vlc_player_t *player,
3094  const struct input_stats_t *stats, void *data);
3095 
3096  /**
3097  * Called when the A to B loop has changed
3098  *
3099  * @see vlc_player_SetAtoBLoop()
3100  *
3101  * @param player locked player instance
3102  * @param state A, when only A is set, B when both A and B are set, None by
3103  * default
3104  * @param time valid time or VLC_TICK_INVALID of the current state
3105  * @param pos valid pos of the current state
3106  * @param data opaque pointer set by vlc_player_AddListener()
3107  */
3108  void (*on_atobloop_changed)(vlc_player_t *player,
3109  enum vlc_player_abloop new_state, vlc_tick_t time, float pos,
3110  void *data);
3111 
3112  /**
3113  * Called when media stopped action has changed
3114  *
3115  * @see vlc_player_SetMediaStoppedAction()
3116  *
3117  * @param player locked player instance
3118  * @param new_action action to execute when a media is stopped
3119  * @param data opaque pointer set by vlc_player_AddListener()
3120  */
3122  enum vlc_player_media_stopped_action new_action, void *data);
3123 
3124  /**
3125  * Called when the media meta has changed
3126  *
3127  * @param player locked player instance
3128  * @param media current media
3129  * @param data opaque pointer set by vlc_player_AddListener()
3130  */
3131  void (*on_media_meta_changed)(vlc_player_t *player,
3132  input_item_t *media, void *data);
3133 
3134  /**
3135  * Called when media epg has changed
3136  *
3137  * @param player locked player instance
3138  * @param media current media
3139  * @param data opaque pointer set by vlc_player_AddListener()
3140  */
3141  void (*on_media_epg_changed)(vlc_player_t *player,
3142  input_item_t *media, void *data);
3143 
3144  /**
3145  * Called when the media has new subitems
3146  *
3147  * @param player locked player instance
3148  * @param media current media
3149  * @param new_subitems node representing all media subitems
3150  * @param data opaque pointer set by vlc_player_AddListener()
3151  */
3152  void (*on_media_subitems_changed)(vlc_player_t *player,
3153  input_item_t *media, input_item_node_t *new_subitems, void *data);
3154 
3155  /**
3156  * Called when a vout is started or stopped
3157  *
3158  * @note In case, several media with only one video track are played
3159  * successively, the same vout instance will be started and stopped several
3160  * time.
3161  *
3162  * @param player locked player instance
3163  * @param action started or stopped
3164  * @param vout vout (can't be NULL)
3165  * @param order vout order
3166  * @param es_id the ES id associated with this vout
3167  * @param data opaque pointer set by vlc_player_AddListener()
3168  */
3169  void (*on_vout_changed)(vlc_player_t *player,
3171  enum vlc_vout_order order, vlc_es_id_t *es_id, void *data);
3172 
3173  /**
3174  * Called when the player is corked
3175  *
3176  * The player can be corked when the audio output loose focus or when a
3177  * renderer was paused from the outside.
3178  *
3179  * @note called only if pause on cork was not set to true (by
3180  * vlc_player_SetPauseOnCork())
3181  * @note a cork_count higher than 0 means the player is corked. In that
3182  * case, the user should pause the player and release all external resource
3183  * needed by the player. A value higher than 1 mean that the player was
3184  * corked more than one time (for different reasons). A value of 0 means
3185  * the player is no longer corked. In that case, the user could resume the
3186  * player.
3187  *
3188  * @param player locked player instance
3189  * @param cork_count 0 for uncorked, > 0 for corked
3190  * @param data opaque pointer set by vlc_player_AddListener()
3191  */
3192  void (*on_cork_changed)(vlc_player_t *player, unsigned cork_count,
3193  void *data);
3194 
3195  /**
3196  * Called to query the user about restoring the previous playback position
3197  *
3198  * If this callback isn't provided, the user won't be asked to restore
3199  * the previous playback position, effectively causing
3200  * VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK to be handled as
3201  * VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
3202  *
3203  * The implementation can react to this callback by calling
3204  * vlc_player_RestorePlaybackPos(), or by discarding the event.
3205  *
3206  * @param player locked player instance
3207  * @param data opaque pointer set by vlc_player_AddListener()
3208  */
3209  void (*on_playback_restore_queried)(vlc_player_t *player, void *data);
3210 };
3211 
3212 /**
3213  * Add a listener callback
3214  *
3215  * @note Every registered callbacks need to be removed by the caller with
3216  * vlc_player_RemoveListener().
3217  *
3218  * @param player locked player instance
3219  * @param cbs pointer to a vlc_player_cbs structure, the structure must be
3220  * valid during the lifetime of the player
3221  * @param cbs_data opaque pointer used by the callbacks
3222  * @return a valid listener id, or NULL in case of allocation error
3223  */
3226  const struct vlc_player_cbs *cbs, void *cbs_data);
3227 
3228 /**
3229  * Remove a listener callback
3230  *
3231  * @param player locked player instance
3232  * @param listener_id listener id returned by vlc_player_AddListener()
3233  */
3234 VLC_API void
3236  vlc_player_listener_id *listener_id);
3237 
3238 /** @} vlc_player__events */
3239 
3240 /**
3241  * @defgroup vlc_player__timer Player timer
3242  * @{
3243  */
3244 
3245 /**
3246  * Player timer opaque structure.
3247  */
3250 /**
3251  * Player timer point
3252  *
3253  * @see vlc_player_timer_cbs.on_update
3254  */
3257  /** Position in the range [0.0f;1.0] */
3258  float position;
3259  /** Rate of the player */
3260  double rate;
3261  /** Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with
3262  * VLC_TICK_0 to get the original value. */
3263  vlc_tick_t ts;
3264  /** Valid length >= VLC_TICK_0 or VLC_TICK_INVALID */
3266  /** System date of this record (always valid), this date can be in the
3267  * future or in the past. The special value of INT64_MAX mean that the
3268  * clock was paused when this point was updated. In that case,
3269  * vlc_player_timer_point_Interpolate() will return the current ts/pos of
3270  * this point (there is nothing to interpolate). */
3272 };
3273 
3274 /**
3275  * Player smpte timecode
3276  *
3277  * @see vlc_player_timer_smpte_cbs
3278  */
3281  /** Hours [0;n] */
3282  unsigned hours;
3283  /** Minutes [0;59] */
3284  unsigned minutes;
3285  /** Seconds [0;59] */
3286  unsigned seconds;
3287  /** Frame number [0;n] */
3288  unsigned frames;
3289  /** Maximum number of digits needed to display the frame number */
3290  unsigned frame_resolution;
3291  /** True if the source is NTSC 29.97fps or 59.94fps DF */
3292  bool drop_frame;
3293 };
3294 
3295 /**
3296  * Player timer callbacks
3297  *
3298  * @see vlc_player_AddTimer
3299  */
3300 struct vlc_player_timer_cbs
3302  /**
3303  * Called when the state or the time changed.
3304  *
3305  * Get notified when the time is updated by the input or output source. The
3306  * input source is the 'demux' or the 'access_demux'. The output source are
3307  * audio and video outputs: an update is received each time a video frame
3308  * is displayed or an audio sample is written. The delay between each
3309  * updates may depend on the input and source type (it can be every 5ms,
3310  * 30ms, 1s or 10s...). The user of this timer may need to update the
3311  * position at a higher frequency from its own mainloop via
3312  * vlc_player_timer_point_Interpolate().
3313  *
3314  * @warning The player is not locked from this callback. It is forbidden
3315  * to call any player functions from here.
3316  *
3317  * @param value always valid, the time corresponding to the state
3318  * @param data opaque pointer set by vlc_player_AddTimer()
3319  */
3320  void (*on_update)(const struct vlc_player_timer_point *value, void *data);
3322  /**
3323  * The player is paused or a discontinuity occurred, likely caused by seek
3324  * from the user or because the playback is stopped. The player user should
3325  * stop its "interpolate" timer.
3326  *
3327  * @param system_date system date of this event, only valid when paused. It
3328  * can be used to interpolate the last updated point to this date in order
3329  * to get the last paused ts/position.
3330  * @param data opaque pointer set by vlc_player_AddTimer()
3331  */
3332  void (*on_discontinuity)(vlc_tick_t system_date, void *data);
3333 };
3334 
3335 /**
3336  * Player smpte timer callbacks
3337  *
3338  * @see vlc_player_AddSmpteTimer
3339  */
3342  /**
3343  * Called when a new frame is displayed
3344 
3345  * @warning The player is not locked from this callback. It is forbidden
3346  * to call any player functions from here.
3347  *
3348  * @param tc always valid, the timecode corresponding to the frame just
3349  * displayed
3350  * @param data opaque pointer set by vlc_player_AddTimer()
3351  */
3352  void (*on_update)(const struct vlc_player_timer_smpte_timecode *tc,
3353  void *data);
3354 };
3355 
3356 /**
3357  * Add a timer in order to get times updates
3358  *
3359  * @param player player instance (locked or not)
3360  * @param min_period corresponds to the minimum period between each updates,
3361  * use it to avoid flood from too many source updates, set it to
3362  * VLC_TICK_INVALID to receive all updates.
3363  * @param cbs pointer to a vlc_player_timer_cbs structure, the structure must
3364  * be valid during the lifetime of the player
3365  * @param cbs_data opaque pointer used by the callbacks
3366  * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3367  * error
3368  */
3370 vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period,
3371  const struct vlc_player_timer_cbs *cbs, void *data);
3372 
3373 /**
3374  * Add a smpte timer in order to get accurate video frame updates
3375  *
3376  * @param player player instance (locked or not)
3377  * @param cbs pointer to a vlc_player_timer_smpte_cbs structure, the structure must
3378  * be valid during the lifetime of the player
3379  * @param cbs_data opaque pointer used by the callbacks
3380  * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3381  * error
3382  */
3385  const struct vlc_player_timer_smpte_cbs *cbs,
3386  void *data);
3387 
3388 /**
3389  * Remove a player timer
3390  *
3391  * @param player player instance (locked or not)
3392  * @param timer timer created by vlc_player_AddTimer()
3393  */
3394 VLC_API void
3396 
3397 /**
3398  * Interpolate the last timer value to now
3399  *
3400  * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3401  * callback
3402  * @param system_now current system date
3403  * @param player_rate rate of the player
3404  * @param out_ts pointer where to set the interpolated ts, subtract this time
3405  * with VLC_TICK_0 to get the original value.
3406  * @param out_pos pointer where to set the interpolated position
3407  * @return VLC_SUCCESS in case of success, an error in the interpolated ts is
3408  * negative (could happen during the buffering step)
3409  */
3410 VLC_API int
3412  vlc_tick_t system_now,
3413  vlc_tick_t *out_ts, float *out_pos);
3414 
3415 /**
3416  * Get the date of the next interval
3417  *
3418  * Can be used to setup an UI timer in order to update some widgets at specific
3419  * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3420  * time widget when the media reaches a new second.
3421  *
3422  * @note The media time doesn't necessarily correspond to the system time, that
3423  * is why this function is needed and use the rate of the current point.
3424  *
3425  * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3426  * @param system_now current system date
3427  * @param interpolated_ts ts returned by vlc_player_timer_point_Interpolate()
3428  * with the same system now
3429  * @param next_interval next interval
3430  * @return the absolute system date of the next interval
3431  */
3434  vlc_tick_t system_now,
3435  vlc_tick_t interpolated_ts,
3436  vlc_tick_t next_interval);
3437 
3438 /** @} vlc_player__timer */
3439 
3440 /** @} vlc_player */
3441 
3442 #endif
vlc_player_t
Definition: player.h:227
vlc_player_GetSubtitleTrackCount
static size_t vlc_player_GetSubtitleTrackCount(vlc_player_t *player)
Helper to get the subtitle track count.
Definition: vlc_player.h:1439
vlc_player_program::name
const char * name
Program name, always valid.
Definition: vlc_player.h:1179
vlc_player_GetCategoryLanguage
VLC_EXPORT char * vlc_player_GetCategoryLanguage(vlc_player_t *player, enum es_format_category_e cat)
Get the language of an ES category.
Definition: player.c:725
VLC_PLAYER_NAV_UP
@ VLC_PLAYER_NAV_UP
Select a navigation item above or move the viewpoint up.
Definition: vlc_player.h:334
vlc_player_Navigate
VLC_EXPORT void vlc_player_Navigate(vlc_player_t *player, enum vlc_player_nav nav)
Navigate (for DVD/Bluray menus or viewpoint)
Definition: player.c:1554
VLC_PLAYER_LIST_ADDED
@ VLC_PLAYER_LIST_ADDED
Definition: vlc_player.h:2723
vlc_player_GetTitleList
VLC_EXPORT vlc_player_title_list * vlc_player_GetTitleList(vlc_player_t *player)
Get the title list of the current media.
Definition: player.c:814
vlc_player_SelectSubtitleLanguage
static void vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
Helper to select the subtitle language.
Definition: vlc_player.h:1774
vlc_player_cbs::on_error_changed
void(* on_error_changed)(vlc_player_t *player, enum vlc_player_error error, void *data)
Called when a media triggered an error.
Definition: vlc_player.h:2785
VLC_PLAYER_MEDIA_STOPPED_STOP
@ VLC_PLAYER_MEDIA_STOPPED_STOP
Stop, even if there is a next media to play.
Definition: vlc_player.h:102
count
size_t count
Definition: core.c:401
vlc_player_SelectTitle
VLC_EXPORT void vlc_player_SelectTitle(vlc_player_t *player, const struct vlc_player_title *title)
Select a title for the current media.
Definition: player.c:852
VLC_PLAYER_MEDIA_STOPPED_PAUSE
@ VLC_PLAYER_MEDIA_STOPPED_PAUSE
Pause when reaching the end of file.
Definition: vlc_player.h:100
VLC_API
#define VLC_API
Definition: fourcc_gen.c:31
VIDEO_ES
@ VIDEO_ES
Definition: vlc_es.h:603
vlc_player_vout_cbs
Player vout callbacks.
Definition: vlc_player.h:2512
vlc_player_SetAudioDelay
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:1972
vlc_player_GetState
VLC_EXPORT enum vlc_player_state vlc_player_GetState(vlc_player_t *player)
Get the state of the player.
Definition: player.c:1261
vlc_player_title_list_Hold
VLC_EXPORT 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
vlc_player_GetAudioTrackAt
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:1430
vlc_player_RestartEsId
VLC_EXPORT void vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Restart a track from an ES identifier.
Definition: player.c:697
vlc_player_SetSubtitleTextScale
VLC_EXPORT void vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale)
Set the subtitle text scaling factor.
Definition: player.c:1769
vlc_player_media_stopped_action
vlc_player_media_stopped_action
Action when the player is stopped.
Definition: vlc_player.h:96
vlc_player_GetVideoTrackCount
static size_t vlc_player_GetVideoTrackCount(vlc_player_t *player)
Helper to get the video track count.
Definition: vlc_player.h:1403
vlc_player_cbs::on_media_subitems_changed
void(* on_media_subitems_changed)(vlc_player_t *player, input_item_t *media, input_item_node_t *new_subitems, void *data)
Called when the media has new subitems.
Definition: vlc_player.h:3153
vlc_player_SeekByTime
VLC_EXPORT 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:1423
vlc_player_timer_cbs::on_update
void(* on_update)(const struct vlc_player_timer_point *value, void *data)
Called when the state or the time changed.
Definition: vlc_player.h:3321
vlc_player_timer_point_GetNextIntervalDate
VLC_EXPORT 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:515
vlc_player_cbs::on_teletext_menu_changed
void(* on_teletext_menu_changed)(vlc_player_t *player, bool has_teletext_menu, void *data)
Called when the media has a teletext menu.
Definition: vlc_player.h:2985
vlc_player_SelectPrevTrack
VLC_EXPORT void vlc_player_SelectPrevTrack(vlc_player_t *player, enum es_format_category_e cat)
Select the Previous track.
Definition: player.c:669
vlc_player_cbs::on_playback_restore_queried
void(* on_playback_restore_queried)(vlc_player_t *player, void *data)
Called to query the user about restoring the previous playback position.
Definition: vlc_player.h:3210
vlc_player_GetAtoBLoop
VLC_EXPORT 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:1531
vlc_player_cbs::on_vout_changed
void(* on_vout_changed)(vlc_player_t *player, enum vlc_player_vout_action action, vout_thread_t *vout, enum vlc_vout_order order, vlc_es_id_t *es_id, void *data)
Called when a vout is started or stopped.
Definition: vlc_player.h:3170
vlc_player_GetTime
VLC_EXPORT vlc_tick_t vlc_player_GetTime(vlc_player_t *player)
Get the time of the current media.
Definition: player.c:1356
vlc_player_IncrementRate
VLC_EXPORT void vlc_player_IncrementRate(vlc_player_t *player)
Increment the rate of the player (faster)
Definition: player.c:1337
vlc_player_timer_point::position
float position
Position in the range [0.0f;1.0].
Definition: vlc_player.h:3259
vlc_player_track_Dup
VLC_EXPORT struct vlc_player_track * vlc_player_track_Dup(const struct vlc_player_track *track)
Duplicate a track.
Definition: track.c:157
vlc_player_SetEsIdDelay
VLC_EXPORT 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:1680
vlc_player_timer_smpte_timecode::minutes
unsigned minutes
Minutes [0;59].
Definition: vlc_player.h:3285
vlc_player_aout_cbs::on_volume_changed
void(* on_volume_changed)(audio_output_t *aout, float new_volume, void *data)
Called when the volume has changed.
Definition: vlc_player.h:2296
vlc_player_IsVideoEnabled
static bool vlc_player_IsVideoEnabled(vlc_player_t *player)
Helper to check if video tracks are enabled.
Definition: vlc_player.h:1816
vlc_player_error
vlc_player_error
Error of the player.
Definition: vlc_player.h:289
vlc_player_AddListener
VLC_EXPORT 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:970
VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
Definition: vlc_player.h:379
vlc_player_listener_id
Definition: player.h:128
vlc_player_program::selected
bool selected
True if the program is selected.
Definition: vlc_player.h:1181
vlc_common.h
vlc_player_cbs::on_rate_changed
void(* on_rate_changed)(vlc_player_t *player, float new_rate, void *data)
Called when the player rate has changed.
Definition: vlc_player.h:2811
vlc_player_vout_ToggleFullscreen
static void vlc_player_vout_ToggleFullscreen(vlc_player_t *player)
Helper to toggle the player fullscreen state.
Definition: vlc_player.h:2636
vlc_player_title
Player title structure.
Definition: vlc_player.h:956
VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK
Definition: vlc_player.h:380
VLC_PLAYER_LOCK_NORMAL
@ VLC_PLAYER_LOCK_NORMAL
Normal lock.
Definition: vlc_player.h:79
vlc_player_GetSelectedChapter
static const struct vlc_player_chapter * vlc_player_GetSelectedChapter(vlc_player_t *player)
Helper to get the current selected chapter.
Definition: vlc_player.h:1125
vlc_player_program_Dup
VLC_EXPORT struct vlc_player_program * vlc_player_program_Dup(const struct vlc_player_program *prgm)
Duplicate a program.
Definition: track.c:69
vlc_player_aout_cbs
Player aout callbacks.
Definition: vlc_player.h:2285
vlc_player_track_Delete
VLC_EXPORT void vlc_player_track_Delete(struct vlc_player_track *track)
Delete a duplicated track.
Definition: track.c:149
vlc_player_GetProgram
VLC_EXPORT 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:279
vlc_player_program::group_id
int group_id
Id used for vlc_player_SelectProgram()
Definition: vlc_player.h:1177
vlc_player_program::scrambled
bool scrambled
True if the program is scrambled.
Definition: vlc_player.h:1183
vlc_player_select_policy
vlc_player_select_policy
Player selection policy.
Definition: vlc_player.h:1308
vlc_player_CanChangeRate
static bool vlc_player_CanChangeRate(vlc_player_t *player)
Helper to get the change-rate capability.
Definition: vlc_player.h:591
vlc_player_SelectCategoryLanguage
VLC_EXPORT 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:706
vlc_player_aout_IsMuted
VLC_EXPORT int vlc_player_aout_IsMuted(vlc_player_t *player)
Check if the audio output is muted.
Definition: aout.c:159
input_item_t
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:77
vlc_player_osd_Message
VLC_EXPORT void vlc_player_osd_Message(vlc_player_t *player, const char *fmt,...)
Display an OSD message on all vouts.
Definition: osd.c:89
vlc_player_GetSubtitleDelay
static vlc_tick_t vlc_player_GetSubtitleDelay(vlc_player_t *player)
Helper to get the subtitle delay.
Definition: vlc_player.h:1983
VLC_PLAYER_ERROR_GENERIC
@ VLC_PLAYER_ERROR_GENERIC
Definition: vlc_player.h:292
vlc_player_title_list_Release
VLC_EXPORT void vlc_player_title_list_Release(vlc_player_title_list *titles)
Release of previously held title list.
Definition: title.c:38
vlc_player_title::chapter_count
size_t chapter_count
Number of chapters, can be 0.
Definition: vlc_player.h:966
VLC_PLAYER_CAP_PAUSE
#define VLC_PLAYER_CAP_PAUSE
Player capability: can pause.
Definition: vlc_player.h:360
vlc_player_SelectNextTitle
VLC_EXPORT void vlc_player_SelectNextTitle(vlc_player_t *player)
Select the next title for the current media.
Definition: player.c:871
VLC_PLAYER_STATE_STARTED
@ VLC_PLAYER_STATE_STARTED
The player is started.
Definition: vlc_player.h:258
vlc_player_GetCategoryDelay
VLC_EXPORT 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:1667
vlc_player_timer_smpte_timecode::hours
unsigned hours
Hours [0;n].
Definition: vlc_player.h:3283
vlc_player_GetSelectedChapterIdx
VLC_EXPORT ssize_t vlc_player_GetSelectedChapterIdx(vlc_player_t *player)
Get the selected chapter index for the current media.
Definition: player.c:895
vlc_player_GetCurrentMedia
VLC_EXPORT input_item_t * vlc_player_GetCurrentMedia(vlc_player_t *player)
Get the current played media.
Definition: player.c:1043
vlc_player_cbs::on_titles_changed
void(* on_titles_changed)(vlc_player_t *player, vlc_player_title_list *titles, void *data)
Called when the media titles has changed.
Definition: vlc_player.h:2939
vlc_player_cbs::on_program_list_changed
void(* on_program_list_changed)(vlc_player_t *player, enum vlc_player_list_action action, const struct vlc_player_program *prgm, void *data)
Called when a new program is added, removed or updated.
Definition: vlc_player.h:2907
vlc_player_aout_SetVolume
VLC_EXPORT int vlc_player_aout_SetVolume(vlc_player_t *player, float volume)
Set the audio volume.
Definition: aout.c:135
vlc_player_Stop
VLC_EXPORT int vlc_player_Stop(vlc_player_t *player)
Stop the playback of the current media.
Definition: player.c:1185
vlc_player_SelectEsIdList
VLC_EXPORT 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:446
vlc_player_metadata_listener_id
Definition: player.h:135
vlc_player_ToggleRecording
static void vlc_player_ToggleRecording(vlc_player_t *player)
Helper to toggle the recording state.
Definition: vlc_player.h:874
vlc_player_HoldCurrentMedia
static input_item_t * vlc_player_HoldCurrentMedia(vlc_player_t *player)
Helper that hold the current media.
Definition: vlc_player.h:421
vlc_player_metadata_cbs
Player metadata callbacks.
Definition: vlc_player.h:2196
vlc_player_SetTrackCategoryEnabled
VLC_EXPORT 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:1741
vlc_player_vout_HoldAll
VLC_EXPORT 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
vlc_player_SelectProgram
VLC_EXPORT void vlc_player_SelectProgram(vlc_player_t *player, int group_id)
Select a program from an ES group identifier.
Definition: player.c:292
VLC_PLAYER_STATE_PLAYING
@ VLC_PLAYER_STATE_PLAYING
The player is playing.
Definition: vlc_player.h:266
vlc_player_title::name
const char * name
Title name, always valid.
Definition: vlc_player.h:959
vlc_player_vout_action
vlc_player_vout_action
action of vlc_player_cbs.on_vout_changed callback
Definition: vlc_player.h:2494
vlc_player_timer_smpte_cbs
Player smpte timer callbacks.
Definition: vlc_player.h:3341
vlc_player_aout_listener_id
Definition: player.h:155
vlc_player_GetAudioTrackCount
static size_t vlc_player_GetAudioTrackCount(vlc_player_t *player)
Helper to get the audio track count.
Definition: vlc_player.h:1421
vlc_player_SetRenderer
VLC_EXPORT void vlc_player_SetRenderer(vlc_player_t *player, vlc_renderer_item_t *renderer)
Set the renderer.
Definition: player.c:1447
vlc_player_aout_ToggleMute
static int vlc_player_aout_ToggleMute(vlc_player_t *player)
Helper to toggle the mute state.
Definition: vlc_player.h:2460
vlc_player_Start
VLC_EXPORT int vlc_player_Start(vlc_player_t *player)
Start the playback of the current media.
Definition: player.c:1136
vlc_player_timer_point::length
vlc_tick_t length
Valid length >= VLC_TICK_0 or VLC_TICK_INVALID.
Definition: vlc_player.h:3266
vlc_player_vout_cbs::on_wallpaper_mode_changed
void(* on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled, void *data)
Called when the player and/or vout wallpaper mode has changed.
Definition: vlc_player.h:2535
vlc_player_metadata_cbs::on_momentary_loudness_changed
void(* on_momentary_loudness_changed)(vlc_tick_t date, double momentary_loudness, void *data)
Called when the momentary loudness measurement have changed.
Definition: vlc_player.h:2211
vlc_player_track
Player track structure.
Definition: vlc_player.h:1334
vlc_player_GetV4l2Object
VLC_EXPORT vlc_object_t * vlc_player_GetV4l2Object(vlc_player_t *player)
Get the V4L2 object used to do controls.
Definition: player.c:1850
vlc_player_RestorePlaybackPos
VLC_EXPORT void vlc_player_RestorePlaybackPos(vlc_player_t *player)
Restore the previous playback position of the current media.
Definition: medialib.c:294
input_stats_t
Definition: vlc_input_item.h:507
vlc_player_InvalidateNextMedia
VLC_EXPORT void vlc_player_InvalidateNextMedia(vlc_player_t *player)
Invalidate the next media.
Definition: player.c:1123
VLC_PLAYER_NAV_ACTIVATE
@ VLC_PLAYER_NAV_ACTIVATE
Activate the navigation item selected.
Definition: vlc_player.h:332
vlc_viewpoint_t
Viewpoints.
Definition: vlc_viewpoint.h:41
vlc_player_vout_ToggleWallpaperMode
static void vlc_player_vout_ToggleWallpaperMode(vlc_player_t *player)
Helper to toggle the player wallpaper-mode state.
Definition: vlc_player.h:2679
vlc_player_title::chapters
const struct vlc_player_chapter * chapters
Array of chapters, can be NULL.
Definition: vlc_player.h:968
vlc_player_vout_Snapshot
VLC_EXPORT void vlc_player_vout_Snapshot(vlc_player_t *player)
Take a snapshot on all vouts.
Definition: vout.c:206
vlc_input.h
vlc_player_SelectEsId
VLC_EXPORT 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:560
VLC_PLAYER_NAV_RIGHT
@ VLC_PLAYER_NAV_RIGHT
Select a navigation item on the right or move the viewpoint right.
Definition: vlc_player.h:340
vlc_player_GetAudioDelay
static vlc_tick_t vlc_player_GetAudioDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition: vlc_player.h:1963
vlc_player_RemoveMetadataListener
VLC_EXPORT void vlc_player_RemoveMetadataListener(vlc_player_t *player, vlc_player_metadata_listener_id *listener_id)
Remove a metadata listener.
Definition: metadata.c:201
vlc_player_GetTrackAt
VLC_EXPORT 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:367
vlc_player_SelectTeletextPage
VLC_EXPORT void vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page)
Select a teletext page or do an action from a key.
Definition: player.c:754
vlc_player_SetTimeFast
static void vlc_player_SetTimeFast(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time fast.
Definition: vlc_player.h:763
vlc_player_track::name
const char * name
Track name, always valid.
Definition: vlc_player.h:1339
vlc_player_ChangeRate
VLC_EXPORT void vlc_player_ChangeRate(vlc_player_t *player, float rate)
Change the rate of the player.
Definition: player.c:1292
vlc_player_lock_type
vlc_player_lock_type
Player lock type (normal or reentrant)
Definition: vlc_player.h:71
VLC_PLAYER_NAV_DOWN
@ VLC_PLAYER_NAV_DOWN
Select a navigation item under or move the viewpoint down.
Definition: vlc_player.h:336
vlc_player_timer_smpte_cbs::on_update
void(* on_update)(const struct vlc_player_timer_smpte_timecode *tc, void *data)
Called when a new frame is displayed.
Definition: vlc_player.h:3353
VLC_PLAYER_LIST_UPDATED
@ VLC_PLAYER_LIST_UPDATED
Definition: vlc_player.h:2725
vlc_player_timer_point_Interpolate
VLC_EXPORT 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:474
vlc_player_vout_SetWallpaperModeEnabled
VLC_EXPORT void vlc_player_vout_SetWallpaperModeEnabled(vlc_player_t *player, bool enabled)
Enable or disable the player wallpaper-mode.
Definition: vout.c:198
vlc_player_DisplayPosition
VLC_EXPORT void vlc_player_DisplayPosition(vlc_player_t *player)
Display the player position on the vout OSD.
Definition: player.c:1386
vlc_player_GetSelectedProgram
static const struct vlc_player_program * vlc_player_GetSelectedProgram(vlc_player_t *player)
Helper to get the current selected program.
Definition: vlc_player.h:1282
VLC_PLAYER_ABLOOP_B
@ VLC_PLAYER_ABLOOP_B
Definition: vlc_player.h:354
VLC_PLAYER_ERROR_NONE
@ VLC_PLAYER_ERROR_NONE
Definition: vlc_player.h:291
vlc_player_aout_DecrementVolume
static int vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
Helper to decrement the audio volume.
Definition: vlc_player.h:2421
es_format_category_e
es_format_category_e
ES Categories.
Definition: vlc_es.h:600
vlc_player_SelectAudioLanguage
static void vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
Helper to select the audio language.
Definition: vlc_player.h:1765
vlc_player_GetPosition
VLC_EXPORT float vlc_player_GetPosition(vlc_player_t *player)
Get the position of the current media.
Definition: player.c:1367
vlc_player_SetSubtitleDelay
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:1992
vlc_player_cbs::on_capabilities_changed
void(* on_capabilities_changed)(vlc_player_t *player, int old_caps, int new_caps, void *data)
Called when the media capabilities has changed.
Definition: vlc_player.h:2824
vlc_player_cbs::on_cork_changed
void(* on_cork_changed)(vlc_player_t *player, unsigned cork_count, void *data)
Called when the player is corked.
Definition: vlc_player.h:3193
VLC_PLAYER_WHENCE_RELATIVE
@ VLC_PLAYER_WHENCE_RELATIVE
The current position +/- the given time/position.
Definition: vlc_player.h:321
audio_output
Audio output object.
Definition: vlc_aout.h:141
vlc_player_GetEsIdFromVout
VLC_EXPORT 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:420
vlc_player_aout_AddListener
VLC_EXPORT 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
vlc_player_GetSelectedTrack
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:1513
vlc_player_SetRecordingEnabled
VLC_EXPORT void vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled)
Enable or disable recording for the current media.
Definition: player.c:1618
vlc_player_TogglePause
static void vlc_player_TogglePause(vlc_player_t *player)
Helper to toggle the pause state.
Definition: vlc_player.h:545
vlc_player_GetStatistics
VLC_EXPORT const struct input_stats_t * vlc_player_GetStatistics(vlc_player_t *player)
Get the statistics of the current media.
Definition: player.c:1797
vlc_player_Unlock
VLC_EXPORT void vlc_player_Unlock(vlc_player_t *player)
Unlock the player.
Definition: player.c:957
vlc_player_SetMediaStoppedAction
VLC_EXPORT 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:1203
VLC_PLAYER_SELECT_SIMULTANEOUS
@ VLC_PLAYER_SELECT_SIMULTANEOUS
Select multiple tracks for one category.
Definition: vlc_player.h:1322
vlc_player_SetAssociatedSubsFPS
VLC_EXPORT void vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps)
Set the associated subtitle FPS.
Definition: player.c:1104
vlc_player_CanSeek
static bool vlc_player_CanSeek(vlc_player_t *player)
Helper to get the seek capability.
Definition: vlc_player.h:573
vlc_player_program
Player program structure.
Definition: vlc_player.h:1174
vlc_player_cbs::on_media_epg_changed
void(* on_media_epg_changed)(vlc_player_t *player, input_item_t *media, void *data)
Called when media epg has changed.
Definition: vlc_player.h:3142
vlc_player_SelectTracksByStringIds
VLC_EXPORT void vlc_player_SelectTracksByStringIds(vlc_player_t *player, enum es_format_category_e cat, const char *str_ids)
Select tracks by their string identifier.
Definition: player.c:587
vlc_player_RestartTrackCategory
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:1715
VLC_PLAYER_CAP_REWIND
#define VLC_PLAYER_CAP_REWIND
Player capability: can seek back.
Definition: vlc_player.h:364
vlc_player_vout_listener_id
Definition: player.h:148
vlc_player_GetVideoTrackAt
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:1412
vlc_player_SelectNextProgram
VLC_EXPORT void vlc_player_SelectNextProgram(vlc_player_t *player)
Select the next program.
Definition: player.c:342
vlc_player_GetTrackCount
VLC_EXPORT 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:354
vlc_player_GetProgramAt
VLC_EXPORT 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:267
vlc_player_SeekByPos
VLC_EXPORT 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:1398
vlc_player_aout_cbs::on_device_changed
void(* on_device_changed)(audio_output_t *aout, const char *device, void *data)
Called when the audio device has changed.
Definition: vlc_player.h:2318
vlc_player_cbs::on_title_selection_changed
void(* on_title_selection_changed)(vlc_player_t *player, const struct vlc_player_title *new_title, size_t new_idx, void *data)
Called when a new title is selected.
Definition: vlc_player.h:2955
vlc_player_New
VLC_EXPORT 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:1921
vlc_player_vout_RemoveListener
VLC_EXPORT 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_SetCurrentMedia
VLC_EXPORT int vlc_player_SetCurrentMedia(vlc_player_t *player, input_item_t *media)
Set the current media.
Definition: player.c:1000
vlc_player_Pause
VLC_EXPORT void vlc_player_Pause(vlc_player_t *player)
Pause the playback.
Definition: player.c:1237
es_format_t
Definition: vlc_es.h:617
vlc_player_GetTeletextPage
VLC_EXPORT unsigned vlc_player_GetTeletextPage(vlc_player_t *player)
Get the current teletext page.
Definition: player.c:800
vlc_tick_t
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45
VLC_PLAYER_SELECT_EXCLUSIVE
@ VLC_PLAYER_SELECT_EXCLUSIVE
Only one track per category is selected.
Definition: vlc_player.h:1314
vlc_player_AddMetadataListener
VLC_EXPORT vlc_player_metadata_listener_id * vlc_player_AddMetadataListener(vlc_player_t *player, enum vlc_player_metadata_option option, const union vlc_player_metadata_cbs *cbs, void *cbs_data)
Add a metadata listener.
Definition: metadata.c:158
vlc_player_IsSubtitleEnabled
static bool vlc_player_IsSubtitleEnabled(vlc_player_t *player)
Helper to check if subtitle tracks are enabled.
Definition: vlc_player.h:1852
VLC_PLAYER_WHENCE_ABSOLUTE
@ VLC_PLAYER_WHENCE_ABSOLUTE
Given time/position.
Definition: vlc_player.h:319
vlc_player_vout_IsFullscreen
VLC_EXPORT bool vlc_player_vout_IsFullscreen(vlc_player_t *player)
Check if the player is fullscreen.
Definition: vout.c:101
VLC_PLAYER_MEDIA_STOPPED_CONTINUE
@ VLC_PLAYER_MEDIA_STOPPED_CONTINUE
Continue (or stop if there is no next media), default behavior.
Definition: vlc_player.h:98
vlc_player_metadata_option
vlc_player_metadata_option
Player metadata option.
Definition: vlc_player.h:2169
vlc_player_timer_smpte_timecode::drop_frame
bool drop_frame
True if the source is NTSC 29.97fps or 59.94fps DF.
Definition: vlc_player.h:3293
vlc_player_GetLength
VLC_EXPORT vlc_tick_t vlc_player_GetLength(vlc_player_t *player)
Get the length of the current media.
Definition: player.c:1349
VLC_DEPRECATED
#define VLC_DEPRECATED
Deprecated functions or compound members annotation.
Definition: vlc_common.h:119
vlc_player_title_list_GetAt
VLC_EXPORT 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
vlc_player_GetSubtitleTrackAt
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:1448
vlc_player_CondWait
VLC_EXPORT void vlc_player_CondWait(vlc_player_t *player, vlc_cond_t *cond)
Wait on a condition variable.
Definition: player.c:963
vlc_player_SelectTitleIdx
VLC_EXPORT void vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index)
Select a title index for the current media.
Definition: player.c:843
vlc_player_GetCapabilities
VLC_EXPORT int vlc_player_GetCapabilities(vlc_player_t *player)
Get the player capabilities.
Definition: player.c:1275
vlc_player_vout_SetFullscreen
VLC_EXPORT void vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
Enable or disable the player fullscreen state.
Definition: vout.c:181
vlc_player_SelectPrevTitle
VLC_EXPORT void vlc_player_SelectPrevTitle(vlc_player_t *player)
Select the previous title for the current media.
Definition: player.c:883
vlc_player_SetCategoryDelay
VLC_EXPORT 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:1633
vlc_player_SetSubtitleEnabled
static void vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable subtitle tracks.
Definition: vlc_player.h:1843
vlc_player_cbs::on_signal_changed
void(* on_signal_changed)(vlc_player_t *player, float quality, float strength, void *data)
Called when the media signal has changed.
Definition: vlc_player.h:3081
VLC_PLAYER_VOUT_STOPPED
@ VLC_PLAYER_VOUT_STOPPED
Definition: vlc_player.h:2497
vlc_player_SetStartPaused
VLC_EXPORT void vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused)
Ask to start in a paused state.
Definition: player.c:1214
vlc_player_SetPosition
static void vlc_player_SetPosition(vlc_player_t *player, float position)
Helper to set the absolute position precisely.
Definition: vlc_player.h:721
vlc_player_timer_point::system_date
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:3272
vlc_player_Lock
VLC_EXPORT void vlc_player_Lock(vlc_player_t *player)
Lock the player.
Definition: player.c:941
vlc_player_title::flags
unsigned flags
Bit flag of VLC_PLAYER_TITLE_MENU and VLC_PLAYER_TITLE_INTERACTIVE.
Definition: vlc_player.h:964
vlc_player_SetTime
static void vlc_player_SetTime(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time precisely.
Definition: vlc_player.h:753
vlc_player_HasTeletextMenu
VLC_EXPORT bool vlc_player_HasTeletextMenu(vlc_player_t *player)
Check if the media has a teletext menu.
Definition: player.c:781
vlc_player_program_Delete
VLC_EXPORT void vlc_player_program_Delete(struct vlc_player_program *prgm)
Delete a duplicated program.
Definition: track.c:82
vlc_player_IsTeletextTransparent
VLC_EXPORT bool vlc_player_IsTeletextTransparent(vlc_player_t *player)
Check if teletext is transparent.
Definition: player.c:807
vlc_player_cbs::on_teletext_transparency_changed
void(* on_teletext_transparency_changed)(vlc_player_t *player, bool enabled, void *data)
Called when the teletext transparency has changed.
Definition: vlc_player.h:3021
vlc_player_GetProgramCount
VLC_EXPORT size_t vlc_player_GetProgramCount(vlc_player_t *player)
Get the number of programs.
Definition: player.c:259
VLC_PLAYER_NAV_LEFT
@ VLC_PLAYER_NAV_LEFT
Select a navigation item on the left or move the viewpoint left.
Definition: vlc_player.h:338
vlc_player_timer_id
Definition: player.h:169
vlc_player_abloop
vlc_player_abloop
A to B loop state.
Definition: vlc_player.h:350
VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS
Definition: vlc_player.h:381
vlc_player_track::es_id
vlc_es_id_t * es_id
Id used for any player actions, like vlc_player_SelectEsId()
Definition: vlc_player.h:1337
vlc_player_IsStarted
static bool vlc_player_IsStarted(vlc_player_t *player)
Helper to get the started state.
Definition: vlc_player.h:519
VLC_PLAYER_STATE_STOPPING
@ VLC_PLAYER_STATE_STOPPING
The player is stopping.
Definition: vlc_player.h:281
VLC_PLAYER_SEEK_PRECISE
@ VLC_PLAYER_SEEK_PRECISE
Do a precise seek.
Definition: vlc_player.h:304
vlc_player_cbs::on_teletext_page_changed
void(* on_teletext_page_changed)(vlc_player_t *player, unsigned new_page, void *data)
Called when the teletext page has changed.
Definition: vlc_player.h:3009
VLC_PLAYER_NAV_MENU
@ VLC_PLAYER_NAV_MENU
Activate disc Root Menu.
Definition: vlc_player.h:344
vlc_player_timer_point::rate
double rate
Rate of the player.
Definition: vlc_player.h:3261
vlc_player_seek_speed
vlc_player_seek_speed
Seek speed type.
Definition: vlc_player.h:301
vlc_player_aout_GetVolume
VLC_EXPORT float vlc_player_aout_GetVolume(vlc_player_t *player)
Get the audio volume.
Definition: aout.c:123
vlc_player_chapter
Player chapter structure.
Definition: vlc_player.h:942
vlc_player_SelectNextTrack
VLC_EXPORT void vlc_player_SelectNextTrack(vlc_player_t *player, enum es_format_category_e cat)
Select the next track.
Definition: player.c:662
vlc_player_GetSelectedTitleIdx
VLC_EXPORT ssize_t vlc_player_GetSelectedTitleIdx(vlc_player_t *player)
Get the selected title index for the current media.
Definition: player.c:821
vlc_player_vout_IsWallpaperModeEnabled
VLC_EXPORT bool vlc_player_vout_IsWallpaperModeEnabled(vlc_player_t *player)
Check if the player has wallpaper-mode enaled.
Definition: vout.c:189
vlc_player_GetAssociatedSubsFPS
VLC_EXPORT float vlc_player_GetAssociatedSubsFPS(vlc_player_t *player)
Get the associated subtitle FPS.
Definition: player.c:1116
vlc_player_SetVideoEnabled
static void vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable video tracks.
Definition: vlc_player.h:1807
vlc_player_whence
vlc_player_whence
Player seek/delay directive.
Definition: vlc_player.h:316
vlc_es_id_t
Opaque structure representing an ES (Elementary Stream) track.
Definition: es_out.c:94
AUDIO_ES
@ AUDIO_ES
Definition: vlc_es.h:604
VLC_PLAYER_LIST_REMOVED
@ VLC_PLAYER_LIST_REMOVED
Definition: vlc_player.h:2724
vlc_player_JumpPos
static void vlc_player_JumpPos(vlc_player_t *player, float jumppos)
Helper to jump the position precisely.
Definition: vlc_player.h:741
vlc_player_cbs::on_track_selection_changed
void(* on_track_selection_changed)(vlc_player_t *player, vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data)
Called when a new track is selected and/or unselected.
Definition: vlc_player.h:2881
vlc_player_cbs::on_statistics_changed
void(* on_statistics_changed)(vlc_player_t *player, const struct input_stats_t *stats, void *data)
Called when the player has new statisics.
Definition: vlc_player.h:3094
vlc_player_timer_smpte_timecode::seconds
unsigned seconds
Seconds [0;59].
Definition: vlc_player.h:3287
vlc_player_CanRewind
static bool vlc_player_CanRewind(vlc_player_t *player)
Helper to get the rewindable capability.
Definition: vlc_player.h:600
vlc_player_list_action
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:2721
vlc_player_cbs::on_associated_subs_fps_changed
void(* on_associated_subs_fps_changed)(vlc_player_t *player, float subs_fps, void *data)
Called when associated subtitle has changed.
Definition: vlc_player.h:3046
vlc_player_vout_cbs::on_fullscreen_changed
void(* on_fullscreen_changed)(vout_thread_t *vout, bool enabled, void *data)
Called when the player and/or vout fullscreen state has changed.
Definition: vlc_player.h:2523
vlc_player_NextVideoFrame
VLC_EXPORT void vlc_player_NextVideoFrame(vlc_player_t *player)
Pause and display the next video frame.
Definition: player.c:1249
vlc_player_GetSelectedTitle
static const struct vlc_player_title * vlc_player_GetSelectedTitle(vlc_player_t *player)
Helper to get the current selected title.
Definition: vlc_player.h:1038
vlc_object_t
VLC object common members.
Definition: vlc_objects.h:43
vlc_player_AddAssociatedMedia
VLC_EXPORT 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:1051
vlc_player_aout_cbs::on_mute_changed
void(* on_mute_changed)(audio_output_t *aout, bool new_muted, void *data)
Called when the mute state has changed.
Definition: vlc_player.h:2308
vlc_player_metadata_cbs::on_loudness_changed
void(* on_loudness_changed)(vlc_tick_t date, const struct vlc_audio_loudness *loudness, void *data)
Called when loudness measurements have changed.
Definition: vlc_player.h:2228
vlc_player_DecrementRate
VLC_EXPORT void vlc_player_DecrementRate(vlc_player_t *player)
Decrement the rate of the player (Slower)
Definition: player.c:1343
vlc_player_title::length
vlc_tick_t length
Length of the title.
Definition: vlc_player.h:961
vlc_player_cbs::on_length_changed
void(* on_length_changed)(vlc_player_t *player, vlc_tick_t new_length, void *data)
Called when the media length has changed.
Definition: vlc_player.h:2851
VLC_PLAYER_MEDIA_STOPPED_EXIT
@ VLC_PLAYER_MEDIA_STOPPED_EXIT
Exit VLC.
Definition: vlc_player.h:104
vlc_player_aout_RemoveListener
VLC_EXPORT 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
vlc_player_cbs::on_chapter_selection_changed
void(* on_chapter_selection_changed)(vlc_player_t *player, const struct vlc_player_title *title, size_t title_idx, const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx, void *data)
Called when a new chapter is selected.
Definition: vlc_player.h:2973
VLC_PLAYER_ABLOOP_A
@ VLC_PLAYER_ABLOOP_A
Definition: vlc_player.h:353
vlc_player_AddTimer
VLC_EXPORT 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:418
vlc_player_SetPauseOnCork
VLC_EXPORT void vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled)
Enable or disable pause on cork event.
Definition: player.c:1805
vlc_player_cbs::on_media_stopped_action_changed
void(* on_media_stopped_action_changed)(vlc_player_t *player, enum vlc_player_media_stopped_action new_action, void *data)
Called when media stopped action has changed.
Definition: vlc_player.h:3122
vlc_player_IsTeletextEnabled
VLC_EXPORT bool vlc_player_IsTeletextEnabled(vlc_player_t *player)
Check if teletext is enabled.
Definition: player.c:788
VLC_PLAYER_SEEK_FAST
@ VLC_PLAYER_SEEK_FAST
Do a fast seek.
Definition: vlc_player.h:306
VLC_PLAYER_METADATA_LOUDNESS_MOMENTARY
@ VLC_PLAYER_METADATA_LOUDNESS_MOMENTARY
Ask for momentary loudness measurement.
Definition: vlc_player.h:2177
vlc_player_title_list_GetCount
VLC_EXPORT size_t vlc_player_title_list_GetCount(vlc_player_title_list *titles)
Get the number of title of a list.
Definition: title.c:171
VLC_PLAYER_STATE_PAUSED
@ VLC_PLAYER_STATE_PAUSED
The player is paused.
Definition: vlc_player.h:273
vlc_player_cbs::on_buffering_changed
void(* on_buffering_changed)(vlc_player_t *player, float new_buffering, void *data)
Called when the player buffering (or cache) has changed.
Definition: vlc_player.h:2798
vlc_player_IsRecording
VLC_EXPORT bool vlc_player_IsRecording(vlc_player_t *player)
Check if the playing is recording.
Definition: player.c:1610
vlc_player_GetSignal
VLC_EXPORT 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:1782
vlc_player_GetTrack
VLC_EXPORT 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:397
vlc_player_cbs::on_renderer_changed
void(* on_renderer_changed)(vlc_player_t *player, vlc_renderer_item_t *new_item, void *data)
Called when a new renderer item is set.
Definition: vlc_player.h:3058
vlc_player_chapter::name
const char * name
Chapter name, always valid.
Definition: vlc_player.h:945
vlc_player_timer_point::ts
vlc_tick_t ts
Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with VLC_TICK_0 to get the original ...
Definition: vlc_player.h:3264
VLC_PLAYER_ABLOOP_NONE
@ VLC_PLAYER_ABLOOP_NONE
Definition: vlc_player.h:352
vlc_player_restore_playback_pos
vlc_player_restore_playback_pos
Definition: vlc_player.h:377
VLC_PLAYER_VOUT_STARTED
@ VLC_PLAYER_VOUT_STARTED
Definition: vlc_player.h:2496
vlc_player_IsAudioEnabled
static bool vlc_player_IsAudioEnabled(vlc_player_t *player)
Helper to check if audio tracks are enabled.
Definition: vlc_player.h:1834
vlc_player_track::selected
bool selected
True if the track is selected.
Definition: vlc_player.h:1343
name
const char name[16]
Definition: httpd.c:1268
vlc_renderer_item_t
Definition: renderer_discovery.c:34
vlc_player_state
vlc_player_state
State of the player.
Definition: vlc_player.h:243
vlc_player_RemoveListener
VLC_EXPORT void vlc_player_RemoveListener(vlc_player_t *player, vlc_player_listener_id *listener_id)
Remove a listener callback.
Definition: player.c:989
vlc_player_UnselectEsId
VLC_EXPORT void vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Unselect a track from an ES identifier.
Definition: player.c:676
vlc_cond_t
Condition variable.
Definition: vlc_threads.h:349
vlc_player_cbs::on_state_changed
void(* on_state_changed)(vlc_player_t *player, enum vlc_player_state new_state, void *data)
Called when the player state has changed.
Definition: vlc_player.h:2771
vlc_vout_order
vlc_vout_order
vout or spu_channel order
Definition: vlc_vout.h:70
VLC_PLAYER_CAP_CHANGE_RATE
#define VLC_PLAYER_CAP_CHANGE_RATE
Player capability: can change the rate.
Definition: vlc_player.h:362
vlc_player_UnselectTrack
static void vlc_player_UnselectTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to unselect a track.
Definition: vlc_player.h:1664
vlc_player_aout_Mute
VLC_EXPORT int vlc_player_aout_Mute(vlc_player_t *player, bool mute)
Mute or unmute the audio output.
Definition: aout.c:171
SPU_ES
@ SPU_ES
Definition: vlc_es.h:605
vlc_player_title_list
Definition: player.h:49
vlc_player_SelectTrack
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:1577
vlc_player_SetTeletextTransparency
VLC_EXPORT void vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled)
Enable or disable teletext transparency.
Definition: player.c:767
vlc_player_cbs::on_track_delay_changed
void(* on_track_delay_changed)(vlc_player_t *player, vlc_es_id_t *es_id, vlc_tick_t delay, void *data)
Called when a track delay has changed.
Definition: vlc_player.h:2892
vlc_player_GetSubtitleTextScale
VLC_EXPORT unsigned vlc_player_GetSubtitleTextScale(vlc_player_t *player)
Get the subtitle text scaling factor.
Definition: player.c:1776
vlc_player_IsTrackCategoryEnabled
VLC_EXPORT bool vlc_player_IsTrackCategoryEnabled(vlc_player_t *player, enum es_format_category_e cat)
Check if a track category is enabled.
Definition: player.c:1761
vlc_player_AddSmpteTimer
VLC_EXPORT 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:440
vlc_player_chapter::time
vlc_tick_t time
Position of this chapter.
Definition: vlc_player.h:947
vlc_player_timer_smpte_timecode
Player smpte timecode.
Definition: vlc_player.h:3280
vlc_player_Delete
VLC_EXPORT void vlc_player_Delete(vlc_player_t *player)
Delete a player instance.
Definition: player.c:1873
vlc_player_aout_IncrementVolume
VLC_EXPORT int vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result)
Increment the audio volume.
Definition: aout.c:147
vlc_player_timer_smpte_timecode::frame_resolution
unsigned frame_resolution
Maximum number of digits needed to display the frame number.
Definition: vlc_player.h:3291
vlc_player_cbs::on_position_changed
void(* on_position_changed)(vlc_player_t *player, vlc_tick_t new_time, float new_pos, void *data)
Called when the player position has changed.
Definition: vlc_player.h:2837
vlc_player_SetAtoBLoop
VLC_EXPORT 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:1474
vlc_player_ToggleSubtitle
static void vlc_player_ToggleSubtitle(vlc_player_t *player)
Helper to toggle subtitles.
Definition: vlc_player.h:1861
VLC_PLAYER_NAV_POPUP
@ VLC_PLAYER_NAV_POPUP
Activate the popup Menu (for BD)
Definition: vlc_player.h:342
vlc_player_nav
vlc_player_nav
Menu (VCD/DVD/BD) and viewpoint navigations.
Definition: vlc_player.h:329
vlc_player_SelectChapter
VLC_EXPORT 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:861
vlc_player_GetRate
VLC_EXPORT float vlc_player_GetRate(vlc_player_t *player)
Get the rate of the player.
Definition: player.c:1282
vlc_player_SelectPrevChapter
VLC_EXPORT void vlc_player_SelectPrevChapter(vlc_player_t *player)
Select the previous chapter for the current media.
Definition: player.c:929
vlc_player_SelectChapterIdx
VLC_EXPORT void vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index)
Select a chapter index for the current media.
Definition: player.c:905
vlc_player_aout_Hold
VLC_EXPORT audio_output_t * vlc_player_aout_Hold(vlc_player_t *player)
Get the audio output.
Definition: aout.c:44
vlc_player_cbs::on_media_meta_changed
void(* on_media_meta_changed)(vlc_player_t *player, input_item_t *media, void *data)
Called when the media meta has changed.
Definition: vlc_player.h:3132
vlc_player_GetEsIdVout
VLC_EXPORT 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:405
vlc_aout.h
vout_thread_t
Video output thread descriptor.
Definition: vlc_vout.h:55
vlc_player_aout_Reset
VLC_EXPORT void vlc_player_aout_Reset(vlc_player_t *player)
Reset the main audio output.
Definition: aout.c:242
vlc_player_SelectNextChapter
VLC_EXPORT void vlc_player_SelectNextChapter(vlc_player_t *player)
Select the next chapter for the current media.
Definition: player.c:917
vlc_player_track::fmt
es_format_t fmt
Es format.
Definition: vlc_player.h:1341
vlc_player_cbs::on_category_delay_changed
void(* on_category_delay_changed)(vlc_player_t *player, enum es_format_category_e cat, vlc_tick_t new_delay, void *data)
Called when the player category delay has changed for the current media.
Definition: vlc_player.h:3034
input_item_node_t
Definition: vlc_input_item.h:194
vlc_player_cbs::on_atobloop_changed
void(* on_atobloop_changed)(vlc_player_t *player, enum vlc_player_abloop new_state, vlc_tick_t time, float pos, void *data)
Called when the A to B loop has changed.
Definition: vlc_player.h:3109
VLC_PLAYER_STATE_STOPPED
@ VLC_PLAYER_STATE_STOPPED
The player is stopped.
Definition: vlc_player.h:251
vlc_player_SelectPrevProgram
VLC_EXPORT void vlc_player_SelectPrevProgram(vlc_player_t *player)
Select the previous program.
Definition: player.c:348
vlc_player_cbs::on_program_selection_changed
void(* on_program_selection_changed)(vlc_player_t *player, int unselected_id, int selected_id, void *data)
Called when a new program is selected and/or unselected.
Definition: vlc_player.h:2922
vlc_player_cbs::on_current_media_changed
void(* on_current_media_changed)(vlc_player_t *player, input_item_t *new_media, void *data)
Called when the current media has changed.
Definition: vlc_player.h:2759
vlc_player_media_provider
Callbacks for the owner of the player.
Definition: vlc_player.h:117
input_item_Hold
input_item_t * input_item_Hold(input_item_t *p_item)
Holds an input item, i.e.
Definition: item.c:442
vlc_player_cbs
Player callbacks.
Definition: vlc_player.h:2742
vlc_player_JumpTime
static void vlc_player_JumpTime(vlc_player_t *player, vlc_tick_t jumptime)
Helper to jump the time precisely.
Definition: vlc_player.h:773
VLC_PLAYER_METADATA_LOUDNESS_FULL
@ VLC_PLAYER_METADATA_LOUDNESS_FULL
Ask for all loudness measurements.
Definition: vlc_player.h:2185
vlc_player_timer_point
Player timer point.
Definition: vlc_player.h:3256
vlc_player_SetAudioEnabled
static void vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable audio tracks.
Definition: vlc_player.h:1825
vlc_player_cbs::on_teletext_enabled_changed
void(* on_teletext_enabled_changed)(vlc_player_t *player, bool enabled, void *data)
Called when teletext is enabled or disabled.
Definition: vlc_player.h:2997
vlc_player_timer_smpte_timecode::frames
unsigned frames
Frame number [0;n].
Definition: vlc_player.h:3289
vlc_player_cbs::on_track_list_changed
void(* on_track_list_changed)(vlc_player_t *player, enum vlc_player_list_action action, const struct vlc_player_track *track, void *data)
Called when a track is added, removed, or updated.
Definition: vlc_player.h:2866
vlc_player_timer_cbs
Player timer callbacks.
Definition: vlc_player.h:3301
vlc_player_CanPause
static bool vlc_player_CanPause(vlc_player_t *player)
Helper to get the pause capability.
Definition: vlc_player.h:582
vlc_player_timer_cbs::on_discontinuity
void(* on_discontinuity)(vlc_tick_t system_date, void *data)
The player is paused or a discontinuity occurred, likely caused by seek from the user or because the ...
Definition: vlc_player.h:3333
vlc_player_vout_AddListener
VLC_EXPORT 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
vlc_player_GetEsIdDelay
VLC_EXPORT 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:1720
vlc_player_vout_Hold
VLC_EXPORT vout_thread_t * vlc_player_vout_Hold(vlc_player_t *player)
Get and hold the main video output.
Definition: vout.c:43
vlc_player_SetPositionFast
static void vlc_player_SetPositionFast(vlc_player_t *player, float position)
Helper to set the absolute position fast.
Definition: vlc_player.h:731
VLC_PLAYER_LOCK_REENTRANT
@ VLC_PLAYER_LOCK_REENTRANT
Reentrant lock.
Definition: vlc_player.h:88
vlc_player_SetTeletextEnabled
VLC_EXPORT void vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled)
Enable or disable teletext.
Definition: player.c:741
VLC_PLAYER_CAP_SEEK
#define VLC_PLAYER_CAP_SEEK
Player capability: can seek.
Definition: vlc_player.h:358
vlc_player_UnselectTrackCategory
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:1674
vlc_player_aout_EnableFilter
VLC_EXPORT int vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add)
Enable or disable an audio filter.
Definition: aout.c:183
vlc_player_Resume
VLC_EXPORT void vlc_player_Resume(vlc_player_t *player)
Resume the playback from a pause.
Definition: player.c:1243
vlc_player_RemoveTimer
VLC_EXPORT void vlc_player_RemoveTimer(vlc_player_t *player, vlc_player_timer_id *timer)
Remove a player timer.
Definition: timer.c:462
vlc_player_GetRenderer
VLC_EXPORT vlc_renderer_item_t * vlc_player_GetRenderer(vlc_player_t *player)
Get the renderer.
Definition: player.c:1467
vlc_player_GetError
VLC_EXPORT enum vlc_player_error vlc_player_GetError(vlc_player_t *player)
Get the error state of the player.
Definition: player.c:1268
vlc_player_cbs::on_recording_changed
void(* on_recording_changed)(vlc_player_t *player, bool recording, void *data)
Called when the player recording state has changed.
Definition: vlc_player.h:3070
vlc_player_RestartTrack
static void vlc_player_RestartTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to restart a track.
Definition: vlc_player.h:1705
vlc_audio_loudness
Audio loudness measurement.
Definition: vlc_aout.h:549
vlc_player_UpdateViewpoint
VLC_EXPORT void vlc_player_UpdateViewpoint(vlc_player_t *player, const vlc_viewpoint_t *viewpoint, enum vlc_player_whence whence)
Update the viewpoint.
Definition: player.c:1592
vlc_player_IsPaused
static bool vlc_player_IsPaused(vlc_player_t *player)
Helper to get the paused state.
Definition: vlc_player.h:536