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;1] (VLC_PLAYER_WHENCE_ABSOLUTE)
706 * or [-1;1] (VLC_PLAYER_WHENCE_RELATIVE)
707 * @param speed precise of fast
708 * @param whence absolute or relative
709 */
710VLC_API void
711vlc_player_SeekByPos(vlc_player_t *player, double position,
712 enum vlc_player_seek_speed speed,
713 enum vlc_player_whence whence);
714
715/**
716 * Seek the current media by time
717 *
718 * @note This function can be called before vlc_player_Start() in order to set
719 * a starting position.
720 *
721 * @warning This function has an effect only if the media has a valid length.
722 *
723 * @param player locked player instance
724 * @param time a time in the range [0;length]
725 * @param speed precise of fast
726 * @param whence absolute or relative
727 */
728VLC_API void
730 enum vlc_player_seek_speed speed,
731 enum vlc_player_whence whence);
732
733/**
734 * Helper to set the absolute position precisely
735 */
736static inline void
737vlc_player_SetPosition(vlc_player_t *player, double position)
743/**
744 * Helper to set the absolute position fast
745 */
746static inline void
747vlc_player_SetPositionFast(vlc_player_t *player, double position)
753/**
754 * Helper to jump the position precisely
755 */
756static inline void
757vlc_player_JumpPos(vlc_player_t *player, double jumppos)
759 /* No fask seek for jumps. Indeed, jumps can seek to the current position
760 * if not precise enough or if the jump value is too small. */
763}
764
765/**
766 * Helper to set the absolute time precisely
767 */
768static inline void
775/**
776 * Helper to set the absolute time fast
777 */
778static inline void
785/**
786 * Helper to jump the time precisely
787 */
788static inline void
791 /* No fask seek for jumps. Indeed, jumps can seek to the current position
792 * if not precise enough or if the jump value is too small. */
795}
796
797/**
798 * Display the player position on the vout OSD
799 *
800 * @param player locked player instance
801 */
802VLC_API void
804
805/**
806 * Enable A to B loop of the current media
807 *
808 * This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and
809 * VLC_PLAYER_ABLOOP_B to setup an A to B loop. It uses and stores the
810 * current time/position when called. The B time must be higher than the
811 * A time.
812 *
813 * @param player locked player instance
814 * @param abloop select which A/B cursor to set
815 * @return VLC_SUCCESS or a VLC error code
816 */
817VLC_API int
819
820/**
821 * Enable A to B loop of the current media by setting start and end time
822 *
823 * The B time must be higher than the A time.
824 *
825 * @param player locked player instance
826 * @param a_time start time for the loop
827 * @param b_time end time for the loop
828 * @return VLC_SUCCESS or a VLC error code
829 */
830VLC_API int
832
833/**
834 * Enable A to B loop of the current media by setting start and end position
835 *
836 * The B position must be higher than the A position.
837 *
838 * @param player locked player instance
839 * @param a_pos start position for the loop
840 * @param b_pos end position for the loop
841 * @return VLC_SUCCESS or a VLC error code
842 */
843VLC_API int
844vlc_player_SetAtoBLoopPosition(vlc_player_t *player, double a_pos, double b_pos);
845
846/**
847 * Reset/remove the A to B loop of the current media
848 *
849 * @param player locked player instance
850 * @return VLC_SUCCESS or a VLC error code
851 */
852VLC_API int
854
855/**
856 * Get the A to B loop status
857 *
858 * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
859 * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
860 * output parameters are valid. If the returned status is
861 * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
862 *
863 * @see vlc_player_cbs.on_atobloop_changed
864 *
865 * @param player locked player instance
866 * @param a_time A time or VLC_TICK_INVALID (if the media doesn't have valid
867 * times)
868 * @param a_pos A position
869 * @param b_time B time or VLC_TICK_INVALID (if the media doesn't have valid
870 * times)
871 * @param b_pos B position
872 * @return A to B loop status
873 */
875vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, double *a_pos,
876 vlc_tick_t *b_time, double *b_pos);
877
878/**
879 * Navigate (for DVD/Bluray menus or viewpoint)
880 *
881 * @param player locked player instance
882 * @param nav navigation key
883 */
884VLC_API void
886
887/**
888 * Update the viewpoint
889 *
890 * @param player locked player instance
891 * @param viewpoint the viewpoint value
892 * @param whence absolute or relative
893 */
894VLC_API void
896 const vlc_viewpoint_t *viewpoint,
897 enum vlc_player_whence whence);
898
899/**
900 * Check if the playing is recording
901 *
902 * @see vlc_player_cbs.on_recording_changed
903 *
904 * @param player locked player instance
905 * @return true if the player is recording
906 */
907VLC_API bool
909
910/**
911 * Enable or disable recording for the current media
912 *
913 * @note A successful call will trigger the vlc_player_cbs.on_recording_changed
914 * event.
915 *
916 * @param player locked player instance
917 * @param enabled true to enable recording
918 * @param dir_path path of the recording directory or NULL (use default path),
919 * has only an effect when first enabling recording.
920 */
921VLC_API void
922vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled,
923 const char *dir_path);
924
925/**
926 * Helper to toggle the recording state
927 */
928static inline void
932}
933
934/**
935 * Add an associated (or external) media to the current media
936 *
937 * @param player locked player instance
938 * @param cat SPU_ES or UNKNOWN_ES
939 * @param uri absolute uri of the external media
940 * @param select true to select the track of this external media
941 * @param notify true to notify the OSD
942 * @param check_ext true to check subtitles extension
943 */
944VLC_API int
946 enum es_format_category_e cat, const char *uri,
947 bool select, bool notify, bool check_ext);
948
949/**
950 * Get the signal quality and strength of the current media
951 *
952 * @param player locked player instance
953 * @param quality a pointer that will be assigned with the signal quality
954 * @param strength a pointer that will be assigned with the signal strength
955 * @retval VLC_SUCCESS when quality and strength have been assigned
956 * @retval VLC_EGENERIC in case of error (strength and quality are not assigned)
957 */
958VLC_API int
959vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength);
960
961/**
962 * Get the statistics of the current media
963 *
964 * @warning The returned pointer becomes invalid when the player is unlocked.
965 * The referenced structure can be safely copied.
966 *
967 * @see vlc_player_cbs.on_statistics_changed
968 *
969 * @param player locked player instance
970 * @return pointer to the player stats structure or NULL
971 */
972VLC_API const struct input_stats_t *
974
975/**
976 * Restore the previous playback position of the current media
977 */
978VLC_API void
980
981/**
982 * Get the V4L2 object used to do controls
983 *
984 * @param player locked player instance
985 * @return the V4L2 object or NULL if not any. This object must be used with
986 * the player lock held.
987 */
990
991/** @} vlc_player__playback */
992
993/**
994 * @defgroup vlc_player__titles Title and chapter control
995 * @{
996 */
997
998/**
999 * Player chapter structure
1000 */
1001struct vlc_player_chapter
1003 /** Chapter name, always valid */
1004 const char *name;
1005 /** Position of this chapter */
1008
1009/** vlc_player_title.flags: The title is a menu. */
1010#define VLC_PLAYER_TITLE_MENU 0x01
1011/** vlc_player_title.flags: The title is interactive. */
1012#define VLC_PLAYER_TITLE_INTERACTIVE 0x02
1013/** vlc_player_title.flags: The title is the main one. */
1014#define VLC_PLAYER_TITLE_MAIN 0x04
1016/** Player title structure */
1017struct vlc_player_title
1019 /** Title name, always valid */
1020 const char *name;
1021 /** Length of the title */
1023 /** Bit flag of @ref VLC_PLAYER_TITLE_MENU and @ref
1024 * VLC_PLAYER_TITLE_INTERACTIVE */
1025 unsigned flags;
1026 /** Number of chapters, can be 0 */
1027 size_t chapter_count;
1028 /** Array of chapters, can be NULL */
1029 const struct vlc_player_chapter *chapters;
1031
1032/**
1033 * Opaque structure representing a list of @ref vlc_player_title.
1034 *
1035 * @see vlc_player_GetTitleList()
1036 * @see vlc_player_title_list_GetCount()
1037 * @see vlc_player_title_list_GetAt()
1038 */
1041/**
1042 * Hold the title list of the player
1043 *
1044 * This function can be used to pass this title list from a callback to an
1045 * other thread.
1046 *
1047 * @see vlc_player_cbs.on_titles_changed
1048 *
1049 * @return the same instance
1050 */
1053
1054/**
1055 * Release of previously held title list
1056 */
1057VLC_API void
1059
1060/**
1061 * Get the number of title of a list
1062 */
1063VLC_API size_t
1065
1066/**
1067 * Get the title at a given index
1068 *
1069 * @param titles a valid title list
1070 * @param idx index in the range [0; count[
1071 * @return a valid title (can't be NULL)
1072 */
1073VLC_API const struct vlc_player_title *
1075
1076/**
1077 * Get the title list of the current media
1078 *
1079 * @see vlc_player_cbs.on_titles_changed
1080 *
1081 * @param player locked player instance
1082 */
1085
1086/**
1087 * Get the selected title index for the current media
1088 *
1089 * @see vlc_player_cbs.on_title_selection_changed
1090 *
1091 * @param player locked player instance
1092 */
1093VLC_API ssize_t
1095
1096/**
1097 * Helper to get the current selected title
1098 */
1099static inline const struct vlc_player_title *
1103 if (!titles)
1104 return NULL;
1105 ssize_t selected_idx = vlc_player_GetSelectedTitleIdx(player);
1106 if (selected_idx < 0)
1107 return NULL;
1108 return vlc_player_title_list_GetAt(titles, selected_idx);
1109}
1110
1111/**
1112 * Select a title index for the current media
1113 *
1114 * @note A successful call will trigger the
1115 * vlc_player_cbs.on_title_selection_changed event.
1116 *
1117 * @see vlc_player_title_list_GetAt()
1118 * @see vlc_player_title_list_GetCount()
1119 *
1120 * @param player locked player instance
1121 * @param index valid index in the range [0;count[
1122 */
1123VLC_API void
1124vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index);
1125
1126/**
1127 * Select a title for the current media
1128 *
1129 * @note A successful call will trigger the
1130 * vlc_player_cbs.on_title_selection_changed event.
1131 *
1132 * @see vlc_player_title_list_GetAt()
1133 * @see vlc_player_title_list_GetCount()
1134 *
1135 * @param player locked player instance
1136 * @param title a valid title coming from the vlc_player_title_list
1137 */
1138VLC_API void
1140 const struct vlc_player_title *title);
1141
1142/**
1143 * Select a chapter for the current media
1144 *
1145 * @note A successful call will trigger the
1146 * vlc_player_cbs.on_chapter_selection_changed event.
1147 *
1148 * @param player locked player instance
1149 * @param title the selected title
1150 * @param chapter_idx index from vlc_player_title.chapters
1151 */
1152VLC_API void
1154 const struct vlc_player_title *title,
1155 size_t chapter_idx);
1156
1157/**
1158 * Select the next title for the current media
1159 *
1160 * @see vlc_player_SelectTitleIdx()
1161 */
1162VLC_API void
1164
1165/**
1166 * Select the previous title for the current media
1167 *
1168 * @see vlc_player_SelectTitleIdx()
1169 */
1170VLC_API void
1172
1173/**
1174 * Get the selected chapter index for the current media
1175 *
1176 * @see vlc_player_cbs.on_chapter_selection_changed
1177 *
1178 * @param player locked player instance
1179 */
1180VLC_API ssize_t
1182
1183/**
1184 * Helper to get the current selected chapter
1185 */
1186static inline const struct vlc_player_chapter *
1189 const struct vlc_player_title *title = vlc_player_GetSelectedTitle(player);
1190 if (!title || !title->chapter_count)
1191 return NULL;
1192 ssize_t chapter_idx = vlc_player_GetSelectedChapterIdx(player);
1193 return chapter_idx >= 0 ? &title->chapters[chapter_idx] : NULL;
1194}
1195
1196/**
1197 * Select a chapter index for the current media
1198 *
1199 * @note A successful call will trigger the
1200 * vlc_player_cbs.on_chapter_selection_changed event.
1201 *
1202 * @see vlc_player_title.chapters
1203 *
1204 * @param player locked player instance
1205 * @param index valid index in the range [0;vlc_player_title.chapter_count[
1206 */
1207VLC_API void
1208vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index);
1209
1210/**
1211 * Select the next chapter for the current media
1212 *
1213 * @see vlc_player_SelectChapterIdx()
1214 */
1215VLC_API void
1217
1218/**
1219 * Select the previous chapter for the current media
1220 *
1221 * @see vlc_player_SelectChapterIdx()
1222 */
1223VLC_API void
1225
1226/** @} vlc_player__titles */
1227
1228/**
1229 * @defgroup vlc_player__programs Program control
1230 * @{
1231 */
1232
1233/**
1234 * Player program structure.
1235 */
1236struct vlc_player_program
1238 /** Id used for vlc_player_SelectProgram() */
1239 int group_id;
1240 /** Program name, always valid */
1241 const char *name;
1242 /** True if the program is selected */
1243 bool selected;
1244 /** True if the program is scrambled */
1245 bool scrambled;
1247
1248/**
1249 * Duplicate a program
1250 *
1251 * This function can be used to pass a program from a callback to an other
1252 * context.
1253 *
1254 * @see vlc_player_cbs.on_program_list_changed
1255 *
1256 * @return a duplicated program or NULL on allocation error
1257 */
1259vlc_player_program_Dup(const struct vlc_player_program *prgm);
1260
1261/**
1262 * Delete a duplicated program
1263 */
1264VLC_API void
1266
1267/**
1268 * Get the number of programs
1269 *
1270 * @warning The returned size becomes invalid when the player is unlocked.
1271 *
1272 * @param player locked player instance
1273 * @return number of programs, or 0 (in case of error, or if the media is not
1274 * started)
1275 */
1276VLC_API size_t
1278
1279/**
1280 * Get the program at a specific index
1281 *
1282 * @warning The behaviour is undefined if the index is not valid.
1283 *
1284 * @warning The returned pointer becomes invalid when the player is unlocked.
1285 * The referenced structure can be safely copied with vlc_player_program_Dup().
1286 *
1287 * @param player locked player instance
1288 * @param index valid index in the range [0; count[
1289 * @return a valid program (can't be NULL if vlc_player_GetProgramCount()
1290 * returned a valid count)
1291 */
1292VLC_API const struct vlc_player_program *
1293vlc_player_GetProgramAt(vlc_player_t *player, size_t index);
1294
1295/**
1296 * Get a program from an ES group identifier
1297 *
1298 * @param player locked player instance
1299 * @param group_id a program ID (retrieved from
1300 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1301 * @return a valid program or NULL (if the program was terminated by the
1302 * playback thread)
1303 */
1304VLC_API const struct vlc_player_program *
1306
1307/**
1308 * Select a program from an ES group identifier
1309 *
1310 * This function can be used to pre-select a program by its id before starting
1311 * the player. It has only effect for the current media. It can also be used
1312 * when the player is already started.
1313 *
1314 * @note Selecting a non-existing program will cause the player to no select
1315 * any programs. Therefore, all tracks will be disabled.
1316 *
1317 * @param player locked player instance
1318 * @param group_id a program ID (retrieved from
1319 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1320 */
1321VLC_API void
1323
1324/**
1325 * Select the next program
1326 *
1327 * @param player locked player instance
1328 */
1329VLC_API void
1331
1332/**
1333 * Select the previous program
1334 *
1335 * @param player locked player instance
1336 */
1337VLC_API void
1339
1340/**
1341 * Helper to get the current selected program
1342 */
1343static inline const struct vlc_player_program *
1346 size_t count = vlc_player_GetProgramCount(player);
1347 for (size_t i = 0; i < count; ++i)
1348 {
1349 const struct vlc_player_program *program =
1350 vlc_player_GetProgramAt(player, i);
1351 assert(program);
1352 if (program->selected)
1353 return program;
1354 }
1355 return NULL;
1356}
1357
1358/** @} vlc_player__programs */
1359
1360/**
1361 * @defgroup vlc_player__tracks Tracks control
1362 * @{
1363 */
1364
1365/**
1366 * Player selection policy
1367 *
1368 * @see vlc_player_SelectEsId()
1369 */
1372 /**
1373 * Only one track per category is selected. Selecting a track with this
1374 * policy will disable all other tracks for the same category.
1375 */
1377 /**
1378 * Select multiple tracks for one category.
1379 *
1380 * Only one audio track can be selected at a time.
1381 * Two subtitle tracks can be selected simultaneously.
1382 * Multiple video tracks can be selected simultaneously.
1383 */
1386
1387/**
1388 * Player track structure.
1389 *
1390 * A track is a representation of an ES identifier at a given time. Once the
1391 * player is unlocked, all content except the es_id pointer can be updated.
1392 *
1393 * @see vlc_player_cbs.on_track_list_changed
1394 * @see vlc_player_GetTrack
1395 */
1396struct vlc_player_track
1398 /** Id used for any player actions, like vlc_player_SelectEsId() */
1400 /** Track name, always valid */
1401 const char *name;
1402 /** Es format */
1404 /** True if the track is selected */
1405 bool selected;
1407
1408/**
1409 * Duplicate a track
1410 *
1411 * This function can be used to pass a track from a callback to an other
1412 * context. The es_id will be held by the duplicated track.
1413 *
1414 * @warning The returned track won't be updated if the original one is modified
1415 * by the player.
1416 *
1417 * @see vlc_player_cbs.on_track_list_changed
1418 *
1419 * @return a duplicated track or NULL on allocation error
1420 */
1422vlc_player_track_Dup(const struct vlc_player_track *track);
1423
1424/**
1425 * Delete a duplicated track
1426 */
1427VLC_API void
1429
1430/**
1431 * Get the number of tracks for an ES category
1432 *
1433 * @warning The returned size becomes invalid when the player is unlocked.
1434 *
1435 * @param player locked player instance
1436 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1437 * @return number of tracks, or 0 (in case of error, or if the media is not
1438 * started)
1439 */
1440VLC_API size_t
1442
1443/**
1444 * Get the track at a specific index for an ES category
1445 *
1446 * @warning The behaviour is undefined if the index is not valid.
1447 *
1448 * @warning The returned pointer becomes invalid when the player is unlocked.
1449 * The referenced structure can be safely copied with vlc_player_track_Dup().
1450 *
1451 * @param player locked player instance
1452 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1453 * @param index valid index in the range [0; count[
1454 * @return a valid track (can't be NULL if vlc_player_GetTrackCount() returned
1455 * a valid count)
1456 */
1457VLC_API const struct vlc_player_track *
1459 size_t index);
1460
1461/**
1462 * Helper to get the video track count
1463 */
1464static inline size_t
1467 return vlc_player_GetTrackCount(player, VIDEO_ES);
1468}
1469
1470/**
1471 * Helper to get a video track at a specific index
1472 */
1473static inline const struct vlc_player_track *
1474vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
1476 return vlc_player_GetTrackAt(player, VIDEO_ES, index);
1477}
1478
1479/**
1480 * Helper to get the audio track count
1481 */
1482static inline size_t
1485 return vlc_player_GetTrackCount(player, AUDIO_ES);
1486}
1487
1488/**
1489 * Helper to get an audio track at a specific index
1490 */
1491static inline const struct vlc_player_track *
1492vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
1494 return vlc_player_GetTrackAt(player, AUDIO_ES, index);
1495}
1496
1497/**
1498 * Helper to get the subtitle track count
1499 */
1500static inline size_t
1503 return vlc_player_GetTrackCount(player, SPU_ES);
1504}
1505
1506/**
1507 * Helper to get a subtitle track at a specific index
1508 */
1509static inline const struct vlc_player_track *
1510vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
1512 return vlc_player_GetTrackAt(player, SPU_ES, index);
1513}
1514
1515/**
1516 * Get a track from an ES identifier
1517 *
1518 * @warning The returned pointer becomes invalid when the player is unlocked.
1519 * The referenced structure can be safely copied with vlc_player_track_Dup().
1520 *
1521 * @param player locked player instance
1522 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1523 * vlc_player_GetTrackAt())
1524 * @return a valid player track or NULL (if the track was terminated by the
1525 * playback thread)
1526 */
1527VLC_API const struct vlc_player_track *
1529
1530/**
1531 * Get and the video output used by a ES identifier
1532 *
1533 * @warning A same vout can be associated with multiple ES during the lifetime
1534 * of the player. The information returned by this function becomes invalid
1535 * when the player is unlocked. The returned vout doesn't need to be released,
1536 * but must be held with vout_Hold() if it is accessed after the player is
1537 * unlocked.
1538 *
1539 * @param player locked player instance
1540 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1541 * vlc_player_GetTrackAt())
1542 * @param order if not null, the order of the vout
1543 * @return a valid vout or NULL (if the track is disabled, it it's not a video
1544 * or spu track, or if the vout failed to start)
1545 */
1548 enum vlc_vout_order *order);
1549
1550/**
1551 * Get the ES identifier of a video output
1552 *
1553 * @warning A same vout can be associated with multiple ES during the lifetime
1554 * of the player. The information returned by this function becomes invalid
1555 * when the player is unlocked. The returned es_id doesn't need to be released,
1556 * but must be held with vlc_es_id_Hold() if it accessed after the player is
1557 * unlocked.
1558 *
1559 * @param player locked player instance
1560 * @param vout vout (can't be NULL)
1561 * @return a valid ES identifier or NULL (if the vout is stopped)
1562 */
1565
1566/**
1567 * Helper to get the selected track from an ES category
1568 *
1569 * @warning The player can have more than one selected track for a same ES
1570 * category. This function will only return the first selected one. Use
1571 * vlc_player_GetTrackAt() and vlc_player_GetTrackCount() to iterate through
1572 * several selected tracks.
1573 */
1574static inline const struct vlc_player_track *
1577 size_t count = vlc_player_GetTrackCount(player, cat);
1578 for (size_t i = 0; i < count; ++i)
1579 {
1580 const struct vlc_player_track *track =
1581 vlc_player_GetTrackAt(player, cat, i);
1582 assert(track);
1583 if (track->selected)
1584 return track;
1585 }
1586 return NULL;
1587}
1588
1589/**
1590 * Select tracks by their string identifier
1591 *
1592 * This function can be used to pre-select a list of tracks before starting the
1593 * player. It has only effect for the current media. It can also be used when
1594 * the player is already started.
1595
1596 * 'str_ids' can contain more than one track id, delimited with ','. "" or any
1597 * invalid track id will cause the player to unselect all tracks of that
1598 * category. NULL will disable the preference for newer tracks without
1599 * unselecting any current tracks.
1600 *
1601 * Example:
1602 * - (VIDEO_ES, "video/1,video/2") will select these 2 video tracks. If there
1603 * is only one video track with the id "video/0", no tracks will be selected.
1604 * - (SPU_ES, "${slave_url_md5sum}/spu/0) will select one spu added by an input
1605 * slave with the corresponding url.
1606 *
1607 * @note The string identifier of a track can be found via vlc_es_id_GetStrId().
1608 *
1609 * @param player locked player instance
1610 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1611 * @param str_ids list of string identifier or NULL
1612 */
1613VLC_API void
1615 enum es_format_category_e cat,
1616 const char *str_ids);
1617
1618/**
1619 * Select a track from an ES identifier
1620 *
1621 * @note A successful call will trigger the
1622 * vlc_player_cbs.on_track_selection_changed event.
1623 *
1624 * @param player locked player instance
1625 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1626 * vlc_player_GetTrackAt())
1627 * @param policy exclusive or simultaneous
1628 * @return the number of track selected for es_id category
1629 */
1630VLC_API unsigned
1632 enum vlc_player_select_policy policy);
1633
1634
1635/**
1636 * Helper to select a track
1637 */
1638static inline unsigned
1640 const struct vlc_player_track *track,
1641 enum vlc_player_select_policy policy)
1642{
1643 return vlc_player_SelectEsId(player, track->es_id, policy);
1644}
1645
1646/**
1647 * Select multiple tracks from a list of ES identifiers.
1648 *
1649 * Any tracks of the category, not referenced in the list will be unselected.
1650 *
1651 * @warning there is no guarantee all requested tracks will be selected. The
1652 * behaviour is undefined if the list is not null-terminated.
1653 *
1654 * @note A successful call will trigger the
1655 * vlc_player_cbs.on_track_selection_changed event for each track that has
1656 * its selection state changed.
1657 *
1658 * @see VLC_PLAYER_SELECT_SIMULTANEOUS
1659 *
1660 * @param player locked player instance
1661 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1662 * @param es_id_list a null-terminated list of ES identifiers. es_ids not
1663 * corresponding to the category will be ignored.
1664 * (ES IDs can be retrieved from vlc_player_cbs.on_track_list_changed or
1665 * vlc_player_GetTrackAt())
1666 * @return the number of track selected for that category
1667 */
1668VLC_API unsigned
1670 enum es_format_category_e cat,
1671 vlc_es_id_t *const es_id_list[]);
1672
1673
1674/**
1675 * Cycle through the tracks
1676 *
1677 * If the last track is already selected, a call to this function will disable
1678 * this last track. And a second call will select the first track.
1679 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1680 *
1681 * @param player locked player instance
1682 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1683 * @param next the cycle order
1684 */
1685VLC_API void
1687 enum vlc_vout_order vout_order, bool next);
1688
1689/**
1690 * Helper to select the next track
1691 *
1692 * If the last track is already selected, a call to this function will disable
1693 * this last track. And a second call will select the first track.
1694 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1695 *
1696 * @param player locked player instance
1697 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1698 */
1699static inline void
1701 enum vlc_vout_order vout_order)
1702{
1703 vlc_player_CycleTrack(player, cat, vout_order, true);
1704}
1705
1706/**
1707 * Helper to select the Previous track
1708 *
1709 * If the first track is already selected, a call to this function will disable
1710 * this first track. And a second call will select the last track.
1711 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1712 *
1713 * @param player locked player instance
1714 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1715 */
1716static inline void
1718 enum vlc_vout_order vout_order)
1719{
1720 vlc_player_CycleTrack(player, cat, vout_order, false);
1721}
1722
1723/**
1724 * Unselect a track from an ES identifier
1725 *
1726 * @warning Other tracks of the same category won't be touched.
1727 *
1728 * @note A successful call will trigger the
1729 * vlc_player_cbs.on_track_selection_changed event.
1730 *
1731 * @param player locked player instance
1732 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1733 * vlc_player_GetTrackAt())
1734 */
1735VLC_API void
1737
1738/**
1739 * Helper to unselect a track
1740 */
1741static inline void
1743 const struct vlc_player_track *track)
1744{
1745 vlc_player_UnselectEsId(player, track->es_id);
1746}
1747
1748/**
1749 * Helper to unselect all tracks from an ES category
1750 */
1751static inline void
1754{
1755 size_t count = vlc_player_GetTrackCount(player, cat);
1756 for (size_t i = 0; i < count; ++i)
1757 {
1758 const struct vlc_player_track *track =
1759 vlc_player_GetTrackAt(player, cat, i);
1760 assert(track);
1761 if (track->selected)
1762 vlc_player_UnselectTrack(player, track);
1763 }
1764}
1765
1766/**
1767 * Restart a track from an ES identifier
1768 *
1769 * @note A successful call will trigger the
1770 * vlc_player_cbs.on_track_selection_changed event.
1771 *
1772 * @param player locked player instance
1773 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1774 * vlc_player_GetTrackAt())
1775 */
1776VLC_API void
1778
1779/**
1780 * Helper to restart a track
1781 */
1782static inline void
1784 const struct vlc_player_track *track)
1785{
1786 vlc_player_RestartEsId(player, track->es_id);
1787}
1788
1789/**
1790 * Helper to restart all selected tracks from an ES category
1791 */
1792static inline void
1795{
1796 size_t count = vlc_player_GetTrackCount(player, cat);
1797 for (size_t i = 0; i < count; ++i)
1798 {
1799 const struct vlc_player_track *track =
1800 vlc_player_GetTrackAt(player, cat, i);
1801 assert(track);
1802 if (track->selected)
1803 vlc_player_RestartTrack(player, track);
1804 }
1805}
1806
1807/**
1808 * Select the language for an ES category
1809 *
1810 * @warning The language will only be set for all future played media.
1811 *
1812 * @param player locked player instance
1813 * @param cat AUDIO_ES or SPU_ES
1814 * @param lang comma separated, two or three letters country code, 'any' as a
1815 * fallback or NULL to reset the default state
1816 */
1817VLC_API void
1819 enum es_format_category_e cat,
1820 const char *lang);
1821
1822/**
1823 * Get the language of an ES category
1824 *
1825 * @warning This only reflects the change made by
1826 * vlc_player_SelectCategoryLanguage(). The current playing track doesn't
1827 * necessarily correspond to the returned language.
1828 *
1829 * @see vlc_player_SelectCategoryLanguage
1830 *
1831 * @param player locked player instance
1832 * @param cat AUDIO_ES or SPU_ES
1833 * @return valid language or NULL, need to be freed
1834 */
1835VLC_API char *
1837 enum es_format_category_e cat);
1838
1839/**
1840 * Helper to select the audio language
1841 */
1842static inline void
1843vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
1846}
1847
1848/**
1849 * Helper to select the subtitle language
1850 */
1851static inline void
1852vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
1855}
1856
1857/**
1858 * Enable or disable a track category
1859 *
1860 * If a track category is disabled, the player won't select any tracks of this
1861 * category automatically or via an user action (vlc_player_SelectTrack()).
1862 *
1863 * @param player locked player instance
1864 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1865 * @param enabled true to enable
1866 */
1867VLC_API void
1869 enum es_format_category_e cat, bool enabled);
1870
1871/**
1872 * Check if a track category is enabled
1873 *
1874 * @param player locked player instance
1875 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1876 */
1877VLC_API bool
1879 enum es_format_category_e cat);
1880
1881/**
1882 * Helper to enable or disable video tracks
1883 */
1884static inline void
1885vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
1888}
1889
1890/**
1891 * Helper to check if video tracks are enabled
1892 */
1893static inline bool
1897}
1898
1899/**
1900 * Helper to enable or disable audio tracks
1901 */
1902static inline void
1903vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
1906}
1907
1908/**
1909 * Helper to check if audio tracks are enabled
1910 */
1911static inline bool
1915}
1916
1917/**
1918 * Helper to enable or disable subtitle tracks
1919 */
1920static inline void
1921vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
1924}
1925
1926/**
1927 * Helper to check if subtitle tracks are enabled
1928 */
1929static inline bool
1933}
1934
1935/**
1936 * Helper to toggle subtitles
1937 */
1938static inline void
1941 bool enabled = !vlc_player_IsSubtitleEnabled(player);
1942 vlc_player_SetSubtitleEnabled(player, enabled);
1943}
1944
1945/**
1946 * Set the subtitle text scaling factor
1947 *
1948 * @note This function have an effect only if the subtitle track is a text type.
1949 *
1950 * @param player locked player instance
1951 * @param scale factor in the range [10;500] (default: 100)
1952 */
1953VLC_API void
1954vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale);
1955
1956/**
1957 * Get the subtitle text scaling factor
1958 *
1959 * @param player locked player instance
1960 * @return scale factor
1961 */
1962VLC_API unsigned
1964
1965/** @} vlc_player__tracks */
1966
1967/**
1968 * @defgroup vlc_player__tracks_sync Tracks synchronisation (delay)
1969 * @{
1970 */
1971
1972/**
1973 * Get the delay of an ES category for the current media
1974 *
1975 * @see vlc_player_cbs.on_category_delay_changed
1976 *
1977 * @param player locked player instance
1978 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1979 * @return a valid delay or 0
1980 */
1983
1984/**
1985 * Set the delay of one category for the current media
1986 *
1987 * @note A successful call will trigger the
1988 * vlc_player_cbs.on_category_delay_changed event.
1989 *
1990 * @warning This has no effect on tracks where the delay was set by
1991 * vlc_player_SetEsIdDelay()
1992 *
1993 * @param player locked player instance
1994 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1995 * @param delay a valid time
1996 * @param whence absolute or relative
1997 * @return VLC_SUCCESS or VLC_EGENERIC if the category is not handled
1998 */
1999VLC_API int
2001 vlc_tick_t delay, enum vlc_player_whence whence);
2002
2003/**
2004 * Get the delay of a track
2005 *
2006 * @see vlc_player_cbs.on_track_delay_changed
2007 *
2008 * @param player locked player instance
2009 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
2010 * vlc_player_GetTrackAt())
2011 * @return a valid delay or INT64_MAX is no delay is set for this track
2012 */
2015
2016/**
2017 * Set the delay of one track
2018 *
2019 * @note A successful call will trigger the
2020 * vlc_player_cbs.on_track_delay_changed event.
2021 *
2022 * @warning Setting the delay of one specific track will override previous and
2023 * future changes of delay made by vlc_player_SetCategoryDelay()
2024 *
2025 * @param player locked player instance
2026 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
2027 * vlc_player_GetTrackAt())
2028 * @param delay a valid time or INT64_MAX to use default category delay
2029 * @param whence absolute or relative
2030 * @return VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not
2031 * handled (VIDEO_ES not supported yet)
2032 */
2033VLC_API int
2035 vlc_tick_t delay, enum vlc_player_whence whence);
2036
2037/**
2038 * Helper to get the audio delay
2039 */
2040static inline vlc_tick_t
2043 return vlc_player_GetCategoryDelay(player, AUDIO_ES);
2044}
2045
2046/**
2047 * Helper to set the audio delay
2048 */
2049static inline void
2052
2053{
2054 vlc_player_SetCategoryDelay(player, AUDIO_ES, delay, whence);
2055}
2056
2057/**
2058 * Helper to get the audio delay
2059 */
2060static inline vlc_tick_t
2063 return vlc_player_GetCategoryDelay(player, VIDEO_ES);
2064}
2065
2066/**
2067 * Helper to set the audio delay
2068 */
2069static inline void
2072
2073{
2074 vlc_player_SetCategoryDelay(player, VIDEO_ES, delay, whence);
2075}
2076
2077/**
2078 * Helper to get the subtitle delay
2079 */
2080static inline vlc_tick_t
2083 return vlc_player_GetCategoryDelay(player, SPU_ES);
2084}
2085
2086/**
2087 * Helper to set the subtitle delay
2088 */
2089static inline void
2092{
2093 vlc_player_SetCategoryDelay(player, SPU_ES, delay, whence);
2094}
2095
2096/**
2097 * Set the associated subtitle FPS
2098 *
2099 * In order to correct the rate of the associated media according to this FPS
2100 * and the media video FPS.
2101 *
2102 * @note A successful call will trigger the
2103 * vlc_player_cbs.on_associated_subs_fps_changed event.
2104 *
2105 * @warning this function will change the rate of all external subtitle files
2106 * associated with the current media.
2107 *
2108 * @param player locked player instance
2109 * @param fps FPS of the subtitle file
2110 */
2111VLC_API void
2113
2114/**
2115 * Get the associated subtitle FPS
2116 *
2117 * @param player locked player instance
2118 * @return fps
2119 */
2120VLC_API float
2122
2123/** @} vlc_player__tracks_sync */
2124
2125/**
2126 * @defgroup vlc_player__teletext Teletext control
2127 * @{
2128 */
2129
2130/**
2131 * Check if the media has a teletext menu
2132 *
2133 * @see vlc_player_cbs.on_teletext_menu_changed
2134 *
2135 * @param player locked player instance
2136 * @return true if the media has a teletext menu
2137 */
2138VLC_API bool
2140
2141/**
2142 * Enable or disable teletext
2143 *
2144 * This function has an effect only if the player has a teletext menu.
2145 *
2146 * @note A successful call will trigger the
2147 * vlc_player_cbs.on_teletext_enabled_changed event.
2148 *
2149 * @param player locked player instance
2150 * @param enabled true to enable
2151 */
2152VLC_API void
2153vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled);
2154
2155/**
2156 * Check if teletext is enabled
2157 *
2158 * @see vlc_player_cbs.on_teletext_enabled_changed
2159 *
2160 * @param player locked player instance
2161 */
2162VLC_API bool
2164
2165/**
2166 * Select a teletext page or do an action from a key
2167 *
2168 * This function has an effect only if the player has a teletext menu.
2169 *
2170 * @note Page keys can be the following: @ref VLC_PLAYER_TELETEXT_KEY_RED,
2171 * @ref VLC_PLAYER_TELETEXT_KEY_GREEN, @ref VLC_PLAYER_TELETEXT_KEY_YELLOW,
2172 * @ref VLC_PLAYER_TELETEXT_KEY_BLUE or @ref VLC_PLAYER_TELETEXT_KEY_INDEX.
2173
2174 * @note A successful call will trigger the
2175 * vlc_player_cbs.on_teletext_page_changed event.
2176 *
2177 * @param player locked player instance
2178 * @param page a page in the range ]0;888] or a valid key
2179 */
2180VLC_API void
2181vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page);
2182
2183/**
2184 * Get the current teletext page
2185 *
2186 * @see vlc_player_cbs.on_teletext_page_changed
2187 *
2188 * @param player locked player instance
2189 */
2190VLC_API unsigned
2192
2193/**
2194 * Enable or disable teletext transparency
2195 *
2196 * This function has an effect only if the player has a teletext menu.
2197
2198 * @note A successful call will trigger the
2199 * vlc_player_cbs.on_teletext_transparency_changed event.
2200 *
2201 * @param player locked player instance
2202 * @param enabled true to enable
2203 */
2204VLC_API void
2206
2207/**
2208 * Check if teletext is transparent
2209 *
2210 * @param player locked player instance
2211 */
2212VLC_API bool
2214
2215/** @} vlc_player__teletext */
2216
2217/**
2218 * @defgroup vlc_player__renderer External renderer control
2219 * @{
2220 */
2221
2222/**
2223 * Set the renderer
2224 *
2225 * Valid for the current media and all future ones.
2226 *
2227 * @note A successful call will trigger the vlc_player_cbs.on_renderer_changed
2228 * event.
2229 *
2230 * @param player locked player instance
2231 * @param renderer a valid renderer item or NULL (to disable it), the item will
2232 * be held by the player
2233 */
2234VLC_API void
2236
2237/**
2238 * Get the renderer
2239 *
2240 * @see vlc_player_cbs.on_renderer_changed
2241 *
2242 * @param player locked player instance
2243 * @return the renderer item set by vlc_player_SetRenderer()
2244 */
2247
2248/** @} vlc_player__renderer */
2249
2250/**
2251 * @defgroup vlc_player__metadata Metadata callbacks
2252 * @{
2253 */
2254
2255/**
2256 * Player metadata listener opaque structure.
2257 *
2258 * This opaque structure is returned by vlc_player_AddMetadataListener() and
2259 * can be used to remove the listener via
2260 * vlc_player_RemoveMetadataListener().
2261 */
2264/**
2265 * Player metadata option
2266 */
2269 /**
2270 * Ask for momentary loudness measurement
2271 *
2272 * Very low CPU usage.
2273 * @see vlc_player_metadata_cbs.on_momentary_loudness_changed
2274 */
2277 /**
2278 * Ask for all loudness measurements
2279 *
2280 * High CPU usage.
2281 * @see vlc_player_metadata_cbs.on_loudness_changed
2282 */
2285
2286/**
2287 * Player metadata callbacks
2288 *
2289 * Can be registered with vlc_player_AddMetadataListener().
2290 *
2291 * @warning To avoid deadlocks, users should never call vlc_player_t functions
2292 * from these callbacks.
2293 */
2296 /**
2297 * Called when the momentary loudness measurement have changed
2298 *
2299 * @see VLC_PLAYER_METADATA_LOUDNESS_MOMEMTARY
2300 *
2301 * Only sent when audio is playing, approximately every 400ms (but can be
2302 * higher, depending on the input sample size).
2303 *
2304 * @param date Absolute date of the measurement. It is most likely in the
2305 * future (0 to 2seconds) depending on the audio output buffer size.
2306 * @param momentary_loudness Momentary loudness
2307 * @param data opaque pointer set by vlc_player_AddMetadataListener()
2308 */
2310 double momentary_loudness,
2311 void *data);
2312
2313 /**
2314 * Called when loudness measurements have changed
2315 *
2316 * @see VLC_PLAYER_METADATA_LOUDNESS_FULL
2317 *
2318 * Only sent when audio is playing, approximately every 400ms (but can be
2319 * higher, depending on the input sample size).
2320 *
2321 * @param date Absolute date of the measurement. It is most likely in the
2322 * future (0 to 2seconds) depending on the audio output buffer size.
2323 * @param loudness loudness measurement
2324 * @param data opaque pointer set by vlc_player_AddMetadataListener()
2325 */
2326 void (*on_loudness_changed)(vlc_tick_t date,
2327 const struct vlc_audio_loudness *loudness,
2328 void *data);
2329};
2330
2331/**
2332 * Add a metadata listener
2333 *
2334 * @note Every registered loudness meter need to be removed by the caller with
2335 * vlc_player_RemoveMetadataListener().
2336 *
2337 * @param player locked player instance
2338 * @param option select which metadata to listen
2339 * @param cbs pointer to a vlc_player_metadata_cbs union, the
2340 * structure must be valid during the lifetime of the player
2341 * @param cbs_data opaque pointer used by the callbacks
2342 * @return a valid listener id, or NULL in case of error (plugin missing)
2343 */
2346 enum vlc_player_metadata_option option,
2347 const union vlc_player_metadata_cbs *cbs,
2348 void *cbs_data);
2349
2350/**
2351 * Remove a metadata listener
2352 *
2353 * @param player player instance
2354 * @param listener_id listener id returned by vlc_player_AddMetadataListener()
2355 */
2356VLC_API void
2358 vlc_player_metadata_listener_id *listener_id);
2359
2360
2361/** @} vlc_player__metadata */
2362
2363/**
2364 * @defgroup vlc_player__aout Audio output control
2365 * @{
2366 */
2367
2368/**
2369 * Player aout listener opaque structure.
2370 *
2371 * This opaque structure is returned by vlc_player_aout_AddListener() and can
2372 * be used to remove the listener via vlc_player_aout_RemoveListener().
2373 */
2376/**
2377 * Player aout callbacks
2378 *
2379 * Can be registered with vlc_player_aout_AddListener().
2380 *
2381 * @warning To avoid deadlocks, users should never call audio_output_t and
2382 * vlc_player_t functions from these callbacks.
2383 */
2386 /**
2387 * Called when the volume has changed
2388 *
2389 * @see vlc_player_aout_SetVolume()
2390 *
2391 * @param aout the main aout of the player
2392 * @param new_volume volume in the range [0;2.f]
2393 * @param data opaque pointer set by vlc_player_aout_AddListener()
2394 */
2395 void (*on_volume_changed)(audio_output_t *aout, float new_volume,
2396 void *data);
2397
2398 /**
2399 * Called when the mute state has changed
2400 *
2401 * @see vlc_player_aout_Mute()
2402 *
2403 * @param aout the main aout of the player
2404 * @param new_mute true if muted
2405 * @param data opaque pointer set by vlc_player_aout_AddListener()
2406 */
2407 void (*on_mute_changed)(audio_output_t *aout, bool new_muted,
2408 void *data);
2409
2410 /**
2411 * Called when the audio device has changed
2412 *
2413 * @param aout the main aout of the player
2414 * @param device the device name
2415 * @param data opaque pointer set by vlc_player_aout_AddListener()
2416 */
2417 void (*on_device_changed)(audio_output_t *aout, const char *device,
2418 void *data);
2419};
2420
2421/**
2422 * Get the audio output
2423 *
2424 * @warning The returned pointer must be released with aout_Release().
2425 *
2426 * @param player player instance
2427 * @return a valid audio_output_t * or NULL (if there is no aouts)
2428 */
2431
2432/**
2433 * Reset the main audio output
2434 *
2435 * @warning The main aout can only by reset if it is not currently used by any
2436 * decoders (before any play).
2437 *
2438 * @param player player instance
2439 */
2440VLC_API void
2442
2443/**
2444 * Add a listener callback for audio output events
2445 *
2446 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2447 * functions.
2448 * @note Every registered callbacks need to be removed by the caller with
2449 * vlc_player_aout_RemoveListener().
2450 *
2451 * @param player player instance
2452 * @param cbs pointer to a vlc_player_aout_cbs structure, the structure must be
2453 * valid during the lifetime of the player
2454 * @param cbs_data opaque pointer used by the callbacks
2455 * @return a valid listener id, or NULL in case of allocation error
2456 */
2459 const struct vlc_player_aout_cbs *cbs,
2460 void *cbs_data);
2461
2462/**
2463 * Remove a aout listener callback
2464 *
2465 * @param player player instance
2466 * @param listener_id listener id returned by vlc_player_aout_AddListener()
2467 */
2468VLC_API void
2470 vlc_player_aout_listener_id *listener_id);
2471
2472/**
2473 * Get the audio volume
2474 *
2475 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2476 * functions.
2477 *
2478 * @see vlc_player_aout_cbs.on_volume_changed
2479 *
2480 * @param player player instance
2481 * @return volume in the range [0;2.f] or -1.f if there is no audio outputs
2482 * (independent of mute)
2483 */
2484VLC_API float
2486
2487/**
2488 * Set the audio volume
2489 *
2490 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2491 * functions.
2492 *
2493 * @note A successful call will trigger the
2494 * vlc_player_vout_cbs.on_volume_changed event.
2495 *
2496 * @param player player instance
2497 * @param volume volume in the range [0;2.f]
2498 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2499 */
2500VLC_API int
2501vlc_player_aout_SetVolume(vlc_player_t *player, float volume);
2502
2503/**
2504 * Increment the audio volume
2505 *
2506 * @see vlc_player_aout_SetVolume()
2507 *
2508 * @param player player instance
2509 * @param steps number of "volume-step"
2510 * @param result pointer to store the resulting volume (can be NULL)
2511 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2512 */
2513VLC_API int
2514vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result);
2515
2516/**
2517 * Helper to decrement the audio volume
2518 */
2519static inline int
2520vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
2522 return vlc_player_aout_IncrementVolume(player, -steps, result);
2523}
2524
2525/**
2526 * Check if the audio output is muted
2527 *
2528 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2529 * functions.
2530 *
2531 * @see vlc_player_aout_cbs.on_mute_changed
2532 *
2533 * @param player player instance
2534 * @return 0 if not muted, 1 if muted, -1 if there is no audio outputs
2535 */
2536VLC_API int
2538
2539/**
2540 * Mute or unmute the audio output
2541 *
2542 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2543 * functions.
2544 *
2545 * @note A successful call will trigger the
2546 * vlc_player_aout_cbs.on_mute_changed event.
2547 *
2548 * @param player player instance
2549 * @param mute true to mute
2550 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2551 */
2552VLC_API int
2553vlc_player_aout_Mute(vlc_player_t *player, bool mute);
2554
2555/**
2556 * Helper to toggle the mute state
2557 */
2558static inline int
2561 return vlc_player_aout_Mute(player,
2562 !vlc_player_aout_IsMuted(player));
2563}
2564
2565/**
2566 * Enable or disable an audio filter
2567 *
2568 * @see aout_EnableFilter()
2569 *
2570 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2571 */
2572VLC_API int
2573vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
2574
2575/** @} vlc_player__aout */
2576
2577/**
2578 * @defgroup vlc_player__vout Video output control
2579 * @{
2580 */
2581
2582/**
2583 * Player vout listener opaque structure.
2584 *
2585 * This opaque structure is returned by vlc_player_vout_AddListener() and can
2586 * be used to remove the listener via vlc_player_vout_RemoveListener().
2587 */
2590/**
2591 * action of vlc_player_cbs.on_vout_changed callback
2592 */
2599/**
2600 * Player vout callbacks
2601 *
2602 * Can be registered with vlc_player_vout_AddListener().
2603 *
2604 * @note The state changed from the callbacks can be either applied on the
2605 * player (and all future video outputs), or on a specified video output. The
2606 * state is applied on the player when the vout argument is NULL.
2607 *
2608 * @warning To avoid deadlocks, users should never call vout_thread_t and
2609 * vlc_player_t functions from these callbacks.
2610 */
2613 /**
2614 * Called when the player and/or vout fullscreen state has changed
2615 *
2616 * @see vlc_player_vout_SetFullscreen()
2617 *
2618 * @param vout cf. vlc_player_vout_cbs note
2619 * @param enabled true when fullscreen is enabled
2620 * @param data opaque pointer set by vlc_player_vout_AddListener()
2621 */
2622 void (*on_fullscreen_changed)(vout_thread_t *vout, bool enabled,
2623 void *data);
2624
2625 /**
2626 * Called when the player and/or vout wallpaper mode has changed
2627 *
2628 * @see vlc_player_vout_SetWallpaperModeEnabled()
2629 *
2630 * @param vout cf. vlc_player_vout_cbs note
2631 * @param enabled true when wallpaper mode is enabled
2632 * @param data opaque pointer set by vlc_player_vout_AddListener()
2633 */
2634 void (*on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled,
2635 void *data);
2636};
2637
2638
2639/**
2640 * Get and hold the main video output
2641 *
2642 * @warning the returned vout_thread_t * must be released with vout_Release().
2643 * @see vlc_player_cbs.on_vout_changed
2644 *
2645 * @note The player is guaranteed to always hold one valid vout. Only vout
2646 * variables can be changed from this instance. The vout returned before
2647 * playback is not necessarily the same one that will be used for playback.
2648 *
2649 * @param player player instance
2650 * @return a valid vout_thread_t * or NULL, cf. warning
2651 */
2654
2655/**
2656 * Get and hold the list of video output
2657 *
2658 * @warning All vout_thread_t * element of the array must be released with
2659 * vout_Release(). The returned array must be freed.
2660 *
2661 * @see vlc_player_cbs.on_vout_changed
2662 *
2663 * @param player player instance
2664 * @param count valid pointer to store the array count
2665 * @return a array of vout_thread_t * or NULL, cf. warning
2666 */
2669
2670/**
2671 * Add a listener callback for video output events
2672 *
2673 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2674 * functions.
2675 * @note Every registered callbacks need to be removed by the caller with
2676 * vlc_player_vout_RemoveListener().
2677 *
2678 * @param player player instance
2679 * @param cbs pointer to a vlc_player_vout_cbs structure, the structure must be
2680 * valid during the lifetime of the player
2681 * @param cbs_data opaque pointer used by the callbacks
2682 * @return a valid listener id, or NULL in case of allocation error
2683 */
2686 const struct vlc_player_vout_cbs *cbs,
2687 void *cbs_data);
2688
2689/**
2690 * Remove a vout listener callback
2691 *
2692 * @param player player instance
2693 * @param listener_id listener id returned by vlc_player_vout_AddListener()
2694 */
2695VLC_API void
2697 vlc_player_vout_listener_id *listener_id);
2698
2699/**
2700 * Check if the player is fullscreen
2701 *
2702 * @warning The fullscreen state of the player and all vouts can be different.
2703 *
2704 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2705 * functions.
2706 *
2707 * @see vlc_player_vout_cbs.on_fullscreen_changed
2708 *
2709 * @param player player instance
2710 * @return true if the player is fullscreen
2711 */
2712VLC_API bool
2714
2715/**
2716 * Enable or disable the player fullscreen state
2717 *
2718 * This will have an effect on all current and future vouts.
2719 *
2720 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2721 * functions.
2722 * @note A successful call will trigger the
2723 * vlc_player_vout_cbs.on_fullscreen_changed event.
2724 *
2725 * @param player player instance
2726 * @param enabled true to enable fullscreen
2727 */
2728VLC_API void
2729vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled);
2730
2731/**
2732 * Helper to toggle the player fullscreen state
2733 */
2734static inline void
2739}
2740
2741/**
2742 * Check if the player has wallpaper-mode enaled
2743 *
2744 * @warning The wallpaper-mode state of the player and all vouts can be
2745 * different.
2746 *
2747 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2748 * functions.
2749 *
2750 * @see vlc_player_vout_cbs.on_wallpaper_mode_changed
2751 *
2752 * @param player player instance
2753 * @return true if the player is fullscreen
2754 */
2755VLC_API bool
2757
2758/**
2759 * Enable or disable the player wallpaper-mode
2760 *
2761 * This will have an effect on all current and future vouts.
2762 *
2763 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2764 * functions.
2765 * @note A successful call will trigger the
2766 * vlc_player_vout_cbs.on_wallpaper_mode_changed event.
2767 *
2768 * @param player player instance
2769 * @param enabled true to enable wallpaper-mode
2770 */
2771VLC_API void
2773
2774/**
2775 * Helper to toggle the player wallpaper-mode state
2776 */
2777static inline void
2784/**
2785 * Take a snapshot on all vouts
2786 *
2787 * @param player player instance
2788 */
2789VLC_API void
2791
2792/**
2793 * Display an OSD message on all vouts
2794 *
2795 * @param player player instance
2796 * @param fmt format string
2797 */
2798VLC_API void
2799vlc_player_osd_Message(vlc_player_t *player, const char *fmt, ...);
2800
2801/** @} vlc_player__vout */
2802
2803/**
2804 * @defgroup vlc_player__events Player events
2805 * @{
2806 */
2807
2808/**
2809 * Player listener opaque structure.
2810 *
2811 * This opaque structure is returned by vlc_player_AddListener() and can be
2812 * used to remove the listener via vlc_player_RemoveListener().
2813 */
2816/**
2817 * Action of vlc_player_cbs.on_track_list_changed,
2818 * vlc_player_cbs.on_program_list_changed callbacks
2819 */
2827/**
2828 * Player callbacks
2829 *
2830 * Can be registered with vlc_player_AddListener().
2831 *
2832 * All callbacks are called with the player locked (cf. vlc_player_Lock()) and
2833 * from any threads (and even synchronously from a vlc_player function in some
2834 * cases). It is safe to call any vlc_player functions from these callbacks
2835 * except vlc_player_Delete().
2836 *
2837 * @warning To avoid deadlocks, users should never call vlc_player functions
2838 * with an external mutex locked and lock this same mutex from a player
2839 * callback.
2840 */
2841struct vlc_player_cbs
2843 /**
2844 * Called when the current media has changed
2845 *
2846 * @note This can be called from the PLAYING state (when the player plays
2847 * the next media internally) or from the STOPPED state (from
2848 * vlc_player_SetCurrentMedia() or from an internal transition).
2849 *
2850 * The user could set the next media via vlc_player_SetNextMedia() from
2851 * the current callback or anytime before the current media is stopped.
2852
2853 * @see vlc_player_SetCurrentMedia()
2854 *
2855 * @param player locked player instance
2856 * @param new_media new media currently played or NULL (when there is no
2857 * more media to play)
2858 * @param data opaque pointer set by vlc_player_AddListener()
2859 */
2860 void (*on_current_media_changed)(vlc_player_t *player,
2861 input_item_t *new_media, void *data);
2862
2863 /**
2864 * Called when the player state has changed
2865 *
2866 * @see vlc_player_state
2867 *
2868 * @param player locked player instance
2869 * @param new_state new player state
2870 * @param data opaque pointer set by vlc_player_AddListener()
2871 */
2872 void (*on_state_changed)(vlc_player_t *player,
2873 enum vlc_player_state new_state, void *data);
2874
2875 /**
2876 * Called when a media triggered an error
2877 *
2878 * Can be called from any states. When it happens the player will stop
2879 * itself. It is safe to play an other media or event restart the player
2880 * (This will reset the error state).
2881 *
2882 * @param player locked player instance
2883 * @param error player error
2884 * @param data opaque pointer set by vlc_player_AddListener()
2885 */
2886 void (*on_error_changed)(vlc_player_t *player,
2887 enum vlc_player_error error, void *data);
2888
2889 /**
2890 * Called when the player buffering (or cache) has changed
2891 *
2892 * This event is always called with the 0 and 1 values before a playback
2893 * (in case of success). Values in between depends on the media type.
2894 *
2895 * @param player locked player instance
2896 * @param new_buffering buffering in the range [0:1]
2897 * @param data opaque pointer set by vlc_player_AddListener()
2898 */
2899 void (*on_buffering_changed)(vlc_player_t *player,
2900 float new_buffering, void *data);
2901
2902 /**
2903 * Called when the player rate has changed
2904 *
2905 * Triggered by vlc_player_ChangeRate(), not sent when the media starts
2906 * with the default rate (1.f)
2907 *
2908 * @param player locked player instance
2909 * @param new_rate player
2910 * @param data opaque pointer set by vlc_player_AddListener()
2911 */
2912 void (*on_rate_changed)(vlc_player_t *player,
2913 float new_rate, void *data);
2914
2915 /**
2916 * Called when the media capabilities has changed
2917 *
2918 * Always called when the media is opening or stopping.
2919 * Can be called during playback.
2920 *
2921 * @param player locked player instance
2922 * @param old_caps old player capabilities
2923 * @param new_caps new player capabilities
2924 * @param data opaque pointer set by vlc_player_AddListener()
2925 */
2926 void (*on_capabilities_changed)(vlc_player_t *player,
2927 int old_caps, int new_caps, void *data);
2928
2929 /**
2930 * Called when the player position has changed
2931 *
2932 * @note A started and playing media doesn't have necessarily a valid time.
2933 *
2934 * @param player locked player instance
2935 * @param new_time a valid time or VLC_TICK_INVALID
2936 * @param new_pos a valid position
2937 * @param data opaque pointer set by vlc_player_AddListener()
2938 */
2939 void (*on_position_changed)(vlc_player_t *player,
2940 vlc_tick_t new_time, double new_pos, void *data);
2941
2942 /**
2943 * Called when the media length has changed
2944 *
2945 * May be called when the media is opening or during playback.
2946 *
2947 * @note A started and playing media doesn't have necessarily a valid length.
2948 *
2949 * @param player locked player instance
2950 * @param new_length a valid time or VLC_TICK_INVALID
2951 * @param data opaque pointer set by vlc_player_AddListener()
2952 */
2953 void (*on_length_changed)(vlc_player_t *player,
2954 vlc_tick_t new_length, void *data);
2955
2956 /**
2957 * Called when a track is added, removed, or updated
2958 *
2959 * @note The track is only valid from this callback context. Users should
2960 * duplicate this track via vlc_player_track_Dup() if they want to use it
2961 * from an other context.
2962 *
2963 * @param player locked player instance
2964 * @param action added, removed or updated
2965 * @param track valid track
2966 * @param data opaque pointer set by vlc_player_AddListener()
2967 */
2968 void (*on_track_list_changed)(vlc_player_t *player,
2970 const struct vlc_player_track *track, void *data);
2971
2972 /**
2973 * Called when a new track is selected and/or unselected
2974 *
2975 * @note This event can be called with both unselected_id and selected_id
2976 * valid. This mean that a new track is replacing the old one.
2977 *
2978 * @param player locked player instance
2979 * @param unselected_id valid track id or NULL (when nothing is unselected)
2980 * @param selected_id valid track id or NULL (when nothing is selected)
2981 * @param data opaque pointer set by vlc_player_AddListener()
2982 */
2984 vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data);
2985
2986 /**
2987 * Called when a track delay has changed
2988 *
2989 * @param player locked player instance
2990 * @param es_id valid track id
2991 * @param delay a valid delay or INT64_MAX if the delay of this track is
2992 * canceled
2993 */
2994 void (*on_track_delay_changed)(vlc_player_t *player,
2995 vlc_es_id_t *es_id, vlc_tick_t delay, void *data);
2996
2997 /**
2998 * Called when a new program is added, removed or updated
2999 *
3000 * @note The program is only valid from this callback context. Users should
3001 * duplicate this program via vlc_player_program_Dup() if they want to use
3002 * it from an other context.
3003 *
3004 * @param player locked player instance
3005 * @param action added, removed or updated
3006 * @param prgm valid program
3007 * @param data opaque pointer set by vlc_player_AddListener()
3008 */
3009 void (*on_program_list_changed)(vlc_player_t *player,
3011 const struct vlc_player_program *prgm, void *data);
3012
3013 /**
3014 * Called when a new program is selected and/or unselected
3015 *
3016 * @note This event can be called with both unselected_id and selected_id
3017 * valid. This mean that a new program is replacing the old one.
3018 *
3019 * @param player locked player instance
3020 * @param unselected_id valid program id or -1 (when nothing is unselected)
3021 * @param selected_id valid program id or -1 (when nothing is selected)
3022 * @param data opaque pointer set by vlc_player_AddListener()
3023 */
3025 int unselected_id, int selected_id, void *data);
3026
3027 /**
3028 * Called when the media titles has changed
3029 *
3030 * This event is not called when the opening media doesn't have any titles.
3031 * This title list and all its elements are constant. If an element is to
3032 * be updated, a new list will be sent from this callback.
3033 *
3034 * @note Users should hold this list with vlc_player_title_list_Hold() if
3035 * they want to use it from an other context.
3036 *
3037 * @param player locked player instance
3038 * @param titles valid title list or NULL
3039 * @param data opaque pointer set by vlc_player_AddListener()
3040 */
3041 void (*on_titles_changed)(vlc_player_t *player,
3042 vlc_player_title_list *titles, void *data);
3043
3044 /**
3045 * Called when a new title is selected
3046 *
3047 * There are no events when a title is unselected. Titles are automatically
3048 * unselected when the title list changes. Titles and indexes are always
3049 * valid inside the vlc_player_title_list sent by
3050 * vlc_player_cbs.on_titles_changed.
3051 *
3052 * @param player locked player instance
3053 * @param new_title new selected title
3054 * @param new_idx index of this title
3055 * @param data opaque pointer set by vlc_player_AddListener()
3056 */
3058 const struct vlc_player_title *new_title, size_t new_idx, void *data);
3059
3060 /**
3061 * Called when a new chapter is selected
3062 *
3063 * There are no events when a chapter is unselected. Chapters are
3064 * automatically unselected when the title list changes. Titles, chapters
3065 * and indexes are always valid inside the vlc_player_title_list sent by
3066 * vlc_player_cbs.on_titles_changed.
3067 *
3068 * @param player locked player instance
3069 * @param title selected title
3070 * @param title_idx selected title index
3071 * @param chapter new selected chapter
3072 * @param chapter_idx new selected chapter index
3073 * @param data opaque pointer set by vlc_player_AddListener()
3074 */
3076 const struct vlc_player_title *title, size_t title_idx,
3077 const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx,
3078 void *data);
3079
3080 /**
3081 * Called when the media has a teletext menu
3082 *
3083 * @param player locked player instance
3084 * @param has_teletext_menu true if the media has a teletext menu
3085 * @param data opaque pointer set by vlc_player_AddListener()
3086 */
3087 void (*on_teletext_menu_changed)(vlc_player_t *player,
3088 bool has_teletext_menu, void *data);
3089
3090 /**
3091 * Called when teletext is enabled or disabled
3092 *
3093 * @see vlc_player_SetTeletextEnabled()
3094 *
3095 * @param player locked player instance
3096 * @param enabled true if teletext is enabled
3097 * @param data opaque pointer set by vlc_player_AddListener()
3098 */
3100 bool enabled, void *data);
3101
3102 /**
3103 * Called when the teletext page has changed
3104 *
3105 * @see vlc_player_SelectTeletextPage()
3106 *
3107 * @param player locked player instance
3108 * @param new_page page in the range ]0;888]
3109 * @param data opaque pointer set by vlc_player_AddListener()
3110 */
3111 void (*on_teletext_page_changed)(vlc_player_t *player,
3112 unsigned new_page, void *data);
3113
3114 /**
3115 * Called when the teletext transparency has changed
3116 *
3117 * @see vlc_player_SetTeletextTransparency()
3118 *
3119 * @param player locked player instance
3120 * @param enabled true is the teletext overlay is transparent
3121 * @param data opaque pointer set by vlc_player_AddListener()
3122 */
3124 bool enabled, void *data);
3125
3126 /**
3127 * Called when the player category delay has changed for the current media
3128 *
3129 * @see vlc_player_SetCategoryDelay()
3130 *
3131 * @param player locked player instance
3132 * @param cat AUDIO_ES or SPU_ES
3133 * @param new_delay audio delay
3134 * @param data opaque pointer set by vlc_player_AddListener()
3135 */
3137 enum es_format_category_e cat, vlc_tick_t new_delay, void *data);
3138
3139 /**
3140 * Called when associated subtitle has changed
3141 *
3142 * @see vlc_player_SetAssociatedSubsFPS()
3143 *
3144 * @param player locked player instance
3145 * @param sub_fps subtitle fps
3146 * @param data opaque pointer set by vlc_player_AddListener()
3147 */
3149 float subs_fps, void *data);
3150
3151 /**
3152 * Called when a new renderer item is set
3153 *
3154 * @see vlc_player_SetRenderer()
3155 *
3156 * @param player locked player instance
3157 * @param new_item a valid renderer item or NULL (if unset)
3158 * @param data opaque pointer set by vlc_player_AddListener()
3159 */
3160 void (*on_renderer_changed)(vlc_player_t *player,
3161 vlc_renderer_item_t *new_item, void *data);
3162
3163 /**
3164 * Called when the player recording state has changed
3165 *
3166 * @see vlc_player_SetRecordingEnabled()
3167 *
3168 * @param player locked player instance
3169 * @param recording true if recording is enabled
3170 * @param data opaque pointer set by vlc_player_AddListener()
3171 */
3172 void (*on_recording_changed)(vlc_player_t *player,
3173 bool recording, void *data);
3174
3175 /**
3176 * Called when the media signal has changed
3177 *
3178 * @param player locked player instance
3179 * @param new_quality signal quality
3180 * @param new_strength signal strength,
3181 * @param data opaque pointer set by vlc_player_AddListener()
3182 */
3183 void (*on_signal_changed)(vlc_player_t *player,
3184 float quality, float strength, void *data);
3185
3186 /**
3187 * Called when the player has new statisics
3188 *
3189 * @note The stats structure is only valid from this callback context. It
3190 * can be copied in order to use it from an other context.
3191 *
3192 * @param player locked player instance
3193 * @param stats valid stats, only valid from this context
3194 * @param data opaque pointer set by vlc_player_AddListener()
3195 */
3196 void (*on_statistics_changed)(vlc_player_t *player,
3197 const struct input_stats_t *stats, void *data);
3198
3199 /**
3200 * Called when the A to B loop has changed
3201 *
3202 * @see vlc_player_SetAtoBLoop()
3203 *
3204 * @param player locked player instance
3205 * @param state A, when only A is set, B when both A and B are set, None by
3206 * default
3207 * @param time valid time or VLC_TICK_INVALID of the current state
3208 * @param pos valid pos of the current state
3209 * @param data opaque pointer set by vlc_player_AddListener()
3210 */
3211 void (*on_atobloop_changed)(vlc_player_t *player,
3212 enum vlc_player_abloop new_state, vlc_tick_t time, double pos,
3213 void *data);
3214
3215 /**
3216 * Called when the media meta and/or info has changed
3217 *
3218 * @param player locked player instance
3219 * @param media current media
3220 * @param data opaque pointer set by vlc_player_AddListener()
3221 */
3222 void (*on_media_meta_changed)(vlc_player_t *player,
3223 input_item_t *media, void *data);
3224
3225 /**
3226 * Called when media epg has changed
3227 *
3228 * @param player locked player instance
3229 * @param media current media
3230 * @param data opaque pointer set by vlc_player_AddListener()
3231 */
3232 void (*on_media_epg_changed)(vlc_player_t *player,
3233 input_item_t *media, void *data);
3234
3235 /**
3236 * Called when the media has new subitems
3237 *
3238 * @param player locked player instance
3239 * @param media current media
3240 * @param new_subitems node representing all media subitems
3241 * @param data opaque pointer set by vlc_player_AddListener()
3242 */
3244 input_item_t *media, const input_item_node_t *new_subitems, void *data);
3245
3246 /**
3247 * Called when new attachments are added to the media
3248 *
3249 * @note It can be called several times for one parse request. The array
3250 * contains only new elements after a second call.
3251 *
3252 * @param player locked player instance
3253 * @param media current media
3254 * @param array valid array containing new elements, should only be used
3255 * within the callback. One and all elements can be held and stored on a
3256 * new variable or new array.
3257 * @param count number of elements in the array
3258 * @param data opaque pointer set by vlc_player_AddListener()
3259 */
3261 input_item_t *media, input_attachment_t *const *array, size_t count,
3262 void *data);
3263
3264 /**
3265 * Called when a vout is started or stopped
3266 *
3267 * @note In case, several media with only one video track are played
3268 * successively, the same vout instance will be started and stopped several
3269 * time.
3270 *
3271 * @param player locked player instance
3272 * @param action started or stopped
3273 * @param vout vout (can't be NULL)
3274 * @param order vout order
3275 * @param es_id the ES id associated with this vout
3276 * @param data opaque pointer set by vlc_player_AddListener()
3277 */
3278 void (*on_vout_changed)(vlc_player_t *player,
3280 enum vlc_vout_order order, vlc_es_id_t *es_id, void *data);
3281
3282 /**
3283 * Called when the player is corked
3284 *
3285 * The player can be corked when the audio output loose focus or when a
3286 * renderer was paused from the outside.
3287 *
3288 * @note called only if pause on cork was not set to true (by
3289 * vlc_player_SetPauseOnCork())
3290 * @note a cork_count higher than 0 means the player is corked. In that
3291 * case, the user should pause the player and release all external resource
3292 * needed by the player. A value higher than 1 mean that the player was
3293 * corked more than one time (for different reasons). A value of 0 means
3294 * the player is no longer corked. In that case, the user could resume the
3295 * player.
3296 *
3297 * @param player locked player instance
3298 * @param cork_count 0 for uncorked, > 0 for corked
3299 * @param data opaque pointer set by vlc_player_AddListener()
3300 */
3301 void (*on_cork_changed)(vlc_player_t *player, unsigned cork_count,
3302 void *data);
3303
3304 /**
3305 * Called to query the user about restoring the previous playback position
3306 *
3307 * If this callback isn't provided, the user won't be asked to restore
3308 * the previous playback position, effectively causing
3309 * VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK to be handled as
3310 * VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
3311 *
3312 * The implementation can react to this callback by calling
3313 * vlc_player_RestorePlaybackPos(), or by discarding the event.
3314 *
3315 * @param player locked player instance
3316 * @param data opaque pointer set by vlc_player_AddListener()
3317 */
3318 void (*on_playback_restore_queried)(vlc_player_t *player, void *data);
3320 /**
3321 * Called when the player will stop the current media.
3322 *
3323 * @note This can be called from the PLAYING state, before the
3324 * player requests the next media, or from the STOPPING state, ie.
3325 * when the player is stopping, or by an internal transition
3326 * (e.g., when the media reaches the end of file or errors out).
3327 *
3328 * @see vlc_player_SetCurrentMedia()
3329 * @see vlc_player_Stop()
3330 *
3331 * @param player locked player instance
3332 * @param current_media media currently stopping
3333 * @param stopping_reason reason why the media is stopping
3334 * @param data opaque pointer set by vlc_player_AddListener()
3335 */
3336 void (*on_stopping_current_media)(vlc_player_t *player, input_item_t *current_media,
3338 void *data);
3339
3340 /**
3341 * Called when the next frame, following a call to
3342 * `vlc_player_NextVideoFrame()`, is about to be displayed.
3343 *
3344 * @see vlc_player_NextVideoFrame()
3345 *
3346 * @note This event is sent just before the frame is sent to the video
3347 * output, use vlc_player_AddTimer() if you need to know exactly when the
3348 * frame is displayed.
3349 *
3350 * @param player locked player instance
3351 * @param status 0 in case of success, -EAGAIN on first call (paused),
3352 * -EBUSY in case of video error, -ENOTSUP if can't pause,
3353 * -EINVAL in case of invalid state
3354 */
3355 void (*on_next_frame_status)(vlc_player_t *player, int status, void *data);
3357 /**
3358 * Called when the previous frame, following a call to
3359 * `vlc_player_PreviousVideoFrame()`, is about to displayed.
3360 *
3361 * @see vlc_player_PreviousVideoFrame()
3362 *
3363 * @note This event is sent just before the frame is sent to the video
3364 * output, use vlc_player_AddTimer() if you need to know exactly when the
3365 * frame is displayed.
3366 *
3367 * @param player locked player instance
3368 * @param status 0 in case of success,
3369 * -EAGAIN on first call (paused) or on first frame,
3370 * -EBUSY in case of video error,
3371 * -ENOTSUP if can't pause/seek/pace,
3372 * -EINVAL in case of invalid state,
3373 * -ERANGE if the player could not seek back
3374 */
3375 void (*on_prev_frame_status)(vlc_player_t *player, int status, void *data);
3377
3378/**
3379 * Add a listener callback
3380 *
3381 * @note Every registered callbacks need to be removed by the caller with
3382 * vlc_player_RemoveListener().
3383 *
3384 * @param player locked player instance
3385 * @param cbs pointer to a vlc_player_cbs structure, the structure must be
3386 * valid during the lifetime of the player
3387 * @param cbs_data opaque pointer used by the callbacks
3388 * @return a valid listener id, or NULL in case of allocation error
3389 */
3392 const struct vlc_player_cbs *cbs, void *cbs_data);
3393
3394/**
3395 * Remove a listener callback
3396 *
3397 * @param player locked player instance
3398 * @param listener_id listener id returned by vlc_player_AddListener()
3399 */
3400VLC_API void
3402 vlc_player_listener_id *listener_id);
3403
3404/** @} vlc_player__events */
3405
3406/**
3407 * @defgroup vlc_player__timer Player timer
3408 * @{
3409 */
3410
3411/**
3412 * Player timer opaque structure.
3413 */
3416/**
3417 * Player timer point
3418 *
3419 * @see vlc_player_timer_cbs.on_update
3420 */
3423 /** Position in the range [0.0f;1.0] */
3424 double position;
3425 /** Rate of the player */
3426 double rate;
3427 /** Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with
3428 * VLC_TICK_0 to get the original value. */
3429 vlc_tick_t ts;
3430 /** Valid length >= VLC_TICK_0 or VLC_TICK_INVALID */
3432 /** if true, length represents the seek range and position is the position
3433 * within that seek_range */
3434 bool live;
3435 /** System date of this record (always valid), this date can be in the
3436 * future or in the past. The special value of INT64_MAX mean that the
3437 * clock was paused when this point was updated. In that case,
3438 * vlc_player_timer_point_Interpolate() will return the current ts/pos of
3439 * this point (there is nothing to interpolate). */
3442
3443/**
3444 * Player smpte timecode
3445 *
3446 * @see vlc_player_timer_smpte_cbs
3447 */
3450 /** Hours [0;n] */
3451 unsigned hours;
3452 /** Minutes [0;59] */
3453 unsigned minutes;
3454 /** Seconds [0;59] */
3455 unsigned seconds;
3456 /** Frame number [0;n] */
3457 unsigned frames;
3458 /** Maximum number of digits needed to display the frame number */
3459 unsigned frame_resolution;
3460 /** True if the source is NTSC 29.97fps or 59.94fps DF */
3461 bool drop_frame;
3463
3464/**
3465 * Player timer callbacks
3466 *
3467 * @see vlc_player_AddTimer
3468 */
3471 /**
3472 * Called when the state or the time changed (mandatory).
3473 *
3474 * Get notified when the time is updated by the input or output source. The
3475 * input source is the 'demux' or the 'access_demux'. The output source are
3476 * audio and video outputs: an update is received each time a video frame
3477 * is displayed or an audio sample is written. The delay between each
3478 * updates may depend on the input and source type (it can be every 5ms,
3479 * 30ms, 1s or 10s...). The user of this timer may need to update the
3480 * position at a higher frequency from its own mainloop via
3481 * vlc_player_timer_point_Interpolate().
3482 *
3483 * @warning The player is not locked from this callback. It is forbidden
3484 * to call any player functions from here.
3485 *
3486 * @param value always valid, the time corresponding to the state
3487 * @param data opaque pointer set by vlc_player_AddTimer()
3488 */
3489 void (*on_update)(const struct vlc_player_timer_point *value, void *data);
3491 /**
3492 * The player timer is paused (can be NULL).
3493 *
3494 * This event is sent when the player is paused or stopping. The player
3495 * user should stop its "interpolate" timer.
3496 *
3497 * @note on_update() can be called when paused for those 2 reasons:
3498 * - playback is resumed (vlc_player_timer_point.system_date is valid)
3499 * - a track, likely video (next-frame) is outputted when paused
3500 * (vlc_player_timer_point.system_date = INT64_MAX)
3501 *
3502 * @warning The player is not locked from this callback. It is forbidden
3503 * to call any player functions from here.
3504 *
3505 * @param system_date system date of this event, not valid when stopped. It
3506 * can be used to interpolate the last updated point to this date in order
3507 * to get the last paused ts/position.
3508 * @param data opaque pointer set by vlc_player_AddTimer()
3509 */
3510 void (*on_paused)(vlc_tick_t system_date, void *data);
3512 /**
3513 * Called when the player is seeking or finished seeking (can be NULL).
3514 *
3515 * @warning The player is not locked from this callback. It is forbidden
3516 * to call any player functions from here.
3517 *
3518 * @note on_update() can be called when seeking. It corresponds to tracks
3519 * updating their points prior to receiving the asynchronous seek event.
3520 * The user could discard them manually.
3521 *
3522 * @param value point of the seek request or NULL when seeking is finished
3523 * @param data opaque pointer set by vlc_player_AddTimer()
3524 */
3525 void (*on_seek)(const struct vlc_player_timer_point *value, void *data);
3527
3528/**
3529 * Player smpte timer callbacks
3530 *
3531 * @see vlc_player_AddSmpteTimer
3532 */
3535 /**
3536 * Called when a new frame is displayed
3537 *
3538 * @warning The player is not locked from this callback. It is forbidden
3539 * to call any player functions from here.
3540 *
3541 * @param tc always valid, the timecode corresponding to the frame just
3542 * displayed
3543 * @param data opaque pointer set by vlc_player_AddTimer()
3544 */
3545 void (*on_update)(const struct vlc_player_timer_smpte_timecode *tc,
3546 void *data);
3547
3548 /**
3549 * The player timer is paused (can be NULL).
3550 *
3551 * @see vlc_player_timer_cbs.on_paused
3552 */
3553 void (*on_paused)(vlc_tick_t system_date, void *data);
3555 /**
3556 * Called when the player is seeking or finished seeking (can be NULL).
3557 *
3558 * @warning The player is not locked from this callback. It is forbidden
3559 * to call any player functions from here.
3560 *
3561 * @warning the value is parameter is a timestamp point and not a timecode,
3562 * as this is an approximation.
3563 *
3564 * @note on_update() can be called when seeking. It corresponds to tracks
3565 * updating their points prior to receiving the asynchronous seek event.
3566 * The user could discard them manually.
3567 *
3568 * @param value point of the seek request or NULL when seeking is finished
3569 * @param data opaque pointer set by vlc_player_AddTimer()
3570 */
3571 void (*on_seek)(const struct vlc_player_timer_point *value, void *data);
3573
3574/**
3575 * Add a timer in order to get times updates
3576 *
3577 * @param player player instance (locked or not)
3578 * @param min_period corresponds to the minimum period between each updates,
3579 * use it to avoid flood from too many source updates, set it to
3580 * VLC_TICK_INVALID to receive all updates.
3581 * @param cbs pointer to a vlc_player_timer_cbs structure, the structure must
3582 * be valid during the lifetime of the player
3583 * @param cbs_data opaque pointer used by the callbacks
3584 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3585 * error
3586 */
3588vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period,
3589 const struct vlc_player_timer_cbs *cbs,
3590 void *cbs_data);
3591
3592/**
3593 * Add a smpte timer in order to get accurate video frame updates
3594 *
3595 * @param player player instance (locked or not)
3596 * @param cbs pointer to a vlc_player_timer_smpte_cbs structure, the structure must
3597 * be valid during the lifetime of the player
3598 * @param cbs_data opaque pointer used by the callbacks
3599 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3600 * error
3601 */
3604 const struct vlc_player_timer_smpte_cbs *cbs,
3605 void *cbs_data);
3606
3607/**
3608 * Remove a player timer
3609 *
3610 * @param player player instance (locked or not)
3611 * @param timer timer created by vlc_player_AddTimer()
3612 */
3613VLC_API void
3615
3616/**
3617 * Interpolate the last timer value to now
3618 *
3619 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3620 * callback
3621 * @param system_now current system date
3622 * @param out_ts pointer where to set the interpolated ts, subtract this time
3623 * with VLC_TICK_0 to get the original value.
3624 * @param out_pos pointer where to set the interpolated position
3625 * @return VLC_SUCCESS in case of success, an error in the interpolated ts is
3626 * negative (could happen during the buffering step)
3627 */
3628VLC_API int
3630 vlc_tick_t system_now,
3631 vlc_tick_t *out_ts, double *out_pos);
3632
3633/**
3634 * Get the date of the next interval
3635 *
3636 * Can be used to setup an UI timer in order to update some widgets at specific
3637 * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3638 * time widget when the media reaches a new second.
3639 *
3640 * @note The media time doesn't necessarily correspond to the system time, that
3641 * is why this function is needed and use the rate of the current point.
3642 *
3643 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3644 * @param system_now current system date
3645 * @param interpolated_ts ts returned by vlc_player_timer_point_Interpolate()
3646 * with the same system now
3647 * @param next_interval next interval
3648 * @return the absolute system date of the next interval
3649 */
3652 vlc_tick_t system_now,
3653 vlc_tick_t interpolated_ts,
3654 vlc_tick_t next_interval);
3655
3656/** @} vlc_player__timer */
3657
3658/** @} vlc_player */
3659
3660#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:2521
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:2560
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:2822
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:1045
void vlc_player_RemoveListener(vlc_player_t *player, vlc_player_listener_id *listener_id)
Remove a listener callback.
Definition player.c:1064
@ VLC_PLAYER_LIST_ADDED
Definition vlc_player.h:2823
@ VLC_PLAYER_LIST_UPDATED
Definition vlc_player.h:2825
@ VLC_PLAYER_LIST_REMOVED
Definition vlc_player.h:2824
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:2100
void vlc_player_SetRepeatCount(vlc_player_t *player, unsigned repeat_count)
Repeat playback when reaching EOF.
Definition player.c:1331
void vlc_player_SetPlayAndPause(vlc_player_t *player, bool play_and_pause)
Pause when reaching EOF.
Definition player.c:1324
void vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled)
Enable or disable pause on cork event.
Definition player.c:1979
void vlc_player_CondWait(vlc_player_t *player, vlc_cond_t *cond)
Wait on a condition variable.
Definition player.c:1038
void vlc_player_Delete(vlc_player_t *player)
Delete a player instance.
Definition player.c:2047
void vlc_player_Unlock(vlc_player_t *player)
Unlock the player.
Definition player.c:1032
void vlc_player_Lock(vlc_player_t *player)
Lock the player.
Definition player.c:1016
vlc_player_lock_type
Player lock type (normal or reentrant).
Definition vlc_player.h:72
struct vlc_player_t vlc_player_t
Player opaque structure.
Definition vlc_player.h:66
void vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused)
Ask to start in a paused state.
Definition player.c:1317
@ 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:2269
@ VLC_PLAYER_METADATA_LOUDNESS_MOMENTARY
Ask for momentary loudness measurement.
Definition vlc_player.h:2276
@ VLC_PLAYER_METADATA_LOUDNESS_FULL
Ask for all loudness measurements.
Definition vlc_player.h:2284
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:1366
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:1417
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:1086
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:1360
vlc_tick_t vlc_player_GetTime(vlc_player_t *player)
Get the time of the current media.
Definition player.c:1481
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:770
void vlc_player_Navigate(vlc_player_t *player, enum vlc_player_nav nav)
Navigate (for DVD/Bluray menus or viewpoint).
Definition player.c:1727
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:1560
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:930
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:1462
int vlc_player_GetCapabilities(vlc_player_t *player)
Get the player capabilities.
Definition player.c:1400
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:758
float vlc_player_GetRate(vlc_player_t *player)
Get the rate of the player.
Definition player.c:1407
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:748
void vlc_player_Pause(vlc_player_t *player)
Pause the playback.
Definition player.c:1354
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:1765
static void vlc_player_SetTimeFast(vlc_player_t *player, vlc_tick_t time)
Helper to set the absolute time fast.
Definition vlc_player.h:780
int vlc_player_Stop(vlc_player_t *player)
Stop the playback of the current media.
Definition player.c:1299
bool vlc_player_IsRecording(vlc_player_t *player)
Check if the playing is recording.
Definition player.c:1775
int vlc_player_Start(vlc_player_t *player)
Start the playback of the current media.
Definition player.c:1229
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:1141
#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:738
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:1149
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:1523
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:1704
void vlc_player_DecrementRate(vlc_player_t *player)
Decrement the rate of the player (Slower).
Definition player.c:1468
#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:1971
void vlc_player_DisplayPosition(vlc_player_t *player)
Display the player position on the vout OSD.
Definition player.c:1500
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:1386
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:1956
void vlc_player_PreviousVideoFrame(vlc_player_t *player)
Pause and display the previous video frame.
Definition player.c:1376
vlc_object_t * vlc_player_GetV4l2Object(vlc_player_t *player)
Get the V4L2 object used to do controls.
Definition player.c:2024
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:1474
static void vlc_player_JumpTime(vlc_player_t *player, vlc_tick_t jumptime)
Helper to jump the time precisely.
Definition vlc_player.h:790
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:1513
void vlc_player_SetNextMedia(vlc_player_t *player, input_item_t *media)
Set the next media.
Definition player.c:1127
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:1623
double vlc_player_GetPosition(vlc_player_t *player)
Get the position of the current media.
Definition player.c:1492
int vlc_player_ResetAtoBLoop(vlc_player_t *player)
Reset/remove the A to B loop of the current media.
Definition player.c:1686
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:1783
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:1157
enum vlc_player_error vlc_player_GetError(vlc_player_t *player)
Get the error state of the player.
Definition player.c:1393
#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:1656
@ 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:1345
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:1553
void vlc_player_SetRenderer(vlc_player_t *player, vlc_renderer_item_t *renderer)
Set the renderer.
Definition player.c:1533
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:652
void vlc_player_RemoveTimer(vlc_player_t *player, vlc_player_timer_id *timer)
Remove a player timer.
Definition timer.c:696
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:708
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:749
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:674
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:996
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:1188
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:983
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:970
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:1101
void vlc_player_SelectPrevTitle(vlc_player_t *player)
Select the previous title for the current media.
Definition player.c:924
struct vlc_player_title_list vlc_player_title_list
Opaque structure representing a list of vlc_player_title.
Definition vlc_player.h:1040
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:2091
void vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps)
Set the associated subtitle FPS.
Definition player.c:1210
static vlc_tick_t vlc_player_GetVideoDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition vlc_player.h:2062
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:1854
float vlc_player_GetAssociatedSubsFPS(vlc_player_t *player)
Get the associated subtitle FPS.
Definition player.c:1222
static vlc_tick_t vlc_player_GetAudioDelay(vlc_player_t *player)
Helper to get the audio delay.
Definition vlc_player.h:2042
static vlc_tick_t vlc_player_GetSubtitleDelay(vlc_player_t *player)
Helper to get the subtitle delay.
Definition vlc_player.h:2082
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:2051
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:2071
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:1809
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:1841
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:1894
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:1913
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:1576
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:1794
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:1493
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:1950
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:1753
static void vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable audio tracks.
Definition vlc_player.h:1904
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:1511
static void vlc_player_RestartTrack(vlc_player_t *player, const struct vlc_player_track *track)
Helper to restart a track.
Definition vlc_player.h:1784
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:1502
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:1372
static size_t vlc_player_GetAudioTrackCount(vlc_player_t *player)
Helper to get the audio track count.
Definition vlc_player.h:1484
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:1922
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:1718
static void vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
Helper to enable or disable video tracks.
Definition vlc_player.h:1886
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:1895
static size_t vlc_player_GetVideoTrackCount(vlc_player_t *player)
Helper to get the video track count.
Definition vlc_player.h:1466
bool vlc_player_IsTrackCategoryEnabled(vlc_player_t *player, enum es_format_category_e cat)
Check if a track category is enabled.
Definition player.c:1935
static void vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
Helper to select the subtitle language.
Definition vlc_player.h:1853
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:1475
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:1915
static void vlc_player_ToggleSubtitle(vlc_player_t *player)
Helper to toggle subtitles.
Definition vlc_player.h:1940
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:1640
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:1701
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:1844
void vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale)
Set the subtitle text scaling factor.
Definition player.c:1943
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:1743
static bool vlc_player_IsSubtitleEnabled(vlc_player_t *player)
Helper to check if subtitle tracks are enabled.
Definition vlc_player.h:1931
@ VLC_PLAYER_SELECT_SIMULTANEOUS
Select multiple tracks for one category.
Definition vlc_player.h:1385
@ VLC_PLAYER_SELECT_EXCLUSIVE
Only one track per category is selected.
Definition vlc_player.h:1377
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:2595
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:2736
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:2779
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:2597
@ VLC_PLAYER_VOUT_STARTED
Definition vlc_player.h:2596
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
Definition vlc_es.h:617
Definition vlc_input.h:168
Definition vlc_input_item.h:201
Describes an input and is used to spawn input_thread_t objects.
Definition vlc_input_item.h:98
Definition vlc_input_item.h:541
Audio loudness measurement.
Definition vlc_aout.h:637
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:2386
void(* on_volume_changed)(audio_output_t *aout, float new_volume, void *data)
Called when the volume has changed.
Definition vlc_player.h:2396
void(* on_mute_changed)(audio_output_t *aout, bool new_muted, void *data)
Called when the mute state has changed.
Definition vlc_player.h:2408
void(* on_device_changed)(audio_output_t *aout, const char *device, void *data)
Called when the audio device has changed.
Definition vlc_player.h:2418
Definition player.h:164
Player callbacks.
Definition vlc_player.h:2843
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:3244
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:3010
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:2954
void(* on_recording_changed)(vlc_player_t *player, bool recording, void *data)
Called when the player recording state has changed.
Definition vlc_player.h:3173
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:3137
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:3337
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:3112
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:2927
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:3184
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:3058
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:2861
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:3376
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:3088
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:3197
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:3223
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 about to be displayed...
Definition vlc_player.h:3356
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:2984
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:3149
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:3233
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:3279
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:3025
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:3042
void(* on_cork_changed)(vlc_player_t *player, unsigned cork_count, void *data)
Called when the player is corked.
Definition vlc_player.h:3302
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:2969
void(* on_teletext_enabled_changed)(vlc_player_t *player, bool enabled, void *data)
Called when teletext is enabled or disabled.
Definition vlc_player.h:3100
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:3319
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:2995
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:3076
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:3212
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:2873
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:2940
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:2900
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:2887
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:3161
void(* on_teletext_transparency_changed)(vlc_player_t *player, bool enabled, void *data)
Called when the teletext transparency has changed.
Definition vlc_player.h:3124
void(* on_rate_changed)(vlc_player_t *player, float new_rate, void *data)
Called when the player rate has changed.
Definition vlc_player.h:2913
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:3261
Player chapter structure.
Definition vlc_player.h:1003
const char * name
Chapter name, always valid.
Definition vlc_player.h:1005
vlc_tick_t time
Position of this chapter.
Definition vlc_player.h:1007
Definition player.h:137
Definition player.h:144
Player program structure.
Definition vlc_player.h:1238
bool selected
True if the program is selected.
Definition vlc_player.h:1244
const char * name
Program name, always valid.
Definition vlc_player.h:1242
int group_id
Id used for vlc_player_SelectProgram().
Definition vlc_player.h:1240
bool scrambled
True if the program is scrambled.
Definition vlc_player.h:1246
Definition player.h:256
vlc_cond_t notify
Definition player.h:306
bool play_and_pause
Definition player.h:265
bool start_paused
Definition player.h:264
input_item_t * media
Definition player.h:278
Player timer callbacks.
Definition vlc_player.h:3471
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:3526
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:3490
void(* on_paused)(vlc_tick_t system_date, void *data)
The player timer is paused (can be NULL).
Definition vlc_player.h:3511
Definition player.h:178
Player timer point.
Definition vlc_player.h:3423
bool live
if true, length represents the seek range and position is the position within that seek_range
Definition vlc_player.h:3435
double position
Position in the range [0.0f;1.0].
Definition vlc_player.h:3425
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:3441
double rate
Rate of the player.
Definition vlc_player.h:3427
vlc_tick_t length
Valid length >= VLC_TICK_0 or VLC_TICK_INVALID.
Definition vlc_player.h:3432
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:3430
Player smpte timer callbacks.
Definition vlc_player.h:3535
void(* on_update)(const struct vlc_player_timer_smpte_timecode *tc, void *data)
Called when a new frame is displayed.
Definition vlc_player.h:3546
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:3572
void(* on_paused)(vlc_tick_t system_date, void *data)
The player timer is paused (can be NULL).
Definition vlc_player.h:3554
Player smpte timecode.
Definition vlc_player.h:3450
unsigned seconds
Seconds [0;59].
Definition vlc_player.h:3456
unsigned minutes
Minutes [0;59].
Definition vlc_player.h:3454
unsigned hours
Hours [0;n].
Definition vlc_player.h:3452
bool drop_frame
True if the source is NTSC 29.97fps or 59.94fps DF.
Definition vlc_player.h:3462
unsigned frame_resolution
Maximum number of digits needed to display the frame number.
Definition vlc_player.h:3460
unsigned frames
Frame number [0;n].
Definition vlc_player.h:3458
Definition player.h:51
Player title structure.
Definition vlc_player.h:1019
const struct vlc_player_chapter * chapters
Array of chapters, can be NULL.
Definition vlc_player.h:1030
size_t chapter_count
Number of chapters, can be 0.
Definition vlc_player.h:1028
vlc_tick_t length
Length of the title.
Definition vlc_player.h:1023
unsigned flags
Bit flag of VLC_PLAYER_TITLE_MENU and VLC_PLAYER_TITLE_INTERACTIVE.
Definition vlc_player.h:1026
const char * name
Title name, always valid.
Definition vlc_player.h:1021
Player track structure.
Definition vlc_player.h:1398
bool selected
True if the track is selected.
Definition vlc_player.h:1406
es_format_t fmt
Es format.
Definition vlc_player.h:1404
const char * name
Track name, always valid.
Definition vlc_player.h:1402
vlc_es_id_t * es_id
Id used for any player actions, like vlc_player_SelectEsId().
Definition vlc_player.h:1400
Player vout callbacks.
Definition vlc_player.h:2613
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:2635
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:2623
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:2296
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:2327
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:2310
Audio output modules interface.
This file is a collection of common definitions and types.
struct audio_output audio_output_t
Definition vlc_common.h:401
es_format_category_e
ES Categories.
Definition vlc_es.h:600
@ SPU_ES
Definition vlc_es.h:604
@ AUDIO_ES
Definition vlc_es.h:603
@ VIDEO_ES
Definition vlc_es.h:602
Input thread interface.
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48