VLC 4.0.0-dev
Loading...
Searching...
No Matches
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
33digraph 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 */
65typedef struct vlc_player_t vlc_player_t;
67/**
68 * Player lock type (normal or reentrant)
69 */
72 /**
73 * Normal lock
74 *
75 * If the player is already locked, subsequent calls to vlc_player_Lock()
76 * will deadlock.
77 */
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 * Create a new player instance
92 *
93 * @param parent parent VLC object
94 * @param lock_type whether the player lock is reentrant or not
95 * @param media_provider pointer to a media_provider structure or NULL, the
96 * structure must be valid during the lifetime of the player
97 * @param media_provider_data opaque data used by provider callbacks
98 * @return a pointer to a valid player instance or NULL in case of error
99 */
101vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type);
102
103/**
104 * Delete a player instance
105 *
106 * This function stop any playback previously started and wait for their
107 * termination.
108 *
109 * @warning Blocking function if the player state is not STOPPED, don't call it
110 * from an UI thread in that case.
111 *
112 * @param player unlocked player instance created by vlc_player_New()
113 */
114VLC_API void
116
117/**
118 * Lock the player.
119 *
120 * All player functions (except vlc_player_Delete()) need to be called while
121 * the player lock is held.
122 *
123 * @param player unlocked player instance
124 */
125VLC_API void
127
128/**
129 * Unlock the player
130 *
131 * @param player locked player instance
132 */
133VLC_API void
135
136/**
137 * Wait on a condition variable
138 *
139 * This call allow users to use their own condition with the player mutex.
140 *
141 * @param player locked player instance
142 * @param cond external condition
143 */
144VLC_API void
146
147/**
148 * Ask to start in a paused state
149 *
150 * This function can be used before vlc_player_Start()
151 *
152 * @param player locked player instance
153 * @param start_paused true to start in a paused state, false to cancel it
154 */
155VLC_API void
157
158/**
159 * Pause when reaching EOF
160 *
161 * @param player locked player instance
162 * @param play_and_pause true to pause the player when reaching EOF
163 */
164VLC_API void
166
167/**
168 * Repeat playback when reaching EOF
169 *
170 * @param player locked player instance
171 * @param repeat_count number of time to restart the same media
172 */
173VLC_API void
174vlc_player_SetRepeatCount(vlc_player_t *player, unsigned repeat_count);
175
176/**
177 * Enable or disable pause on cork event
178 *
179 * If enabled, the player will automatically pause and resume on cork events.
180 * In that case, cork events won't be propagated via callbacks.
181 * @see vlc_player_cbs.on_cork_changed
182 *
183 * @param player locked player instance
184 * @param enabled true to enable
185 */
186VLC_API void
187vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
188
189/** @} vlc_player__instance */
190
191/**
192 * @defgroup vlc_player__playback Playback control
193 * @{
194 */
195
196/**
197 * State of the player
198 *
199 * During a normal playback (no errors), the user is expected to receive all
200 * events in the following order: STARTED, PLAYING, STOPPING, STOPPED.
201 *
202 * @note When playing more than one media in a row, the player stay at the
203 * PLAYING state when doing the transition from the current media to the next
204 * media (that can be gapless). This means that STOPPING, STOPPED states (for
205 * the current media) and STARTED, PLAYING states (for the next one) won't be
206 * sent. Nevertheless, the vlc_player_cbs.on_current_media_changed callback
207 * will be called during this transition.
208 */
211 /**
212 * The player is stopped
213 *
214 * Initial state, or triggered by an internal transition from the STOPPING
215 * state.
216 */
219 /**
220 * The player is started
221 *
222 * Triggered by vlc_player_Start()
223 */
226 /**
227 * The player is playing
228 *
229 * Triggered by vlc_player_Resume() or by an internal transition from the
230 * STARTED state.
231 */
234 /**
235 * The player is paused
236 *
237 * Triggered by vlc_player_Pause().
238 */
241 /**
242 * The player is stopping
243 *
244 * Triggered by vlc_player_Stop(), vlc_player_SetCurrentMedia() or by an
245 * internal transition (when the media reach the end of file for example).
246 */
249
250/**
251 * Error of the player
252 *
253 * @see vlc_player_GetError()
254 */
261/**
262 * Seek speed type
263 *
264 * @see vlc_player_SeekByPos()
265 * @see vlc_player_SeekByTime()
266 */
269 /** Do a precise seek */
271 /** Do a fast seek */
274
275/**
276 * Player seek/delay directive
277 *
278 * @see vlc_player_SeekByPos()
279 * @see vlc_player_SeekByTime()
280 * @see vlc_player_SetCategoryDelay()
281 */
284 /** Given time/position */
286 /** The current position +/- the given time/position */
289
290/**
291 * Menu (VCD/DVD/BD) and viewpoint navigations
292 *
293 * @see vlc_player_Navigate()
294 */
297 /** Activate the navigation item selected */
299 /** Select a navigation item above or move the viewpoint up */
301 /** Select a navigation item under or move the viewpoint down */
303 /** Select a navigation item on the left or move the viewpoint left */
305 /** Select a navigation item on the right or move the viewpoint right */
307 /** Activate the popup Menu (for BD) */
309 /** Activate disc Root Menu */
312
313/**
314 * A to B loop state
315 */
323/**
324 * Reason why the current media is stopping
325 */
328 /** The media is stopping because of an error (default) */
330 /** The media reached the end of stream */
332 /** The media is stopping because of a user request */
335
336/** Player capability: can seek */
337#define VLC_PLAYER_CAP_SEEK (1<<0)
338/** Player capability: can pause */
339#define VLC_PLAYER_CAP_PAUSE (1<<1)
340/** Player capability: can change the rate */
341#define VLC_PLAYER_CAP_CHANGE_RATE (1<<2)
342/** Player capability: can seek back */
343#define VLC_PLAYER_CAP_REWIND (1<<3)
345/** Player teletext key: Red */
346#define VLC_PLAYER_TELETEXT_KEY_RED ('r' << 16)
347/** Player teletext key: Green */
348#define VLC_PLAYER_TELETEXT_KEY_GREEN ('g' << 16)
349/** Player teletext key: Yellow */
350#define VLC_PLAYER_TELETEXT_KEY_YELLOW ('y' << 16)
351/** Player teletext key: Blue */
352#define VLC_PLAYER_TELETEXT_KEY_BLUE ('b' << 16)
353/** Player teletext key: Index */
354#define VLC_PLAYER_TELETEXT_KEY_INDEX ('i' << 16)
363/**
364 * Set the current media
365 *
366 * This function replaces the current and next medias.
367 *
368 * @note A successful call will always result of
369 * vlc_player_cbs.on_current_media_changed being called. This function is not
370 * blocking. If a media is currently being played, this media will be stopped
371 * and the requested media will be set after.
372 *
373 * @note The function will open the media, without starting it, allowing the
374 * user to send controls (like seek requests) before Starting the player.
375 *
376 * @warning This function is either synchronous (if the player state is
377 * STOPPED) or asynchronous. In the later case, vlc_player_GetCurrentMedia()
378 * will return the old media, even after this call, and until the
379 * vlc_player_cbs.on_current_media_changed is called.
380 *
381 * @param player locked player instance
382 * @param media new media to play (will be held by the player)
383 * @return VLC_SUCCESS or a VLC error code
384 */
385VLC_API int
387
388/**
389 * Set the next media
390 *
391 * This function replaces the next media to be played.
392 * The user should set the next media from the
393 * vlc_player_cbs.current_media_changed callback or anytime before the current
394 * media is stopped.
395 *
396 * @note The media won't be opened directly by this function. If there is no
397 * current media, the next media will be opened from vlc_player_Start(). If
398 * there is a current playing media, the next media will be opened and played
399 * automatically.
400 *
401 * @param player locked player instance
402 * @param media next media to play (will be held by the player)
403 */
404VLC_API void
406
407/**
408 * Get the current played media.
409 *
410 * @see vlc_player_cbs.on_current_media_changed
411 *
412 * @param player locked player instance
413 * @return a valid media or NULL (if no media is set)
414 */
417
418/**
419 * Get the next played media.
420 *
421 * This function return the media set by vlc_player_SetNextMedia()
422 *
423 * @param player locked player instance
424 * @return a valid media or NULL (if no next media is set)
425 */
428
429/**
430 * Helper that hold the current media
431 */
432static inline input_item_t *
436 return item ? input_item_Hold(item) : NULL;
437}
438
439/**
440 * Start the playback of the current media.
441 *
442 * @param player locked player instance
443 * @return VLC_SUCCESS or a VLC error code
444 */
445VLC_API int
447
448/**
449 * Stop the playback of the current media
450 *
451 * @note This function is asynchronous. In case of success, the user should wait
452 * for the STOPPED state event to know when the stop is finished.
453 *
454 * @param player locked player instance
455 * @return VLC_SUCCESS if the player is being stopped, VLC_EGENERIC otherwise
456 * (no-op)
457 */
458VLC_API int
460
461/**
462 * Pause the playback
463 *
464 * @param player locked player instance
465 */
466VLC_API void
468
469/**
470 * Resume the playback from a pause
471 *
472 * @param player locked player instance
473 */
474VLC_API void
476
477/**
478 * Pause and display the next video frame
479 *
480 * @note Works only on streams that can pause..
481 *
482 * @note listen to the vlc_player_cbs.on_next_frame_status to be notified when
483 * the next frame is displayed.
484 *
485 * @param player locked player instance
486 */
487VLC_API void
489
490/**
491 * Pause and display the previous video frame
492 *
493 * @note Works only on streams that can pause, seek and pace.
494 *
495 * @note listen to the vlc_player_cbs.on_prev_frame_status to be notified when
496 * the previous frame is displayed.
497 *
498 * @param player locked player instance
499 */
500VLC_API void
502
503/**
504 * Get the state of the player
505 *
506 * @note Since all players actions are asynchronous, this function won't
507 * reflect the new state immediately. Wait for the
508 * vlc_player_cbs.on_state_changed event to be notified.
509 *
510 * @see vlc_player_state
511 * @see vlc_player_cbs.on_state_changed
512 *
513 * @param player locked player instance
514 * @return the current player state
515 */
518
519/**
520 * Get the error state of the player
521 *
522 * @see vlc_player_cbs.on_capabilities_changed
523 *
524 * @param player locked player instance
525 * @return the current error state
526 */
529
530/**
531 * Helper to get the started state
532 */
533static inline bool
536 switch (vlc_player_GetState(player))
537 {
541 return true;
542 default:
543 return false;
544 }
545}
546
547/**
548 * Helper to get the paused state
549 */
550static inline bool
554}
555
556/**
557 * Helper to toggle the pause state
558 */
559static inline void
562 if (vlc_player_IsStarted(player))
563 {
564 if (vlc_player_IsPaused(player))
565 vlc_player_Resume(player);
566 else
567 vlc_player_Pause(player);
568 }
569}
570
571/**
572 * Get the player capabilities
573 *
574 * @see vlc_player_cbs.on_capabilities_changed
575 *
576 * @param player locked player instance
577 * @return the player capabilities, a bitwise mask of @ref VLC_PLAYER_CAP_SEEK,
578 * @ref VLC_PLAYER_CAP_PAUSE, @ref VLC_PLAYER_CAP_CHANGE_RATE, @ref
579 * VLC_PLAYER_CAP_REWIND
580 */
581VLC_API int
583
584/**
585 * Helper to get the seek capability
586 */
587static inline bool
591}
592
593/**
594 * Helper to get the pause capability
595 */
596static inline bool
600}
601
602/**
603 * Helper to get the change-rate capability
604 */
605static inline bool
611/**
612 * Helper to get the rewindable capability
613 */
614static inline bool
618}
619
620/**
621 * Get the rate of the player
622 *
623 * @see vlc_player_cbs.on_rate_changed
624 *
625 * @param player locked player instance
626 * @return rate of the player (< 1.f is slower, > 1.f is faster)
627 */
628VLC_API float
630
631/**
632 * Change the rate of the player
633 *
634 * @note The rate is saved across several medias
635 *
636 * @param player locked player instance
637 * @param rate new rate (< 1.f is slower, > 1.f is faster)
638 */
639VLC_API void
640vlc_player_ChangeRate(vlc_player_t *player, float rate);
641
642/**
643 * Increment the rate of the player (faster)
644 *
645 * @param player locked player instance
646 */
647VLC_API void
649
650/**
651 * Decrement the rate of the player (Slower)
652 *
653 * @param player locked player instance
654 */
655VLC_API void
657
658/**
659 * Get the length of the current media
660 *
661 * @note A started and playing media doesn't have necessarily a valid length.
662 *
663 * @see vlc_player_cbs.on_length_changed
664 *
665 * @param player locked player instance
666 * @return a valid length or VLC_TICK_INVALID (if no media is set,
667 * playback is not yet started or in case of error)
668 */
671
672/**
673 * Get the time of the current media
674 *
675 * @note A started and playing media doesn't have necessarily a valid time.
676 *
677 * @see vlc_player_cbs.on_position_changed
678 *
679 * @param player locked player instance
680 * @return a valid time or VLC_TICK_INVALID (if no media is set, the media
681 * doesn't have any time, if playback is not yet started or in case of error)
682 */
685
686/**
687 * Get the position of the current media
688 *
689 * @see vlc_player_cbs.on_position_changed
690 *
691 * @param player locked player instance
692 * @return a valid position in the range [0.f;1.f] or -1.f (if no media is
693 * set,if playback is not yet started or in case of error)
694 */
695VLC_API double
697
698/**
699 * Seek the current media by position
700 *
701 * @note This function can be called before vlc_player_Start() in order to set
702 * a starting position.
703 *
704 * @param player locked player instance
705 * @param position position in the range [0.f;1.f]
706 * @param speed precise of fast
707 * @param whence absolute or relative
708 */
709VLC_API void
710vlc_player_SeekByPos(vlc_player_t *player, double position,
711 enum vlc_player_seek_speed speed,
712 enum vlc_player_whence whence);
713
714/**
715 * Seek the current media by time
716 *
717 * @note This function can be called before vlc_player_Start() in order to set
718 * a starting position.
719 *
720 * @warning This function has an effect only if the media has a valid length.
721 *
722 * @param player locked player instance
723 * @param time a time in the range [0;length]
724 * @param speed precise of fast
725 * @param whence absolute or relative
726 */
727VLC_API void
729 enum vlc_player_seek_speed speed,
730 enum vlc_player_whence whence);
731
732/**
733 * Helper to set the absolute position precisely
734 */
735static inline void
736vlc_player_SetPosition(vlc_player_t *player, double position)
742/**
743 * Helper to set the absolute position fast
744 */
745static inline void
746vlc_player_SetPositionFast(vlc_player_t *player, double position)
752/**
753 * Helper to jump the position precisely
754 */
755static inline void
756vlc_player_JumpPos(vlc_player_t *player, double jumppos)
758 /* No fask seek for jumps. Indeed, jumps can seek to the current position
759 * if not precise enough or if the jump value is too small. */
762}
763
764/**
765 * Helper to set the absolute time precisely
766 */
767static inline void
774/**
775 * Helper to set the absolute time fast
776 */
777static inline void
784/**
785 * Helper to jump the time precisely
786 */
787static inline void
790 /* No fask seek for jumps. Indeed, jumps can seek to the current position
791 * if not precise enough or if the jump value is too small. */
794}
795
796/**
797 * Display the player position on the vout OSD
798 *
799 * @param player locked player instance
800 */
801VLC_API void
803
804/**
805 * Enable A to B loop of the current media
806 *
807 * This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and
808 * VLC_PLAYER_ABLOOP_B to setup an A to B loop. It uses and stores the
809 * current time/position when called. The B time must be higher than the
810 * A time.
811 *
812 * @param player locked player instance
813 * @param abloop select which A/B cursor to set
814 * @return VLC_SUCCESS or a VLC error code
815 */
816VLC_API int
818
819/**
820 * Enable A to B loop of the current media by setting start and end time
821 *
822 * The B time must be higher than the A time.
823 *
824 * @param player locked player instance
825 * @param a_time start time for the loop
826 * @param b_time end time for the loop
827 * @return VLC_SUCCESS or a VLC error code
828 */
829VLC_API int
831
832/**
833 * Enable A to B loop of the current media by setting start and end position
834 *
835 * The B position must be higher than the A position.
836 *
837 * @param player locked player instance
838 * @param a_pos start position for the loop
839 * @param b_pos end position for the loop
840 * @return VLC_SUCCESS or a VLC error code
841 */
842VLC_API int
843vlc_player_SetAtoBLoopPosition(vlc_player_t *player, double a_pos, double b_pos);
844
845/**
846 * Reset/remove the A to B loop of the current media
847 *
848 * @param player locked player instance
849 * @return VLC_SUCCESS or a VLC error code
850 */
851VLC_API int
853
854/**
855 * Get the A to B loop status
856 *
857 * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
858 * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
859 * output parameters are valid. If the returned status is
860 * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
861 *
862 * @see vlc_player_cbs.on_atobloop_changed
863 *
864 * @param player locked player instance
865 * @param a_time A time or VLC_TICK_INVALID (if the media doesn't have valid
866 * times)
867 * @param a_pos A position
868 * @param b_time B time or VLC_TICK_INVALID (if the media doesn't have valid
869 * times)
870 * @param b_pos B position
871 * @return A to B loop status
872 */
874vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, double *a_pos,
875 vlc_tick_t *b_time, double *b_pos);
876
877/**
878 * Navigate (for DVD/Bluray menus or viewpoint)
879 *
880 * @param player locked player instance
881 * @param nav navigation key
882 */
883VLC_API void
885
886/**
887 * Update the viewpoint
888 *
889 * @param player locked player instance
890 * @param viewpoint the viewpoint value
891 * @param whence absolute or relative
892 */
893VLC_API void
895 const vlc_viewpoint_t *viewpoint,
896 enum vlc_player_whence whence);
897
898/**
899 * Check if the playing is recording
900 *
901 * @see vlc_player_cbs.on_recording_changed
902 *
903 * @param player locked player instance
904 * @return true if the player is recording
905 */
906VLC_API bool
908
909/**
910 * Enable or disable recording for the current media
911 *
912 * @note A successful call will trigger the vlc_player_cbs.on_recording_changed
913 * event.
914 *
915 * @param player locked player instance
916 * @param enabled true to enable recording
917 * @param dir_path path of the recording directory or NULL (use default path),
918 * has only an effect when first enabling recording.
919 */
920VLC_API void
921vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled,
922 const char *dir_path);
923
924/**
925 * Helper to toggle the recording state
926 */
927static inline void
931}
932
933/**
934 * Add an associated (or external) media to the current media
935 *
936 * @param player locked player instance
937 * @param cat SPU_ES or UNKNOWN_ES
938 * @param uri absolute uri of the external media
939 * @param select true to select the track of this external media
940 * @param notify true to notify the OSD
941 * @param check_ext true to check subtitles extension
942 */
943VLC_API int
945 enum es_format_category_e cat, const char *uri,
946 bool select, bool notify, bool check_ext);
947
948/**
949 * Get the signal quality and strength of the current media
950 *
951 * @param player locked player instance
952 * @param quality a pointer that will be assigned with the signal quality
953 * @param strength a pointer that will be assigned with the signal strength
954 * @retval VLC_SUCCESS when quality and strength have been assigned
955 * @retval VLC_EGENERIC in case of error (strength and quality are not assigned)
956 */
957VLC_API int
958vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength);
959
960/**
961 * Get the statistics of the current media
962 *
963 * @warning The returned pointer becomes invalid when the player is unlocked.
964 * The referenced structure can be safely copied.
965 *
966 * @see vlc_player_cbs.on_statistics_changed
967 *
968 * @param player locked player instance
969 * @return pointer to the player stats structure or NULL
970 */
971VLC_API const struct input_stats_t *
973
974/**
975 * Restore the previous playback position of the current media
976 */
977VLC_API void
979
980/**
981 * Get the V4L2 object used to do controls
982 *
983 * @param player locked player instance
984 * @return the V4L2 object or NULL if not any. This object must be used with
985 * the player lock held.
986 */
989
990/** @} vlc_player__playback */
991
992/**
993 * @defgroup vlc_player__titles Title and chapter control
994 * @{
995 */
996
997/**
998 * Player chapter structure
999 */
1000struct vlc_player_chapter
1002 /** Chapter name, always valid */
1003 const char *name;
1004 /** Position of this chapter */
1007
1008/** vlc_player_title.flags: The title is a menu. */
1009#define VLC_PLAYER_TITLE_MENU 0x01
1010/** vlc_player_title.flags: The title is interactive. */
1011#define VLC_PLAYER_TITLE_INTERACTIVE 0x02
1012/** vlc_player_title.flags: The title is the main one. */
1013#define VLC_PLAYER_TITLE_MAIN 0x04
1015/** Player title structure */
1016struct vlc_player_title
1018 /** Title name, always valid */
1019 const char *name;
1020 /** Length of the title */
1022 /** Bit flag of @ref VLC_PLAYER_TITLE_MENU and @ref
1023 * VLC_PLAYER_TITLE_INTERACTIVE */
1024 unsigned flags;
1025 /** Number of chapters, can be 0 */
1026 size_t chapter_count;
1027 /** Array of chapters, can be NULL */
1028 const struct vlc_player_chapter *chapters;
1030
1031/**
1032 * Opaque structure representing a list of @ref vlc_player_title.
1033 *
1034 * @see vlc_player_GetTitleList()
1035 * @see vlc_player_title_list_GetCount()
1036 * @see vlc_player_title_list_GetAt()
1037 */
1040/**
1041 * Hold the title list of the player
1042 *
1043 * This function can be used to pass this title list from a callback to an
1044 * other thread.
1045 *
1046 * @see vlc_player_cbs.on_titles_changed
1047 *
1048 * @return the same instance
1049 */
1052
1053/**
1054 * Release of previously held title list
1055 */
1056VLC_API void
1058
1059/**
1060 * Get the number of title of a list
1061 */
1062VLC_API size_t
1064
1065/**
1066 * Get the title at a given index
1067 *
1068 * @param titles a valid title list
1069 * @param idx index in the range [0; count[
1070 * @return a valid title (can't be NULL)
1071 */
1072VLC_API const struct vlc_player_title *
1074
1075/**
1076 * Get the title list of the current media
1077 *
1078 * @see vlc_player_cbs.on_titles_changed
1079 *
1080 * @param player locked player instance
1081 */
1084
1085/**
1086 * Get the selected title index for the current media
1087 *
1088 * @see vlc_player_cbs.on_title_selection_changed
1089 *
1090 * @param player locked player instance
1091 */
1092VLC_API ssize_t
1094
1095/**
1096 * Helper to get the current selected title
1097 */
1098static inline const struct vlc_player_title *
1102 if (!titles)
1103 return NULL;
1104 ssize_t selected_idx = vlc_player_GetSelectedTitleIdx(player);
1105 if (selected_idx < 0)
1106 return NULL;
1107 return vlc_player_title_list_GetAt(titles, selected_idx);
1108}
1109
1110/**
1111 * Select a title index for the current media
1112 *
1113 * @note A successful call will trigger the
1114 * vlc_player_cbs.on_title_selection_changed event.
1115 *
1116 * @see vlc_player_title_list_GetAt()
1117 * @see vlc_player_title_list_GetCount()
1118 *
1119 * @param player locked player instance
1120 * @param index valid index in the range [0;count[
1121 */
1122VLC_API void
1123vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index);
1124
1125/**
1126 * Select a title for the current media
1127 *
1128 * @note A successful call will trigger the
1129 * vlc_player_cbs.on_title_selection_changed event.
1130 *
1131 * @see vlc_player_title_list_GetAt()
1132 * @see vlc_player_title_list_GetCount()
1133 *
1134 * @param player locked player instance
1135 * @param title a valid title coming from the vlc_player_title_list
1136 */
1137VLC_API void
1139 const struct vlc_player_title *title);
1140
1141/**
1142 * Select a chapter for the current media
1143 *
1144 * @note A successful call will trigger the
1145 * vlc_player_cbs.on_chapter_selection_changed event.
1146 *
1147 * @param player locked player instance
1148 * @param title the selected title
1149 * @param chapter_idx index from vlc_player_title.chapters
1150 */
1151VLC_API void
1153 const struct vlc_player_title *title,
1154 size_t chapter_idx);
1155
1156/**
1157 * Select the next title for the current media
1158 *
1159 * @see vlc_player_SelectTitleIdx()
1160 */
1161VLC_API void
1163
1164/**
1165 * Select the previous title for the current media
1166 *
1167 * @see vlc_player_SelectTitleIdx()
1168 */
1169VLC_API void
1171
1172/**
1173 * Get the selected chapter index for the current media
1174 *
1175 * @see vlc_player_cbs.on_chapter_selection_changed
1176 *
1177 * @param player locked player instance
1178 */
1179VLC_API ssize_t
1181
1182/**
1183 * Helper to get the current selected chapter
1184 */
1185static inline const struct vlc_player_chapter *
1188 const struct vlc_player_title *title = vlc_player_GetSelectedTitle(player);
1189 if (!title || !title->chapter_count)
1190 return NULL;
1191 ssize_t chapter_idx = vlc_player_GetSelectedChapterIdx(player);
1192 return chapter_idx >= 0 ? &title->chapters[chapter_idx] : NULL;
1193}
1194
1195/**
1196 * Select a chapter index for the current media
1197 *
1198 * @note A successful call will trigger the
1199 * vlc_player_cbs.on_chapter_selection_changed event.
1200 *
1201 * @see vlc_player_title.chapters
1202 *
1203 * @param player locked player instance
1204 * @param index valid index in the range [0;vlc_player_title.chapter_count[
1205 */
1206VLC_API void
1207vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index);
1208
1209/**
1210 * Select the next chapter for the current media
1211 *
1212 * @see vlc_player_SelectChapterIdx()
1213 */
1214VLC_API void
1216
1217/**
1218 * Select the previous chapter for the current media
1219 *
1220 * @see vlc_player_SelectChapterIdx()
1221 */
1222VLC_API void
1224
1225/** @} vlc_player__titles */
1226
1227/**
1228 * @defgroup vlc_player__programs Program control
1229 * @{
1230 */
1231
1232/**
1233 * Player program structure.
1234 */
1235struct vlc_player_program
1237 /** Id used for vlc_player_SelectProgram() */
1238 int group_id;
1239 /** Program name, always valid */
1240 const char *name;
1241 /** True if the program is selected */
1242 bool selected;
1243 /** True if the program is scrambled */
1244 bool scrambled;
1246
1247/**
1248 * Duplicate a program
1249 *
1250 * This function can be used to pass a program from a callback to an other
1251 * context.
1252 *
1253 * @see vlc_player_cbs.on_program_list_changed
1254 *
1255 * @return a duplicated program or NULL on allocation error
1256 */
1258vlc_player_program_Dup(const struct vlc_player_program *prgm);
1259
1260/**
1261 * Delete a duplicated program
1262 */
1263VLC_API void
1265
1266/**
1267 * Get the number of programs
1268 *
1269 * @warning The returned size becomes invalid when the player is unlocked.
1270 *
1271 * @param player locked player instance
1272 * @return number of programs, or 0 (in case of error, or if the media is not
1273 * started)
1274 */
1275VLC_API size_t
1277
1278/**
1279 * Get the program at a specific index
1280 *
1281 * @warning The behaviour is undefined if the index is not valid.
1282 *
1283 * @warning The returned pointer becomes invalid when the player is unlocked.
1284 * The referenced structure can be safely copied with vlc_player_program_Dup().
1285 *
1286 * @param player locked player instance
1287 * @param index valid index in the range [0; count[
1288 * @return a valid program (can't be NULL if vlc_player_GetProgramCount()
1289 * returned a valid count)
1290 */
1291VLC_API const struct vlc_player_program *
1292vlc_player_GetProgramAt(vlc_player_t *player, size_t index);
1293
1294/**
1295 * Get a program from an ES group identifier
1296 *
1297 * @param player locked player instance
1298 * @param group_id a program ID (retrieved from
1299 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1300 * @return a valid program or NULL (if the program was terminated by the
1301 * playback thread)
1302 */
1303VLC_API const struct vlc_player_program *
1305
1306/**
1307 * Select a program from an ES group identifier
1308 *
1309 * This function can be used to pre-select a program by its id before starting
1310 * the player. It has only effect for the current media. It can also be used
1311 * when the player is already started.
1312 *
1313 * @note Selecting a non-existing program will cause the player to no select
1314 * any programs. Therefore, all tracks will be disabled.
1315 *
1316 * @param player locked player instance
1317 * @param group_id a program ID (retrieved from
1318 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1319 */
1320VLC_API void
1322
1323/**
1324 * Select the next program
1325 *
1326 * @param player locked player instance
1327 */
1328VLC_API void
1330
1331/**
1332 * Select the previous program
1333 *
1334 * @param player locked player instance
1335 */
1336VLC_API void
1338
1339/**
1340 * Helper to get the current selected program
1341 */
1342static inline const struct vlc_player_program *
1345 size_t count = vlc_player_GetProgramCount(player);
1346 for (size_t i = 0; i < count; ++i)
1347 {
1348 const struct vlc_player_program *program =
1349 vlc_player_GetProgramAt(player, i);
1350 assert(program);
1351 if (program->selected)
1352 return program;
1353 }
1354 return NULL;
1355}
1356
1357/** @} vlc_player__programs */
1358
1359/**
1360 * @defgroup vlc_player__tracks Tracks control
1361 * @{
1362 */
1363
1364/**
1365 * Player selection policy
1366 *
1367 * @see vlc_player_SelectEsId()
1368 */
1371 /**
1372 * Only one track per category is selected. Selecting a track with this
1373 * policy will disable all other tracks for the same category.
1374 */
1376 /**
1377 * Select multiple tracks for one category.
1378 *
1379 * Only one audio track can be selected at a time.
1380 * Two subtitle tracks can be selected simultaneously.
1381 * Multiple video tracks can be selected simultaneously.
1382 */
1385
1386/**
1387 * Player track structure.
1388 *
1389 * A track is a representation of an ES identifier at a given time. Once the
1390 * player is unlocked, all content except the es_id pointer can be updated.
1391 *
1392 * @see vlc_player_cbs.on_track_list_changed
1393 * @see vlc_player_GetTrack
1394 */
1395struct vlc_player_track
1397 /** Id used for any player actions, like vlc_player_SelectEsId() */
1399 /** Track name, always valid */
1400 const char *name;
1401 /** Es format */
1403 /** True if the track is selected */
1404 bool selected;
1406
1407/**
1408 * Duplicate a track
1409 *
1410 * This function can be used to pass a track from a callback to an other
1411 * context. The es_id will be held by the duplicated track.
1412 *
1413 * @warning The returned track won't be updated if the original one is modified
1414 * by the player.
1415 *
1416 * @see vlc_player_cbs.on_track_list_changed
1417 *
1418 * @return a duplicated track or NULL on allocation error
1419 */
1421vlc_player_track_Dup(const struct vlc_player_track *track);
1422
1423/**
1424 * Delete a duplicated track
1425 */
1426VLC_API void
1428
1429/**
1430 * Get the number of tracks for an ES category
1431 *
1432 * @warning The returned size becomes invalid when the player is unlocked.
1433 *
1434 * @param player locked player instance
1435 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1436 * @return number of tracks, or 0 (in case of error, or if the media is not
1437 * started)
1438 */
1439VLC_API size_t
1441
1442/**
1443 * Get the track at a specific index for an ES category
1444 *
1445 * @warning The behaviour is undefined if the index is not valid.
1446 *
1447 * @warning The returned pointer becomes invalid when the player is unlocked.
1448 * The referenced structure can be safely copied with vlc_player_track_Dup().
1449 *
1450 * @param player locked player instance
1451 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1452 * @param index valid index in the range [0; count[
1453 * @return a valid track (can't be NULL if vlc_player_GetTrackCount() returned
1454 * a valid count)
1455 */
1456VLC_API const struct vlc_player_track *
1458 size_t index);
1459
1460/**
1461 * Helper to get the video track count
1462 */
1463static inline size_t
1466 return vlc_player_GetTrackCount(player, VIDEO_ES);
1467}
1468
1469/**
1470 * Helper to get a video track at a specific index
1471 */
1472static inline const struct vlc_player_track *
1473vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
1475 return vlc_player_GetTrackAt(player, VIDEO_ES, index);
1476}
1477
1478/**
1479 * Helper to get the audio track count
1480 */
1481static inline size_t
1484 return vlc_player_GetTrackCount(player, AUDIO_ES);
1485}
1486
1487/**
1488 * Helper to get an audio track at a specific index
1489 */
1490static inline const struct vlc_player_track *
1491vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
1493 return vlc_player_GetTrackAt(player, AUDIO_ES, index);
1494}
1495
1496/**
1497 * Helper to get the subtitle track count
1498 */
1499static inline size_t
1502 return vlc_player_GetTrackCount(player, SPU_ES);
1503}
1504
1505/**
1506 * Helper to get a subtitle track at a specific index
1507 */
1508static inline const struct vlc_player_track *
1509vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
1511 return vlc_player_GetTrackAt(player, SPU_ES, index);
1512}
1513
1514/**
1515 * Get a track from an ES identifier
1516 *
1517 * @warning The returned pointer becomes invalid when the player is unlocked.
1518 * The referenced structure can be safely copied with vlc_player_track_Dup().
1519 *
1520 * @param player locked player instance
1521 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1522 * vlc_player_GetTrackAt())
1523 * @return a valid player track or NULL (if the track was terminated by the
1524 * playback thread)
1525 */
1526VLC_API const struct vlc_player_track *
1528
1529/**
1530 * Get and the video output used by a ES identifier
1531 *
1532 * @warning A same vout can be associated with multiple ES during the lifetime
1533 * of the player. The information returned by this function becomes invalid
1534 * when the player is unlocked. The returned vout doesn't need to be released,
1535 * but must be held with vout_Hold() if it is accessed after the player is
1536 * unlocked.
1537 *
1538 * @param player locked player instance
1539 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1540 * vlc_player_GetTrackAt())
1541 * @param order if not null, the order of the vout
1542 * @return a valid vout or NULL (if the track is disabled, it it's not a video
1543 * or spu track, or if the vout failed to start)
1544 */
1547 enum vlc_vout_order *order);
1548
1549/**
1550 * Get the ES identifier of a video output
1551 *
1552 * @warning A same vout can be associated with multiple ES during the lifetime
1553 * of the player. The information returned by this function becomes invalid
1554 * when the player is unlocked. The returned es_id doesn't need to be released,
1555 * but must be held with vlc_es_id_Hold() if it accessed after the player is
1556 * unlocked.
1557 *
1558 * @param player locked player instance
1559 * @param vout vout (can't be NULL)
1560 * @return a valid ES identifier or NULL (if the vout is stopped)
1561 */
1564
1565/**
1566 * Helper to get the selected track from an ES category
1567 *
1568 * @warning The player can have more than one selected track for a same ES
1569 * category. This function will only return the first selected one. Use
1570 * vlc_player_GetTrackAt() and vlc_player_GetTrackCount() to iterate through
1571 * several selected tracks.
1572 */
1573static inline const struct vlc_player_track *
1576 size_t count = vlc_player_GetTrackCount(player, cat);
1577 for (size_t i = 0; i < count; ++i)
1578 {
1579 const struct vlc_player_track *track =
1580 vlc_player_GetTrackAt(player, cat, i);
1581 assert(track);
1582 if (track->selected)
1583 return track;
1584 }
1585 return NULL;
1586}
1587
1588/**
1589 * Select tracks by their string identifier
1590 *
1591 * This function can be used to pre-select a list of tracks before starting the
1592 * player. It has only effect for the current media. It can also be used when
1593 * the player is already started.
1594
1595 * 'str_ids' can contain more than one track id, delimited with ','. "" or any
1596 * invalid track id will cause the player to unselect all tracks of that
1597 * category. NULL will disable the preference for newer tracks without
1598 * unselecting any current tracks.
1599 *
1600 * Example:
1601 * - (VIDEO_ES, "video/1,video/2") will select these 2 video tracks. If there
1602 * is only one video track with the id "video/0", no tracks will be selected.
1603 * - (SPU_ES, "${slave_url_md5sum}/spu/0) will select one spu added by an input
1604 * slave with the corresponding url.
1605 *
1606 * @note The string identifier of a track can be found via vlc_es_id_GetStrId().
1607 *
1608 * @param player locked player instance
1609 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1610 * @param str_ids list of string identifier or NULL
1611 */
1612VLC_API void
1614 enum es_format_category_e cat,
1615 const char *str_ids);
1616
1617/**
1618 * Select a track from an ES identifier
1619 *
1620 * @note A successful call will trigger the
1621 * vlc_player_cbs.on_track_selection_changed event.
1622 *
1623 * @param player locked player instance
1624 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1625 * vlc_player_GetTrackAt())
1626 * @param policy exclusive or simultaneous
1627 * @return the number of track selected for es_id category
1628 */
1629VLC_API unsigned
1631 enum vlc_player_select_policy policy);
1632
1633
1634/**
1635 * Helper to select a track
1636 */
1637static inline unsigned
1639 const struct vlc_player_track *track,
1640 enum vlc_player_select_policy policy)
1641{
1642 return vlc_player_SelectEsId(player, track->es_id, policy);
1643}
1644
1645/**
1646 * Select multiple tracks from a list of ES identifiers.
1647 *
1648 * Any tracks of the category, not referenced in the list will be unselected.
1649 *
1650 * @warning there is no guarantee all requested tracks will be selected. The
1651 * behaviour is undefined if the list is not null-terminated.
1652 *
1653 * @note A successful call will trigger the
1654 * vlc_player_cbs.on_track_selection_changed event for each track that has
1655 * its selection state changed.
1656 *
1657 * @see VLC_PLAYER_SELECT_SIMULTANEOUS
1658 *
1659 * @param player locked player instance
1660 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1661 * @param es_id_list a null-terminated list of ES identifiers. es_ids not
1662 * corresponding to the category will be ignored.
1663 * (ES IDs can be retrieved from vlc_player_cbs.on_track_list_changed or
1664 * vlc_player_GetTrackAt())
1665 * @return the number of track selected for that category
1666 */
1667VLC_API unsigned
1669 enum es_format_category_e cat,
1670 vlc_es_id_t *const es_id_list[]);
1671
1672
1673/**
1674 * Cycle through the tracks
1675 *
1676 * If the last track is already selected, a call to this function will disable
1677 * this last track. And a second call will select the first track.
1678 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1679 *
1680 * @param player locked player instance
1681 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1682 * @param next the cycle order
1683 */
1684VLC_API void
1686 enum vlc_vout_order vout_order, bool next);
1687
1688/**
1689 * Helper to select the next track
1690 *
1691 * If the last track is already selected, a call to this function will disable
1692 * this last track. And a second call will select the first track.
1693 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1694 *
1695 * @param player locked player instance
1696 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1697 */
1698static inline void
1700 enum vlc_vout_order vout_order)
1701{
1702 vlc_player_CycleTrack(player, cat, vout_order, true);
1703}
1704
1705/**
1706 * Helper to select the Previous track
1707 *
1708 * If the first track is already selected, a call to this function will disable
1709 * this first track. And a second call will select the last track.
1710 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1711 *
1712 * @param player locked player instance
1713 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1714 */
1715static inline void
1717 enum vlc_vout_order vout_order)
1718{
1719 vlc_player_CycleTrack(player, cat, vout_order, false);
1720}
1721
1722/**
1723 * Unselect a track from an ES identifier
1724 *
1725 * @warning Other tracks of the same category won't be touched.
1726 *
1727 * @note A successful call will trigger the
1728 * vlc_player_cbs.on_track_selection_changed event.
1729 *
1730 * @param player locked player instance
1731 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1732 * vlc_player_GetTrackAt())
1733 */
1734VLC_API void
1736
1737/**
1738 * Helper to unselect a track
1739 */
1740static inline void
1742 const struct vlc_player_track *track)
1743{
1744 vlc_player_UnselectEsId(player, track->es_id);
1745}
1746
1747/**
1748 * Helper to unselect all tracks from an ES category
1749 */
1750static inline void
1753{
1754 size_t count = vlc_player_GetTrackCount(player, cat);
1755 for (size_t i = 0; i < count; ++i)
1756 {
1757 const struct vlc_player_track *track =
1758 vlc_player_GetTrackAt(player, cat, i);
1759 assert(track);
1760 if (track->selected)
1761 vlc_player_UnselectTrack(player, track);
1762 }
1763}
1764
1765/**
1766 * Restart a track from an ES identifier
1767 *
1768 * @note A successful call will trigger the
1769 * vlc_player_cbs.on_track_selection_changed event.
1770 *
1771 * @param player locked player instance
1772 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1773 * vlc_player_GetTrackAt())
1774 */
1775VLC_API void
1777
1778/**
1779 * Helper to restart a track
1780 */
1781static inline void
1783 const struct vlc_player_track *track)
1784{
1785 vlc_player_RestartEsId(player, track->es_id);
1786}
1787
1788/**
1789 * Helper to restart all selected tracks from an ES category
1790 */
1791static inline void
1794{
1795 size_t count = vlc_player_GetTrackCount(player, cat);
1796 for (size_t i = 0; i < count; ++i)
1797 {
1798 const struct vlc_player_track *track =
1799 vlc_player_GetTrackAt(player, cat, i);
1800 assert(track);
1801 if (track->selected)
1802 vlc_player_RestartTrack(player, track);
1803 }
1804}
1805
1806/**
1807 * Select the language for an ES category
1808 *
1809 * @warning The language will only be set for all future played media.
1810 *
1811 * @param player locked player instance
1812 * @param cat AUDIO_ES or SPU_ES
1813 * @param lang comma separated, two or three letters country code, 'any' as a
1814 * fallback or NULL to reset the default state
1815 */
1816VLC_API void
1818 enum es_format_category_e cat,
1819 const char *lang);
1820
1821/**
1822 * Get the language of an ES category
1823 *
1824 * @warning This only reflects the change made by
1825 * vlc_player_SelectCategoryLanguage(). The current playing track doesn't
1826 * necessarily correspond to the returned language.
1827 *
1828 * @see vlc_player_SelectCategoryLanguage
1829 *
1830 * @param player locked player instance
1831 * @param cat AUDIO_ES or SPU_ES
1832 * @return valid language or NULL, need to be freed
1833 */
1834VLC_API char *
1836 enum es_format_category_e cat);
1837
1838/**
1839 * Helper to select the audio language
1840 */
1841static inline void
1842vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
1845}
1846
1847/**
1848 * Helper to select the subtitle language
1849 */
1850static inline void
1851vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
1854}
1855
1856/**
1857 * Enable or disable a track category
1858 *
1859 * If a track category is disabled, the player won't select any tracks of this
1860 * category automatically or via an user action (vlc_player_SelectTrack()).
1861 *
1862 * @param player locked player instance
1863 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1864 * @param enabled true to enable
1865 */
1866VLC_API void
1868 enum es_format_category_e cat, bool enabled);
1869
1870/**
1871 * Check if a track category is enabled
1872 *
1873 * @param player locked player instance
1874 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1875 */
1876VLC_API bool
1878 enum es_format_category_e cat);
1879
1880/**
1881 * Helper to enable or disable video tracks
1882 */
1883static inline void
1884vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
1887}
1888
1889/**
1890 * Helper to check if video tracks are enabled
1891 */
1892static inline bool
1896}
1897
1898/**
1899 * Helper to enable or disable audio tracks
1900 */
1901static inline void
1902vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
1905}
1906
1907/**
1908 * Helper to check if audio tracks are enabled
1909 */
1910static inline bool
1914}
1915
1916/**
1917 * Helper to enable or disable subtitle tracks
1918 */
1919static inline void
1920vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
1923}
1924
1925/**
1926 * Helper to check if subtitle tracks are enabled
1927 */
1928static inline bool
1932}
1933
1934/**
1935 * Helper to toggle subtitles
1936 */
1937static inline void
1940 bool enabled = !vlc_player_IsSubtitleEnabled(player);
1941 vlc_player_SetSubtitleEnabled(player, enabled);
1942}
1943
1944/**
1945 * Set the subtitle text scaling factor
1946 *
1947 * @note This function have an effect only if the subtitle track is a text type.
1948 *
1949 * @param player locked player instance
1950 * @param scale factor in the range [10;500] (default: 100)
1951 */
1952VLC_API void
1953vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale);
1954
1955/**
1956 * Get the subtitle text scaling factor
1957 *
1958 * @param player locked player instance
1959 * @return scale factor
1960 */
1961VLC_API unsigned
1963
1964/** @} vlc_player__tracks */
1965
1966/**
1967 * @defgroup vlc_player__tracks_sync Tracks synchronisation (delay)
1968 * @{
1969 */
1970
1971/**
1972 * Get the delay of an ES category for the current media
1973 *
1974 * @see vlc_player_cbs.on_category_delay_changed
1975 *
1976 * @param player locked player instance
1977 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1978 * @return a valid delay or 0
1979 */
1982
1983/**
1984 * Set the delay of one category for the current media
1985 *
1986 * @note A successful call will trigger the
1987 * vlc_player_cbs.on_category_delay_changed event.
1988 *
1989 * @warning This has no effect on tracks where the delay was set by
1990 * vlc_player_SetEsIdDelay()
1991 *
1992 * @param player locked player instance
1993 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1994 * @param delay a valid time
1995 * @param whence absolute or relative
1996 * @return VLC_SUCCESS or VLC_EGENERIC if the category is not handled
1997 */
1998VLC_API int
2000 vlc_tick_t delay, enum vlc_player_whence whence);
2001
2002/**
2003 * Get the delay of a track
2004 *
2005 * @see vlc_player_cbs.on_track_delay_changed
2006 *
2007 * @param player locked player instance
2008 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
2009 * vlc_player_GetTrackAt())
2010 * @return a valid delay or INT64_MAX is no delay is set for this track
2011 */
2014
2015/**
2016 * Set the delay of one track
2017 *
2018 * @note A successful call will trigger the
2019 * vlc_player_cbs.on_track_delay_changed event.
2020 *
2021 * @warning Setting the delay of one specific track will override previous and
2022 * future changes of delay made by vlc_player_SetCategoryDelay()
2023 *
2024 * @param player locked player instance
2025 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
2026 * vlc_player_GetTrackAt())
2027 * @param delay a valid time or INT64_MAX to use default category delay
2028 * @param whence absolute or relative
2029 * @return VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not
2030 * handled (VIDEO_ES not supported yet)
2031 */
2032VLC_API int
2034 vlc_tick_t delay, enum vlc_player_whence whence);
2035
2036/**
2037 * Helper to get the audio delay
2038 */
2039static inline vlc_tick_t
2042 return vlc_player_GetCategoryDelay(player, AUDIO_ES);
2043}
2044
2045/**
2046 * Helper to set the audio delay
2047 */
2048static inline void
2051
2052{
2053 vlc_player_SetCategoryDelay(player, AUDIO_ES, delay, whence);
2054}
2055
2056/**
2057 * Helper to get the audio delay
2058 */
2059static inline vlc_tick_t
2062 return vlc_player_GetCategoryDelay(player, VIDEO_ES);
2063}
2064
2065/**
2066 * Helper to set the audio delay
2067 */
2068static inline void
2071
2072{
2073 vlc_player_SetCategoryDelay(player, VIDEO_ES, delay, whence);
2074}
2075
2076/**
2077 * Helper to get the subtitle delay
2078 */
2079static inline vlc_tick_t
2082 return vlc_player_GetCategoryDelay(player, SPU_ES);
2083}
2084
2085/**
2086 * Helper to set the subtitle delay
2087 */
2088static inline void
2091{
2092 vlc_player_SetCategoryDelay(player, SPU_ES, delay, whence);
2093}
2094
2095/**
2096 * Set the associated subtitle FPS
2097 *
2098 * In order to correct the rate of the associated media according to this FPS
2099 * and the media video FPS.
2100 *
2101 * @note A successful call will trigger the
2102 * vlc_player_cbs.on_associated_subs_fps_changed event.
2103 *
2104 * @warning this function will change the rate of all external subtitle files
2105 * associated with the current media.
2106 *
2107 * @param player locked player instance
2108 * @param fps FPS of the subtitle file
2109 */
2110VLC_API void
2112
2113/**
2114 * Get the associated subtitle FPS
2115 *
2116 * @param player locked player instance
2117 * @return fps
2118 */
2119VLC_API float
2121
2122/** @} vlc_player__tracks_sync */
2123
2124/**
2125 * @defgroup vlc_player__teletext Teletext control
2126 * @{
2127 */
2128
2129/**
2130 * Check if the media has a teletext menu
2131 *
2132 * @see vlc_player_cbs.on_teletext_menu_changed
2133 *
2134 * @param player locked player instance
2135 * @return true if the media has a teletext menu
2136 */
2137VLC_API bool
2139
2140/**
2141 * Enable or disable teletext
2142 *
2143 * This function has an effect only if the player has a teletext menu.
2144 *
2145 * @note A successful call will trigger the
2146 * vlc_player_cbs.on_teletext_enabled_changed event.
2147 *
2148 * @param player locked player instance
2149 * @param enabled true to enable
2150 */
2151VLC_API void
2152vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled);
2153
2154/**
2155 * Check if teletext is enabled
2156 *
2157 * @see vlc_player_cbs.on_teletext_enabled_changed
2158 *
2159 * @param player locked player instance
2160 */
2161VLC_API bool
2163
2164/**
2165 * Select a teletext page or do an action from a key
2166 *
2167 * This function has an effect only if the player has a teletext menu.
2168 *
2169 * @note Page keys can be the following: @ref VLC_PLAYER_TELETEXT_KEY_RED,
2170 * @ref VLC_PLAYER_TELETEXT_KEY_GREEN, @ref VLC_PLAYER_TELETEXT_KEY_YELLOW,
2171 * @ref VLC_PLAYER_TELETEXT_KEY_BLUE or @ref VLC_PLAYER_TELETEXT_KEY_INDEX.
2172
2173 * @note A successful call will trigger the
2174 * vlc_player_cbs.on_teletext_page_changed event.
2175 *
2176 * @param player locked player instance
2177 * @param page a page in the range ]0;888] or a valid key
2178 */
2179VLC_API void
2180vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page);
2181
2182/**
2183 * Get the current teletext page
2184 *
2185 * @see vlc_player_cbs.on_teletext_page_changed
2186 *
2187 * @param player locked player instance
2188 */
2189VLC_API unsigned
2191
2192/**
2193 * Enable or disable teletext transparency
2194 *
2195 * This function has an effect only if the player has a teletext menu.
2196
2197 * @note A successful call will trigger the
2198 * vlc_player_cbs.on_teletext_transparency_changed event.
2199 *
2200 * @param player locked player instance
2201 * @param enabled true to enable
2202 */
2203VLC_API void
2205
2206/**
2207 * Check if teletext is transparent
2208 *
2209 * @param player locked player instance
2210 */
2211VLC_API bool
2213
2214/** @} vlc_player__teletext */
2215
2216/**
2217 * @defgroup vlc_player__renderer External renderer control
2218 * @{
2219 */
2220
2221/**
2222 * Set the renderer
2223 *
2224 * Valid for the current media and all future ones.
2225 *
2226 * @note A successful call will trigger the vlc_player_cbs.on_renderer_changed
2227 * event.
2228 *
2229 * @param player locked player instance
2230 * @param renderer a valid renderer item or NULL (to disable it), the item will
2231 * be held by the player
2232 */
2233VLC_API void
2235
2236/**
2237 * Get the renderer
2238 *
2239 * @see vlc_player_cbs.on_renderer_changed
2240 *
2241 * @param player locked player instance
2242 * @return the renderer item set by vlc_player_SetRenderer()
2243 */
2246
2247/** @} vlc_player__renderer */
2248
2249/**
2250 * @defgroup vlc_player__metadata Metadata callbacks
2251 * @{
2252 */
2253
2254/**
2255 * Player metadata listener opaque structure.
2256 *
2257 * This opaque structure is returned by vlc_player_AddMetadataListener() and
2258 * can be used to remove the listener via
2259 * vlc_player_RemoveMetadataListener().
2260 */
2263/**
2264 * Player metadata option
2265 */
2268 /**
2269 * Ask for momentary loudness measurement
2270 *
2271 * Very low CPU usage.
2272 * @see vlc_player_metadata_cbs.on_momentary_loudness_changed
2273 */
2276 /**
2277 * Ask for all loudness measurements
2278 *
2279 * High CPU usage.
2280 * @see vlc_player_metadata_cbs.on_loudness_changed
2281 */
2284
2285/**
2286 * Player metadata callbacks
2287 *
2288 * Can be registered with vlc_player_AddMetadataListener().
2289 *
2290 * @warning To avoid deadlocks, users should never call vlc_player_t functions
2291 * from these callbacks.
2292 */
2295 /**
2296 * Called when the momentary loudness measurement have changed
2297 *
2298 * @see VLC_PLAYER_METADATA_LOUDNESS_MOMEMTARY
2299 *
2300 * Only sent when audio is playing, approximately every 400ms (but can be
2301 * higher, depending on the input sample size).
2302 *
2303 * @param date Absolute date of the measurement. It is most likely in the
2304 * future (0 to 2seconds) depending on the audio output buffer size.
2305 * @param momentary_loudness Momentary loudness
2306 * @param data opaque pointer set by vlc_player_AddMetadataListener()
2307 */
2309 double momentary_loudness,
2310 void *data);
2311
2312 /**
2313 * Called when loudness measurements have changed
2314 *
2315 * @see VLC_PLAYER_METADATA_LOUDNESS_FULL
2316 *
2317 * Only sent when audio is playing, approximately every 400ms (but can be
2318 * higher, depending on the input sample size).
2319 *
2320 * @param date Absolute date of the measurement. It is most likely in the
2321 * future (0 to 2seconds) depending on the audio output buffer size.
2322 * @param loudness loudness measurement
2323 * @param data opaque pointer set by vlc_player_AddMetadataListener()
2324 */
2325 void (*on_loudness_changed)(vlc_tick_t date,
2326 const struct vlc_audio_loudness *loudness,
2327 void *data);
2328};
2329
2330/**
2331 * Add a metadata listener
2332 *
2333 * @note Every registered loudness meter need to be removed by the caller with
2334 * vlc_player_RemoveMetadataListener().
2335 *
2336 * @param player locked player instance
2337 * @param option select which metadata to listen
2338 * @param cbs pointer to a vlc_player_metadata_cbs union, the
2339 * structure must be valid during the lifetime of the player
2340 * @param cbs_data opaque pointer used by the callbacks
2341 * @return a valid listener id, or NULL in case of error (plugin missing)
2342 */
2345 enum vlc_player_metadata_option option,
2346 const union vlc_player_metadata_cbs *cbs,
2347 void *cbs_data);
2348
2349/**
2350 * Remove a metadata listener
2351 *
2352 * @param player player instance
2353 * @param listener_id listener id returned by vlc_player_AddMetadataListener()
2354 */
2355VLC_API void
2357 vlc_player_metadata_listener_id *listener_id);
2358
2359
2360/** @} vlc_player__metadata */
2361
2362/**
2363 * @defgroup vlc_player__aout Audio output control
2364 * @{
2365 */
2366
2367/**
2368 * Player aout listener opaque structure.
2369 *
2370 * This opaque structure is returned by vlc_player_aout_AddListener() and can
2371 * be used to remove the listener via vlc_player_aout_RemoveListener().
2372 */
2375/**
2376 * Player aout callbacks
2377 *
2378 * Can be registered with vlc_player_aout_AddListener().
2379 *
2380 * @warning To avoid deadlocks, users should never call audio_output_t and
2381 * vlc_player_t functions from these callbacks.
2382 */
2385 /**
2386 * Called when the volume has changed
2387 *
2388 * @see vlc_player_aout_SetVolume()
2389 *
2390 * @param aout the main aout of the player
2391 * @param new_volume volume in the range [0;2.f]
2392 * @param data opaque pointer set by vlc_player_aout_AddListener()
2393 */
2394 void (*on_volume_changed)(audio_output_t *aout, float new_volume,
2395 void *data);
2396
2397 /**
2398 * Called when the mute state has changed
2399 *
2400 * @see vlc_player_aout_Mute()
2401 *
2402 * @param aout the main aout of the player
2403 * @param new_mute true if muted
2404 * @param data opaque pointer set by vlc_player_aout_AddListener()
2405 */
2406 void (*on_mute_changed)(audio_output_t *aout, bool new_muted,
2407 void *data);
2408
2409 /**
2410 * Called when the audio device has changed
2411 *
2412 * @param aout the main aout of the player
2413 * @param device the device name
2414 * @param data opaque pointer set by vlc_player_aout_AddListener()
2415 */
2416 void (*on_device_changed)(audio_output_t *aout, const char *device,
2417 void *data);
2418};
2419
2420/**
2421 * Get the audio output
2422 *
2423 * @warning The returned pointer must be released with aout_Release().
2424 *
2425 * @param player player instance
2426 * @return a valid audio_output_t * or NULL (if there is no aouts)
2427 */
2430
2431/**
2432 * Reset the main audio output
2433 *
2434 * @warning The main aout can only by reset if it is not currently used by any
2435 * decoders (before any play).
2436 *
2437 * @param player player instance
2438 */
2439VLC_API void
2441
2442/**
2443 * Add a listener callback for audio output events
2444 *
2445 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2446 * functions.
2447 * @note Every registered callbacks need to be removed by the caller with
2448 * vlc_player_aout_RemoveListener().
2449 *
2450 * @param player player instance
2451 * @param cbs pointer to a vlc_player_aout_cbs structure, the structure must be
2452 * valid during the lifetime of the player
2453 * @param cbs_data opaque pointer used by the callbacks
2454 * @return a valid listener id, or NULL in case of allocation error
2455 */
2458 const struct vlc_player_aout_cbs *cbs,
2459 void *cbs_data);
2460
2461/**
2462 * Remove a aout listener callback
2463 *
2464 * @param player player instance
2465 * @param listener_id listener id returned by vlc_player_aout_AddListener()
2466 */
2467VLC_API void
2469 vlc_player_aout_listener_id *listener_id);
2470
2471/**
2472 * Get the audio volume
2473 *
2474 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2475 * functions.
2476 *
2477 * @see vlc_player_aout_cbs.on_volume_changed
2478 *
2479 * @param player player instance
2480 * @return volume in the range [0;2.f] or -1.f if there is no audio outputs
2481 * (independent of mute)
2482 */
2483VLC_API float
2485
2486/**
2487 * Set the audio volume
2488 *
2489 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2490 * functions.
2491 *
2492 * @note A successful call will trigger the
2493 * vlc_player_vout_cbs.on_volume_changed event.
2494 *
2495 * @param player player instance
2496 * @param volume volume in the range [0;2.f]
2497 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2498 */
2499VLC_API int
2500vlc_player_aout_SetVolume(vlc_player_t *player, float volume);
2501
2502/**
2503 * Increment the audio volume
2504 *
2505 * @see vlc_player_aout_SetVolume()
2506 *
2507 * @param player player instance
2508 * @param steps number of "volume-step"
2509 * @param result pointer to store the resulting volume (can be NULL)
2510 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2511 */
2512VLC_API int
2513vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result);
2514
2515/**
2516 * Helper to decrement the audio volume
2517 */
2518static inline int
2519vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
2521 return vlc_player_aout_IncrementVolume(player, -steps, result);
2522}
2523
2524/**
2525 * Check if the audio output is muted
2526 *
2527 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2528 * functions.
2529 *
2530 * @see vlc_player_aout_cbs.on_mute_changed
2531 *
2532 * @param player player instance
2533 * @return 0 if not muted, 1 if muted, -1 if there is no audio outputs
2534 */
2535VLC_API int
2537
2538/**
2539 * Mute or unmute the audio output
2540 *
2541 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2542 * functions.
2543 *
2544 * @note A successful call will trigger the
2545 * vlc_player_aout_cbs.on_mute_changed event.
2546 *
2547 * @param player player instance
2548 * @param mute true to mute
2549 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2550 */
2551VLC_API int
2552vlc_player_aout_Mute(vlc_player_t *player, bool mute);
2553
2554/**
2555 * Helper to toggle the mute state
2556 */
2557static inline int
2560 return vlc_player_aout_Mute(player,
2561 !vlc_player_aout_IsMuted(player));
2562}
2563
2564/**
2565 * Enable or disable an audio filter
2566 *
2567 * @see aout_EnableFilter()
2568 *
2569 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2570 */
2571VLC_API int
2572vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
2573
2574/** @} vlc_player__aout */
2575
2576/**
2577 * @defgroup vlc_player__vout Video output control
2578 * @{
2579 */
2580
2581/**
2582 * Player vout listener opaque structure.
2583 *
2584 * This opaque structure is returned by vlc_player_vout_AddListener() and can
2585 * be used to remove the listener via vlc_player_vout_RemoveListener().
2586 */
2589/**
2590 * action of vlc_player_cbs.on_vout_changed callback
2591 */
2598/**
2599 * Player vout callbacks
2600 *
2601 * Can be registered with vlc_player_vout_AddListener().
2602 *
2603 * @note The state changed from the callbacks can be either applied on the
2604 * player (and all future video outputs), or on a specified video output. The
2605 * state is applied on the player when the vout argument is NULL.
2606 *
2607 * @warning To avoid deadlocks, users should never call vout_thread_t and
2608 * vlc_player_t functions from these callbacks.
2609 */
2612 /**
2613 * Called when the player and/or vout fullscreen state has changed
2614 *
2615 * @see vlc_player_vout_SetFullscreen()
2616 *
2617 * @param vout cf. vlc_player_vout_cbs note
2618 * @param enabled true when fullscreen is enabled
2619 * @param data opaque pointer set by vlc_player_vout_AddListener()
2620 */
2621 void (*on_fullscreen_changed)(vout_thread_t *vout, bool enabled,
2622 void *data);
2623
2624 /**
2625 * Called when the player and/or vout wallpaper mode has changed
2626 *
2627 * @see vlc_player_vout_SetWallpaperModeEnabled()
2628 *
2629 * @param vout cf. vlc_player_vout_cbs note
2630 * @param enabled true when wallpaper mode is enabled
2631 * @param data opaque pointer set by vlc_player_vout_AddListener()
2632 */
2633 void (*on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled,
2634 void *data);
2635};
2636
2637
2638/**
2639 * Get and hold the main video output
2640 *
2641 * @warning the returned vout_thread_t * must be released with vout_Release().
2642 * @see vlc_player_cbs.on_vout_changed
2643 *
2644 * @note The player is guaranteed to always hold one valid vout. Only vout
2645 * variables can be changed from this instance. The vout returned before
2646 * playback is not necessarily the same one that will be used for playback.
2647 *
2648 * @param player player instance
2649 * @return a valid vout_thread_t * or NULL, cf. warning
2650 */
2653
2654/**
2655 * Get and hold the list of video output
2656 *
2657 * @warning All vout_thread_t * element of the array must be released with
2658 * vout_Release(). The returned array must be freed.
2659 *
2660 * @see vlc_player_cbs.on_vout_changed
2661 *
2662 * @param player player instance
2663 * @param count valid pointer to store the array count
2664 * @return a array of vout_thread_t * or NULL, cf. warning
2665 */
2668
2669/**
2670 * Add a listener callback for video output events
2671 *
2672 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2673 * functions.
2674 * @note Every registered callbacks need to be removed by the caller with
2675 * vlc_player_vout_RemoveListener().
2676 *
2677 * @param player player instance
2678 * @param cbs pointer to a vlc_player_vout_cbs structure, the structure must be
2679 * valid during the lifetime of the player
2680 * @param cbs_data opaque pointer used by the callbacks
2681 * @return a valid listener id, or NULL in case of allocation error
2682 */
2685 const struct vlc_player_vout_cbs *cbs,
2686 void *cbs_data);
2687
2688/**
2689 * Remove a vout listener callback
2690 *
2691 * @param player player instance
2692 * @param listener_id listener id returned by vlc_player_vout_AddListener()
2693 */
2694VLC_API void
2696 vlc_player_vout_listener_id *listener_id);
2697
2698/**
2699 * Check if the player is fullscreen
2700 *
2701 * @warning The fullscreen state of the player and all vouts can be different.
2702 *
2703 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2704 * functions.
2705 *
2706 * @see vlc_player_vout_cbs.on_fullscreen_changed
2707 *
2708 * @param player player instance
2709 * @return true if the player is fullscreen
2710 */
2711VLC_API bool
2713
2714/**
2715 * Enable or disable the player fullscreen state
2716 *
2717 * This will have an effect on all current and future vouts.
2718 *
2719 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2720 * functions.
2721 * @note A successful call will trigger the
2722 * vlc_player_vout_cbs.on_fullscreen_changed event.
2723 *
2724 * @param player player instance
2725 * @param enabled true to enable fullscreen
2726 */
2727VLC_API void
2728vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled);
2729
2730/**
2731 * Helper to toggle the player fullscreen state
2732 */
2733static inline void
2738}
2739
2740/**
2741 * Check if the player has wallpaper-mode enaled
2742 *
2743 * @warning The wallpaper-mode state of the player and all vouts can be
2744 * different.
2745 *
2746 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2747 * functions.
2748 *
2749 * @see vlc_player_vout_cbs.on_wallpaper_mode_changed
2750 *
2751 * @param player player instance
2752 * @return true if the player is fullscreen
2753 */
2754VLC_API bool
2756
2757/**
2758 * Enable or disable the player wallpaper-mode
2759 *
2760 * This will have an effect on all current and future vouts.
2761 *
2762 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2763 * functions.
2764 * @note A successful call will trigger the
2765 * vlc_player_vout_cbs.on_wallpaper_mode_changed event.
2766 *
2767 * @param player player instance
2768 * @param enabled true to enable wallpaper-mode
2769 */
2770VLC_API void
2772
2773/**
2774 * Helper to toggle the player wallpaper-mode state
2775 */
2776static inline void
2783/**
2784 * Take a snapshot on all vouts
2785 *
2786 * @param player player instance
2787 */
2788VLC_API void
2790
2791/**
2792 * Display an OSD message on all vouts
2793 *
2794 * @param player player instance
2795 * @param fmt format string
2796 */
2797VLC_API void
2798vlc_player_osd_Message(vlc_player_t *player, const char *fmt, ...);
2799
2800/** @} vlc_player__vout */
2801
2802/**
2803 * @defgroup vlc_player__events Player events
2804 * @{
2805 */
2806
2807/**
2808 * Player listener opaque structure.
2809 *
2810 * This opaque structure is returned by vlc_player_AddListener() and can be
2811 * used to remove the listener via vlc_player_RemoveListener().
2812 */
2815/**
2816 * Action of vlc_player_cbs.on_track_list_changed,
2817 * vlc_player_cbs.on_program_list_changed callbacks
2818 */
2826/**
2827 * Player callbacks
2828 *
2829 * Can be registered with vlc_player_AddListener().
2830 *
2831 * All callbacks are called with the player locked (cf. vlc_player_Lock()) and
2832 * from any threads (and even synchronously from a vlc_player function in some
2833 * cases). It is safe to call any vlc_player functions from these callbacks
2834 * except vlc_player_Delete().
2835 *
2836 * @warning To avoid deadlocks, users should never call vlc_player functions
2837 * with an external mutex locked and lock this same mutex from a player
2838 * callback.
2839 */
2840struct vlc_player_cbs
2842 /**
2843 * Called when the current media has changed
2844 *
2845 * @note This can be called from the PLAYING state (when the player plays
2846 * the next media internally) or from the STOPPED state (from
2847 * vlc_player_SetCurrentMedia() or from an internal transition).
2848 *
2849 * The user could set the next media via vlc_player_SetNextMedia() from
2850 * the current callback or anytime before the current media is stopped.
2851
2852 * @see vlc_player_SetCurrentMedia()
2853 *
2854 * @param player locked player instance
2855 * @param new_media new media currently played or NULL (when there is no
2856 * more media to play)
2857 * @param data opaque pointer set by vlc_player_AddListener()
2858 */
2859 void (*on_current_media_changed)(vlc_player_t *player,
2860 input_item_t *new_media, void *data);
2861
2862 /**
2863 * Called when the player state has changed
2864 *
2865 * @see vlc_player_state
2866 *
2867 * @param player locked player instance
2868 * @param new_state new player state
2869 * @param data opaque pointer set by vlc_player_AddListener()
2870 */
2871 void (*on_state_changed)(vlc_player_t *player,
2872 enum vlc_player_state new_state, void *data);
2873
2874 /**
2875 * Called when a media triggered an error
2876 *
2877 * Can be called from any states. When it happens the player will stop
2878 * itself. It is safe to play an other media or event restart the player
2879 * (This will reset the error state).
2880 *
2881 * @param player locked player instance
2882 * @param error player error
2883 * @param data opaque pointer set by vlc_player_AddListener()
2884 */
2885 void (*on_error_changed)(vlc_player_t *player,
2886 enum vlc_player_error error, void *data);
2887
2888 /**
2889 * Called when the player buffering (or cache) has changed
2890 *
2891 * This event is always called with the 0 and 1 values before a playback
2892 * (in case of success). Values in between depends on the media type.
2893 *
2894 * @param player locked player instance
2895 * @param new_buffering buffering in the range [0:1]
2896 * @param data opaque pointer set by vlc_player_AddListener()
2897 */
2898 void (*on_buffering_changed)(vlc_player_t *player,
2899 float new_buffering, void *data);
2900
2901 /**
2902 * Called when the player rate has changed
2903 *
2904 * Triggered by vlc_player_ChangeRate(), not sent when the media starts
2905 * with the default rate (1.f)
2906 *
2907 * @param player locked player instance
2908 * @param new_rate player
2909 * @param data opaque pointer set by vlc_player_AddListener()
2910 */
2911 void (*on_rate_changed)(vlc_player_t *player,
2912 float new_rate, void *data);
2913
2914 /**
2915 * Called when the media capabilities has changed
2916 *
2917 * Always called when the media is opening or stopping.
2918 * Can be called during playback.
2919 *
2920 * @param player locked player instance
2921 * @param old_caps old player capabilities
2922 * @param new_caps new player capabilities
2923 * @param data opaque pointer set by vlc_player_AddListener()
2924 */
2925 void (*on_capabilities_changed)(vlc_player_t *player,
2926 int old_caps, int new_caps, void *data);
2927
2928 /**
2929 * Called when the player position has changed
2930 *
2931 * @note A started and playing media doesn't have necessarily a valid time.
2932 *
2933 * @param player locked player instance
2934 * @param new_time a valid time or VLC_TICK_INVALID
2935 * @param new_pos a valid position
2936 * @param data opaque pointer set by vlc_player_AddListener()
2937 */
2938 void (*on_position_changed)(vlc_player_t *player,
2939 vlc_tick_t new_time, double new_pos, void *data);
2940
2941 /**
2942 * Called when the media length has changed
2943 *
2944 * May be called when the media is opening or during playback.
2945 *
2946 * @note A started and playing media doesn't have necessarily a valid length.
2947 *
2948 * @param player locked player instance
2949 * @param new_length a valid time or VLC_TICK_INVALID
2950 * @param data opaque pointer set by vlc_player_AddListener()
2951 */
2952 void (*on_length_changed)(vlc_player_t *player,
2953 vlc_tick_t new_length, void *data);
2954
2955 /**
2956 * Called when a track is added, removed, or updated
2957 *
2958 * @note The track is only valid from this callback context. Users should
2959 * duplicate this track via vlc_player_track_Dup() if they want to use it
2960 * from an other context.
2961 *
2962 * @param player locked player instance
2963 * @param action added, removed or updated
2964 * @param track valid track
2965 * @param data opaque pointer set by vlc_player_AddListener()
2966 */
2967 void (*on_track_list_changed)(vlc_player_t *player,
2969 const struct vlc_player_track *track, void *data);
2970
2971 /**
2972 * Called when a new track is selected and/or unselected
2973 *
2974 * @note This event can be called with both unselected_id and selected_id
2975 * valid. This mean that a new track is replacing the old one.
2976 *
2977 * @param player locked player instance
2978 * @param unselected_id valid track id or NULL (when nothing is unselected)
2979 * @param selected_id valid track id or NULL (when nothing is selected)
2980 * @param data opaque pointer set by vlc_player_AddListener()
2981 */
2983 vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data);
2984
2985 /**
2986 * Called when a track delay has changed
2987 *
2988 * @param player locked player instance
2989 * @param es_id valid track id
2990 * @param delay a valid delay or INT64_MAX if the delay of this track is
2991 * canceled
2992 */
2993 void (*on_track_delay_changed)(vlc_player_t *player,
2994 vlc_es_id_t *es_id, vlc_tick_t delay, void *data);
2995
2996 /**
2997 * Called when a new program is added, removed or updated
2998 *
2999 * @note The program is only valid from this callback context. Users should
3000 * duplicate this program via vlc_player_program_Dup() if they want to use
3001 * it from an other context.
3002 *
3003 * @param player locked player instance
3004 * @param action added, removed or updated
3005 * @param prgm valid program
3006 * @param data opaque pointer set by vlc_player_AddListener()
3007 */
3008 void (*on_program_list_changed)(vlc_player_t *player,
3010 const struct vlc_player_program *prgm, void *data);
3011
3012 /**
3013 * Called when a new program is selected and/or unselected
3014 *
3015 * @note This event can be called with both unselected_id and selected_id
3016 * valid. This mean that a new program is replacing the old one.
3017 *
3018 * @param player locked player instance
3019 * @param unselected_id valid program id or -1 (when nothing is unselected)
3020 * @param selected_id valid program id or -1 (when nothing is selected)
3021 * @param data opaque pointer set by vlc_player_AddListener()
3022 */
3024 int unselected_id, int selected_id, void *data);
3025
3026 /**
3027 * Called when the media titles has changed
3028 *
3029 * This event is not called when the opening media doesn't have any titles.
3030 * This title list and all its elements are constant. If an element is to
3031 * be updated, a new list will be sent from this callback.
3032 *
3033 * @note Users should hold this list with vlc_player_title_list_Hold() if
3034 * they want to use it from an other context.
3035 *
3036 * @param player locked player instance
3037 * @param titles valid title list or NULL
3038 * @param data opaque pointer set by vlc_player_AddListener()
3039 */
3040 void (*on_titles_changed)(vlc_player_t *player,
3041 vlc_player_title_list *titles, void *data);
3042
3043 /**
3044 * Called when a new title is selected
3045 *
3046 * There are no events when a title is unselected. Titles are automatically
3047 * unselected when the title list changes. Titles and indexes are always
3048 * valid inside the vlc_player_title_list sent by
3049 * vlc_player_cbs.on_titles_changed.
3050 *
3051 * @param player locked player instance
3052 * @param new_title new selected title
3053 * @param new_idx index of this title
3054 * @param data opaque pointer set by vlc_player_AddListener()
3055 */
3057 const struct vlc_player_title *new_title, size_t new_idx, void *data);
3058
3059 /**
3060 * Called when a new chapter is selected
3061 *
3062 * There are no events when a chapter is unselected. Chapters are
3063 * automatically unselected when the title list changes. Titles, chapters
3064 * and indexes are always valid inside the vlc_player_title_list sent by
3065 * vlc_player_cbs.on_titles_changed.
3066 *
3067 * @param player locked player instance
3068 * @param title selected title
3069 * @param title_idx selected title index
3070 * @param chapter new selected chapter
3071 * @param chapter_idx new selected chapter index
3072 * @param data opaque pointer set by vlc_player_AddListener()
3073 */
3075 const struct vlc_player_title *title, size_t title_idx,
3076 const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx,
3077 void *data);
3078
3079 /**
3080 * Called when the media has a teletext menu
3081 *
3082 * @param player locked player instance
3083 * @param has_teletext_menu true if the media has a teletext menu
3084 * @param data opaque pointer set by vlc_player_AddListener()
3085 */
3086 void (*on_teletext_menu_changed)(vlc_player_t *player,
3087 bool has_teletext_menu, void *data);
3088
3089 /**
3090 * Called when teletext is enabled or disabled
3091 *
3092 * @see vlc_player_SetTeletextEnabled()
3093 *
3094 * @param player locked player instance
3095 * @param enabled true if teletext is enabled
3096 * @param data opaque pointer set by vlc_player_AddListener()
3097 */
3099 bool enabled, void *data);
3100
3101 /**
3102 * Called when the teletext page has changed
3103 *
3104 * @see vlc_player_SelectTeletextPage()
3105 *
3106 * @param player locked player instance
3107 * @param new_page page in the range ]0;888]
3108 * @param data opaque pointer set by vlc_player_AddListener()
3109 */
3110 void (*on_teletext_page_changed)(vlc_player_t *player,
3111 unsigned new_page, void *data);
3112
3113 /**
3114 * Called when the teletext transparency has changed
3115 *
3116 * @see vlc_player_SetTeletextTransparency()
3117 *
3118 * @param player locked player instance
3119 * @param enabled true is the teletext overlay is transparent
3120 * @param data opaque pointer set by vlc_player_AddListener()
3121 */
3123 bool enabled, void *data);
3124
3125 /**
3126 * Called when the player category delay has changed for the current media
3127 *
3128 * @see vlc_player_SetCategoryDelay()
3129 *
3130 * @param player locked player instance
3131 * @param cat AUDIO_ES or SPU_ES
3132 * @param new_delay audio delay
3133 * @param data opaque pointer set by vlc_player_AddListener()
3134 */
3136 enum es_format_category_e cat, vlc_tick_t new_delay, void *data);
3137
3138 /**
3139 * Called when associated subtitle has changed
3140 *
3141 * @see vlc_player_SetAssociatedSubsFPS()
3142 *
3143 * @param player locked player instance
3144 * @param sub_fps subtitle fps
3145 * @param data opaque pointer set by vlc_player_AddListener()
3146 */
3148 float subs_fps, void *data);
3149
3150 /**
3151 * Called when a new renderer item is set
3152 *
3153 * @see vlc_player_SetRenderer()
3154 *
3155 * @param player locked player instance
3156 * @param new_item a valid renderer item or NULL (if unset)
3157 * @param data opaque pointer set by vlc_player_AddListener()
3158 */
3159 void (*on_renderer_changed)(vlc_player_t *player,
3160 vlc_renderer_item_t *new_item, void *data);
3161
3162 /**
3163 * Called when the player recording state has changed
3164 *
3165 * @see vlc_player_SetRecordingEnabled()
3166 *
3167 * @param player locked player instance
3168 * @param recording true if recording is enabled
3169 * @param data opaque pointer set by vlc_player_AddListener()
3170 */
3171 void (*on_recording_changed)(vlc_player_t *player,
3172 bool recording, void *data);
3173
3174 /**
3175 * Called when the media signal has changed
3176 *
3177 * @param player locked player instance
3178 * @param new_quality signal quality
3179 * @param new_strength signal strength,
3180 * @param data opaque pointer set by vlc_player_AddListener()
3181 */
3182 void (*on_signal_changed)(vlc_player_t *player,
3183 float quality, float strength, void *data);
3184
3185 /**
3186 * Called when the player has new statisics
3187 *
3188 * @note The stats structure is only valid from this callback context. It
3189 * can be copied in order to use it from an other context.
3190 *
3191 * @param player locked player instance
3192 * @param stats valid stats, only valid from this context
3193 * @param data opaque pointer set by vlc_player_AddListener()
3194 */
3195 void (*on_statistics_changed)(vlc_player_t *player,
3196 const struct input_stats_t *stats, void *data);
3197
3198 /**
3199 * Called when the A to B loop has changed
3200 *
3201 * @see vlc_player_SetAtoBLoop()
3202 *
3203 * @param player locked player instance
3204 * @param state A, when only A is set, B when both A and B are set, None by
3205 * default
3206 * @param time valid time or VLC_TICK_INVALID of the current state
3207 * @param pos valid pos of the current state
3208 * @param data opaque pointer set by vlc_player_AddListener()
3209 */
3210 void (*on_atobloop_changed)(vlc_player_t *player,
3211 enum vlc_player_abloop new_state, vlc_tick_t time, double pos,
3212 void *data);
3213
3214 /**
3215 * Called when the media meta and/or info has changed
3216 *
3217 * @param player locked player instance
3218 * @param media current media
3219 * @param data opaque pointer set by vlc_player_AddListener()
3220 */
3221 void (*on_media_meta_changed)(vlc_player_t *player,
3222 input_item_t *media, void *data);
3223
3224 /**
3225 * Called when media epg has changed
3226 *
3227 * @param player locked player instance
3228 * @param media current media
3229 * @param data opaque pointer set by vlc_player_AddListener()
3230 */
3231 void (*on_media_epg_changed)(vlc_player_t *player,
3232 input_item_t *media, void *data);
3233
3234 /**
3235 * Called when the media has new subitems
3236 *
3237 * @param player locked player instance
3238 * @param media current media
3239 * @param new_subitems node representing all media subitems
3240 * @param data opaque pointer set by vlc_player_AddListener()
3241 */
3243 input_item_t *media, const input_item_node_t *new_subitems, void *data);
3244
3245 /**
3246 * Called when new attachments are added to the media
3247 *
3248 * @note It can be called several times for one parse request. The array
3249 * contains only new elements after a second call.
3250 *
3251 * @param player locked player instance
3252 * @param media current media
3253 * @param array valid array containing new elements, should only be used
3254 * within the callback. One and all elements can be held and stored on a
3255 * new variable or new array.
3256 * @param count number of elements in the array
3257 * @param data opaque pointer set by vlc_player_AddListener()
3258 */
3260 input_item_t *media, input_attachment_t *const *array, size_t count,
3261 void *data);
3262
3263 /**
3264 * Called when a vout is started or stopped
3265 *
3266 * @note In case, several media with only one video track are played
3267 * successively, the same vout instance will be started and stopped several
3268 * time.
3269 *
3270 * @param player locked player instance
3271 * @param action started or stopped
3272 * @param vout vout (can't be NULL)
3273 * @param order vout order
3274 * @param es_id the ES id associated with this vout
3275 * @param data opaque pointer set by vlc_player_AddListener()
3276 */
3277 void (*on_vout_changed)(vlc_player_t *player,
3279 enum vlc_vout_order order, vlc_es_id_t *es_id, void *data);
3280
3281 /**
3282 * Called when the player is corked
3283 *
3284 * The player can be corked when the audio output loose focus or when a
3285 * renderer was paused from the outside.
3286 *
3287 * @note called only if pause on cork was not set to true (by
3288 * vlc_player_SetPauseOnCork())
3289 * @note a cork_count higher than 0 means the player is corked. In that
3290 * case, the user should pause the player and release all external resource
3291 * needed by the player. A value higher than 1 mean that the player was
3292 * corked more than one time (for different reasons). A value of 0 means
3293 * the player is no longer corked. In that case, the user could resume the
3294 * player.
3295 *
3296 * @param player locked player instance
3297 * @param cork_count 0 for uncorked, > 0 for corked
3298 * @param data opaque pointer set by vlc_player_AddListener()
3299 */
3300 void (*on_cork_changed)(vlc_player_t *player, unsigned cork_count,
3301 void *data);
3302
3303 /**
3304 * Called to query the user about restoring the previous playback position
3305 *
3306 * If this callback isn't provided, the user won't be asked to restore
3307 * the previous playback position, effectively causing
3308 * VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK to be handled as
3309 * VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
3310 *
3311 * The implementation can react to this callback by calling
3312 * vlc_player_RestorePlaybackPos(), or by discarding the event.
3313 *
3314 * @param player locked player instance
3315 * @param data opaque pointer set by vlc_player_AddListener()
3316 */
3317 void (*on_playback_restore_queried)(vlc_player_t *player, void *data);
3319 /**
3320 * Called when the player will stop the current media.
3321 *
3322 * @note This can be called from the PLAYING state, before the
3323 * player requests the next media, or from the STOPPING state, ie.
3324 * when the player is stopping, or by an internal transition
3325 * (e.g., when the media reaches the end of file or errors out).
3326 *
3327 * @see vlc_player_SetCurrentMedia()
3328 * @see vlc_player_Stop()
3329 *
3330 * @param player locked player instance
3331 * @param current_media media currently stopping
3332 * @param stopping_reason reason why the media is stopping
3333 * @param data opaque pointer set by vlc_player_AddListener()
3334 */
3335 void (*on_stopping_current_media)(vlc_player_t *player, input_item_t *current_media,
3337 void *data);
3338
3339 /**
3340 * Called when the next frame, following a call to
3341 * `vlc_player_NextVideoFrame()`, is displayed.
3342 *
3343 * @see vlc_player_NextVideoFrame()
3344 *
3345 * @param player locked player instance
3346 * @param status 0 in case of success, -EAGAIN on first call (paused),
3347 * -EBUSY in case of video error, -ENOTSUP if can't pause,
3348 * -EINVAL in case of invalid state
3349 */
3350 void (*on_next_frame_status)(vlc_player_t *player, int status, void *data);
3352 /**
3353 * Called when the previous frame, following a call to
3354 * `vlc_player_PreviousVideoFrame()`, is displayed.
3355 *
3356 * @see vlc_player_PreviousVideoFrame()
3357 *
3358 * @param player locked player instance
3359 * @param status 0 in case of success,
3360 * -EAGAIN on first call (paused) or on first frame,
3361 * -EBUSY in case of video error,
3362 * -ENOTSUP if can't pause/seek/pace,
3363 * -EINVAL in case of invalid state,
3364 * -ERANGE if the player could not seek back
3365 */
3366 void (*on_prev_frame_status)(vlc_player_t *player, int status, void *data);
3368
3369/**
3370 * Add a listener callback
3371 *
3372 * @note Every registered callbacks need to be removed by the caller with
3373 * vlc_player_RemoveListener().
3374 *
3375 * @param player locked player instance
3376 * @param cbs pointer to a vlc_player_cbs structure, the structure must be
3377 * valid during the lifetime of the player
3378 * @param cbs_data opaque pointer used by the callbacks
3379 * @return a valid listener id, or NULL in case of allocation error
3380 */
3383 const struct vlc_player_cbs *cbs, void *cbs_data);
3384
3385/**
3386 * Remove a listener callback
3387 *
3388 * @param player locked player instance
3389 * @param listener_id listener id returned by vlc_player_AddListener()
3390 */
3391VLC_API void
3393 vlc_player_listener_id *listener_id);
3394
3395/** @} vlc_player__events */
3396
3397/**
3398 * @defgroup vlc_player__timer Player timer
3399 * @{
3400 */
3401
3402/**
3403 * Player timer opaque structure.
3404 */
3407/**
3408 * Player timer point
3409 *
3410 * @see vlc_player_timer_cbs.on_update
3411 */
3414 /** Position in the range [0.0f;1.0] */
3415 double position;
3416 /** Rate of the player */
3417 double rate;
3418 /** Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with
3419 * VLC_TICK_0 to get the original value. */
3420 vlc_tick_t ts;
3421 /** Valid length >= VLC_TICK_0 or VLC_TICK_INVALID */
3423 /** if true, length represents the seek range and position is the position
3424 * within that seek_range */
3425 bool live;
3426 /** System date of this record (always valid), this date can be in the
3427 * future or in the past. The special value of INT64_MAX mean that the
3428 * clock was paused when this point was updated. In that case,
3429 * vlc_player_timer_point_Interpolate() will return the current ts/pos of
3430 * this point (there is nothing to interpolate). */
3433
3434/**
3435 * Player smpte timecode
3436 *
3437 * @see vlc_player_timer_smpte_cbs
3438 */
3441 /** Hours [0;n] */
3442 unsigned hours;
3443 /** Minutes [0;59] */
3444 unsigned minutes;
3445 /** Seconds [0;59] */
3446 unsigned seconds;
3447 /** Frame number [0;n] */
3448 unsigned frames;
3449 /** Maximum number of digits needed to display the frame number */
3450 unsigned frame_resolution;
3451 /** True if the source is NTSC 29.97fps or 59.94fps DF */
3452 bool drop_frame;
3454
3455/**
3456 * Player timer callbacks
3457 *
3458 * @see vlc_player_AddTimer
3459 */
3462 /**
3463 * Called when the state or the time changed (mandatory).
3464 *
3465 * Get notified when the time is updated by the input or output source. The
3466 * input source is the 'demux' or the 'access_demux'. The output source are
3467 * audio and video outputs: an update is received each time a video frame
3468 * is displayed or an audio sample is written. The delay between each
3469 * updates may depend on the input and source type (it can be every 5ms,
3470 * 30ms, 1s or 10s...). The user of this timer may need to update the
3471 * position at a higher frequency from its own mainloop via
3472 * vlc_player_timer_point_Interpolate().
3473 *
3474 * @warning The player is not locked from this callback. It is forbidden
3475 * to call any player functions from here.
3476 *
3477 * @param value always valid, the time corresponding to the state
3478 * @param data opaque pointer set by vlc_player_AddTimer()
3479 */
3480 void (*on_update)(const struct vlc_player_timer_point *value, void *data);
3482 /**
3483 * The player timer is paused (can be NULL).
3484 *
3485 * This event is sent when the player is paused or stopping. The player
3486 * user should stop its "interpolate" timer.
3487 *
3488 * @note on_update() can be called when paused for those 2 reasons:
3489 * - playback is resumed (vlc_player_timer_point.system_date is valid)
3490 * - a track, likely video (next-frame) is outputted when paused
3491 * (vlc_player_timer_point.system_date = INT64_MAX)
3492 *
3493 * @warning The player is not locked from this callback. It is forbidden
3494 * to call any player functions from here.
3495 *
3496 * @param system_date system date of this event, not valid when stopped. It
3497 * can be used to interpolate the last updated point to this date in order
3498 * to get the last paused ts/position.
3499 * @param data opaque pointer set by vlc_player_AddTimer()
3500 */
3501 void (*on_paused)(vlc_tick_t system_date, void *data);
3503 /**
3504 * Called when the player is seeking or finished seeking (can be NULL).
3505 *
3506 * @warning The player is not locked from this callback. It is forbidden
3507 * to call any player functions from here.
3508 *
3509 * @note on_update() can be called when seeking. It corresponds to tracks
3510 * updating their points prior to receiving the asynchronous seek event.
3511 * The user could discard them manually.
3512 *
3513 * @param value point of the seek request or NULL when seeking is finished
3514 * @param data opaque pointer set by vlc_player_AddTimer()
3515 */
3516 void (*on_seek)(const struct vlc_player_timer_point *value, void *data);
3518
3519/**
3520 * Player smpte timer callbacks
3521 *
3522 * @see vlc_player_AddSmpteTimer
3523 */
3526 /**
3527 * Called when a new frame is displayed
3528 *
3529 * @warning The player is not locked from this callback. It is forbidden
3530 * to call any player functions from here.
3531 *
3532 * @param tc always valid, the timecode corresponding to the frame just
3533 * displayed
3534 * @param data opaque pointer set by vlc_player_AddTimer()
3535 */
3536 void (*on_update)(const struct vlc_player_timer_smpte_timecode *tc,
3537 void *data);
3538
3539 /**
3540 * The player timer is paused (can be NULL).
3541 *
3542 * @see vlc_player_timer_cbs.on_paused
3543 */
3544 void (*on_paused)(vlc_tick_t system_date, void *data);
3546 /**
3547 * Called when the player is seeking or finished seeking (can be NULL).
3548 *
3549 * @warning The player is not locked from this callback. It is forbidden
3550 * to call any player functions from here.
3551 *
3552 * @warning the value is parameter is a timestamp point and not a timecode,
3553 * as this is an approximation.
3554 *
3555 * @note on_update() can be called when seeking. It corresponds to tracks
3556 * updating their points prior to receiving the asynchronous seek event.
3557 * The user could discard them manually.
3558 *
3559 * @param value point of the seek request or NULL when seeking is finished
3560 * @param data opaque pointer set by vlc_player_AddTimer()
3561 */
3562 void (*on_seek)(const struct vlc_player_timer_point *value, void *data);
3564
3565/**
3566 * Add a timer in order to get times updates
3567 *
3568 * @param player player instance (locked or not)
3569 * @param min_period corresponds to the minimum period between each updates,
3570 * use it to avoid flood from too many source updates, set it to
3571 * VLC_TICK_INVALID to receive all updates.
3572 * @param cbs pointer to a vlc_player_timer_cbs structure, the structure must
3573 * be valid during the lifetime of the player
3574 * @param cbs_data opaque pointer used by the callbacks
3575 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3576 * error
3577 */
3579vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period,
3580 const struct vlc_player_timer_cbs *cbs,
3581 void *cbs_data);
3582
3583/**
3584 * Add a smpte timer in order to get accurate video frame updates
3585 *
3586 * @param player player instance (locked or not)
3587 * @param cbs pointer to a vlc_player_timer_smpte_cbs structure, the structure must
3588 * be valid during the lifetime of the player
3589 * @param cbs_data opaque pointer used by the callbacks
3590 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3591 * error
3592 */
3595 const struct vlc_player_timer_smpte_cbs *cbs,
3596 void *cbs_data);
3597
3598/**
3599 * Remove a player timer
3600 *
3601 * @param player player instance (locked or not)
3602 * @param timer timer created by vlc_player_AddTimer()
3603 */
3604VLC_API void
3606
3607/**
3608 * Interpolate the last timer value to now
3609 *
3610 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3611 * callback
3612 * @param system_now current system date
3613 * @param out_ts pointer where to set the interpolated ts, subtract this time
3614 * with VLC_TICK_0 to get the original value.
3615 * @param out_pos pointer where to set the interpolated position
3616 * @return VLC_SUCCESS in case of success, an error in the interpolated ts is
3617 * negative (could happen during the buffering step)
3618 */
3619VLC_API int
3621 vlc_tick_t system_now,
3622 vlc_tick_t *out_ts, double *out_pos);
3623
3624/**
3625 * Get the date of the next interval
3626 *
3627 * Can be used to setup an UI timer in order to update some widgets at specific
3628 * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3629 * time widget when the media reaches a new second.
3630 *
3631 * @note The media time doesn't necessarily correspond to the system time, that
3632 * is why this function is needed and use the rate of the current point.
3633 *
3634 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3635 * @param system_now current system date
3636 * @param interpolated_ts ts returned by vlc_player_timer_point_Interpolate()
3637 * with the same system now
3638 * @param next_interval next interval
3639 * @return the absolute system date of the next interval
3640 */
3643 vlc_tick_t system_now,
3644 vlc_tick_t interpolated_ts,
3645 vlc_tick_t next_interval);
3646
3647/** @} vlc_player__timer */
3648
3649/** @} vlc_player */
3650
3651#endif
size_t count
Definition core.c:403
#define VLC_API
Definition fourcc_gen.c:31
#define VLC_DEPRECATED
Definition vlc_common.h:158
vlc_vout_order
vout or spu_channel order
Definition vlc_vout.h:70
audio_output_t * vlc_player_aout_Hold(vlc_player_t *player)
Get the audio output.
Definition aout.c:44
static int vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
Helper to decrement the audio volume.
Definition vlc_player.h:2520
int vlc_player_aout_SetVolume(vlc_player_t *player, float volume)
Set the audio volume.
Definition aout.c:135
vlc_player_aout_listener_id * vlc_player_aout_AddListener(vlc_player_t *player, const struct vlc_player_aout_cbs *cbs, void *cbs_data)
Add a listener callback for audio output events.
Definition aout.c:50
int vlc_player_aout_Mute(vlc_player_t *player, bool mute)
Mute or unmute the audio output.
Definition aout.c:171
int vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result)
Increment the audio volume.
Definition aout.c:147
float vlc_player_aout_GetVolume(vlc_player_t *player)
Get the audio volume.
Definition aout.c:123
void vlc_player_aout_Reset(vlc_player_t *player)
Reset the main audio output.
Definition aout.c:242
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
static int vlc_player_aout_ToggleMute(vlc_player_t *player)
Helper to toggle the mute state.
Definition vlc_player.h:2559
int vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add)
Enable or disable an audio filter.
Definition aout.c:183
int vlc_player_aout_IsMuted(vlc_player_t *player)
Check if the audio output is muted.
Definition aout.c:159
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:2821
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:1011
void vlc_player_RemoveListener(vlc_player_t *player, vlc_player_listener_id *listener_id)
Remove a listener callback.
Definition player.c:1030
@ VLC_PLAYER_LIST_ADDED
Definition vlc_player.h:2822
@ VLC_PLAYER_LIST_UPDATED
Definition vlc_player.h:2824
@ VLC_PLAYER_LIST_REMOVED
Definition vlc_player.h:2823
vlc_player_t * vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type)
Create a new player instance.
Definition player.c:2062
void vlc_player_SetRepeatCount(vlc_player_t *player, unsigned repeat_count)
Repeat playback when reaching EOF.
Definition player.c:1297
void vlc_player_SetPlayAndPause(vlc_player_t *player, bool play_and_pause)
Pause when reaching EOF.
Definition player.c:1290
void vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled)
Enable or disable pause on cork event.
Definition player.c:1941
void vlc_player_CondWait(vlc_player_t *player, vlc_cond_t *cond)
Wait on a condition variable.
Definition player.c:1004
void vlc_player_Delete(vlc_player_t *player)
Delete a player instance.
Definition player.c:2009
void vlc_player_Unlock(vlc_player_t *player)
Unlock the player.
Definition player.c:998
void vlc_player_Lock(vlc_player_t *player)
Lock the player.
Definition player.c:982
vlc_player_lock_type
Player lock type (normal or reentrant)
Definition vlc_player.h:72
void vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused)
Ask to start in a paused state.
Definition player.c:1283
@ VLC_PLAYER_LOCK_REENTRANT
Reentrant lock.
Definition vlc_player.h:88
@ VLC_PLAYER_LOCK_NORMAL
Normal lock.
Definition vlc_player.h:79
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
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_metadata_option
Player metadata option.
Definition vlc_player.h:2268
@ VLC_PLAYER_METADATA_LOUDNESS_MOMENTARY
Ask for momentary loudness measurement.
Definition vlc_player.h:2275
@ VLC_PLAYER_METADATA_LOUDNESS_FULL
Ask for all loudness measurements.
Definition vlc_player.h:2283
vlc_player_state
State of the player.
Definition vlc_player.h:211
void vlc_player_NextVideoFrame(vlc_player_t *player)
Pause and display the next video frame.
Definition player.c:1332
static bool vlc_player_CanPause(vlc_player_t *player)
Helper to get the pause capability.
Definition vlc_player.h:598
void vlc_player_ChangeRate(vlc_player_t *player, float rate)
Change the rate of the player.
Definition player.c:1383
vlc_player_media_stopping_reason
Reason why the current media is stopping.
Definition vlc_player.h:328
int vlc_player_SetCurrentMedia(vlc_player_t *player, input_item_t *media)
Set the current media.
Definition player.c:1052
vlc_player_abloop
A to B loop state.
Definition vlc_player.h:318
void vlc_player_Resume(vlc_player_t *player)
Resume the playback from a pause.
Definition player.c:1326
vlc_tick_t vlc_player_GetTime(vlc_player_t *player)
Get the time of the current media.
Definition player.c:1447
static input_item_t * vlc_player_HoldCurrentMedia(vlc_player_t *player)
Helper that hold the current media.
Definition vlc_player.h:434
vlc_player_restore_playback_pos
Definition vlc_player.h:358
static void vlc_player_SetTime(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time precisely.
Definition vlc_player.h:769
void vlc_player_Navigate(vlc_player_t *player, enum vlc_player_nav nav)
Navigate (for DVD/Bluray menus or viewpoint)
Definition player.c:1689
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:1526
static bool vlc_player_CanSeek(vlc_player_t *player)
Helper to get the seek capability.
Definition vlc_player.h:589
static void vlc_player_ToggleRecording(vlc_player_t *player)
Helper to toggle the recording state.
Definition vlc_player.h:929
static void vlc_player_TogglePause(vlc_player_t *player)
Helper to toggle the pause state.
Definition vlc_player.h:561
#define VLC_PLAYER_CAP_SEEK
Player capability: can seek.
Definition vlc_player.h:338
void vlc_player_IncrementRate(vlc_player_t *player)
Increment the rate of the player (faster)
Definition player.c:1428
int vlc_player_GetCapabilities(vlc_player_t *player)
Get the player capabilities.
Definition player.c:1366
vlc_player_whence
Player seek/delay directive.
Definition vlc_player.h:284
static void vlc_player_JumpPos(vlc_player_t *player, double jumppos)
Helper to jump the position precisely.
Definition vlc_player.h:757
float vlc_player_GetRate(vlc_player_t *player)
Get the rate of the player.
Definition player.c:1373
void vlc_player_RestorePlaybackPos(vlc_player_t *player)
Restore the previous playback position of the current media.
Definition medialib.c:296
static void vlc_player_SetPositionFast(vlc_player_t *player, double position)
Helper to set the absolute position fast.
Definition vlc_player.h:747
void vlc_player_Pause(vlc_player_t *player)
Pause the playback.
Definition player.c:1320
vlc_player_seek_speed
Seek speed type.
Definition vlc_player.h:269
void vlc_player_UpdateViewpoint(vlc_player_t *player, const vlc_viewpoint_t *viewpoint, enum vlc_player_whence whence)
Update the viewpoint.
Definition player.c:1727
static void vlc_player_SetTimeFast(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time fast.
Definition vlc_player.h:779
int vlc_player_Stop(vlc_player_t *player)
Stop the playback of the current media.
Definition player.c:1265
bool vlc_player_IsRecording(vlc_player_t *player)
Check if the playing is recording.
Definition player.c:1737
int vlc_player_Start(vlc_player_t *player)
Start the playback of the current media.
Definition player.c:1195
static bool vlc_player_CanRewind(vlc_player_t *player)
Helper to get the rewindable capability.
Definition vlc_player.h:616
input_item_t * vlc_player_GetNextMedia(vlc_player_t *player)
Get the next played media.
Definition player.c:1107
#define VLC_PLAYER_CAP_REWIND
Player capability: can seek back.
Definition vlc_player.h:344
static void vlc_player_SetPosition(vlc_player_t *player, double position)
Helper to set the absolute position precisely.
Definition vlc_player.h:737
static bool vlc_player_IsStarted(vlc_player_t *player)
Helper to get the started state.
Definition vlc_player.h:535
input_item_t * vlc_player_GetCurrentMedia(vlc_player_t *player)
Get the current played media.
Definition player.c:1115
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:1489
enum vlc_player_abloop vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, double *a_pos, vlc_tick_t *b_time, double *b_pos)
Get the A to B loop status.
Definition player.c:1666
void vlc_player_DecrementRate(vlc_player_t *player)
Decrement the rate of the player (Slower)
Definition player.c:1434
#define VLC_PLAYER_CAP_PAUSE
Player capability: can pause.
Definition vlc_player.h:340
static bool vlc_player_IsPaused(vlc_player_t *player)
Helper to get the paused state.
Definition vlc_player.h:552
const struct input_stats_t * vlc_player_GetStatistics(vlc_player_t *player)
Get the statistics of the current media.
Definition player.c:1933
void vlc_player_DisplayPosition(vlc_player_t *player)
Display the player position on the vout OSD.
Definition player.c:1466
vlc_player_nav
Menu (VCD/DVD/BD) and viewpoint navigations.
Definition vlc_player.h:297
enum vlc_player_state vlc_player_GetState(vlc_player_t *player)
Get the state of the player.
Definition player.c:1352
vlc_player_error
Error of the player.
Definition vlc_player.h:257
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:1918
void vlc_player_PreviousVideoFrame(vlc_player_t *player)
Pause and display the previous video frame.
Definition player.c:1342
vlc_object_t * vlc_player_GetV4l2Object(vlc_player_t *player)
Get the V4L2 object used to do controls.
Definition player.c:1986
static bool vlc_player_CanChangeRate(vlc_player_t *player)
Helper to get the change-rate capability.
Definition vlc_player.h:607
vlc_tick_t vlc_player_GetLength(vlc_player_t *player)
Get the length of the current media.
Definition player.c:1440
static void vlc_player_JumpTime(vlc_player_t *player, vlc_tick_t jumptime)
Helper to jump the time precisely.
Definition vlc_player.h:789
void vlc_player_SeekByPos(vlc_player_t *player, double position, enum vlc_player_seek_speed speed, enum vlc_player_whence whence)
Seek the current media by position.
Definition player.c:1479
void vlc_player_SetNextMedia(vlc_player_t *player, input_item_t *media)
Set the next media.
Definition player.c:1093
int vlc_player_SetAtoBLoopTime(vlc_player_t *player, vlc_tick_t a_time, vlc_tick_t b_time)
Enable A to B loop of the current media by setting start and end time.
Definition player.c:1589
double vlc_player_GetPosition(vlc_player_t *player)
Get the position of the current media.
Definition player.c:1458
int vlc_player_ResetAtoBLoop(vlc_player_t *player)
Reset/remove the A to B loop of the current media.
Definition player.c:1648
void vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled, const char *dir_path)
Enable or disable recording for the current media.
Definition player.c:1745
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:1123
enum vlc_player_error vlc_player_GetError(vlc_player_t *player)
Get the error state of the player.
Definition player.c:1359
#define VLC_PLAYER_CAP_CHANGE_RATE
Player capability: can change the rate.
Definition vlc_player.h:342
int vlc_player_SetAtoBLoopPosition(vlc_player_t *player, double a_pos, double b_pos)
Enable A to B loop of the current media by setting start and end position.
Definition player.c:1620
@ VLC_PLAYER_STATE_STOPPED
The player is stopped.
Definition vlc_player.h:218
@ VLC_PLAYER_STATE_PAUSED
The player is paused.
Definition vlc_player.h:240
@ VLC_PLAYER_STATE_STOPPING
The player is stopping.
Definition vlc_player.h:248
@ VLC_PLAYER_STATE_STARTED
The player is started.
Definition vlc_player.h:225
@ VLC_PLAYER_STATE_PLAYING
The player is playing.
Definition vlc_player.h:233
@ VLC_PLAYER_MEDIA_STOPPING_ERROR
The media is stopping because of an error (default)
Definition vlc_player.h:330
@ VLC_PLAYER_MEDIA_STOPPING_EOS
The media reached the end of stream.
Definition vlc_player.h:332
@ VLC_PLAYER_MEDIA_STOPPING_USER
The media is stopping because of a user request.
Definition vlc_player.h:334
@ VLC_PLAYER_ABLOOP_B
Definition vlc_player.h:321
@ VLC_PLAYER_ABLOOP_A
Definition vlc_player.h:320
@ VLC_PLAYER_ABLOOP_NONE
Definition vlc_player.h:319
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
Definition vlc_player.h:359
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS
Definition vlc_player.h:361
@ VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK
Definition vlc_player.h:360
@ VLC_PLAYER_WHENCE_RELATIVE
The current position +/- the given time/position.
Definition vlc_player.h:288
@ VLC_PLAYER_WHENCE_ABSOLUTE
Given time/position.
Definition vlc_player.h:286
@ VLC_PLAYER_SEEK_FAST
Do a fast seek.
Definition vlc_player.h:273
@ VLC_PLAYER_SEEK_PRECISE
Do a precise seek.
Definition vlc_player.h:271
@ VLC_PLAYER_NAV_RIGHT
Select a navigation item on the right or move the viewpoint right.
Definition vlc_player.h:307
@ VLC_PLAYER_NAV_UP
Select a navigation item above or move the viewpoint up.
Definition vlc_player.h:301
@ VLC_PLAYER_NAV_POPUP
Activate the popup Menu (for BD)
Definition vlc_player.h:309
@ VLC_PLAYER_NAV_MENU
Activate disc Root Menu.
Definition vlc_player.h:311
@ VLC_PLAYER_NAV_ACTIVATE
Activate the navigation item selected.
Definition vlc_player.h:299
@ VLC_PLAYER_NAV_LEFT
Select a navigation item on the left or move the viewpoint left.
Definition vlc_player.h:305
@ VLC_PLAYER_NAV_DOWN
Select a navigation item under or move the viewpoint down.
Definition vlc_player.h:303
@ VLC_PLAYER_ERROR_GENERIC
Definition vlc_player.h:259
@ VLC_PLAYER_ERROR_NONE
Definition vlc_player.h:258
static const struct vlc_player_program * vlc_player_GetSelectedProgram(vlc_player_t *player)
Helper to get the current selected program.
Definition vlc_player.h:1344
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:300
void vlc_player_SelectNextProgram(vlc_player_t *player)
Select the next program.
Definition player.c:375
size_t vlc_player_GetProgramCount(vlc_player_t *player)
Get the number of programs.
Definition player.c:292
void vlc_player_SelectPrevProgram(vlc_player_t *player)
Select the previous program.
Definition player.c:381
void vlc_player_SelectProgram(vlc_player_t *player, int group_id)
Select a program from an ES group identifier.
Definition player.c:325
struct vlc_player_program * vlc_player_program_Dup(const struct vlc_player_program *prgm)
Duplicate a program.
Definition track.c:69
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:312
void vlc_player_program_Delete(struct vlc_player_program *prgm)
Delete a duplicated program.
Definition track.c:82
vlc_renderer_item_t * vlc_player_GetRenderer(vlc_player_t *player)
Get the renderer.
Definition player.c:1519
void vlc_player_SetRenderer(vlc_player_t *player, vlc_renderer_item_t *renderer)
Set the renderer.
Definition player.c:1499
void vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled)
Enable or disable teletext transparency.
Definition player.c:808
void vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page)
Select a teletext page or do an action from a key.
Definition player.c:795
unsigned vlc_player_GetTeletextPage(vlc_player_t *player)
Get the current teletext page.
Definition player.c:841
bool vlc_player_HasTeletextMenu(vlc_player_t *player)
Check if the media has a teletext menu.
Definition player.c:822
void vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled)
Enable or disable teletext.
Definition player.c:782
bool vlc_player_IsTeletextEnabled(vlc_player_t *player)
Check if teletext is enabled.
Definition player.c:829
bool vlc_player_IsTeletextTransparent(vlc_player_t *player)
Check if teletext is transparent.
Definition player.c:848
vlc_player_timer_id * vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period, const struct vlc_player_timer_cbs *cbs, void *cbs_data)
Add a timer in order to get times updates.
Definition timer.c:617
void vlc_player_RemoveTimer(vlc_player_t *player, vlc_player_timer_id *timer)
Remove a player timer.
Definition timer.c:661
int vlc_player_timer_point_Interpolate(const struct vlc_player_timer_point *point, vlc_tick_t system_now, vlc_tick_t *out_ts, double *out_pos)
Interpolate the last timer value to now.
Definition timer.c:673
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:714
vlc_player_timer_id * vlc_player_AddSmpteTimer(vlc_player_t *player, const struct vlc_player_timer_smpte_cbs *cbs, void *cbs_data)
Add a smpte timer in order to get accurate video frame updates.
Definition timer.c:639
vlc_player_title_list * vlc_player_title_list_Hold(vlc_player_title_list *titles)
Hold the title list of the player.
Definition title.c:32
void vlc_player_SelectPrevChapter(vlc_player_t *player)
Select the previous chapter for the current media.
Definition player.c:970
vlc_player_title_list * vlc_player_GetTitleList(vlc_player_t *player)
Get the title list of the current media.
Definition player.c:855
static const struct vlc_player_chapter * vlc_player_GetSelectedChapter(vlc_player_t *player)
Helper to get the current selected chapter.
Definition vlc_player.h:1187
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:165
ssize_t vlc_player_GetSelectedChapterIdx(vlc_player_t *player)
Get the selected chapter index for the current media.
Definition player.c:936
void vlc_player_SelectNextChapter(vlc_player_t *player)
Select the next chapter for the current media.
Definition player.c:958
void vlc_player_SelectNextTitle(vlc_player_t *player)
Select the next title for the current media.
Definition player.c:912
void vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index)
Select a chapter index for the current media.
Definition player.c:946
void vlc_player_SelectTitle(vlc_player_t *player, const struct vlc_player_title *title)
Select a title for the current media.
Definition player.c:893
void vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index)
Select a title index for the current media.
Definition player.c:884
void vlc_player_title_list_Release(vlc_player_title_list *titles)
Release of previously held title list.
Definition title.c:39
size_t vlc_player_title_list_GetCount(vlc_player_title_list *titles)
Get the number of title of a list.
Definition title.c:172
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:902
static const struct vlc_player_title * vlc_player_GetSelectedTitle(vlc_player_t *player)
Helper to get the current selected title.
Definition vlc_player.h:1100
void vlc_player_SelectPrevTitle(vlc_player_t *player)
Select the previous title for the current media.
Definition player.c:924
ssize_t vlc_player_GetSelectedTitleIdx(vlc_player_t *player)
Get the selected title index for the current media.
Definition player.c:862
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:2090
void vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps)
Set the associated subtitle FPS.
Definition player.c:1176
static vlc_tick_t vlc_player_GetVideoDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition vlc_player.h:2061
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:1816
float vlc_player_GetAssociatedSubsFPS(vlc_player_t *player)
Get the associated subtitle FPS.
Definition player.c:1188
static vlc_tick_t vlc_player_GetAudioDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition vlc_player.h:2041
static vlc_tick_t vlc_player_GetSubtitleDelay(vlc_player_t *player)
Helper to get the subtitle delay.
Definition vlc_player.h:2081
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:2050
static void vlc_player_SetVideoDelay(vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
Helper to set the audio delay.
Definition vlc_player.h:2070
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:1771
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:1803
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:1856
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:387
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:400
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:438
struct vlc_player_track * vlc_player_track_Dup(const struct vlc_player_track *track)
Duplicate a track.
Definition track.c:157
static bool vlc_player_IsAudioEnabled(vlc_player_t *player)
Helper to check if audio tracks are enabled.
Definition vlc_player.h:1912
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:1575
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:1793
void vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Restart a track from an ES identifier.
Definition player.c:738
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:1492
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:620
unsigned vlc_player_GetSubtitleTextScale(vlc_player_t *player)
Get the subtitle text scaling factor.
Definition player.c:1912
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:1752
static void vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable audio tracks.
Definition vlc_player.h:1903
void vlc_player_CycleTrack(vlc_player_t *player, enum es_format_category_e cat, enum vlc_vout_order vout_order, bool next)
Cycle through the tracks.
Definition player.c:644
void vlc_player_track_Delete(struct vlc_player_track *track)
Delete a duplicated track.
Definition track.c:149
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:1510
static void vlc_player_RestartTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to restart a track.
Definition vlc_player.h:1783
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:479
static size_t vlc_player_GetSubtitleTrackCount(vlc_player_t *player)
Helper to get the subtitle track count.
Definition vlc_player.h:1501
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:453
void vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *es_id)
Unselect a track from an ES identifier.
Definition player.c:717
vlc_player_select_policy
Player selection policy.
Definition vlc_player.h:1371
static size_t vlc_player_GetAudioTrackCount(vlc_player_t *player)
Helper to get the audio track count.
Definition vlc_player.h:1483
char * vlc_player_GetCategoryLanguage(vlc_player_t *player, enum es_format_category_e cat)
Get the language of an ES category.
Definition player.c:766
static void vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable subtitle tracks.
Definition vlc_player.h:1921
static void vlc_player_SelectPrevTrack(vlc_player_t *player, enum es_format_category_e cat, enum vlc_vout_order vout_order)
Helper to select the Previous track.
Definition vlc_player.h:1717
static void vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable video tracks.
Definition vlc_player.h:1885
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:747
static bool vlc_player_IsVideoEnabled(vlc_player_t *player)
Helper to check if video tracks are enabled.
Definition vlc_player.h:1894
static size_t vlc_player_GetVideoTrackCount(vlc_player_t *player)
Helper to get the video track count.
Definition vlc_player.h:1465
bool vlc_player_IsTrackCategoryEnabled(vlc_player_t *player, enum es_format_category_e cat)
Check if a track category is enabled.
Definition player.c:1897
static void vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
Helper to select the subtitle language.
Definition vlc_player.h:1852
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:1474
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:1877
static void vlc_player_ToggleSubtitle(vlc_player_t *player)
Helper to toggle subtitles.
Definition vlc_player.h:1939
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:1639
static void vlc_player_SelectNextTrack(vlc_player_t *player, enum es_format_category_e cat, enum vlc_vout_order vout_order)
Helper to select the next track.
Definition vlc_player.h:1700
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:430
static void vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
Helper to select the audio language.
Definition vlc_player.h:1843
void vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale)
Set the subtitle text scaling factor.
Definition player.c:1905
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:593
static void vlc_player_UnselectTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to unselect a track.
Definition vlc_player.h:1742
static bool vlc_player_IsSubtitleEnabled(vlc_player_t *player)
Helper to check if subtitle tracks are enabled.
Definition vlc_player.h:1930
@ VLC_PLAYER_SELECT_SIMULTANEOUS
Select multiple tracks for one category.
Definition vlc_player.h:1384
@ VLC_PLAYER_SELECT_EXCLUSIVE
Only one track per category is selected.
Definition vlc_player.h:1376
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
void vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled)
Enable or disable the player fullscreen state.
Definition vout.c:181
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
void vlc_player_vout_Snapshot(vlc_player_t *player)
Take a snapshot on all vouts.
Definition vout.c:206
vlc_player_vout_action
action of vlc_player_cbs.on_vout_changed callback
Definition vlc_player.h:2594
void vlc_player_osd_Message(vlc_player_t *player, const char *fmt,...)
Display an OSD message on all vouts.
Definition osd.c:90
static void vlc_player_vout_ToggleFullscreen(vlc_player_t *player)
Helper to toggle the player fullscreen state.
Definition vlc_player.h:2735
vout_thread_t * vlc_player_vout_Hold(vlc_player_t *player)
Get and hold the main video output.
Definition vout.c:43
static void vlc_player_vout_ToggleWallpaperMode(vlc_player_t *player)
Helper to toggle the player wallpaper-mode state.
Definition vlc_player.h:2778
void vlc_player_vout_SetWallpaperModeEnabled(vlc_player_t *player, bool enabled)
Enable or disable the player wallpaper-mode.
Definition vout.c:198
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
bool vlc_player_vout_IsWallpaperModeEnabled(vlc_player_t *player)
Check if the player has wallpaper-mode enaled.
Definition vout.c:189
bool vlc_player_vout_IsFullscreen(vlc_player_t *player)
Check if the player is fullscreen.
Definition vout.c:101
@ VLC_PLAYER_VOUT_STOPPED
Definition vlc_player.h:2596
@ VLC_PLAYER_VOUT_STARTED
Definition vlc_player.h:2595
const char name[16]
Definition httpd.c:1298
input_item_t * input_item_Hold(input_item_t *p_item)
Holds an input item, i.e.
Definition item.c:401
Audio output object.
Definition vlc_aout.h:155
Definition vlc_es.h:614
Definition vlc_input.h:168
Definition vlc_input_item.h:204
Describes an input and is used to spawn input_thread_t objects.
Definition vlc_input_item.h:98
Definition vlc_input_item.h:529
Audio loudness measurement.
Definition vlc_aout.h:667
Condition variable.
Definition vlc_threads.h:270
Opaque structure representing an ES (Elementary Stream) track.
Definition es_out.c:103
VLC object common members.
Definition vlc_objects.h:53
Player aout callbacks.
Definition vlc_player.h:2385
void(* on_volume_changed)(audio_output_t *aout, float new_volume, void *data)
Called when the volume has changed.
Definition vlc_player.h:2395
void(* on_mute_changed)(audio_output_t *aout, bool new_muted, void *data)
Called when the mute state has changed.
Definition vlc_player.h:2407
void(* on_device_changed)(audio_output_t *aout, const char *device, void *data)
Called when the audio device has changed.
Definition vlc_player.h:2417
Definition player.h:164
Player callbacks.
Definition vlc_player.h:2842
void(* on_media_subitems_changed)(vlc_player_t *player, input_item_t *media, const input_item_node_t *new_subitems, void *data)
Called when the media has new subitems.
Definition vlc_player.h:3243
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:3009
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:2953
void(* on_recording_changed)(vlc_player_t *player, bool recording, void *data)
Called when the player recording state has changed.
Definition vlc_player.h:3172
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:3136
void(* on_stopping_current_media)(vlc_player_t *player, input_item_t *current_media, enum vlc_player_media_stopping_reason stopping_reason, void *data)
Called when the player will stop the current media.
Definition vlc_player.h:3336
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:3111
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:2926
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:3183
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:3057
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:2860
void(* on_prev_frame_status)(vlc_player_t *player, int status, void *data)
Called when the previous frame, following a call to vlc_player_PreviousVideoFrame(),...
Definition vlc_player.h:3367
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:3087
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:3196
void(* on_media_meta_changed)(vlc_player_t *player, input_item_t *media, void *data)
Called when the media meta and/or info has changed.
Definition vlc_player.h:3222
void(* on_next_frame_status)(vlc_player_t *player, int status, void *data)
Called when the next frame, following a call to vlc_player_NextVideoFrame(), is displayed.
Definition vlc_player.h:3351
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:2983
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:3148
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:3232
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:3278
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:3024
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:3041
void(* on_cork_changed)(vlc_player_t *player, unsigned cork_count, void *data)
Called when the player is corked.
Definition vlc_player.h:3301
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:2968
void(* on_teletext_enabled_changed)(vlc_player_t *player, bool enabled, void *data)
Called when teletext is enabled or disabled.
Definition vlc_player.h:3099
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:3318
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:2994
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:3075
void(* on_atobloop_changed)(vlc_player_t *player, enum vlc_player_abloop new_state, vlc_tick_t time, double pos, void *data)
Called when the A to B loop has changed.
Definition vlc_player.h:3211
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:2872
void(* on_position_changed)(vlc_player_t *player, vlc_tick_t new_time, double new_pos, void *data)
Called when the player position has changed.
Definition vlc_player.h:2939
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:2899
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:2886
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:3160
void(* on_teletext_transparency_changed)(vlc_player_t *player, bool enabled, void *data)
Called when the teletext transparency has changed.
Definition vlc_player.h:3123
void(* on_rate_changed)(vlc_player_t *player, float new_rate, void *data)
Called when the player rate has changed.
Definition vlc_player.h:2912
void(* on_media_attachments_added)(vlc_player_t *player, input_item_t *media, input_attachment_t *const *array, size_t count, void *data)
Called when new attachments are added to the media.
Definition vlc_player.h:3260
Player chapter structure.
Definition vlc_player.h:1002
const char * name
Chapter name, always valid.
Definition vlc_player.h:1004
vlc_tick_t time
Position of this chapter.
Definition vlc_player.h:1006
Definition player.h:137
Definition player.h:144
Player program structure.
Definition vlc_player.h:1237
bool selected
True if the program is selected.
Definition vlc_player.h:1243
const char * name
Program name, always valid.
Definition vlc_player.h:1241
int group_id
Id used for vlc_player_SelectProgram()
Definition vlc_player.h:1239
bool scrambled
True if the program is scrambled.
Definition vlc_player.h:1245
Definition player.h:242
vlc_cond_t notify
Definition player.h:292
bool play_and_pause
Definition player.h:251
bool start_paused
Definition player.h:250
input_item_t * media
Definition player.h:264
Player timer callbacks.
Definition vlc_player.h:3462
void(* on_seek)(const struct vlc_player_timer_point *value, void *data)
Called when the player is seeking or finished seeking (can be NULL).
Definition vlc_player.h:3517
void(* on_update)(const struct vlc_player_timer_point *value, void *data)
Called when the state or the time changed (mandatory).
Definition vlc_player.h:3481
void(* on_paused)(vlc_tick_t system_date, void *data)
The player timer is paused (can be NULL).
Definition vlc_player.h:3502
Definition player.h:178
Player timer point.
Definition vlc_player.h:3414
bool live
if true, length represents the seek range and position is the position within that seek_range
Definition vlc_player.h:3426
double position
Position in the range [0.0f;1.0].
Definition vlc_player.h:3416
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:3432
double rate
Rate of the player.
Definition vlc_player.h:3418
vlc_tick_t length
Valid length >= VLC_TICK_0 or VLC_TICK_INVALID.
Definition vlc_player.h:3423
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:3421
Player smpte timer callbacks.
Definition vlc_player.h:3526
void(* on_update)(const struct vlc_player_timer_smpte_timecode *tc, void *data)
Called when a new frame is displayed.
Definition vlc_player.h:3537
void(* on_seek)(const struct vlc_player_timer_point *value, void *data)
Called when the player is seeking or finished seeking (can be NULL).
Definition vlc_player.h:3563
void(* on_paused)(vlc_tick_t system_date, void *data)
The player timer is paused (can be NULL).
Definition vlc_player.h:3545
Player smpte timecode.
Definition vlc_player.h:3441
unsigned seconds
Seconds [0;59].
Definition vlc_player.h:3447
unsigned minutes
Minutes [0;59].
Definition vlc_player.h:3445
unsigned hours
Hours [0;n].
Definition vlc_player.h:3443
bool drop_frame
True if the source is NTSC 29.97fps or 59.94fps DF.
Definition vlc_player.h:3453
unsigned frame_resolution
Maximum number of digits needed to display the frame number.
Definition vlc_player.h:3451
unsigned frames
Frame number [0;n].
Definition vlc_player.h:3449
Definition player.h:51
Player title structure.
Definition vlc_player.h:1018
const struct vlc_player_chapter * chapters
Array of chapters, can be NULL.
Definition vlc_player.h:1029
size_t chapter_count
Number of chapters, can be 0.
Definition vlc_player.h:1027
vlc_tick_t length
Length of the title.
Definition vlc_player.h:1022
unsigned flags
Bit flag of VLC_PLAYER_TITLE_MENU and VLC_PLAYER_TITLE_INTERACTIVE.
Definition vlc_player.h:1025
const char * name
Title name, always valid.
Definition vlc_player.h:1020
Player track structure.
Definition vlc_player.h:1397
bool selected
True if the track is selected.
Definition vlc_player.h:1405
es_format_t fmt
Es format.
Definition vlc_player.h:1403
const char * name
Track name, always valid.
Definition vlc_player.h:1401
vlc_es_id_t * es_id
Id used for any player actions, like vlc_player_SelectEsId()
Definition vlc_player.h:1399
Player vout callbacks.
Definition vlc_player.h:2612
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:2634
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:2622
Definition player.h:157
Definition renderer_discovery.c:36
Viewpoints.
Definition vlc_viewpoint.h:41
Video output thread descriptor.
Definition vlc_vout.h:54
Player metadata callbacks.
Definition vlc_player.h:2295
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:2326
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:2309
Audio output modules interface.
This file is a collection of common definitions and types.
es_format_category_e
ES Categories.
Definition vlc_es.h:597
@ SPU_ES
Definition vlc_es.h:601
@ AUDIO_ES
Definition vlc_es.h:600
@ VIDEO_ES
Definition vlc_es.h:599
Input thread interface.
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48