VLC 4.0.0-dev
Loading...
Searching...
No Matches
libvlc_media_player.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2024 VLC authors and VideoLAN
5 *
6 * Authors: Clément Stenac <zorglub@videolan.org>
7 * Jean-Paul Saman <jpsaman@videolan.org>
8 * Pierre d'Herbemont <pdherbemont@videolan.org>
9 * Maxime Chapelet <umxprime at videolabs dot io>
10 * Alexandre Janniaux <ajanni@videolabs.io>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation; either version 2.1 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this program; if not, write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
26
27#ifndef VLC_LIBVLC_MEDIA_PLAYER_H
28#define VLC_LIBVLC_MEDIA_PLAYER_H 1
29
30/* Definitions of enum properties for video */
31#include "libvlc_video.h"
32
33# ifdef __cplusplus
34extern "C" {
35# else
36# include <stdbool.h>
37# endif
38
41typedef struct libvlc_media_t libvlc_media_t;
48
49/** \defgroup libvlc_media_player LibVLC media player
50 * \ingroup libvlc
51 * A LibVLC media player plays one media (usually in a custom drawable).
52 * @{
53 * \file
54 * LibVLC simple media player external API
55 */
56
58
59/**
60 * Description for titles
61 */
62enum
63{
66};
67
69{
70 libvlc_time_t i_duration; /**< duration in microseconds (us) */
71 char *psz_name; /**< title name */
72 unsigned i_flags; /**< info if item was recognized as a menu, interactive or plain content by the demuxer */
74
75/**
76 * Description for chapters
77 */
79{
80 libvlc_time_t i_time_offset; /**< time-offset of the chapter in microseconds (us) */
81 libvlc_time_t i_duration; /**< duration of the chapter in microseconds (us), 0 if unknown */
82 char *psz_name; /**< chapter name */
84
85/**
86 * Description for audio output. It contains
87 * name, description and pointer to next record.
88 */
96
97/**
98 * Description for audio output device.
99 */
101{
102 struct libvlc_audio_output_device_t *p_next; /**< Next entry in list */
103 char *psz_device; /**< Device identifier string */
104 char *psz_description; /**< User-friendly device description */
105 /* More fields may be added here in later versions */
107
108/**
109 * Marq options definition
110 */
123
124/**
125 * Navigation mode
126 */
136
137/**
138 * Enumeration of values used to set position (e.g. of video title).
139 */
152
153/**
154 * Enumeration of values used to set the video fitting inside the display area.
155 */
157 libvlc_video_fit_none = 0, /**< Explicit zoom set by \ref libvlc_video_set_scale */
158 libvlc_video_fit_smaller, /**< Fit inside / to smallest display dimension */
159 libvlc_video_fit_larger, /**< Fit outside / to largest display dimension */
160 libvlc_video_fit_width, /**< Fit to display width */
161 libvlc_video_fit_height, /**< Fit to display height */
163
164/**
165 * Enumeration of teletext keys than can be passed via
166 * libvlc_video_set_teletext()
167 */
175
176/**
177 * A to B loop state
178 */
184
185/**
186 * Enumeration of player capabilities
187 */
189 /** player can seek */
191 /** player can pause */
193 /** player can change rate */
195 /** player can seek back */
198
199/**
200 * Enumeration of player track/program list actions
201 */
207
208/**
209 * Enumeration of media stopping reasons
210 */
212 /** media is stopping due to an error (default) */
214 /** media has reached the end of stream */
216 /** media is stopping due to user request */
219
220/**
221 * Opaque equalizer handle.
222 *
223 * Equalizer settings can be applied to a media player.
224 */
226
227/**
228 * struct defining callbacks for libvlc_media_player_new()
229 */
231{
232 /**
233 * Version of struct libvlc_media_player_cbs
234 */
235 uint32_t version;
236
237 /**
238 * Callback prototype that notify when the player changed media
239 *
240 * \note Optional (can be NULL),
241 * available since version 0
242 *
243 * \param opaque opaque pointer set by libvlc_media_player_new()
244 * \param media new played media
245 */
246 void (*on_media_changed)( void *opaque, libvlc_media_t *media );
247
248 /**
249 * Callback prototype that notify when the player will stop the current
250 * media.
251 *
252 * \note Optional (can be NULL),
253 * available since version 0
254 *
255 * This can be called from the PLAYING state, before the
256 * player requests the next media, or from the STOPPING state, ie.
257 * when the player is stopping, or by an internal transition
258 * (e.g., when the media reaches the end of file or errors out).
259 *
260 * \param opaque opaque pointer set by libvlc_media_player_new()
261 * \param media stopping media
262 * \param stopping_reason reason why the media is stopping
263 */
264 void (*on_media_stopping)( void *opaque, libvlc_media_t *media,
265 libvlc_stopping_reason_t stopping_reason );
266
267 /**
268 * Callback prototype that notify when the player state changed
269 *
270 * \note Optional (can be NULL),
271 * available since version 0
272 *
273 * \param opaque opaque pointer set by libvlc_media_player_new()
274 * \param state new player state
275 */
276 void (*on_state_changed)( void *opaque, libvlc_state_t state );
277
278 /**
279 * Callback prototype that notify when the player buffering changed
280 *
281 * \note Optional (can be NULL),
282 * available since version 0
283 *
284 * This event is always called with the 0 and 1 values before a playback
285 * (in case of success). Values in between depends on the media type.
286 *
287 * \param opaque opaque pointer set by libvlc_media_player_new()
288 * \param buffering buffering in the range [0:1]
289 */
290 void (*on_buffering_changed)( void *opaque, float buffering );
291
292 /**
293 * Callback prototype that notify when the player capabilities changed
294 *
295 * \note Optional (can be NULL),
296 * available since version 0
297 *
298 * \param opaque opaque pointer set by libvlc_media_player_new()
299 * \param old_caps old player capabilities
300 * \param new_caps new player capabilities
301 */
302 void (*on_capabilities_changed)( void *opaque, libvlc_capability_t old_caps,
303 libvlc_capability_t new_caps );
304
305 /**
306 * Callback prototype that notify when the player position changed
307 *
308 * \note Optional (can be NULL),
309 * available since version 0
310 *
311 * \param opaque opaque pointer set by libvlc_media_player_new()
312 * \param time a valid time or 0
313 * \param pos a valid position
314 */
315 void (*on_position_changed)( void *opaque, libvlc_time_t time, double pos );
316
317 /**
318 * Callback prototype that notify when the player length changed
319 *
320 * \note Optional (can be NULL),
321 * available since version 0
322 *
323 * May be called when the media is opening or during playback.
324 * A started and playing media doesn't have necessarily a valid length.
325 *
326 * \param opaque opaque pointer set by libvlc_media_player_new()
327 * \param length a valid length or 0
328 */
329 void (*on_length_changed)( void *opaque, libvlc_time_t length );
330
331 /**
332 * Callback prototype that notify when the player added, removed or updated
333 * a track
334 *
335 * \note Optional (can be NULL),
336 * available since version 0
337 *
338 * \param opaque opaque pointer set by libvlc_media_player_new()
339 * \param action added, removed or updated
340 * \param type type of the track
341 * \param id valid track id, call libvlc_media_player_get_track_from_id()
342 * to get the track description.
343 */
344 void (*on_track_list_changed)( void *opaque, libvlc_list_action_t action,
345 libvlc_track_type_t type, const char *id );
346
347 /**
348 * Callback prototype that notify when a track is selected or unselected
349 * by the player
350 *
351 * \note Optional (can be NULL),
352 * available since version 0
353 *
354 * \param opaque opaque pointer set by libvlc_media_player_new()
355 * \param type type of tracks being unselected or selected
356 * \param unselected_id valid track id or NULL (when nothing is unselected)
357 * \param selected_id valid track id or NULL (when nothing is selected),
358 * call libvlc_media_player_get_track_from_id() to get the track description.
359 */
361 const char *unselected_id,
362 const char *selected_id );
363
364 /**
365 * Callback prototype that notify when the player added, removed or updated
366 * a program
367 *
368 * \note Optional (can be NULL),
369 * available since version 0
370 *
371 * \param opaque opaque pointer set by libvlc_media_player_new()
372 * \param action added, removed or updated
373 * \param group_id valid group id, call
374 * libvlc_media_player_get_program_from_id() to get the program description.
375 */
376 void (*on_program_list_changed)( void *opaque, libvlc_list_action_t action,
377 int group_id );
378
379 /**
380 * Callback prototype that notify when a program is selected or unselected
381 * by the player
382 *
383 * \note Optional (can be NULL),
384 * available since version 0
385 *
386 * \param opaque opaque pointer set by libvlc_media_player_new()
387 * \param unselected_group_id valid group id
388 * \param selected_group_id valid group id, call
389 * libvlc_media_player_get_program_from_id() to get the program description.
390 */
391 void (*on_program_selection_changed)( void *opaque, int unselected_group_id,
392 int selected_group_id );
393
394 /**
395 * Callback prototype that notify when the player changed titles
396 *
397 * \note Optional (can be NULL),
398 * available since version 0
399 *
400 * Call libvlc_media_player_get_full_title_descriptions() to get the
401 * description of new titles.
402 *
403 * \param opaque opaque pointer set by libvlc_media_player_new()
404 */
405 void (*on_titles_changed)( void *opaque );
406
407 /**
408 * Callback prototype that notify when the player selected a new title
409 *
410 * \note Optional (can be NULL),
411 * available since version 0
412 *
413 * \param opaque opaque pointer set by libvlc_media_player_new()
414 * \param title description of the new selected title, valid only from this
415 * callback, do not release
416 * \param idx index of the new title
417 */
418 void (*on_title_selection_changed)( void *opaque,
419 const libvlc_title_description_t *title,
420 unsigned idx );
421
422 /**
423 * Callback prototype that notify when the player selected a new chapter
424 *
425 * \note Optional (can be NULL),
426 * available since version 0
427 *
428 * \param opaque opaque pointer set by libvlc_media_player_new()
429 * \param title description of the new selected title, valid only from this
430 * callback, do not release
431 * \param title_idx index of the title
432 * \param chapter description of the new selected chapter, valid only from this
433 * callback, do not release
434 * \param chapter_idx index of the new selected chapter
435 */
436 void (*on_chapter_selection_changed)( void *opaque,
437 const libvlc_title_description_t *title,
438 unsigned title_idx,
439 const libvlc_chapter_description_t *chapter,
440 unsigned chapter_idx );
441
442 /**
443 * Callback prototype that notify when the player recording state changed
444 *
445 * \note Optional (can be NULL),
446 * available since version 0
447 *
448 * \param opaque opaque pointer set by libvlc_media_player_new()
449 * \param recording true if recording is enabled
450 * \param file_path file path of the recording, only valid when the
451 * recording ends (recording == false)
452 */
453 void (*on_recording_changed)( void *opaque, bool recording,
454 const char *file_path );
455
456 /**
457 * Callback prototype that notify when the player took a screenshot
458 *
459 * \note Optional (can be NULL),
460 * available since version 0
461 *
462 * \param opaque opaque pointer set by libvlc_media_player_new()
463 * \param file_path file path of the screenshot
464 */
465 void (*on_screenshot_taken)( void *opaque, const char *file_path );
466
467 /**
468 * Callback prototype that notify when the player parsed the current media
469 *
470 * Called once per media, this won't be called if the media has already
471 * been parsed by the parser, use on_media_meta_changed() to get notified
472 * when media meta is updated.
473 *
474 * \note Optional (can be NULL),
475 * available since version 0
476 *
477 * \param opaque opaque pointer set by libvlc_media_player_new()
478 * \param media media being played/parsed
479 */
480 void (*on_media_parsed)( void *opaque, libvlc_media_t *media );
481
482 /**
483 * Callback prototype that notify when metadata were update by the player
484 *
485 * \note Optional (can be NULL),
486 * available since version 0
487 *
488 * \param opaque opaque pointer set by libvlc_media_player_new()
489 * \param media media being played/parsed, call libvlc_media_get_meta() to
490 * get new metadata
491 */
492 void (*on_media_meta_changed)( void *opaque, libvlc_media_t *media );
493
494 /**
495 * Callback prototype that notify when the player added new subitems to the
496 * current media
497 *
498 * \note Optional (can be NULL),
499 * available since version 0
500 *
501 * \param opaque opaque pointer set by libvlc_media_player_new()
502 * \param media media being played/parsed, call libvlc_media_subitems() to
503 * get sub items
504 */
505 void (*on_media_subitems_changed)( void *opaque, libvlc_media_t *media );
506
507
508 /**
509 * Callback prototype that notify when the player added new attachments to
510 * the current media.
511 *
512 * \note It can be called several times for one playback. The array
513 * contains only new elements after a second call.
514 * Optional (can be NULL),
515 * available since version 0
516 *
517 * \param opaque opaque pointer set by libvlc_media_player_new()
518 * \param media media being played/parsed
519 * \param list list of pictures, the list is only valid from this callback,
520 * each pictures can be held separatly with libvlc_picture_retain().
521 */
522 void (*on_media_attachments_added)( void *opaque, libvlc_media_t *media,
524
525 /**
526 * Callback prototype that notify when the next frame, following a call to
527 * `libvlc_media_player_next_frame()`, is about to displayed.
528 *
529 * \note Optional (can be NULL),
530 * available since version 0
531 *
532 * \see libvlc_media_player_next_frame()
533 *
534 * \note This callback is sent just before the frame is sent to the video
535 * output, use libvlc_media_player_watch_time() if you need to know exactly
536 * when the frame is displayed.
537 *
538 * \param opaque opaque pointer set by libvlc_media_player_new()
539 * \param status 0 in case of success, -EAGAIN on first call (paused),
540 * -EBUSY in case of video error, -ENOTSUP if can't pause,
541 * -EINVAL in case of invalid state
542 */
543 void (*on_next_frame_status)( void *opaque, int status );
544
545 /**
546 * Callback prototype that notify when the previous frame, following a call
547 * to `libvlc_media_player_previous_frame()`, is about to be displayed.
548 *
549 * \note Optional (can be NULL),
550 * available since version 0
551 *
552 * \see libvlc_media_player_previous_frame()
553 *
554 * \note This callback is sent just before the frame is sent to the video
555 * output, use libvlc_media_player_watch_time() if you need to know exactly
556 * when the frame is displayed.
557 *
558 * \param opaque opaque pointer set by libvlc_media_player_new()
559 * \param status 0 in case of success, -EAGAIN on first call (paused),
560 * -EBUSY in case of video error, -ENOTSUP if can't pause,
561 * -EINVAL in case of invalid state, -ERANGE if the player could not seek
562 * back
563 */
564 void (*on_prev_frame_status)( void *opaque, int status );
565
566 /**
567 * Callback prototype that notify when a new player vout is added or removed
568 *
569 * \note Optional (can be NULL),
570 * available since version 0
571 *
572 * \param opaque opaque pointer set by libvlc_media_player_new()
573 * \param vout_count number of active vouts
574 */
575 void (*on_vout_changed)( void *opaque, unsigned vout_count );
576
577 /**
578 * Callback prototype that notify when the player is corked/uncorked
579 *
580 * \note Optional (can be NULL),
581 * available since version 0
582 *
583 * The player can be corked when the audio output loose focus or when a
584 * renderer was paused from the outside.
585 *
586 * \param opaque opaque pointer set by libvlc_media_player_new()
587 * \param corked true if the player is corked. In that case, the user
588 * should pause the player and release all external resource needed by the
589 * player
590 */
591 void (*on_cork_changed)( void *opaque, bool corked );
592
593 /**
594 * Callback prototype that notify when the audio volume has changed
595 *
596 * \note Optional (can be NULL),
597 * available since version 0
598 *
599 * \param opaque opaque pointer set by libvlc_media_player_new()
600 * \param volume volume in the range [0;2.f]
601 */
602 void (*on_audio_volume_changed)( void *opaque, float volume );
603
604 /**
605 * Callback prototype that notify when the audio mute state has changed
606 *
607 * \note Optional (can be NULL),
608 * available since version 0
609 *
610 * \param opaque opaque pointer set by libvlc_media_player_new()
611 * \param muted true if muted
612 */
613 void (*on_audio_mute_changed)( void *opaque, bool muted );
614
615 /**
616 * Callback prototype that notify when the audio device state has changed
617 *
618 * \note Optional (can be NULL),
619 * available since version 0
620 *
621 * \param opaque opaque pointer set by libvlc_media_player_new()
622 * \param device the device name
623 */
624 void (*on_audio_device_changed)( void *opaque, const char *device );
625};
626
627/**
628 * Create an empty Media Player object
629 *
630 * \param p_libvlc_instance the libvlc instance in which the Media Player
631 * should be created.
632 * \param cbs callback to listen to events (can be NULL). The pointed
633 * struct must be kept alive (and not modified) by the caller until
634 * the returned media player is released.
635 * \param cbs_opaque opaque pointer used by the callbacks
636 * \return a new media player object, or NULL on error.
637 * It must be released by libvlc_media_player_release().
638 */
641 const struct libvlc_media_player_cbs *cbs,
642 void *cbs_opaque );
643
644/**
645 * Create a Media Player object from a Media
646 *
647 * \param inst LibVLC instance to create a media player with
648 * \param p_md the media. Afterwards the p_md can be safely
649 * destroyed.
650 * \param cbs callback to listen to events (can be NULL). The pointed
651 * struct must be kept alive (and not modified) by the caller until
652 * the returned media player is released.
653 * \param cbs_opaque opaque pointer used by the callbacks
654 * \return a new media player object, or NULL on error.
655 * It must be released by libvlc_media_player_release().
656 */
659 const struct libvlc_media_player_cbs *cbs,
660 void *cbs_opaque );
661
662/**
663 * Release a media_player after use
664 * Decrement the reference count of a media player object. If the
665 * reference count is 0, then libvlc_media_player_release() will
666 * release the media player object. If the media player object
667 * has been released, then it should not be used again.
668 *
669 * \param p_mi the Media Player to free
670 */
672
673/**
674 * Retain a reference to a media player object. Use
675 * libvlc_media_player_release() to decrement reference count.
676 *
677 * \param p_mi media player object
678 * \return the same object
679 */
681
682/**
683 * Set the media that will be used by the media_player.
684 *
685 * This function replaces the current and next medias.
686 *
687 * \note The function will open the media, without starting it, allowing the
688 * user to send controls (like seek requests) before Starting the player.
689 *
690 * \note The user should listen to the libvlc_media_player_cbs.on_media_changed
691 * callback, to know when the new media is actually used by the player
692 * (or to know that the older media is no longer used).
693 *
694 * \param p_mi the Media Player
695 * \param p_md the Media. Afterwards the p_md can be safely
696 * destroyed.
697 */
699 libvlc_media_t *p_md );
700
701/**
702 * Get the media used by the media_player.
703 *
704 * \warning Calling this function just after libvlc_media_player_set_media()
705 * will return the media that was just set, but this media might not be
706 * currently used internally by the player. To detect such case, the user
707 * should listen to the libvlc_media_player_cbs.on_media_changed callback.
708 *
709 * \param p_mi the Media Player
710 * \return the media associated with p_mi, or NULL if no
711 * media is associated
712 * \note the caller is responsible for releasing the returned media
713 * with libvlc_media_release().
714 */
716
717/**
718 * Set the next media
719 *
720 * This function replaces the next media to be played.
721 * \note The media won't be opened directly by this function. If there is no
722 * current media, the next media will be opened from
723 * libvlc_media_player_play(). If there is a current playing media, the next
724 * media will be opened and played automatically.
725 *
726 * \param p_mi the Media Player
727 * \param p_md the next Media. Afterwards the p_md can be safely destroyed.
728 */
730 libvlc_media_t *p_md );
731
732/**
733 * Get the next media to be played
734 *
735 * This function return the media set by libvlc_media_player_set_next_media()
736 *
737 * \return the next media, or NULL if there is no next media
738 */
740
741
742/**
743 * is_playing
744 *
745 * \param p_mi the Media Player
746 * \retval true media player is playing
747 * \retval false media player is not playing
748 */
750
751/**
752 * Play
753 *
754 * \param p_mi the Media Player
755 * \return 0 if playback started (or was already started), or -1 on error.
756 */
758
759/**
760 * Pause or resume (no effect if there is no media)
761 *
762 * \param mp the Media Player
763 * \param do_pause play/resume if zero, pause if non-zero
764 * \version LibVLC 1.1.1 or later
765 */
767 int do_pause );
768
769/**
770 * Toggle pause (no effect if there is no media)
771 *
772 * \param p_mi the Media Player
773 */
775
776/**
777 * Stop asynchronously
778 *
779 * \note This function is asynchronous. In case of success, the user should
780 * wait for the libvlc_media_player_cbs.on_state_changed callback to report the
781 * libvlc_Stopped state to know when the stop is finished.
782 *
783 * \param p_mi the Media Player
784 * \return 0 if the player is being stopped, -1 otherwise (no-op)
785 * \version LibVLC 4.0.0 or later
786 */
788
789/**
790 * Set a renderer to the media player
791 *
792 * \note must be called before the first call of libvlc_media_player_play() to
793 * take effect.
794 *
795 * \see libvlc_renderer_discoverer_new
796 *
797 * \param p_mi the Media Player
798 * \param p_item an item discovered by libvlc_renderer_discoverer_start()
799 * \return 0 on success, -1 on error.
800 * \version LibVLC 3.0.0 or later
801 */
803 libvlc_renderer_item_t *p_item );
804
805/**
806 * Enumeration of the Video color primaries.
807 */
816
817/**
818 * Enumeration of the Video color spaces.
819 */
825
826/**
827 * Enumeration of the Video transfer functions.
828 */
839
840
841/**
842 * Callback prototype to allocate and lock a picture buffer.
843 *
844 * Whenever a new video frame needs to be decoded, the lock callback is
845 * invoked. Depending on the video chroma, one or three pixel planes of
846 * adequate dimensions must be returned via the second parameter. Those
847 * planes must be aligned on 32-bytes boundaries.
848 *
849 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
850 * \param[out] planes start address of the pixel planes (LibVLC allocates the array
851 * of void pointers, this callback must initialize the array)
852 * \return a private pointer for the display and unlock callbacks to identify
853 * the picture buffers
854 */
855typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
856
857/**
858 * Callback prototype to unlock a picture buffer.
859 *
860 * When the video frame decoding is complete, the unlock callback is invoked.
861 * This callback might not be needed at all. It is only an indication that the
862 * application can now read the pixel values if it needs to.
863 *
864 * \note A picture buffer is unlocked after the picture is decoded,
865 * but before the picture is displayed.
866 *
867 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
868 * \param[in] picture private pointer returned from the @ref libvlc_video_lock_cb
869 * callback
870 * \param[in] planes pixel planes as defined by the @ref libvlc_video_lock_cb
871 * callback (this parameter is only for convenience)
872 */
873typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
874 void *const *planes);
875
876/**
877 * Callback prototype to display a picture.
878 *
879 * When the video frame needs to be shown, as determined by the media playback
880 * clock, the display callback is invoked.
881 *
882 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
883 * \param[in] picture private pointer returned from the @ref libvlc_video_lock_cb
884 * callback
885 */
886typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
887
888/**
889 * Callback prototype to configure picture buffers format.
890 * This callback gets the format of the video as output by the video decoder
891 * and the chain of video filters (if any). It can opt to change any parameter
892 * as it needs. In that case, LibVLC will attempt to convert the video format
893 * (rescaling and chroma conversion) but these operations can be CPU intensive.
894 *
895 * \param[in,out] opaque pointer to the private pointer passed to
896 * libvlc_video_set_callbacks()
897 * \param[in,out] chroma pointer to the 4 bytes video format identifier
898 * \param[in,out] width pointer to the buffer width in pixels
899 * \param[in,out] height pointer to the buffer height in pixels
900 * \param[out] pitches table of scanline pitches in bytes for each pixel plane
901 * (the table is allocated by LibVLC)
902 * \param[out] lines table of scanlines count for each plane
903 * \return the number of picture buffers allocated, 0 indicates failure
904 *
905 * \version LibVLC 4.0.0 and later.
906 * \param[in] width pointer to display width - 1 in pixels
907 * \param[in] height pointer to display height - 1 in pixels
908 *
909 * \note
910 * For each pixels plane, the scanline pitch must be bigger than or equal to
911 * the number of bytes per pixel multiplied by the pixel width.
912 * Similarly, the number of scanlines must be bigger than of equal to
913 * the pixel height.
914 * Furthermore, we recommend that pitches and lines be multiple of 32
915 * to not break assumptions that might be held by optimized code
916 * in the video decoders, video filters and/or video converters.
917 */
918typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
919 unsigned *width, unsigned *height,
920 unsigned *pitches,
921 unsigned *lines);
922
923/**
924 * Callback prototype to configure picture buffers format.
925 *
926 * \param[in] opaque private pointer as passed to libvlc_video_set_format_callbacks()
927 * (and possibly modified by @ref libvlc_video_format_cb)
928 */
929typedef void (*libvlc_video_cleanup_cb)(void *opaque);
930
931
932/**
933 * Set callbacks and private data to render decoded video to a custom area
934 * in memory.
935 * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
936 * to configure the decoded format.
937 *
938 * \warning Rendering video into custom memory buffers is considerably less
939 * efficient than rendering in a custom window as normal.
940 *
941 * For optimal performances, VLC media player renders into a custom window, and
942 * does not use this function and associated callbacks. It is <b>highly
943 * recommended</b> that other LibVLC-based application do likewise.
944 * To embed video in a window, use libvlc_media_player_set_xwindow() or
945 * equivalent depending on the operating system.
946 *
947 * If window embedding does not fit the application use case, then a custom
948 * LibVLC video output display plugin is required to maintain optimal video
949 * rendering performances.
950 *
951 * The following limitations affect performance:
952 * - Hardware video decoding acceleration will either be disabled completely,
953 * or require (relatively slow) copy from video/DSP memory to main memory.
954 * - Sub-pictures (subtitles, on-screen display, etc.) must be blent into the
955 * main picture by the CPU instead of the GPU.
956 * - Depending on the video format, pixel format conversion, picture scaling,
957 * cropping and/or picture re-orientation, must be performed by the CPU
958 * instead of the GPU.
959 * - Memory copying is required between LibVLC reference picture buffers and
960 * application buffers (between lock and unlock callbacks).
961 *
962 * \param mp the media player
963 * \param lock callback to lock video memory (must not be NULL)
964 * \param unlock callback to unlock video memory (or NULL if not needed)
965 * \param display callback to display video (or NULL if not needed)
966 * \param opaque private pointer for the three callbacks (as first parameter)
967 * \version LibVLC 1.1.1 or later
968 */
974 void *opaque );
975
976/**
977 * Set decoded video chroma and dimensions.
978 * This only works in combination with libvlc_video_set_callbacks(),
979 * and is mutually exclusive with libvlc_video_set_format_callbacks().
980 *
981 * \param mp the media player
982 * \param chroma a four-characters string identifying the chroma
983 * (e.g. "RV32" or "YUYV")
984 * \param width pixel width
985 * \param height pixel height
986 * \param pitch line pitch (in bytes)
987 * \version LibVLC 1.1.1 or later
988 * \bug All pixel planes are expected to have the same pitch.
989 * To use the YCbCr color space with chrominance subsampling,
990 * consider using libvlc_video_set_format_callbacks() instead.
991 */
993void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
994 unsigned width, unsigned height,
995 unsigned pitch );
996
997/**
998 * Set decoded video chroma and dimensions. This only works in combination with
999 * libvlc_video_set_callbacks().
1000 *
1001 * \param mp the media player
1002 * \param setup callback to select the video format (cannot be NULL)
1003 * \param cleanup callback to release any allocated resources (or NULL)
1004 * \version LibVLC 2.0.0 or later
1005 */
1009 libvlc_video_cleanup_cb cleanup );
1010
1011
1013{
1014 bool hardware_decoding; /** set if D3D11_CREATE_DEVICE_VIDEO_SUPPORT is needed for D3D11 */
1016
1018{
1020 struct {
1021 void *device_context; /** ID3D11DeviceContext* */
1022 void *context_mutex; /** Windows Mutex HANDLE to protect ID3D11DeviceContext usage */
1024 struct {
1025 void *device; /** IDirect3D9* */
1026 int adapter; /** Adapter to use with the IDirect3D9* */
1028 } u;
1030
1031/**
1032 * Callback prototype called to initialize user data.
1033 * Setup the rendering environment.
1034 *
1035 * \param[in,out] opaque private pointer passed to the @a libvlc_video_set_output_callbacks()
1036 * on input. The callback can change this value on output to be
1037 * passed to all the other callbacks set on @a libvlc_video_set_output_callbacks().
1038 * \param[in] cfg requested configuration of the video device
1039 * \param[out] out libvlc_video_setup_device_info_t* to fill
1040 * \return true on success
1041 * \version LibVLC 4.0.0 or later
1042 *
1043 * For \ref libvlc_video_engine_d3d9 the output must be a IDirect3D9*.
1044 * A reference to this object is held until the \ref libvlc_video_output_cleanup_cb is called.
1045 * the device must be created with D3DPRESENT_PARAMETERS.hDeviceWindow set to 0.
1046 *
1047 * For \ref libvlc_video_engine_d3d11 the output must be a ID3D11DeviceContext*.
1048 * A reference to this object is held until the \ref libvlc_video_output_cleanup_cb is called.
1049 * The ID3D11Device used to create ID3D11DeviceContext must have multithreading enabled.
1050 *
1051 * If the ID3D11DeviceContext is used outside of the callbacks called by libvlc, the host
1052 * MUST use a mutex to protect the access to the ID3D11DeviceContext of libvlc. This mutex
1053 * value is set on u.d3d11.context_mutex. If the ID3D11DeviceContext is not used outside of
1054 * the callbacks, the mutex u.d3d11.context_mutex may be NULL.
1055 */
1056typedef bool (*libvlc_video_output_setup_cb)(void **opaque,
1059
1060
1061/**
1062 * Callback prototype called to release user data
1063 *
1064 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1065 * \version LibVLC 4.0.0 or later
1066 */
1067typedef void (*libvlc_video_output_cleanup_cb)(void* opaque);
1068
1070{
1071 /** rendering video width in pixel */
1072 unsigned width;
1073 /** rendering video height in pixel */
1074 unsigned height;
1075 /** rendering video bit depth in bits per channel */
1076 unsigned bitdepth;
1077 /** video is full range or studio/limited range */
1079 /** video color space */
1081 /** video color primaries */
1083 /** video transfer function */
1085 /** device used for rendering, IDirect3DDevice9* for D3D9 */
1086 void *device;
1088
1090{
1092 /** The rendering DXGI_FORMAT for \ref libvlc_video_engine_d3d11. */
1094 /** The rendering D3DFORMAT for \ref libvlc_video_engine_d3d9. */
1095 uint32_t d3d9_format;
1096 /** The rendering GLint GL_RGBA or GL_RGB for
1097 * \ref libvlc_video_engine_opengl and for
1098 * \ref libvlc_video_engine_gles2. */
1100 /** currently unused */
1102 struct {
1103 /** Pointer to an ANativeWindow, used for video rendering */
1104 void *video;
1105 /** Pointer to an ANativeWindow, used for subtitles rendering, if
1106 * blending subtitles into the video surface is not possible (when
1107 * using MediaCodec with direct hw rendering) */
1110 } u;
1111 /** Video is full range or studio/limited range. */
1113 /** video color space */
1115 /** video color primaries */
1117 /** video transfer function */
1119 /** video surface orientation */
1122
1123/**
1124 * Callback prototype called on video size changes.
1125 * Update the rendering output setup.
1126 *
1127 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1128 * \param[in] cfg configuration of the video that will be rendered
1129 * \param[out] output configuration describing with how the rendering is setup
1130 * \version LibVLC 4.0.0 or later
1131 *
1132 * \note the configuration device for Direct3D9 is the IDirect3DDevice9 that VLC
1133 * uses to render. The host must set a Render target and call Present()
1134 * when it needs the drawing from VLC to be done. This object is not valid
1135 * anymore after Cleanup is called.
1136 * Tone mapping, range and color conversion will be done depending on the
1137 * values set in the output structure. It can be ignored in the \ref
1138 * libvlc_video_engine_anw case.
1139 */
1140typedef bool (*libvlc_video_update_output_cb)(void* opaque, const libvlc_video_render_cfg_t *cfg,
1141 libvlc_video_output_cfg_t *output );
1142
1143
1144/**
1145 * Callback prototype called after performing drawing calls.
1146 *
1147 * This callback is called outside of libvlc_video_makeCurrent_cb current/not-current
1148 * calls.
1149 *
1150 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1151 * \version LibVLC 4.0.0 or later
1152 */
1153typedef void (*libvlc_video_swap_cb)(void* opaque);
1154
1155/**
1156 * Callback prototype to set up the OpenGL context for rendering.
1157 * Tell the host the rendering is about to start/has finished.
1158 *
1159 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1160 * \param[in] enter true to set the context as current, false to unset it
1161 * \return true on success
1162 * \version LibVLC 4.0.0 or later
1163 *
1164 * On Direct3D11 the following may change on the provided ID3D11DeviceContext*
1165 * between \p enter being true and \p enter being false:
1166 * - IASetPrimitiveTopology()
1167 * - IASetInputLayout()
1168 * - IASetVertexBuffers()
1169 * - IASetIndexBuffer()
1170 * - VSSetConstantBuffers()
1171 * - VSSetShader()
1172 * - PSSetSamplers()
1173 * - PSSetConstantBuffers()
1174 * - PSSetShaderResources()
1175 * - PSSetShader()
1176 * - RSSetViewports()
1177 * - DrawIndexed()
1178 */
1179typedef bool (*libvlc_video_makeCurrent_cb)(void* opaque, bool enter);
1180
1181/**
1182 * Callback prototype to load opengl functions
1183 *
1184 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1185 * \param fct_name name of the opengl function to load
1186 * \return a pointer to the named OpenGL function the NULL otherwise
1187 * \version LibVLC 4.0.0 or later
1188 */
1189typedef void* (*libvlc_video_getProcAddress_cb)(void* opaque, const char* fct_name);
1190
1192{
1193 /* similar to CTA-861-G with ranges from H265, based on SMPTE ST 2086 mastering display color volume */
1194 uint16_t RedPrimary[2]; /**< [5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown */
1195 uint16_t GreenPrimary[2]; /**< [5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown */
1196 uint16_t BluePrimary[2]; /**< [5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown */
1197 uint16_t WhitePoint[2]; /**< [5,37 000] normalized x / [5,42 000] y white point in increments of 0.00002, 0=unknown */
1198 unsigned int MaxMasteringLuminance; /**< [50 000, 100 000 000] maximum luminance in 0.0001 cd/m², 0=unknown */
1199 unsigned int MinMasteringLuminance; /**< [1, 50 000] minimum luminance in 0.0001 cd/m², 0=unknown */
1200 uint16_t MaxContentLightLevel; /**< [1, 50 000] Maximum Content Light Level in cd/m², 0=unknown */
1201 uint16_t MaxFrameAverageLightLevel; /**< [1, 50 000] Maximum Frame-Average Light Level in cd/m², 0=unknown */
1203
1207
1208/**
1209 * Callback prototype to receive metadata before rendering.
1210 *
1211 * \param[in] opaque private pointer passed to the @a libvlc_video_set_output_callbacks()
1212 * \param[in] type type of data passed in metadata
1213 * \param[in] metadata the type of metadata
1214 * \version LibVLC 4.0.0 or later
1215 */
1216typedef void (*libvlc_video_frameMetadata_cb)(void* opaque, libvlc_video_metadata_type_t type, const void *metadata);
1217
1218/**
1219 * Enumeration of the Video engine to be used on output.
1220 * can be passed to @a libvlc_video_set_output_callbacks
1221 */
1223 /** Disable rendering engine */
1227 /** Direct3D11 rendering engine */
1229 /** Direct3D9 rendering engine */
1231
1232 /**
1233 * Android ANativeWindow. It can be set in \ref libvlc_video_output_cfg_t
1234 * from the \ref libvlc_video_update_output_cb callback. The ANativeWindow
1235 * can be created via:
1236 * - 'ANativeWindow_fromSurface': from a JAVA SurfaceView
1237 * - 'AImageReader_getWindow()': from an 'AImageReader' created with the
1238 * following arguments: \verbatim
1239 AImageReader_newWithUsage(1, 1 AIMAGE_FORMAT_PRIVATE,
1240 AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE,
1241 maxImages, &reader);
1242 \endverbatim
1243 * The width and height from \ref libvlc_video_render_cfg_t should be
1244 * ignored as the video size is overridden by the producer (MediaCodec or
1245 * EGL vout).
1246 */
1249
1250
1251/** Callback type that can be called to request a render size changes.
1252 *
1253 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
1254 *
1255 * \param report_opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
1256 * \param width new rendering width requested. [IN]
1257 * \param height new rendering height requested. [IN]
1258 */
1259typedef void( *libvlc_video_output_resize_cb )( void *report_opaque, unsigned width, unsigned height );
1260
1261
1262/**
1263 * Enumeration of the different mouse buttons that can be reported for user interaction
1264 * can be passed to \ref libvlc_video_output_mouse_press_cb and \ref libvlc_video_output_mouse_release_cb.
1265 */
1271
1272
1273/** Callback type that can be called to notify the mouse position when hovering the render surface.
1274 *
1275 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
1276 *
1277 * The position (0,0) denotes the top left corner, bottom right corner position
1278 * is (width,height) as reported by \ref libvlc_video_output_resize_cb.
1279 *
1280 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
1281 * \param x horizontal mouse position in \ref libvlc_video_output_resize_cb coordinates. [IN]
1282 * \param y vertical mouse position in \ref libvlc_video_output_resize_cb coordinates. [IN]
1283 */
1284typedef void (*libvlc_video_output_mouse_move_cb)(void *opaque, int x, int y);
1285
1286/** Callback type that can be called to notify when a mouse button is pressed in the rendering surface.
1287 *
1288 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
1289 *
1290 * The button event will be reported at the last position provided by \ref libvlc_video_output_mouse_move_cb
1291 *
1292 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
1293 * \param button represent the button pressed, see \ref libvlc_video_output_mouse_button_t for available buttons. [IN]
1294 */
1296
1297/** Callback type that can be called to notify when a mouse button is released in the rendering surface.
1298 *
1299 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
1300 *
1301 * The button event will be reported at the last position provided by \ref libvlc_video_output_mouse_move_cb.
1302 *
1303 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
1304 * \param button represent the button released, see \ref libvlc_video_output_mouse_button_t for available buttons. [IN]
1305 */
1307
1308/** Set the callback to call when the host app resizes the rendering area.
1309 *
1310 * This allows text rendering and aspect ratio to be handled properly when the host
1311 * rendering size changes and to provide mouse.
1312 *
1313 * It may be called before the \ref libvlc_video_output_setup_cb callback.
1314 *
1315 * \warning These callbacks cannot be called concurrently, the caller is responsible for serialization
1316 *
1317 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1318 * \param[in] report_size_change callback which must be called when the host size changes.
1319 * The callback is valid until another call to \ref libvlc_video_output_set_window_cb
1320 * is done. This may be called from any thread.
1321 * \param[in] report_mouse_move callback which must be called when the mouse position change on the video surface.
1322 * The coordinates are relative to the size reported through the \p report_size_change.
1323 * This may be called from any thread.
1324 * \param[in] report_mouse_pressed callback which must be called when a mouse button is pressed on the video surface,
1325 * The position of the event is the last position reported by the report_mouse_move callback. This may be
1326 * called from any thread.
1327 * \param[in] report_mouse_released callback which must be called when a mouse button is released on the video surface,
1328 * The position of the event is the last position reported by the report_mouse_move callback. This may be
1329 * called from any thread.
1330 * \param[in] report_opaque private pointer to pass to the \p report_size_change callback.
1331 */
1332typedef void( *libvlc_video_output_set_window_cb )( void *opaque,
1333 libvlc_video_output_resize_cb report_size_change,
1334 libvlc_video_output_mouse_move_cb report_mouse_move,
1335 libvlc_video_output_mouse_press_cb report_mouse_pressed,
1336 libvlc_video_output_mouse_release_cb report_mouse_released,
1337 void *report_opaque );
1338
1339/** Tell the host the rendering for the given plane is about to start
1340 *
1341 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
1342 * \param plane number of the rendering plane to select
1343 * \param output handle of the rendering output for the given plane
1344 * \return true on success
1345 * \version LibVLC 4.0.0 or later
1346 *
1347 * \note This is only used with \ref libvlc_video_engine_d3d11.
1348 *
1349 * The output parameter receives the ID3D11RenderTargetView* to use for rendering
1350 * the plane.
1351 *
1352 * If this callback is not used (set to NULL in @a libvlc_video_set_output_callbacks())
1353 * OMSetRenderTargets has to be set during the @a libvlc_video_makeCurrent_cb()
1354 * entering call.
1355 *
1356 * The number of planes depend on the DXGI_FORMAT returned during the
1357 * @a libvlc_video_update_output_cb() call. It's usually one plane except for
1358 * semi-planar formats like DXGI_FORMAT_NV12 or DXGI_FORMAT_P010.
1359 *
1360 * This callback is called between libvlc_video_makeCurrent_cb current/not-current
1361 * calls.
1362 */
1363typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane, void *output );
1364
1365/**
1366 * Set callbacks and data to render decoded video to a custom texture
1367 *
1368 * \warning VLC will perform video rendering in its own thread and at its own rate,
1369 * You need to provide your own synchronisation mechanism.
1370 *
1371 * \param mp the media player
1372 * \param engine the GPU engine to use
1373 * \param setup_cb callback called to initialize user data
1374 * \param cleanup_cb callback called to clean up user data
1375 * \param window_cb callback called to setup the window
1376 * \param update_output_cb callback to get the rendering format of the host (cannot be NULL)
1377 * \param swap_cb callback called after rendering a video frame (can only be
1378 * NULL when using \ref libvlc_video_engine_anw)
1379 * \param makeCurrent_cb callback called to enter/leave the rendering context
1380 * (can only be NULL when using \ref libvlc_video_engine_anw)
1381 * \param getProcAddress_cb opengl function loading callback (cannot be NULL
1382 * for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
1383 * \param metadata_cb callback to provide frame metadata (D3D11 only)
1384 * \param select_plane_cb callback to select different D3D11 rendering targets
1385 * \param opaque private pointer passed to callbacks
1386 *
1387 * \note the \p setup_cb and \p cleanup_cb may be called more than once per
1388 * playback.
1389 *
1390 * \retval true engine selected and callbacks set
1391 * \retval false engine type unknown, callbacks not set
1392 * \version LibVLC 4.0.0 or later
1393 */
1396 libvlc_video_engine_t engine,
1400 libvlc_video_update_output_cb update_output_cb,
1401 libvlc_video_swap_cb swap_cb,
1402 libvlc_video_makeCurrent_cb makeCurrent_cb,
1403 libvlc_video_getProcAddress_cb getProcAddress_cb,
1406 void* opaque );
1407
1408/**
1409 * Helper to setup output_callbacks for \ref libvlc_video_engine_anw
1410 */
1411static inline bool
1415 libvlc_video_update_output_cb update_output_cb,
1416 void *opaque )
1417{
1419 setup_cb, cleanup_cb, NULL,
1420 update_output_cb, NULL, NULL,
1421 NULL, NULL, NULL, opaque );
1422}
1423
1424/**
1425 * Set the handler where the media player should display its video output.
1426 *
1427 * The drawable is an `NSObject` that require responding to two selectors
1428 * like in this protocol:
1429 *
1430 * @code{.m}
1431 * @protocol VLCDrawable <NSObject>
1432 * - (void)addSubview:(VLCView *)view;
1433 * - (CGRect)bounds;
1434 * @end
1435 * @endcode
1436 *
1437 * In this protocol `VLCView` type can either be a `UIView` or a `NSView` type
1438 * class.
1439 * VLCDrawable protocol conformance isn't mandatory but a drawable must respond
1440 * to both `addSubview:` and `bounds` selectors.
1441 *
1442 * Additionally, a drawable can also conform to the `VLCPictureInPictureDrawable`
1443 * protocol to allow picture in picture support :
1444 *
1445 * @code{.m}
1446 * @protocol VLCPictureInPictureMediaControlling <NSObject>
1447 * - (void)play;
1448 * - (void)pause;
1449 * - (void)seekBy:(int64_t)offset completion:(dispatch_block_t)completion;;
1450 * - (int64_t)mediaLength;
1451 * - (int64_t)mediaTime;
1452 * - (BOOL)isMediaSeekable;
1453 * - (BOOL)isMediaPlaying;
1454 * @end
1455 *
1456 * @protocol VLCPictureInPictureWindowControlling <NSObject>
1457 * - (void)startPictureInPicture;
1458 * - (void)stopPictureInPicture;
1459 * - (void)invalidatePlaybackState;
1460 * @end
1461 *
1462 * @protocol VLCPictureInPictureDrawable <NSObject>
1463 * - (id<VLCPictureInPictureMediaControlling>) mediaController;
1464 * - (void (^)(id<VLCPictureInPictureWindowControlling>)) pictureInPictureReady;
1465 * @end
1466 * @endcode
1467 *
1468 * Be aware that full `VLCPictureInPictureDrawable` conformance is mandatory to
1469 * enable picture in picture support and that time values in
1470 * `VLCPictureInPictureMediaControlling` methods are expressed in milliseconds.
1471 *
1472 * If you want to use it along with Qt see the QMacCocoaViewContainer. Then
1473 * the following code should work:
1474 * @code{.mm}
1475 * {
1476 * NSView *video = [[NSView alloc] init];
1477 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
1478 * libvlc_media_player_set_nsobject(mp, video);
1479 * [video release];
1480 * }
1481 * @endcode
1482 *
1483 * You can find a live example in VLCVideoView in VLCKit.framework.
1484 *
1485 * \param p_mi the Media Player
1486 * \param drawable the drawable that is either an NSView, a UIView or any
1487 * NSObject responding to `addSubview:` and `bounds` selectors
1488 */
1490
1491/**
1492 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
1493 *
1494 * \param p_mi the Media Player
1495 * \return the NSView handler or 0 if none where set
1496 */
1498
1499/**
1500 * Set an X Window System drawable where the media player should render its
1501 * video output. The call takes effect when the playback starts. If it is
1502 * already started, it might need to be stopped before changes apply.
1503 * If LibVLC was built without X11 output support, then this function has no
1504 * effects.
1505 *
1506 * By default, LibVLC will capture input events on the video rendering area.
1507 * Use libvlc_video_set_mouse_input() and libvlc_video_set_key_input() to
1508 * disable that and deliver events to the parent window / to the application
1509 * instead. By design, the X11 protocol delivers input events to only one
1510 * recipient.
1511 *
1512 * \warning
1513 * The application must call the XInitThreads() function from Xlib before
1514 * libvlc_new(), and before any call to XOpenDisplay() directly or via any
1515 * other library. Failure to call XInitThreads() will seriously impede LibVLC
1516 * performance. Calling XOpenDisplay() before XInitThreads() will eventually
1517 * crash the process. That is a limitation of Xlib.
1518 *
1519 * \param p_mi media player
1520 * \param drawable X11 window ID
1521 *
1522 * \note
1523 * The specified identifier must correspond to an existing Input/Output class
1524 * X11 window. Pixmaps are <b>not</b> currently supported. The default X11
1525 * server is assumed, i.e. that specified in the DISPLAY environment variable.
1526 *
1527 * \warning
1528 * LibVLC can deal with invalid X11 handle errors, however some display drivers
1529 * (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle
1530 * must remain valid until playback is stopped, otherwise the process may
1531 * abort or crash.
1532 *
1533 * \bug
1534 * No more than one window handle per media player instance can be specified.
1535 * If the media has multiple simultaneously active video tracks, extra tracks
1536 * will be rendered into external windows beyond the control of the
1537 * application.
1538 */
1540 uint32_t drawable);
1541
1542/**
1543 * Get the X Window System window identifier previously set with
1544 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
1545 * even if VLC is not currently using it (for instance if it is playing an
1546 * audio-only input).
1547 *
1548 * \param p_mi the Media Player
1549 * \return an X window ID, or 0 if none where set.
1550 */
1552
1553/**
1554 * Set a Win32/Win64 API window handle (HWND) where the media player should
1555 * render its video output. If LibVLC was built without Win32/Win64 API output
1556 * support, then this has no effects.
1557 *
1558 * \warning the HWND must have the WS_CLIPCHILDREN set in its style.
1559 *
1560 * \param p_mi the Media Player
1561 * \param drawable windows handle of the drawable
1562 */
1564
1565/**
1566 * Get the Windows API window handle (HWND) previously set with
1567 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
1568 * is not currently outputting any video to it.
1569 *
1570 * \param p_mi the Media Player
1571 * \return a window handle or NULL if there are none.
1572 */
1574
1575/**
1576 * Set the android context.
1577 *
1578 * \version LibVLC 3.0.0 and later.
1579 *
1580 * \param p_mi the media player
1581 * \param p_awindow_handler org.videolan.libvlc.AWindow jobject owned by the
1582 * org.videolan.libvlc.MediaPlayer class from the libvlc-android project.
1583 */
1585 void *p_awindow_handler );
1586
1587/**
1588 * Callback prototype for audio playback.
1589 *
1590 * The LibVLC media player decodes and post-processes the audio signal
1591 * asynchronously (in an internal thread). Whenever audio samples are ready
1592 * to be queued to the output, this callback is invoked.
1593 *
1594 * The number of samples provided per invocation may depend on the file format,
1595 * the audio coding algorithm, the decoder plug-in, the post-processing
1596 * filters and timing. Application must not assume a certain number of samples.
1597 *
1598 * The exact format of audio samples is determined by libvlc_audio_set_format()
1599 * or libvlc_audio_set_format_callbacks() as is the channels layout.
1600 *
1601 * Note that the number of samples is per channel. For instance, if the audio
1602 * track sampling rate is 48000 Hz, then 1200 samples represent 25 milliseconds
1603 * of audio signal - regardless of the number of audio channels.
1604 *
1605 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1606 * \param[in] samples pointer to a table of audio samples to play back
1607 * \param count number of audio samples to play back
1608 * \param pts expected play time stamp (see libvlc_delay())
1609 */
1610typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
1611 unsigned count, int64_t pts);
1612
1613/**
1614 * Callback prototype for audio pause.
1615 *
1616 * LibVLC invokes this callback to pause audio playback.
1617 *
1618 * \note The pause callback is never called if the audio is already paused.
1619 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1620 * \param pts time stamp of the pause request (should be elapsed already)
1621 */
1622typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
1623
1624/**
1625 * Callback prototype for audio resumption.
1626 *
1627 * LibVLC invokes this callback to resume audio playback after it was
1628 * previously paused.
1629 *
1630 * \note The resume callback is never called if the audio is not paused.
1631 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1632 * \param pts time stamp of the resumption request (should be elapsed already)
1633 */
1634typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
1635
1636/**
1637 * Callback prototype for audio buffer flush.
1638 *
1639 * LibVLC invokes this callback if it needs to discard all pending buffers and
1640 * stop playback as soon as possible. This typically occurs when the media is
1641 * stopped.
1642 *
1643 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1644 */
1645typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
1646
1647/**
1648 * Callback prototype for audio buffer drain.
1649 *
1650 * LibVLC may invoke this callback when the decoded audio track is ending.
1651 * There will be no further decoded samples for the track, but playback should
1652 * nevertheless continue until all already pending buffers are rendered.
1653 *
1654 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1655 */
1656typedef void (*libvlc_audio_drain_cb)(void *data);
1657
1658/**
1659 * Callback prototype for audio volume change.
1660 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1661 * \param volume software volume (1. = nominal, 0. = mute)
1662 * \param mute muted flag
1663 */
1664typedef void (*libvlc_audio_set_volume_cb)(void *data,
1665 float volume, bool mute);
1666
1667/**
1668 * Sets callbacks and private data for decoded audio.
1669 *
1670 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
1671 * to configure the decoded audio format.
1672 *
1673 * \note The audio callbacks override any other audio output mechanism.
1674 * If the callbacks are set, LibVLC will <b>not</b> output audio in any way.
1675 *
1676 * \param mp the media player
1677 * \param play callback to play audio samples (must not be NULL)
1678 * \param pause callback to pause playback (or NULL to ignore)
1679 * \param resume callback to resume playback (or NULL to ignore)
1680 * \param flush callback to flush audio buffers (or NULL to ignore)
1681 * \param drain callback to drain audio buffers (or NULL to ignore)
1682 * \param opaque private pointer for the audio callbacks (as first parameter)
1683 * \version LibVLC 2.0.0 or later
1684 */
1692 void *opaque );
1693
1694/**
1695 * Set callbacks and private data for decoded audio. This only works in
1696 * combination with libvlc_audio_set_callbacks().
1697 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
1698 * to configure the decoded audio format.
1699 *
1700 * \param mp the media player
1701 * \param set_volume callback to apply audio volume,
1702 * or NULL to apply volume in software
1703 * \version LibVLC 2.0.0 or later
1704 */
1707 libvlc_audio_set_volume_cb set_volume );
1708
1709/**
1710 * Callback prototype to setup the audio playback.
1711 *
1712 * This is called when the media player needs to create a new audio output.
1713 * \param[in,out] opaque pointer to the data pointer passed to
1714 * libvlc_audio_set_callbacks()
1715 * \param[in,out] format 4 bytes sample format
1716 * \param[in,out] rate sample rate
1717 * \param[in,out] channels channels count
1718 * \return 0 on success, anything else to skip audio playback
1719 */
1720typedef int (*libvlc_audio_setup_cb)(void **opaque, char *format, unsigned *rate,
1721 unsigned *channels);
1722
1723/**
1724 * Callback prototype for audio playback cleanup.
1725 *
1726 * This is called when the media player no longer needs an audio output.
1727 * \param[in] opaque data pointer as passed to libvlc_audio_set_callbacks()
1728 */
1729typedef void (*libvlc_audio_cleanup_cb)(void *opaque);
1730
1731/**
1732 * Sets decoded audio format via callbacks.
1733 *
1734 * This only works in combination with libvlc_audio_set_callbacks().
1735 *
1736 * \param mp the media player
1737 * \param setup callback to select the audio format (cannot be NULL)
1738 * \param cleanup callback to release any allocated resources (or NULL)
1739 * \version LibVLC 2.0.0 or later
1740 */
1744 libvlc_audio_cleanup_cb cleanup );
1745
1746/**
1747 * Sets a fixed decoded audio format.
1748 *
1749 * This only works in combination with libvlc_audio_set_callbacks(),
1750 * and is mutually exclusive with libvlc_audio_set_format_callbacks().
1751 *
1752 * The supported formats are:
1753 * - "S16N" for signed 16-bit PCM
1754 * - "S32N" for signed 32-bit PCM
1755 * - "FL32" for single precision IEEE 754
1756 *
1757 * All supported formats use the native endianness.
1758 * If there are more than one channel, samples are interleaved.
1759 *
1760 * \param mp the media player
1761 * \param format a four-characters string identifying the sample format
1762 * \param rate sample rate (expressed in Hz)
1763 * \param channels channels count
1764 * \version LibVLC 2.0.0 or later
1765 */
1768 unsigned rate, unsigned channels );
1769
1770/** \bug This might go away ... to be replaced by a broader system */
1771
1772/**
1773 * Get the current movie length (in us).
1774 *
1775 * \param p_mi the Media Player
1776 * \return the movie length (in us), or -1 if there is no media.
1777 */
1779
1780/**
1781 * Get the current movie time (in us).
1782 *
1783 * \param p_mi the Media Player
1784 * \return the movie time (in us), or -1 if there is no media.
1785 */
1787
1788/**
1789 * Set the movie time (in us).
1790 *
1791 * This has no effect if no media is being played.
1792 * Not all formats and protocols support this.
1793 *
1794 * \param p_mi the Media Player
1795 * \param i_time the movie time (in us).
1796 * \param b_fast prefer fast seeking or precise seeking
1797 * \return 0 on success, -1 on error
1798 */
1800 libvlc_time_t i_time, bool b_fast );
1801
1802/**
1803 * Jump the movie time (in us).
1804 *
1805 * This will trigger a precise and relative seek (from the current time).
1806 * This has no effect if no media is being played.
1807 * Not all formats and protocols support this.
1808 *
1809 * \param p_mi the Media Player
1810 * \param i_time the movie time (in us).
1811 * \return 0 on success, -1 on error
1812 * \version LibVLC 4.0.0 and later.
1813 */
1815 libvlc_time_t i_time );
1816
1817/**
1818 * Get movie position as percentage between 0.0 and 1.0.
1819 *
1820 * \param p_mi the Media Player
1821 * \return movie position, or -1. in case of error
1822 */
1824
1825/**
1826 * Set movie position as percentage between 0.0 and 1.0.
1827 * This has no effect if playback is not enabled.
1828 * This might not work depending on the underlying input format and protocol.
1829 *
1830 * \param p_mi the Media Player
1831 * \param b_fast prefer fast seeking or precise seeking
1832 * \param f_pos the position
1833 * \return 0 on success, -1 on error
1834 */
1836 double f_pos, bool b_fast );
1837
1838/**
1839 * Enable A to B loop for the current media by setting the start time and end
1840 * time
1841 *
1842 * The B time must be higher than the A time.
1843 *
1844 * \param p_mi the Media Player
1845 * \param a_time start time for the loop (in us)
1846 * \param b_time end time for the loop (in us)
1847 * \return 0 on success, -1 on error
1848 * \version LibVLC 4.0.0 and later.
1849 */
1850LIBVLC_API int
1852 libvlc_time_t a_time, libvlc_time_t b_time );
1853
1854/**
1855 * Enable A to B loop for the current media by setting the start position and
1856 * end position
1857 *
1858 * The B position must be higher than the A position.
1859 *
1860 * \param p_mi the Media Player
1861 * \param a_pos start position for the loop
1862 * \param b_pos end position for the loop
1863 * \return 0 on success, -1 on error
1864 * \version LibVLC 4.0.0 and later.
1865 */
1866LIBVLC_API int
1868 double a_pos, double b_pos );
1869
1870/**
1871 * Reset/remove the A to B loop for the current media
1872 *
1873 * \param p_mi the Media Player
1874 * \return 0 on success, -1 on error
1875 * \version LibVLC 4.0.0 and later.
1876 */
1877LIBVLC_API int
1879
1880/**
1881 * Get the A to B loop status
1882 *
1883 * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
1884 * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
1885 * output parameters are valid. If the returned status is
1886 * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
1887 *
1888 * @see vlc_player_cbs.on_atobloop_changed
1889 *
1890 * \param p_mi the Media Player
1891 * \param a_time A time (in us) or -1 (if the media doesn't have valid times)
1892 * \param a_pos A position
1893 * \param b_time B time (in us) or -1 (if the media doesn't have valid times)
1894 * \param b_pos B position
1895 * \return A to B loop status
1896 * \version LibVLC 4.0.0 and later.
1897 */
1900 libvlc_time_t *a_time, double *a_pos,
1901 libvlc_time_t *b_time, double *b_pos );
1902/**
1903 * Set movie chapter (if applicable).
1904 *
1905 * \param p_mi the Media Player
1906 * \param i_chapter chapter number to play
1907 */
1909
1910/**
1911 * Get movie chapter.
1912 *
1913 * \param p_mi the Media Player
1914 * \return chapter number currently playing, or -1 if there is no media.
1915 */
1917
1918/**
1919 * Get movie chapter count
1920 *
1921 * \param p_mi the Media Player
1922 * \return number of chapters in movie, or -1.
1923 */
1925
1926/**
1927 * Get title chapter count
1928 *
1929 * \param p_mi the Media Player
1930 * \param i_title title
1931 * \return number of chapters in title, or -1
1932 */
1934 libvlc_media_player_t *p_mi, int i_title );
1935
1936/**
1937 * Set movie title
1938 *
1939 * \param p_mi the Media Player
1940 * \param i_title title number to play
1941 */
1943
1944/**
1945 * Get movie title
1946 *
1947 * \param p_mi the Media Player
1948 * \return title number currently playing, or -1
1949 */
1951
1952/**
1953 * Get movie title count
1954 *
1955 * \param p_mi the Media Player
1956 * \return title number count, or -1
1957 */
1959
1960/**
1961 * Set previous chapter (if applicable)
1962 *
1963 * \param p_mi the Media Player
1964 */
1966
1967/**
1968 * Set next chapter (if applicable)
1969 *
1970 * \param p_mi the Media Player
1971 */
1973
1974/**
1975 * Get the requested movie play rate.
1976 * @warning Depending on the underlying media, the requested rate may be
1977 * different from the real playback rate.
1978 *
1979 * \param p_mi the Media Player
1980 * \return movie play rate
1981 */
1983
1984/**
1985 * Set movie play rate
1986 *
1987 * \param p_mi the Media Player
1988 * \param rate movie play rate to set
1989 * \return -1 if an error was detected, 0 otherwise (but even then, it might
1990 * not actually work depending on the underlying media protocol)
1991 */
1993
1994/**
1995 * Get current movie state
1996 *
1997 * \param p_mi the Media Player
1998 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
1999 */
2001
2002/**
2003 * How many video outputs does this media player have?
2004 *
2005 * \param p_mi the media player
2006 * \return the number of video outputs
2007 */
2009
2010/**
2011 * Is this media player seekable?
2012 *
2013 * \param p_mi the media player
2014 * \retval true media player can seek
2015 * \retval false media player cannot seek
2016 */
2018
2019/**
2020 * Can this media player be paused?
2021 *
2022 * \param p_mi the media player
2023 * \retval true media player can be paused
2024 * \retval false media player cannot be paused
2025 */
2027
2028/**
2029 * Check if the current program is scrambled
2030 *
2031 * \param p_mi the media player
2032 * \retval true current program is scrambled
2033 * \retval false current program is not scrambled
2034 *
2035 * \version LibVLC 2.2.0 or later
2036 */
2038
2039/**
2040 * Pause and display the next video frame.
2041 *
2042 * \note The player must be playing or paused. If playing, the player will be
2043 * paused first.
2044 *
2045 * \note The user should listen to the
2046 * libvlc_media_player_cbs.on_next_frame_status callback, to be notified when
2047 * the next frame is displayed.
2048 *
2049 * \param p_mi the media player
2050 * \version LibVLC 1.1.1 or later
2051 */
2053
2054/**
2055 * Pause and display the previous video frame.
2056 *
2057 * \note Works only on streams that support pause, seek, and pace control. If
2058 * playing, the player will be paused first.
2059 *
2060 * \note The user should listen to the
2061 * libvlc_media_player_cbs.on_prev_frame_status callback, to be notified when
2062 * the previous frame is displayed.
2063 *
2064 * \param p_mi the media player
2065 * \version LibVLC 4.0.0 or later
2066 */
2068
2069/**
2070 * Navigate through DVD Menu
2071 *
2072 * \param p_mi the Media Player
2073 * \param navigate the Navigation mode
2074 * \version libVLC 2.0.0 or later
2075 */
2077 unsigned navigate );
2078
2079/**
2080 * Set if, and how, the video title will be shown when media is played.
2081 *
2082 * \param p_mi the media player
2083 * \param position position at which to display the title, or libvlc_position_disable to prevent the title from being displayed
2084 * \param timeout title display timeout in milliseconds (ignored if libvlc_position_disable)
2085 * \version libVLC 2.1.0 or later
2086 */
2088
2089/**
2090 * Get the track list for one type
2091 *
2092 * \version LibVLC 4.0.0 and later.
2093 *
2094 * \note You need to parse using libvlc_parser_queue() or play the media
2095 * at least once before calling this function. Not doing this will result in
2096 * an empty list.
2097 *
2098 * \note This track list is a snapshot of the current tracks when this function
2099 * is called. If a track is updated after this call, the user will need to call
2100 * this function again to get the updated track.
2101 *
2102 *
2103 * The track list can be used to get track information and to select specific
2104 * tracks.
2105 *
2106 * \param p_mi the media player
2107 * \param type type of the track list to request
2108 * \param selected filter only selected tracks if true (return all tracks, even
2109 * selected ones if false)
2110 *
2111 * \return a valid libvlc_media_tracklist_t or NULL in case of error, if there
2112 * is no track for a category, the returned list will have a size of 0, delete
2113 * with libvlc_media_tracklist_delete()
2114 */
2117 libvlc_track_type_t type, bool selected );
2118
2119/**
2120 * Get the selected track for one type
2121 *
2122 * \version LibVLC 4.0.0 and later.
2123 *
2124 * \warning More than one tracks can be selected for one type. In that case,
2125 * libvlc_media_player_get_tracklist() should be used.
2126 *
2127 * \param p_mi the media player
2128 * \param type type of the selected track
2129 *
2130 * \return a valid track or NULL if there is no selected tracks for this type,
2131 * release it with libvlc_media_track_release().
2132 */
2135 libvlc_track_type_t type );
2136
2137/**
2138 * Get a track from a track id
2139 *
2140 * \version LibVLC 4.0.0 and later.
2141 *
2142 * This function can be used to get the last updated information of a track.
2143 *
2144 * \param p_mi the media player
2145 * \param psz_id valid string representing a track id (cf. psz_id from \ref
2146 * libvlc_media_track_t)
2147 *
2148 * \return a valid track or NULL if there is currently no tracks identified by
2149 * the string id, release it with libvlc_media_track_release().
2150 */
2153 const char *psz_id );
2154
2155
2156/**
2157 * Select a track
2158 *
2159 * This will unselected the current track.
2160 *
2161 * \version LibVLC 4.0.0 and later.
2162 *
2163 * \note Use libvlc_media_player_select_tracks() for multiple selection
2164 *
2165 * \warning Only use a \ref libvlc_media_track_t retrieved with \ref libvlc_media_player_get_tracklist
2166 *
2167 * \param p_mi the media player
2168 * \param track track to select, can't be NULL
2169 */
2170LIBVLC_API void
2172 const libvlc_media_track_t *track );
2173
2174/**
2175 * Unselect all tracks for a given type
2176 *
2177 * \version LibVLC 4.0.0 and later.
2178 *
2179 * \param p_mi the media player
2180 * \param type type to unselect
2181 */
2182LIBVLC_API void
2184 libvlc_track_type_t type );
2185
2186/**
2187 * Select multiple tracks for one type
2188 *
2189 * \version LibVLC 4.0.0 and later.
2190 *
2191 * \note The internal track list can change between the calls of
2192 * libvlc_media_player_get_tracklist() and
2193 * libvlc_media_player_set_tracks(). If a track selection change but the
2194 * track is not present anymore, the player will just ignore it.
2195 *
2196 * \note selecting multiple audio tracks is currently not supported.
2197 *
2198 * \warning Only use a \ref libvlc_media_track_t retrieved with \ref libvlc_media_player_get_tracklist
2199 *
2200 * \param p_mi the media player
2201 * \param type type of the selected track
2202 * \param tracks pointer to the track array, or NULL if track_count is 0
2203 * \param track_count number of tracks in the track array
2204 */
2205LIBVLC_API void
2208 const libvlc_media_track_t **tracks,
2209 size_t track_count );
2210
2211/**
2212 * Select tracks by their string identifier
2213 *
2214 * \version LibVLC 4.0.0 and later.
2215 *
2216 * This function can be used pre-select a list of tracks before starting the
2217 * player. It has only effect for the current media. It can also be used when
2218 * the player is already started.
2219 *
2220 * 'str_ids' can contain more than one track id, delimited with ','. "" or any
2221 * invalid track id will cause the player to unselect all tracks of that
2222 * category. NULL will disable the preference for newer tracks without
2223 * unselecting any current tracks.
2224 *
2225 * Example:
2226 * - (libvlc_track_video, "video/1,video/2") will select these 2 video tracks.
2227 * If there is only one video track with the id "video/0", no tracks will be
2228 * selected.
2229 * - (libvlc_track_type_t, "${slave_url_md5sum}/spu/0) will select one spu
2230 * added by an input slave with the corresponding url.
2231 *
2232 * \note The string identifier of a track can be found via psz_id from \ref
2233 * libvlc_media_track_t
2234 *
2235 * \note selecting multiple audio tracks is currently not supported.
2236 *
2237 * \warning Only use a \ref libvlc_media_track_t id retrieved with \ref libvlc_media_player_get_tracklist
2238 *
2239 * \param p_mi the media player
2240 * \param type type to select
2241 * \param psz_ids list of string identifier or NULL
2242 */
2243LIBVLC_API void
2246 const char *psz_ids );
2247
2248/**
2249 * Add a slave to the current media player.
2250 *
2251 * \note If the player is playing, the slave will be added directly. This call
2252 * will also update the slave list of the attached libvlc_media_t.
2253 *
2254 * \version LibVLC 3.0.0 and later.
2255 *
2256 * \see libvlc_media_slaves_add
2257 *
2258 * \param p_mi the media player
2259 * \param i_type subtitle or audio
2260 * \param psz_uri Uri of the slave (should contain a valid scheme).
2261 * \param b_select True if this slave should be selected when it's loaded
2262 *
2263 * \return 0 on success, -1 on error.
2264 */
2268 const char *psz_uri, bool b_select );
2269
2271{
2272 /** Id used for libvlc_media_player_select_program() */
2274 /** Program name, always valid */
2276 /** True if the program is selected */
2278 /** True if the program is scrambled */
2281
2282/**
2283 * Opaque struct containing a list of program
2284 */
2286
2287/**
2288 * Delete a program struct
2289 *
2290 * \version LibVLC 4.0.0 and later.
2291 *
2292 * \param program returned by libvlc_media_player_get_selected_program() or
2293 * libvlc_media_player_get_program_from_id()
2294 *
2295 */
2296LIBVLC_API void
2298
2299/**
2300 * Get the number of programs in a programlist
2301 *
2302 * \version LibVLC 4.0.0 and later.
2303 *
2304 * \param list valid programlist
2305 *
2306 * \return number of programs, or 0 if the list is empty
2307 */
2308LIBVLC_API size_t
2310
2311/**
2312 * Get a program at a specific index
2313 *
2314 * \warning The behaviour is undefined if the index is not valid.
2315 *
2316 * \version LibVLC 4.0.0 and later.
2317 *
2318 * \param list valid programlist
2319 * \param index valid index in the range [0; count[
2320 *
2321 * \return a valid program (can't be NULL if libvlc_player_programlist_count()
2322 * returned a valid count)
2323 */
2326
2327/**
2328 * Release a programlist
2329 *
2330 * \note program structs from the list are also deleted.
2331 *
2332 * \version LibVLC 4.0.0 and later.
2333 *
2334 * \see libvlc_media_player_get_programlist
2335 *
2336 * \param list valid programlist
2337 */
2338LIBVLC_API void
2340
2341/**
2342 * Select program with a given program id.
2343 *
2344 * \note program ids are sent via the libvlc_media_player_cbs.on_program_list_changed
2345 * callback or can be fetched via libvlc_media_player_get_programlist()
2346 *
2347 * \version LibVLC 4.0.0 or later
2348 *
2349 * \param p_mi opaque media player handle
2350 * \param i_group_id program id
2351 */
2353
2354/**
2355 * Get the selected program
2356 *
2357 * \version LibVLC 4.0.0 or later
2358 *
2359 * \param p_mi opaque media player handle
2360 *
2361 * \return a valid program struct or NULL if no programs are selected. The
2362 * program need to be freed with libvlc_player_program_delete().
2363 */
2366
2367/**
2368 * Get a program struct from a program id
2369 *
2370 * \version LibVLC 4.0.0 or later
2371 *
2372 * \param p_mi opaque media player handle
2373 * \param i_group_id program id
2374 *
2375 * \return a valid program struct or NULL if the i_group_id is not found. The
2376 * program need to be freed with libvlc_player_program_delete().
2377 */
2380
2381/**
2382 * Get the program list
2383 *
2384 * \version LibVLC 4.0.0 and later.
2385 * \note This program list is a snapshot of the current programs when this
2386 * function is called. If a program is updated after this call, the user will
2387 * need to call this function again to get the updated program.
2388 *
2389 * The program list can be used to get program information and to select
2390 * specific programs.
2391 *
2392 * \param p_mi the media player
2393 *
2394 * \return a valid libvlc_media_programlist_t or NULL in case of error or empty
2395 * list, delete with libvlc_media_programlist_delete()
2396 */
2399
2400
2401/** \defgroup libvlc_video LibVLC video controls
2402 * @{
2403 */
2404
2405/**
2406 * Toggle fullscreen status on non-embedded video outputs.
2407 *
2408 * @warning The same limitations applies to this function
2409 * as to libvlc_set_fullscreen().
2410 *
2411 * \param p_mi the media player
2412 */
2414
2415/**
2416 * Enable or disable fullscreen.
2417 *
2418 * @warning With most window managers, only a top-level windows can be in
2419 * full-screen mode. Hence, this function will not operate properly if
2420 * libvlc_media_player_set_xwindow() was used to embed the video in a
2421 * non-top-level window. In that case, the embedding window must be reparented
2422 * to the root window <b>before</b> fullscreen mode is enabled. You will want
2423 * to reparent it back to its normal parent when disabling fullscreen.
2424 *
2425 * \note This setting applies to any and all current or future active video
2426 * tracks and windows for the given media player. The choice of fullscreen
2427 * output for each window is left to the operating system.
2428 *
2429 * \param p_mi the media player
2430 * \param b_fullscreen boolean for fullscreen status
2431 */
2433
2434/**
2435 * Get current fullscreen status.
2436 *
2437 * \param p_mi the media player
2438 * \return the fullscreen status (boolean)
2439 *
2440 * \retval false media player is windowed
2441 * \retval true media player is in fullscreen mode
2442 */
2444
2445/**
2446 * Enable or disable key press events handling, according to the LibVLC hotkeys
2447 * configuration. By default and for historical reasons, keyboard events are
2448 * handled by the LibVLC video widget.
2449 *
2450 * \note On X11, there can be only one subscriber for key press and mouse
2451 * click events per window. If your application has subscribed to those events
2452 * for the X window ID of the video widget, then LibVLC will not be able to
2453 * handle key presses and mouse clicks in any case.
2454 *
2455 * \warning This function is only implemented for X11 and Win32 at the moment.
2456 *
2457 * \param p_mi the media player
2458 * \param on true to handle key press events, false to ignore them.
2459 */
2462
2463/**
2464 * Enable or disable mouse click events handling. By default, those events are
2465 * handled. This is needed for DVD menus to work, as well as a few video
2466 * filters such as "puzzle".
2467 *
2468 * \see libvlc_video_set_key_input().
2469 *
2470 * \warning This function is only implemented for X11 and Win32 at the moment.
2471 *
2472 * \param p_mi the media player
2473 * \param on true to handle mouse click events, false to ignore them.
2474 */
2477
2478/**
2479 * Get the pixel dimensions of a video.
2480 *
2481 * \param p_mi media player
2482 * \param num number of the video (starting from, and most commonly 0)
2483 * \param[out] px pointer to get the pixel width
2484 * \param[out] py pointer to get the pixel height
2485 * \return 0 on success, -1 if the specified video does not exist
2486 */
2489 unsigned *px, unsigned *py );
2490
2491/**
2492 * Get the mouse pointer coordinates over a video.
2493 * Coordinates are expressed in terms of the decoded video resolution,
2494 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
2495 * you can query your windowing system directly).
2496 *
2497 * Either of the coordinates may be negative or larger than the corresponding
2498 * dimension of the video, if the cursor is outside the rendering area.
2499 *
2500 * @warning The coordinates may be out-of-date if the pointer is not located
2501 * on the video rendering area. LibVLC does not track the pointer if it is
2502 * outside of the video widget.
2503 *
2504 * @note LibVLC does not support multiple pointers (it does of course support
2505 * multiple input devices sharing the same pointer) at the moment.
2506 *
2507 * \param p_mi media player
2508 * \param num number of the video (starting from, and most commonly 0)
2509 * \param[out] px pointer to get the abscissa
2510 * \param[out] py pointer to get the ordinate
2511 * \return 0 on success, -1 if the specified video does not exist
2512 */
2515 int *px, int *py );
2516
2517/**
2518 * Get the current video scaling factor.
2519 * See also libvlc_video_set_scale().
2520 *
2521 * \param p_mi the media player
2522 * \return the currently configured zoom factor, or 0. if the video is set
2523 * to fit to the output window/drawable automatically.
2524 */
2526
2527/**
2528 * Set the video scaling factor. That is the ratio of the number of pixels on
2529 * screen to the number of pixels in the original decoded video in each
2530 * dimension. Zero is a special value; it will adjust the video to the output
2531 * window/drawable (in windowed mode) or the entire screen.
2532 *
2533 * Note that not all video outputs support scaling.
2534 *
2535 * \param p_mi the media player
2536 * \param f_factor the scaling factor, or zero
2537 */
2539
2540/**
2541 * Get current video aspect ratio.
2542 *
2543 * \param p_mi the media player
2544 * \return the video aspect ratio or NULL if unspecified
2545 * (the result must be released with free() or libvlc_free()).
2546 */
2548
2549/**
2550 * Set new video aspect ratio.
2551 *
2552 * \param p_mi the media player
2553 * \param psz_aspect new video aspect-ratio, "fill" to fill the window or NULL to reset to source aspect ratio
2554 * \note Invalid aspect ratios are ignored.
2555 */
2557
2558/**
2559 * Get current video display fit mode.
2560 *
2561 * \version LibVLC 4.0.0 or later
2562 *
2563 * \param p_mi the media player
2564 * \return the video display fit mode.
2565 */
2567
2568/**
2569 * Set new video display fit.
2570 *
2571 * \version LibVLC 4.0.0 or later
2572 *
2573 * \param p_mi the media player
2574 * \param fit new display fit mode
2575 * \note Invalid fit mode are ignored.
2576 */
2578
2579/**
2580 * Create a video viewpoint structure.
2581 *
2582 * \version LibVLC 3.0.0 and later
2583 *
2584 * \return video viewpoint or NULL
2585 * (the result must be released with free()).
2586 */
2588
2589/**
2590 * Update the video viewpoint information.
2591 *
2592 * \note It is safe to call this function before the media player is started.
2593 *
2594 * \version LibVLC 3.0.0 and later
2595 *
2596 * \param p_mi the media player
2597 * \param p_viewpoint video viewpoint allocated via libvlc_video_new_viewpoint()
2598 * \param b_absolute if true replace the old viewpoint with the new one. If
2599 * false, increase/decrease it.
2600 * \return -1 in case of error, 0 otherwise
2601 *
2602 * \note the values are set asynchronously, it will be used by the next frame displayed.
2603 */
2605 const libvlc_video_viewpoint_t *p_viewpoint,
2606 bool b_absolute);
2607
2608/**
2609 * Video stereo modes
2610 */
2618
2619/**
2620 * Get current video stereo mode.
2621 *
2622 * \param p_mi the media player
2623 * \return the video stereo mode.
2624 */
2626 libvlc_media_player_t *p_mi );
2627
2628/**
2629 * Set new video stereo mode.
2630 *
2631 * \param p_mi the media player
2632 * \param i_mode new video stereo mode
2633 */
2635 const libvlc_video_stereo_mode_t i_mode );
2636
2637/**
2638 * Get the current subtitle delay. Positive values means subtitles are being
2639 * displayed later, negative values earlier.
2640 *
2641 * \param p_mi media player
2642 * \return time (in microseconds) the display of subtitles is being delayed
2643 * \version LibVLC 2.0.0 or later
2644 */
2646
2647/**
2648 * Get the current subtitle text scale
2649 *
2650 * The scale factor is expressed as a percentage of the default size, where
2651 * 1.0 represents 100 percent.
2652 *
2653 * \param p_mi media player
2654 * \version LibVLC 4.0.0 or later
2655 */
2657
2658/**
2659 * Set the subtitle text scale.
2660 *
2661 * The scale factor is expressed as a percentage of the default size, where
2662 * 1.0 represents 100 percent.
2663 *
2664 * A value of 0.5 would result in text half the normal size, and a value of 2.0
2665 * would result in text twice the normal size.
2666 *
2667 * The minimum acceptable value for the scale factor is 0.1.
2668 *
2669 * The maximum is 5.0 (five times normal size).
2670 *
2671 * \param p_mi media player
2672 * \param f_scale scale factor in the range [0.1;5.0] (default: 1.0)
2673 * \version LibVLC 4.0.0 or later
2674 */
2676
2677/**
2678 * Set the subtitle delay. This affects the timing of when the subtitle will
2679 * be displayed. Positive values result in subtitles being displayed later,
2680 * while negative values will result in subtitles being displayed earlier.
2681 *
2682 * The subtitle delay will be reset to zero each time the media changes.
2683 *
2684 * \param p_mi media player
2685 * \param i_delay time (in microseconds) the display of subtitles should be delayed
2686 * \return 0 on success, -1 on error
2687 * \version LibVLC 2.0.0 or later
2688 */
2690
2691/**
2692 * Get the full description of available titles
2693 *
2694 * \version LibVLC 3.0.0 and later.
2695 *
2696 * \param p_mi the media player
2697 * \param[out] titles address to store an allocated array of title descriptions
2698 * descriptions (must be freed with libvlc_title_descriptions_release()
2699 * by the caller)
2700 *
2701 * \return the number of titles (-1 on error)
2702 */
2704 libvlc_title_description_t ***titles );
2705
2706/**
2707 * Release a title description
2708 *
2709 * \version LibVLC 3.0.0 and later
2710 *
2711 * \param p_titles title description array to release
2712 * \param i_count number of title descriptions to release
2713 */
2716 unsigned i_count );
2717
2718/**
2719 * Get the full description of available chapters
2720 *
2721 * \version LibVLC 3.0.0 and later.
2722 *
2723 * \param p_mi the media player
2724 * \param i_chapters_of_title index of the title to query for chapters (uses current title if set to -1)
2725 * \param[out] pp_chapters address to store an allocated array of chapter descriptions
2726 * descriptions (must be freed with libvlc_chapter_descriptions_release()
2727 * by the caller)
2728 *
2729 * \return the number of chapters (-1 on error)
2730 */
2732 int i_chapters_of_title,
2733 libvlc_chapter_description_t *** pp_chapters );
2734
2735/**
2736 * Release a chapter description
2737 *
2738 * \version LibVLC 3.0.0 and later
2739 *
2740 * \param p_chapters chapter description array to release
2741 * \param i_count number of chapter descriptions to release
2742 */
2745 unsigned i_count );
2746
2747/**
2748 * Set/unset the video crop ratio.
2749 *
2750 * This function forces a crop ratio on any and all video tracks rendered by
2751 * the media player. If the display aspect ratio of a video does not match the
2752 * crop ratio, either the top and bottom, or the left and right of the video
2753 * will be cut out to fit the crop ratio.
2754 *
2755 * For instance, a ratio of 1:1 will force the video to a square shape.
2756 *
2757 * To disable video crop, set a crop ratio with zero as denominator.
2758 *
2759 * A call to this function overrides any previous call to any of
2760 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2761 * libvlc_video_set_crop_window().
2762 *
2763 * \see libvlc_video_set_aspect_ratio()
2764 *
2765 * \param mp the media player
2766 * \param num crop ratio numerator (ignored if denominator is 0)
2767 * \param den crop ratio denominator (or 0 to unset the crop ratio)
2768 *
2769 * \version LibVLC 4.0.0 and later
2770 */
2773 unsigned num, unsigned den);
2774
2775/**
2776 * Set the video crop window.
2777 *
2778 * This function selects a sub-rectangle of video to show. Any pixels outside
2779 * the rectangle will not be shown.
2780 *
2781 * To unset the video crop window, use libvlc_video_set_crop_ratio() or
2782 * libvlc_video_set_crop_border().
2783 *
2784 * A call to this function overrides any previous call to any of
2785 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2786 * libvlc_video_set_crop_window().
2787 *
2788 * \param mp the media player
2789 * \param x abscissa (i.e. leftmost sample column offset) of the crop window
2790 * \param y ordinate (i.e. topmost sample row offset) of the crop window
2791 * \param width sample width of the crop window (cannot be zero)
2792 * \param height sample height of the crop window (cannot be zero)
2793 *
2794 * \version LibVLC 4.0.0 and later
2795 */
2798 unsigned x, unsigned y,
2799 unsigned width, unsigned height);
2800
2801/**
2802 * Set the video crop borders.
2803 *
2804 * This function selects the size of video edges to be cropped out.
2805 *
2806 * To unset the video crop borders, set all borders to zero.
2807 *
2808 * A call to this function overrides any previous call to any of
2809 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2810 * libvlc_video_set_crop_window().
2811 *
2812 * \param mp the media player
2813 * \param left number of sample columns to crop on the left
2814 * \param right number of sample columns to crop on the right
2815 * \param top number of sample rows to crop on the top
2816 * \param bottom number of sample rows to corp on the bottom
2817 *
2818 * \version LibVLC 4.0.0 and later
2819 */
2822 unsigned left, unsigned right,
2823 unsigned top, unsigned bottom);
2824
2825/**
2826 * Get current teletext page requested or 0 if it's disabled.
2827 *
2828 * Teletext is disabled by default, call libvlc_video_set_teletext() to enable
2829 * it.
2830 *
2831 * \param p_mi the media player
2832 * \return the current teletext page requested.
2833 */
2835
2836/**
2837 * Set new teletext page to retrieve.
2838 *
2839 * This function can also be used to send a teletext key.
2840 *
2841 * \param p_mi the media player
2842 * \param i_page teletex page number requested. This value can be 0 to disable
2843 * teletext, a number in the range ]0;1000[ to show the requested page, or a
2844 * \ref libvlc_teletext_key_t. 100 is the default teletext page.
2845 */
2847
2848/**
2849 * Set teletext background transparency.
2850 *
2851 * \param p_mi the media player
2852 * \param transparent whether background should be transparent.
2853 * \version LibVLC 4.0.0 or later
2854 */
2856
2857/**
2858 * Get teletext background transparency.
2859 *
2860 * \param p_mi the media player
2861 * \retval true teletext has transparent background
2862 * \retval false teletext has opaque background
2863 * \version LibVLC 4.0.0 or later
2864 */
2866
2867/**
2868 * Take a snapshot of the current video window.
2869 *
2870 * If i_width AND i_height is 0, original size is used.
2871 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
2872 *
2873 * \param p_mi media player instance
2874 * \param num number of video output (typically 0 for the first/only one)
2875 * \param psz_filepath the path of a file or a folder to save the screenshot into
2876 * \param i_width the snapshot's width
2877 * \param i_height the snapshot's height
2878 * \return 0 on success, -1 if the video was not found
2879 */
2882 const char *psz_filepath, unsigned int i_width,
2883 unsigned int i_height );
2884
2885/**
2886 * Gets the deinterlacing parameters.
2887 *
2888 * If \p modep is not NULL, it will be set to a heap-allocated nul-terminated
2889 * character string indicating the current deinterlacing algorithm name.
2890 * If no algorithm is selected or if allocation fails, it be set to NULL.
2891 * The value should be freed with the C run-time's free() function to avoid
2892 * leaking.
2893 *
2894 * \param mpi media player instance
2895 * \param modep storage space for hold the mode name (or NULL) [OUT]
2896 * \retval -1 deinterlacing is selected automatically
2897 * \retval 0 deinterlacing is forcefully disabled
2898 * \retval 1 deinterlacing is forcefully enabled
2899 */
2901 char **modep);
2902
2903/**
2904 * Enable or disable deinterlace filter
2905 *
2906 * \param p_mi libvlc media player
2907 * \param deinterlace state -1: auto (default), 0: disabled, 1: enabled
2908 * \param psz_mode type of deinterlace filter, NULL for current/default filter
2909 * \version LibVLC 4.0.0 and later
2910 * \return 0 on success, -1 if the mode was not recognised
2911 */
2913 int deinterlace,
2914 const char *psz_mode );
2915
2916/**
2917 * Get an integer marquee option value
2918 *
2919 * \param p_mi libvlc media player
2920 * \param option marq option to get \see libvlc_video_marquee_option_t
2921 */
2923 unsigned option );
2924
2925/**
2926 * Enable, disable or set an integer marquee option
2927 *
2928 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
2929 * or disabling (arg 0) the marq filter.
2930 *
2931 * \param p_mi libvlc media player
2932 * \param option marq option to set \see libvlc_video_marquee_option_t
2933 * \param i_val marq option value
2934 */
2936 unsigned option, int i_val );
2937
2938/**
2939 * Set a marquee string option
2940 *
2941 * \param p_mi libvlc media player
2942 * \param option marq option to set \see libvlc_video_marquee_option_t
2943 * \param psz_text marq option value
2944 */
2946 unsigned option, const char *psz_text );
2947
2948/** option values for libvlc_video_{get,set}_logo_{int,string} */
2959
2960/**
2961 * Get integer logo option.
2962 *
2963 * \param p_mi libvlc media player instance
2964 * \param option logo option to get, values of libvlc_video_logo_option_t
2965 */
2967 unsigned option );
2968
2969/**
2970 * Set logo option as integer. Options that take a different type value
2971 * are ignored.
2972 * Passing libvlc_logo_enable as option value has the side effect of
2973 * starting (arg !0) or stopping (arg 0) the logo filter.
2974 *
2975 * \param p_mi libvlc media player instance
2976 * \param option logo option to set, values of libvlc_video_logo_option_t
2977 * \param value logo option value
2978 */
2980 unsigned option, int value );
2981
2982/**
2983 * Set logo option as string. Options that take a different type value
2984 * are ignored.
2985 *
2986 * \param p_mi libvlc media player instance
2987 * \param option logo option to set, values of libvlc_video_logo_option_t
2988 * \param psz_value logo option value
2989 */
2991 unsigned option, const char *psz_value );
2992
2993
2994/** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
3003
3004/**
3005 * Get integer adjust option.
3006 *
3007 * \param p_mi libvlc media player instance
3008 * \param option adjust option to get, values of libvlc_video_adjust_option_t
3009 * \version LibVLC 1.1.1 and later.
3010 */
3012 unsigned option );
3013
3014/**
3015 * Set adjust option as integer. Options that take a different type value
3016 * are ignored.
3017 * Passing libvlc_adjust_enable as option value has the side effect of
3018 * starting (arg !0) or stopping (arg 0) the adjust filter.
3019 *
3020 * \param p_mi libvlc media player instance
3021 * \param option adjust option to set, values of libvlc_video_adjust_option_t
3022 * \param value adjust option value
3023 * \version LibVLC 1.1.1 and later.
3024 */
3026 unsigned option, int value );
3027
3028/**
3029 * Get float adjust option.
3030 *
3031 * \param p_mi libvlc media player instance
3032 * \param option adjust option to get, values of libvlc_video_adjust_option_t
3033 * \version LibVLC 1.1.1 and later.
3034 */
3036 unsigned option );
3037
3038/**
3039 * Set adjust option as float. Options that take a different type value
3040 * are ignored.
3041 *
3042 * \param p_mi libvlc media player instance
3043 * \param option adjust option to set, values of libvlc_video_adjust_option_t
3044 * \param value adjust option value
3045 * \version LibVLC 1.1.1 and later.
3046 */
3048 unsigned option, float value );
3049/**
3050 * Change the projection mode used for rendering the source.
3051 *
3052 * This changes how the source is mapped to the output w.r.t. 360 playback.
3053 *
3054 * \param p_mi libvlc media player instance
3055 * \param projection_mode the considered projection mode for the source
3056 * \version LibVLC 4.0.0 and later.
3057 */
3058LIBVLC_API void
3060 libvlc_video_projection_t projection_mode);
3061
3062/**
3063 * Remove previously set projection mode.
3064 *
3065 * Remove the effects from previous call to libvlc_video_set_projection_mode.
3066 *
3067 * \param p_mi libvlc media player instance
3068 * \version LibVLC 4.0.0 and later.
3069 */
3070LIBVLC_API void
3072
3073/** @} video */
3074
3075/** \defgroup libvlc_audio LibVLC audio controls
3076 * @{
3077 */
3078
3079/**
3080 * Audio stereo modes
3081 */
3091
3092/**
3093 * Audio mix modes
3094 */
3103
3104/**
3105 * Gets the list of available audio output modules.
3106 *
3107 * \param p_instance libvlc instance
3108 * \return list of available audio outputs. It must be freed with
3109* \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
3110 * In case of error, NULL is returned.
3111 */
3114
3115/**
3116 * Frees the list of available audio output modules.
3117 *
3118 * \param p_list list with audio outputs for release
3119 */
3122
3123/**
3124 * Selects an audio output module.
3125 * \note Any change will take be effect only after playback is stopped and
3126 * restarted. Audio output cannot be changed while playing.
3127 *
3128 * \param p_mi media player
3129 * \param psz_name name of audio output,
3130 * use psz_name of \see libvlc_audio_output_t
3131 * \return 0 if function succeeded, -1 on error
3132 */
3134 const char *psz_name );
3135
3136/**
3137 * Gets a list of potential audio output devices.
3138 *
3139 * See also libvlc_audio_output_device_set().
3140 *
3141 * \note Not all audio outputs support enumerating devices.
3142 * The audio output may be functional even if the list is empty (NULL).
3143 *
3144 * \note The list may not be exhaustive.
3145 *
3146 * \warning Some audio output devices in the list might not actually work in
3147 * some circumstances. By default, it is recommended to not specify any
3148 * explicit audio device.
3149 *
3150 * \param mp media player
3151 * \return A NULL-terminated linked list of potential audio output devices.
3152 * It must be freed with libvlc_audio_output_device_list_release()
3153 * \version LibVLC 2.2.0 or later.
3154 */
3157
3158#if defined (__GNUC__) && !defined (__clang__)
3159__attribute__((unused))
3160__attribute__((noinline))
3161__attribute__((error("Use libvlc_audio_output_device_enum() instead")))
3163libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
3164 const char *aout )
3165{
3166 (void) p_instance; (void) aout;
3167 return NULL;
3168}
3169#endif
3170
3171/**
3172 * Frees a list of available audio output devices.
3173 *
3174 * \param p_list list with audio outputs for release
3175 * \version LibVLC 2.1.0 or later.
3176 */
3179
3180/**
3181 * Configures an explicit audio output device.
3182 *
3183 * A list of adequate potential device strings can be obtained with
3184 * libvlc_audio_output_device_enum().
3185 *
3186 * \note This function does not select the specified audio output plugin.
3187 * libvlc_audio_output_set() is used for that purpose.
3188 *
3189 * \warning The syntax for the device parameter depends on the audio output.
3190 *
3191 * Some audio output modules require further parameters (e.g. a channels map
3192 * in the case of ALSA).
3193 *
3194 * \version This function originally expected three parameters.
3195 * The middle parameter was removed from LibVLC 4.0 onward.
3196 *
3197 * \param mp media player
3198 * \param device_id device identifier string
3199 * (see \ref libvlc_audio_output_device_t::psz_device)
3200 *
3201 * \return If the change of device was requested successfully, zero is returned
3202 * (the actual change is asynchronous and not guaranteed to succeed).
3203 * On error, a non-zero value is returned.
3204 */
3206 const char *device_id );
3207
3208/**
3209 * Get the current audio output device identifier.
3210 *
3211 * This complements libvlc_audio_output_device_set().
3212 *
3213 * \warning The initial value for the current audio output device identifier
3214 * may not be set or may be some unknown value. A LibVLC application should
3215 * compare this value against the known device identifiers (e.g. those that
3216 * were previously retrieved by a call to libvlc_audio_output_device_enum) to
3217 * find the current audio output device.
3218 *
3219 * It is possible that the selected audio output device changes (an external
3220 * change) without a call to libvlc_audio_output_device_set. That may make this
3221 * method unsuitable to use if a LibVLC application is attempting to track
3222 * dynamic audio device changes as they happen.
3223 *
3224 * \param mp media player
3225 * \return the current audio output device identifier
3226 * NULL if no device is selected or in case of error
3227 * (the result must be released with free()).
3228 * \version LibVLC 3.0.0 or later.
3229 */
3231
3232/**
3233 * Toggle mute status.
3234 *
3235 * \param p_mi media player
3236 * \warning Toggling mute atomically is not always possible: On some platforms,
3237 * other processes can mute the VLC audio playback stream asynchronously. Thus,
3238 * there is a small race condition where toggling will not work.
3239 * See also the limitations of libvlc_audio_set_mute().
3240 */
3242
3243/**
3244 * Get current mute status.
3245 *
3246 * \param p_mi media player
3247 * \return the mute status (boolean) if defined, -1 if undefined/unapplicable
3248 */
3250
3251/**
3252 * Set mute status.
3253 *
3254 * \param p_mi media player
3255 * \param status If status is true then mute, otherwise unmute
3256 * \warning This function does not always work. If there are no active audio
3257 * playback stream, the mute status might not be available. If digital
3258 * pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also
3259 * some audio output plugins do not support muting at all.
3260 * \note To force silent playback, disable all audio tracks. This is more
3261 * efficient and reliable than mute.
3262 */
3264
3265/**
3266 * Get current software audio volume.
3267 *
3268 * \param p_mi media player
3269 * \return the software volume in percents
3270 * (0 = mute, 100 = nominal / 0dB)
3271 */
3273
3274/**
3275 * Set current software audio volume.
3276 *
3277 * \param p_mi media player
3278 * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
3279 * \return 0 if the volume was set, -1 if it was out of range
3280 */
3282
3283/**
3284 * Get current audio stereo-mode.
3285 *
3286 * \param p_mi media player
3287 * \return the audio stereo-mode, \see libvlc_audio_output_stereomode_t
3288 * \version LibVLC 4.0.0 or later
3289 */
3291
3292/**
3293 * Set current audio stereo-mode.
3294 *
3295 * \param p_mi media player
3296 * \param mode the audio stereo-mode, \see libvlc_audio_output_stereomode_t
3297 * \return 0 on success, -1 on error
3298 * \version LibVLC 4.0.0 or later
3299 */
3302
3303/**
3304 * Get current audio mix-mode.
3305 *
3306 * \param p_mi media player
3307 * \return the audio mix-mode, \see libvlc_audio_output_mixmode_t
3308 * \version LibVLC 4.0.0 or later
3309 */
3311
3312/**
3313 * Set current audio mix-mode.
3314 *
3315 * By default (::libvlc_AudioMixMode_Unset), the audio output will keep its
3316 * original channel configuration (play stereo as stereo, or 5.1 as 5.1). Yet,
3317 * the OS and Audio API might refuse a channel configuration and asks VLC to
3318 * adapt (Stereo played as 5.1 or vice-versa).
3319 *
3320 * This function allows to force a channel configuration, it will only work if
3321 * the OS and Audio API accept this configuration (otherwise, it won't have any
3322 * effects). Here are some examples:
3323 * - Play multi-channels (5.1, 7.1...) as stereo (::libvlc_AudioMixMode_Stereo)
3324 * - Play Stereo or 5.1 as 7.1 (::libvlc_AudioMixMode_7_1)
3325 * - Play multi-channels as stereo with a binaural effect
3326 * (::libvlc_AudioMixMode_Binaural). It might be selected automatically if the
3327 * OS and Audio API can detect if a headphone is plugged.
3328 *
3329 * \param p_mi media player
3330 * \param mode the audio mix-mode, \see libvlc_audio_output_mixmode_t
3331 * \return 0 on success, -1 on error
3332 * \version LibVLC 4.0.0 or later
3333 */
3336
3337
3338/**
3339 * Get current audio delay.
3340 *
3341 * \param p_mi media player
3342 * \return the audio delay (microseconds)
3343 * \version LibVLC 1.1.1 or later
3344 */
3346
3347/**
3348 * Set current audio delay. The audio delay will be reset to zero each time the media changes.
3349 *
3350 * \param p_mi media player
3351 * \param i_delay the audio delay (microseconds)
3352 * \return 0 on success, -1 on error
3353 * \version LibVLC 1.1.1 or later
3354 */
3356
3357/**
3358 * Get the number of equalizer presets.
3359 *
3360 * \return number of presets
3361 * \version LibVLC 2.2.0 or later
3362 */
3364
3365/**
3366 * Get the name of a particular equalizer preset.
3367 *
3368 * This name can be used, for example, to prepare a preset label or menu in a user
3369 * interface.
3370 *
3371 * \param u_index index of the preset, counting from zero
3372 * \return preset name, or NULL if there is no such preset
3373 * \version LibVLC 2.2.0 or later
3374 */
3376
3377/**
3378 * Get the number of distinct frequency bands for an equalizer.
3379 *
3380 * \return number of frequency bands
3381 * \version LibVLC 2.2.0 or later
3382 */
3384
3385/**
3386 * Get a particular equalizer band frequency.
3387 *
3388 * This value can be used, for example, to create a label for an equalizer band control
3389 * in a user interface.
3390 *
3391 * \param u_index index of the band, counting from zero
3392 * \return equalizer band frequency (Hz), or -1 if there is no such band
3393 * \version LibVLC 2.2.0 or later
3394 */
3396
3397/**
3398 * Create a new default equalizer, with all frequency values zeroed.
3399 *
3400 * The new equalizer can subsequently be applied to a media player by invoking
3401 * libvlc_media_player_set_equalizer().
3402 *
3403 * The returned handle should be freed via libvlc_audio_equalizer_release() when
3404 * it is no longer needed.
3405 *
3406 * \return opaque equalizer handle, or NULL on error
3407 * \version LibVLC 2.2.0 or later
3408 */
3410
3411/**
3412 * Create a new equalizer, with initial frequency values copied from an existing
3413 * preset.
3414 *
3415 * The new equalizer can subsequently be applied to a media player by invoking
3416 * libvlc_media_player_set_equalizer().
3417 *
3418 * The returned handle should be freed via libvlc_audio_equalizer_release() when
3419 * it is no longer needed.
3420 *
3421 * \param u_index index of the preset, counting from zero
3422 * \return opaque equalizer handle, or NULL on error
3423 * (it must be released with libvlc_audio_equalizer_release())
3424 * \version LibVLC 2.2.0 or later
3425 */
3427
3428/**
3429 * Release a previously created equalizer instance.
3430 *
3431 * The equalizer was previously created by using libvlc_audio_equalizer_new() or
3432 * libvlc_audio_equalizer_new_from_preset().
3433 *
3434 * It is safe to invoke this method with a NULL p_equalizer parameter for no effect.
3435 *
3436 * \param p_equalizer opaque equalizer handle, or NULL
3437 * \version LibVLC 2.2.0 or later
3438 */
3440
3441/**
3442 * Set a new pre-amplification value for an equalizer.
3443 *
3444 * The new equalizer settings are subsequently applied to a media player by invoking
3445 * libvlc_media_player_set_equalizer().
3446 *
3447 * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
3448 *
3449 * \param p_equalizer valid equalizer handle, must not be NULL
3450 * \param f_preamp preamp value (-20.0 to 20.0 Hz)
3451 * \return zero on success, -1 on error
3452 * \version LibVLC 2.2.0 or later
3453 */
3455
3456/**
3457 * Get the current pre-amplification value from an equalizer.
3458 *
3459 * \param p_equalizer valid equalizer handle, must not be NULL
3460 * \return preamp value (Hz)
3461 * \version LibVLC 2.2.0 or later
3462 */
3464
3465/**
3466 * Set a new amplification value for a particular equalizer frequency band.
3467 *
3468 * The new equalizer settings are subsequently applied to a media player by invoking
3469 * libvlc_media_player_set_equalizer().
3470 *
3471 * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
3472 *
3473 * \param p_equalizer valid equalizer handle, must not be NULL
3474 * \param f_amp amplification value (-20.0 to 20.0 Hz)
3475 * \param u_band index, counting from zero, of the frequency band to set
3476 * \return zero on success, -1 on error
3477 * \version LibVLC 2.2.0 or later
3478 */
3479LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index( libvlc_equalizer_t *p_equalizer, float f_amp, unsigned u_band );
3480
3481/**
3482 * Get the amplification value for a particular equalizer frequency band.
3483 *
3484 * \param p_equalizer valid equalizer handle, must not be NULL
3485 * \param u_band index, counting from zero, of the frequency band to get
3486 * \return amplification value (Hz); NaN if there is no such frequency band
3487 * \version LibVLC 2.2.0 or later
3488 */
3490
3491/**
3492 * Apply new equalizer settings to a media player.
3493 *
3494 * The equalizer is first created by invoking libvlc_audio_equalizer_new() or
3495 * libvlc_audio_equalizer_new_from_preset().
3496 *
3497 * It is possible to apply new equalizer settings to a media player whether the media
3498 * player is currently playing media or not.
3499 *
3500 * Invoking this method will immediately apply the new equalizer settings to the audio
3501 * output of the currently playing media if there is any.
3502 *
3503 * If there is no currently playing media, the new equalizer settings will be applied
3504 * later if and when new media is played.
3505 *
3506 * Equalizer settings will automatically be applied to subsequently played media.
3507 *
3508 * To disable the equalizer for a media player invoke this method passing NULL for the
3509 * p_equalizer parameter.
3510 *
3511 * The media player does not keep a reference to the supplied equalizer so it is safe
3512 * for an application to release the equalizer reference any time after this method
3513 * returns.
3514 *
3515 * \param p_mi opaque media player handle
3516 * \param p_equalizer opaque equalizer handle, or NULL to disable the equalizer for this media player
3517 * \return zero on success, -1 on error
3518 * \version LibVLC 2.2.0 or later
3519 */
3521
3522/**
3523 * Media player roles.
3524 *
3525 * \version LibVLC 3.0.0 and later.
3526 *
3527 * See \ref libvlc_media_player_set_role()
3528 */
3530 libvlc_role_None = 0, /**< Don't use a media player role */
3531 libvlc_role_Music, /**< Music (or radio) playback */
3532 libvlc_role_Video, /**< Video playback */
3533 libvlc_role_Communication, /**< Speech, real-time communication */
3534 libvlc_role_Game, /**< Video game */
3535 libvlc_role_Notification, /**< User interaction feedback */
3536 libvlc_role_Animation, /**< Embedded animation (e.g. in web page) */
3537 libvlc_role_Production, /**< Audio editing/production */
3538 libvlc_role_Accessibility, /**< Accessibility */
3539 libvlc_role_Test /** Testing */
3540#define libvlc_role_Last libvlc_role_Test
3542
3543/**
3544 * Gets the media role.
3545 *
3546 * \version LibVLC 3.0.0 and later.
3547 *
3548 * \param p_mi media player
3549 * \return the media player role (\ref libvlc_media_player_role_t)
3550 */
3552
3553/**
3554 * Sets the media role.
3555 *
3556 * \param p_mi media player
3557 * \param role the media player role (\ref libvlc_media_player_role_t)
3558 * \return 0 on success, -1 on error
3559 */
3561 unsigned role);
3562
3563/**
3564 * Start/stop recording
3565 *
3566 * \note The user should listen to the libvlc_media_player_cbs.on_recording_changed
3567 * callback, to monitor the recording state.
3568 *
3569 * \version LibVLC 4.0.0 and later.
3570 *
3571 * \param p_mi media player
3572 * \param enable true to start recording, false to stop
3573 * \param dir_path path of the recording directory or NULL (use default path),
3574 * has only an effect when first enabling recording.
3575 */
3577 bool enable, const char *dir_path);
3578
3579/** @} audio */
3580
3581/** \defgroup libvlc_media_player_watch_time LibVLC media player time watch API
3582 * @{
3583 */
3584
3585/**
3586 * Media Player timer point
3587 *
3588 * \note ts and system_date values should not be used directly by the user.
3589 * libvlc_media_player_time_point_interpolate() will read these values and
3590 * return an interpolated ts.
3591 *
3592 * @see libvlc_media_player_watch_time_on_update
3593 */
3595{
3596 /** Position in the range [0.0f;1.0] */
3597 double position;
3598 /** Rate of the player */
3599 double rate;
3600 /** Valid time, in us >= 0 or -1 */
3602 /** Valid length, in us >= 1 or 0 */
3604 /**
3605 * System date, in us, of this record (always valid).
3606 * Based on libvlc_clock(). This date can be in the future or in the past.
3607 * The special value of INT64_MAX mean that the clock was paused when this
3608 * point was updated. In that case,
3609 * libvlc_media_player_time_point_interpolate() will return the current
3610 * ts/pos of this point (there is nothing to interpolate).
3611 * */
3614
3615/**
3616 * struct defining callbacks for libvlc_media_player_watch_time()
3617 */
3619 /**
3620 * Version of struct libvlc_media_player_watch_time_cbs
3621 */
3622 uint32_t version;
3623
3624 /**
3625 * Callback prototype that notify when the player state or time changed.
3626 *
3627 * Get notified when the time is updated by the input or output source. The
3628 * input source is the 'demux' or the 'access_demux'. The output source are
3629 * audio and video outputs: an update is received each time a video frame is
3630 * displayed or an audio sample is written. The delay between each updates may
3631 * depend on the input and source type (it can be every 5ms, 30ms, 1s or
3632 * 10s...). Users of this timer may need to update the position at a higher
3633 * frequency from their own mainloop via
3634 * libvlc_media_player_time_point_interpolate().
3635 *
3636 * \note Mandatory (can't be NULL),
3637 * available since version 0
3638 *
3639 * \warning It is forbidden to call any Media Player functions from here.
3640 *
3641 * \param opaque opaque pointer set by libvlc_media_player_watch_time()
3642 * \param value always valid, the time corresponding to the state
3643 */
3644 void (*on_update)(void *opaque,
3646
3647 /**
3648 * Callback prototype that notify when the timer is paused.
3649 *
3650 * This event is sent when the player is paused or stopping. The player
3651 * user should stop its "interpolate" timer.
3652 *
3653 * \note Optional (can be NULL),
3654 * available since version 0
3655 * \note libvlc_media_player_watch_time_on_update() can be called when
3656 * paused for those 2 reasons:
3657 * - playback is resumed (libvlc_media_player_time_point_t.system_date is
3658 * valid)
3659 * - a track, likely video (next-frame) is outputted when paused
3660 * (libvlc_media_player_time_point_t.system_date = INT64_MAX)
3661 *
3662 * \warning It is forbidden to call any Media Player functions from here.
3663 *
3664 * \param opaque opaque pointer set by libvlc_media_player_watch_time()
3665 * \param system_date_us system date, in us, of this event, only valid (>
3666 * 0) when paused. It can be used to interpolate the last updated point to
3667 * this date in order to get the last paused ts/position.
3668 */
3669 void (*on_paused)(void *opaque, libvlc_time_t system_date_us);
3670
3671 /**
3672 * Callback prototype that notify when the player is seeking or finished
3673 * seeking.
3674 *
3675 * \note Optional (can be NULL),
3676 * available since version 0
3677 *
3678 * \warning It is forbidden to call any Media Player functions from here.
3679 *
3680 * \param opaque opaque pointer set by libvlc_media_player_watch_time()
3681 * \param value point of the seek request or NULL when seeking is finished.
3682 */
3683 void (*on_seek)(void *opaque,
3685};
3686
3687/**
3688 * Watch for times updates
3689 *
3690 * \warning Only one watcher can be registered at a time. Calling this function
3691 * a second time (if libvlc_media_player_unwatch_time() was not called
3692 * in-between) will fail.
3693 *
3694 * \param p_mi the media player
3695 * \param min_period_us corresponds to the minimum period, in us, between each
3696 * updates, use it to avoid flood from too many source updates, set it to 0 to
3697 * receive all updates.
3698 * \param cbs callback to listen to events (can't be NULL). The pointed
3699 * struct must be kept alive (and not modified) by the caller until
3700 * libvlc_media_player_unwatch_time() is called.
3701 * \param cbs_opaque opaque pointer used by the callbacks
3702 * \return 0 on success, -1 on error (allocation error, or if already watching)
3703 * \version LibVLC 4.0.0 or later
3704 */
3705LIBVLC_API int
3707 libvlc_time_t min_period_us,
3708 const struct libvlc_media_player_watch_time_cbs *cbs,
3709 void *cbs_opaque);
3710
3711/**
3712 * Unwatch time updates
3713 *
3714 * \param p_mi the media player
3715 * \version LibVLC 4.0.0 or later
3716 */
3717LIBVLC_API void
3719
3720/**
3721 * Interpolate a timer value to now
3722
3723 * \param point time update obtained via the
3724 * libvlc_media_player_watch_time_on_update() callback
3725 * \param system_now_us current system date, in us, returned by libvlc_clock()
3726 * \param out_ts_us pointer where to set the interpolated ts, in us
3727 * \param out_pos pointer where to set the interpolated position
3728 * \return 0 in case of success, -1 if the interpolated ts is negative (could
3729 * happen during the buffering step)
3730 * \version LibVLC 4.0.0 or later
3731 */
3732LIBVLC_API int
3734 libvlc_time_t system_now_us,
3735 libvlc_time_t *out_ts_us, double *out_pos);
3736
3737/**
3738 * Get the date of the next interval
3739 *
3740 * Can be used to setup an UI timer in order to update some widgets at specific
3741 * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3742 * time widget when the media reaches a new second.
3743 *
3744 * \note The media time doesn't necessarily correspond to the system time, that
3745 * is why this function is needed and uses the rate of the current point.
3746 *
3747 * \param point time update obtained via the
3748 * libvlc_media_player_watch_time_on_update()
3749 * \param system_now_us same system date used by
3750 * libvlc_media_player_time_point_interpolate()
3751 * \param interpolated_ts_us ts returned by
3752 * libvlc_media_player_time_point_interpolate()
3753 * \param next_interval_us next interval, in us
3754 * \return the absolute system date, in us, of the next interval,
3755 * use libvlc_delay() to get a relative delay.
3756 * \version LibVLC 4.0.0 or later
3757 */
3760 libvlc_time_t system_now_us,
3761 libvlc_time_t interpolated_ts_us,
3762 libvlc_time_t next_interval_us);
3763
3764/** @} libvlc_media_player_watch_time */
3765
3766/** \defgroup libvlc_media_player_concurrency LibVLC media player concurrency API
3767 * @{
3768 */
3769
3770/**
3771 * Lock the media_player internal lock
3772
3773 * The lock is recursive, so it's safe to use it multiple times from the same
3774 * thread. You must call libvlc_media_player_unlock() the same number of times
3775 * you called libvlc_media_player_lock().
3776 *
3777 * Locking is not mandatory before calling a libvlc_media_player_t function
3778 * since they will automatically hold the lock internally.
3779 *
3780 * This lock can be used to synchronise user variables that interact with the
3781 * libvlc_media_player_t or can be used to call several functions together.
3782 *
3783 * \param mp media player object
3784 * \version LibVLC 4.0.0 or later
3785 */
3787
3788/**
3789 * Unlock the media_player internal lock
3790 *
3791 * \see libvlc_media_player_lock
3792 *
3793 * \param mp media player object locked using /ref libvlc_media_player_lock
3794 * \version LibVLC 4.0.0 or later
3795 */
3797
3798/**
3799 * Wait for an event to be signalled
3800 *
3801 * \note this is equivalent to pthread_cond_wait() with the
3802 * libvlc_media_player_t internal mutex and condition variable. This function
3803 * may spuriously wake up even without libvlc_media_player_signal() being
3804 * called.
3805 *
3806 * \warning this function must not be called from any libvlc callbacks and
3807 * events. The lock should be held only one time before waiting.
3808 *
3809 * \param mp media player object locked using /ref libvlc_media_player_lock
3810 * \version LibVLC 4.0.0 or later
3811 */
3813
3814/**
3815 * Signal all threads waiting for a signalling event
3816 *
3817 * \note this is equivalent to pthread_cond_broadcast() with the
3818 * libvlc_media_player_t internal condition variable.
3819 *
3820 * \param mp media player object locked using /ref libvlc_media_player_lock
3821 * \version LibVLC 4.0.0 or later
3822 */
3824
3825/** @} libvlc_media_player_concurrency */
3826
3827/** @} media_player */
3828
3829# ifdef __cplusplus
3830}
3831# endif
3832
3833#endif /* VLC_LIBVLC_MEDIA_PLAYER_H */
struct vlc_param ** list
Definition core.c:402
size_t count
Definition core.c:403
libvlc_audio_output_mixmode_t
Audio mix modes.
Definition libvlc_media_player.h:3095
LIBVLC_API int libvlc_media_player_set_equalizer(libvlc_media_player_t *p_mi, libvlc_equalizer_t *p_equalizer)
Apply new equalizer settings to a media player.
LIBVLC_API int libvlc_audio_set_mixmode(libvlc_media_player_t *p_mi, libvlc_audio_output_mixmode_t mode)
Set current audio mix-mode.
libvlc_media_player_role
Media player roles.
Definition libvlc_media_player.h:3529
LIBVLC_API int libvlc_audio_output_set(libvlc_media_player_t *p_mi, const char *psz_name)
Selects an audio output module.
LIBVLC_API const char * libvlc_audio_equalizer_get_preset_name(unsigned u_index)
Get the name of a particular equalizer preset.
LIBVLC_API unsigned libvlc_audio_equalizer_get_band_count(void)
Get the number of distinct frequency bands for an equalizer.
libvlc_audio_output_stereomode_t
Audio stereo modes.
Definition libvlc_media_player.h:3082
LIBVLC_API int libvlc_media_player_set_role(libvlc_media_player_t *p_mi, unsigned role)
Sets the media role.
LIBVLC_API void libvlc_audio_toggle_mute(libvlc_media_player_t *p_mi)
Toggle mute status.
LIBVLC_API int libvlc_audio_equalizer_set_preamp(libvlc_equalizer_t *p_equalizer, float f_preamp)
Set a new pre-amplification value for an equalizer.
LIBVLC_API libvlc_time_t libvlc_audio_get_delay(libvlc_media_player_t *p_mi)
Get current audio delay.
LIBVLC_API void libvlc_audio_set_mute(libvlc_media_player_t *p_mi, int status)
Set mute status.
LIBVLC_API float libvlc_audio_equalizer_get_band_frequency(unsigned u_index)
Get a particular equalizer band frequency.
LIBVLC_API float libvlc_audio_equalizer_get_preamp(libvlc_equalizer_t *p_equalizer)
Get the current pre-amplification value from an equalizer.
LIBVLC_API libvlc_audio_output_t * libvlc_audio_output_list_get(libvlc_instance_t *p_instance)
Gets the list of available audio output modules.
LIBVLC_API int libvlc_audio_set_volume(libvlc_media_player_t *p_mi, int i_volume)
Set current software audio volume.
LIBVLC_API int libvlc_media_player_get_role(libvlc_media_player_t *p_mi)
Gets the media role.
LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index(libvlc_equalizer_t *p_equalizer, float f_amp, unsigned u_band)
Set a new amplification value for a particular equalizer frequency band.
LIBVLC_API int libvlc_audio_get_mute(libvlc_media_player_t *p_mi)
Get current mute status.
LIBVLC_API int libvlc_audio_get_volume(libvlc_media_player_t *p_mi)
Get current software audio volume.
LIBVLC_API int libvlc_audio_output_device_set(libvlc_media_player_t *mp, const char *device_id)
Configures an explicit audio output device.
LIBVLC_API libvlc_audio_output_mixmode_t libvlc_audio_get_mixmode(libvlc_media_player_t *p_mi)
Get current audio mix-mode.
enum libvlc_media_player_role libvlc_media_player_role_t
Media player roles.
LIBVLC_API int libvlc_audio_set_delay(libvlc_media_player_t *p_mi, libvlc_time_t i_delay)
Set current audio delay.
LIBVLC_API libvlc_equalizer_t * libvlc_audio_equalizer_new(void)
Create a new default equalizer, with all frequency values zeroed.
LIBVLC_API int libvlc_audio_set_stereomode(libvlc_media_player_t *p_mi, libvlc_audio_output_stereomode_t mode)
Set current audio stereo-mode.
LIBVLC_API void libvlc_audio_output_list_release(libvlc_audio_output_t *p_list)
Frees the list of available audio output modules.
LIBVLC_API float libvlc_audio_equalizer_get_amp_at_index(libvlc_equalizer_t *p_equalizer, unsigned u_band)
Get the amplification value for a particular equalizer frequency band.
LIBVLC_API libvlc_equalizer_t * libvlc_audio_equalizer_new_from_preset(unsigned u_index)
Create a new equalizer, with initial frequency values copied from an existing preset.
LIBVLC_API void libvlc_media_player_record(libvlc_media_player_t *p_mi, bool enable, const char *dir_path)
Start/stop recording.
LIBVLC_API libvlc_audio_output_device_t * libvlc_audio_output_device_enum(libvlc_media_player_t *mp)
Gets a list of potential audio output devices.
LIBVLC_API unsigned libvlc_audio_equalizer_get_preset_count(void)
Get the number of equalizer presets.
LIBVLC_API char * libvlc_audio_output_device_get(libvlc_media_player_t *mp)
Get the current audio output device identifier.
LIBVLC_API libvlc_audio_output_stereomode_t libvlc_audio_get_stereomode(libvlc_media_player_t *p_mi)
Get current audio stereo-mode.
LIBVLC_API void libvlc_audio_equalizer_release(libvlc_equalizer_t *p_equalizer)
Release a previously created equalizer instance.
LIBVLC_API void libvlc_audio_output_device_list_release(libvlc_audio_output_device_t *p_list)
Frees a list of available audio output devices.
@ libvlc_AudioMixMode_4_0
Definition libvlc_media_player.h:3099
@ libvlc_AudioMixMode_Unset
Definition libvlc_media_player.h:3096
@ libvlc_AudioMixMode_5_1
Definition libvlc_media_player.h:3100
@ libvlc_AudioMixMode_Stereo
Definition libvlc_media_player.h:3097
@ libvlc_AudioMixMode_7_1
Definition libvlc_media_player.h:3101
@ libvlc_AudioMixMode_Binaural
Definition libvlc_media_player.h:3098
@ libvlc_role_Game
Video game.
Definition libvlc_media_player.h:3534
@ libvlc_role_None
Don't use a media player role.
Definition libvlc_media_player.h:3530
@ libvlc_role_Notification
User interaction feedback.
Definition libvlc_media_player.h:3535
@ libvlc_role_Production
Audio editing/production.
Definition libvlc_media_player.h:3537
@ libvlc_role_Communication
Speech, real-time communication.
Definition libvlc_media_player.h:3533
@ libvlc_role_Music
Music (or radio) playback.
Definition libvlc_media_player.h:3531
@ libvlc_role_Accessibility
Accessibility.
Definition libvlc_media_player.h:3538
@ libvlc_role_Video
Video playback.
Definition libvlc_media_player.h:3532
@ libvlc_role_Animation
Embedded animation (e.g.
Definition libvlc_media_player.h:3536
@ libvlc_AudioStereoMode_Stereo
Definition libvlc_media_player.h:3084
@ libvlc_AudioStereoMode_Right
Definition libvlc_media_player.h:3087
@ libvlc_AudioStereoMode_Unset
Definition libvlc_media_player.h:3083
@ libvlc_AudioStereoMode_Mono
Definition libvlc_media_player.h:3089
@ libvlc_AudioStereoMode_Dolbys
Definition libvlc_media_player.h:3088
@ libvlc_AudioStereoMode_Left
Definition libvlc_media_player.h:3086
@ libvlc_AudioStereoMode_RStereo
Definition libvlc_media_player.h:3085
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
int64_t libvlc_time_t
Represents a time value in microseconds.
Definition libvlc.h:79
LIBVLC_API void libvlc_media_player_signal(libvlc_media_player_t *mp)
Signal all threads waiting for a signalling event.
LIBVLC_API void libvlc_media_player_wait(libvlc_media_player_t *mp)
Wait for an event to be signalled.
LIBVLC_API void libvlc_media_player_unlock(libvlc_media_player_t *mp)
Unlock the media_player internal lock.
LIBVLC_API void libvlc_media_player_lock(libvlc_media_player_t *mp)
Lock the media_player internal lock.
LIBVLC_API int libvlc_media_player_watch_time(libvlc_media_player_t *p_mi, libvlc_time_t min_period_us, const struct libvlc_media_player_watch_time_cbs *cbs, void *cbs_opaque)
Watch for times updates.
LIBVLC_API int libvlc_media_player_time_point_interpolate(const libvlc_media_player_time_point_t *point, libvlc_time_t system_now_us, libvlc_time_t *out_ts_us, double *out_pos)
Interpolate a timer value to now.
LIBVLC_API libvlc_time_t libvlc_media_player_time_point_get_next_date(const libvlc_media_player_time_point_t *point, libvlc_time_t system_now_us, libvlc_time_t interpolated_ts_us, libvlc_time_t next_interval_us)
Get the date of the next interval.
LIBVLC_API void libvlc_media_player_unwatch_time(libvlc_media_player_t *p_mi)
Unwatch time updates.
bool(* libvlc_video_output_select_plane_cb)(void *opaque, size_t plane, void *output)
Tell the host the rendering for the given plane is about to start.
Definition libvlc_media_player.h:1363
void(* libvlc_video_unlock_cb)(void *opaque, void *picture, void *const *planes)
Callback prototype to unlock a picture buffer.
Definition libvlc_media_player.h:873
libvlc_stopping_reason_t
Enumeration of media stopping reasons.
Definition libvlc_media_player.h:211
void(* libvlc_video_output_mouse_move_cb)(void *opaque, int x, int y)
Callback type that can be called to notify the mouse position when hovering the render surface.
Definition libvlc_media_player.h:1284
LIBVLC_API libvlc_time_t libvlc_media_player_get_length(libvlc_media_player_t *p_mi)
Get the current movie length (in us).
LIBVLC_API libvlc_media_tracklist_t * libvlc_media_player_get_tracklist(libvlc_media_player_t *p_mi, libvlc_track_type_t type, bool selected)
Get the track list for one type.
LIBVLC_API void libvlc_media_player_set_hwnd(libvlc_media_player_t *p_mi, void *drawable)
Set a Win32/Win64 API window handle (HWND) where the media player should render its video output.
LIBVLC_API libvlc_player_program_t * libvlc_player_programlist_at(libvlc_player_programlist_t *list, size_t index)
Get a program at a specific index.
LIBVLC_API void libvlc_player_program_delete(libvlc_player_program_t *program)
Delete a program struct.
LIBVLC_API libvlc_time_t libvlc_media_player_get_time(libvlc_media_player_t *p_mi)
Get the current movie time (in us).
LIBVLC_API float libvlc_media_player_get_rate(libvlc_media_player_t *p_mi)
Get the requested movie play rate.
LIBVLC_API int libvlc_media_player_set_time(libvlc_media_player_t *p_mi, libvlc_time_t i_time, bool b_fast)
Set the movie time (in us).
struct libvlc_equalizer_t libvlc_equalizer_t
Opaque equalizer handle.
Definition libvlc_media_player.h:225
void(* libvlc_audio_set_volume_cb)(void *data, float volume, bool mute)
Callback prototype for audio volume change.
Definition libvlc_media_player.h:1664
libvlc_teletext_key_t
Enumeration of teletext keys than can be passed via libvlc_video_set_teletext().
Definition libvlc_media_player.h:168
void(* libvlc_video_display_cb)(void *opaque, void *picture)
Callback prototype to display a picture.
Definition libvlc_media_player.h:886
LIBVLC_API void libvlc_media_player_set_next_media(libvlc_media_player_t *p_mi, libvlc_media_t *p_md)
Set the next media.
LIBVLC_API bool libvlc_media_player_is_playing(libvlc_media_player_t *p_mi)
is_playing
LIBVLC_API unsigned libvlc_media_player_has_vout(libvlc_media_player_t *p_mi)
How many video outputs does this media player have?
LIBVLC_API int libvlc_media_player_set_position(libvlc_media_player_t *p_mi, double f_pos, bool b_fast)
Set movie position as percentage between 0.0 and 1.0.
LIBVLC_API void libvlc_media_player_set_android_context(libvlc_media_player_t *p_mi, void *p_awindow_handler)
Set the android context.
LIBVLC_API void libvlc_media_player_previous_chapter(libvlc_media_player_t *p_mi)
Set previous chapter (if applicable).
LIBVLC_API int libvlc_media_player_set_abloop_time(libvlc_media_player_t *p_mi, libvlc_time_t a_time, libvlc_time_t b_time)
Enable A to B loop for the current media by setting the start time and end time.
void(* libvlc_video_frameMetadata_cb)(void *opaque, libvlc_video_metadata_type_t type, const void *metadata)
Callback prototype to receive metadata before rendering.
Definition libvlc_media_player.h:1216
LIBVLC_API libvlc_media_player_t * libvlc_media_player_retain(libvlc_media_player_t *p_mi)
Retain a reference to a media player object.
LIBVLC_API void libvlc_media_player_set_xwindow(libvlc_media_player_t *p_mi, uint32_t drawable)
Set an X Window System drawable where the media player should render its video output.
void(* libvlc_audio_cleanup_cb)(void *opaque)
Callback prototype for audio playback cleanup.
Definition libvlc_media_player.h:1729
LIBVLC_API libvlc_media_track_t * libvlc_media_player_get_track_from_id(libvlc_media_player_t *p_mi, const char *psz_id)
Get a track from a track id.
void(* libvlc_video_output_set_window_cb)(void *opaque, libvlc_video_output_resize_cb report_size_change, libvlc_video_output_mouse_move_cb report_mouse_move, libvlc_video_output_mouse_press_cb report_mouse_pressed, libvlc_video_output_mouse_release_cb report_mouse_released, void *report_opaque)
Set the callback to call when the host app resizes the rendering area.
Definition libvlc_media_player.h:1332
void(* libvlc_video_output_mouse_press_cb)(void *opaque, libvlc_video_output_mouse_button_t button)
Callback type that can be called to notify when a mouse button is pressed in the rendering surface.
Definition libvlc_media_player.h:1295
libvlc_video_marquee_option_t
Marq options definition.
Definition libvlc_media_player.h:111
LIBVLC_API void libvlc_media_player_set_nsobject(libvlc_media_player_t *p_mi, void *drawable)
Set the handler where the media player should display its video output.
LIBVLC_API libvlc_player_program_t * libvlc_media_player_get_program_from_id(libvlc_media_player_t *p_mi, int i_group_id)
Get a program struct from a program id.
LIBVLC_API int libvlc_media_player_reset_abloop(libvlc_media_player_t *p_mi)
Reset/remove the A to B loop for the current media.
void(* libvlc_video_cleanup_cb)(void *opaque)
Callback prototype to configure picture buffers format.
Definition libvlc_media_player.h:929
void(* libvlc_audio_resume_cb)(void *data, int64_t pts)
Callback prototype for audio resumption.
Definition libvlc_media_player.h:1634
LIBVLC_API void * libvlc_media_player_get_hwnd(libvlc_media_player_t *p_mi)
Get the Windows API window handle (HWND) previously set with libvlc_media_player_set_hwnd().
LIBVLC_API void libvlc_player_programlist_delete(libvlc_player_programlist_t *list)
Release a programlist.
void(* libvlc_video_output_resize_cb)(void *report_opaque, unsigned width, unsigned height)
Callback type that can be called to request a render size changes.
Definition libvlc_media_player.h:1259
LIBVLC_API void libvlc_media_player_unselect_track_type(libvlc_media_player_t *p_mi, libvlc_track_type_t type)
Unselect all tracks for a given type.
libvlc_video_fit_mode_t
Enumeration of values used to set the video fitting inside the display area.
Definition libvlc_media_player.h:156
LIBVLC_API void libvlc_media_player_select_program_id(libvlc_media_player_t *p_mi, int i_group_id)
Select program with a given program id.
libvlc_video_color_space_t
Enumeration of the Video color spaces.
Definition libvlc_media_player.h:820
LIBVLC_API void libvlc_video_set_callbacks(libvlc_media_player_t *mp, libvlc_video_lock_cb lock, libvlc_video_unlock_cb unlock, libvlc_video_display_cb display, void *opaque)
Set callbacks and private data to render decoded video to a custom area in memory.
LIBVLC_API void libvlc_media_player_pause(libvlc_media_player_t *p_mi)
Toggle pause (no effect if there is no media).
void *(* libvlc_video_lock_cb)(void *opaque, void **planes)
Callback prototype to allocate and lock a picture buffer.
Definition libvlc_media_player.h:855
LIBVLC_API int libvlc_media_player_get_chapter_count_for_title(libvlc_media_player_t *p_mi, int i_title)
Get title chapter count.
LIBVLC_API void libvlc_video_set_format(libvlc_media_player_t *mp, const char *chroma, unsigned width, unsigned height, unsigned pitch)
Set decoded video chroma and dimensions.
void(* libvlc_video_output_mouse_release_cb)(void *opaque, libvlc_video_output_mouse_button_t button)
Callback type that can be called to notify when a mouse button is released in the rendering surface.
Definition libvlc_media_player.h:1306
libvlc_video_metadata_type_t
Definition libvlc_media_player.h:1204
libvlc_video_output_mouse_button_t
Enumeration of the different mouse buttons that can be reported for user interaction can be passed to...
Definition libvlc_media_player.h:1266
LIBVLC_API void libvlc_media_player_next_chapter(libvlc_media_player_t *p_mi)
Set next chapter (if applicable).
LIBVLC_API void libvlc_media_player_set_pause(libvlc_media_player_t *mp, int do_pause)
Pause or resume (no effect if there is no media).
libvlc_navigate_mode_t
Navigation mode.
Definition libvlc_media_player.h:128
void(* libvlc_audio_flush_cb)(void *data, int64_t pts)
Callback prototype for audio buffer flush.
Definition libvlc_media_player.h:1645
LIBVLC_API libvlc_player_programlist_t * libvlc_media_player_get_programlist(libvlc_media_player_t *p_mi)
Get the program list.
LIBVLC_API libvlc_player_program_t * libvlc_media_player_get_selected_program(libvlc_media_player_t *p_mi)
Get the selected program.
LIBVLC_API int libvlc_media_player_set_abloop_position(libvlc_media_player_t *p_mi, double a_pos, double b_pos)
Enable A to B loop for the current media by setting the start position and end position.
struct libvlc_player_programlist_t libvlc_player_programlist_t
Opaque struct containing a list of program.
Definition libvlc_media_player.h:2285
libvlc_capability_t
Enumeration of player capabilities.
Definition libvlc_media_player.h:188
LIBVLC_API void libvlc_media_player_navigate(libvlc_media_player_t *p_mi, unsigned navigate)
Navigate through DVD Menu.
void(* libvlc_video_output_cleanup_cb)(void *opaque)
Callback prototype called to release user data.
Definition libvlc_media_player.h:1067
libvlc_list_action_t
Enumeration of player track/program list actions.
Definition libvlc_media_player.h:202
libvlc_position_t
Enumeration of values used to set position (e.g.
Definition libvlc_media_player.h:140
void(* libvlc_audio_play_cb)(void *data, const void *samples, unsigned count, int64_t pts)
Callback prototype for audio playback.
Definition libvlc_media_player.h:1610
LIBVLC_API libvlc_media_t * libvlc_media_player_get_media(libvlc_media_player_t *p_mi)
Get the media used by the media_player.
LIBVLC_API bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi)
Can this media player be paused?
LIBVLC_API void libvlc_media_player_previous_frame(libvlc_media_player_t *p_mi)
Pause and display the previous video frame.
LIBVLC_API double libvlc_media_player_get_position(libvlc_media_player_t *p_mi)
Get movie position as percentage between 0.0 and 1.0.
bool(* libvlc_video_makeCurrent_cb)(void *opaque, bool enter)
Callback prototype to set up the OpenGL context for rendering.
Definition libvlc_media_player.h:1179
bool(* libvlc_video_update_output_cb)(void *opaque, const libvlc_video_render_cfg_t *cfg, libvlc_video_output_cfg_t *output)
Callback prototype called on video size changes.
Definition libvlc_media_player.h:1140
LIBVLC_API void libvlc_media_player_select_track(libvlc_media_player_t *p_mi, const libvlc_media_track_t *track)
Select a track.
LIBVLC_API int libvlc_media_player_set_rate(libvlc_media_player_t *p_mi, float rate)
Set movie play rate.
LIBVLC_API int libvlc_media_player_get_title_count(libvlc_media_player_t *p_mi)
Get movie title count.
libvlc_video_engine_t
Enumeration of the Video engine to be used on output.
Definition libvlc_media_player.h:1222
LIBVLC_API void * libvlc_media_player_get_nsobject(libvlc_media_player_t *p_mi)
Get the NSView handler previously set with libvlc_media_player_set_nsobject().
LIBVLC_API void libvlc_audio_set_volume_callback(libvlc_media_player_t *mp, libvlc_audio_set_volume_cb set_volume)
Set callbacks and private data for decoded audio.
void(* libvlc_audio_pause_cb)(void *data, int64_t pts)
Callback prototype for audio pause.
Definition libvlc_media_player.h:1622
LIBVLC_API void libvlc_audio_set_callbacks(libvlc_media_player_t *mp, libvlc_audio_play_cb play, libvlc_audio_pause_cb pause, libvlc_audio_resume_cb resume, libvlc_audio_flush_cb flush, libvlc_audio_drain_cb drain, void *opaque)
Sets callbacks and private data for decoded audio.
LIBVLC_API void libvlc_media_player_select_tracks_by_ids(libvlc_media_player_t *p_mi, libvlc_track_type_t type, const char *psz_ids)
Select tracks by their string identifier.
LIBVLC_API libvlc_media_t * libvlc_media_player_get_next_media(libvlc_media_player_t *p_mi)
Get the next media to be played.
libvlc_abloop_t
A to B loop state.
Definition libvlc_media_player.h:179
LIBVLC_API void libvlc_media_player_set_title(libvlc_media_player_t *p_mi, unsigned i_title)
Set movie title.
struct libvlc_media_player_t libvlc_media_player_t
Definition libvlc_media_list_player.h:34
int(* libvlc_audio_setup_cb)(void **opaque, char *format, unsigned *rate, unsigned *channels)
Callback prototype to setup the audio playback.
Definition libvlc_media_player.h:1720
LIBVLC_API libvlc_media_player_t * libvlc_media_player_new(libvlc_instance_t *p_libvlc_instance, const struct libvlc_media_player_cbs *cbs, void *cbs_opaque)
Create an empty Media Player object.
LIBVLC_API int libvlc_media_player_set_renderer(libvlc_media_player_t *p_mi, libvlc_renderer_item_t *p_item)
Set a renderer to the media player.
LIBVLC_API int libvlc_media_player_get_chapter(libvlc_media_player_t *p_mi)
Get movie chapter.
LIBVLC_API uint32_t libvlc_media_player_get_xwindow(libvlc_media_player_t *p_mi)
Get the X Window System window identifier previously set with libvlc_media_player_set_xwindow().
libvlc_video_color_primaries_t
Enumeration of the Video color primaries.
Definition libvlc_media_player.h:808
LIBVLC_API int libvlc_media_player_play(libvlc_media_player_t *p_mi)
Play.
LIBVLC_API libvlc_state_t libvlc_media_player_get_state(libvlc_media_player_t *p_mi)
Get current movie state.
bool(* libvlc_video_output_setup_cb)(void **opaque, const libvlc_video_setup_device_cfg_t *cfg, libvlc_video_setup_device_info_t *out)
Callback prototype called to initialize user data.
Definition libvlc_media_player.h:1056
LIBVLC_API int libvlc_media_player_stop_async(libvlc_media_player_t *p_mi)
Stop asynchronously.
LIBVLC_API void libvlc_media_player_release(libvlc_media_player_t *p_mi)
Release a media_player after use Decrement the reference count of a media player object.
LIBVLC_API int libvlc_media_player_get_chapter_count(libvlc_media_player_t *p_mi)
Get movie chapter count.
LIBVLC_API bool libvlc_video_set_output_callbacks(libvlc_media_player_t *mp, libvlc_video_engine_t engine, libvlc_video_output_setup_cb setup_cb, libvlc_video_output_cleanup_cb cleanup_cb, libvlc_video_output_set_window_cb window_cb, libvlc_video_update_output_cb update_output_cb, libvlc_video_swap_cb swap_cb, libvlc_video_makeCurrent_cb makeCurrent_cb, libvlc_video_getProcAddress_cb getProcAddress_cb, libvlc_video_frameMetadata_cb metadata_cb, libvlc_video_output_select_plane_cb select_plane_cb, void *opaque)
Set callbacks and data to render decoded video to a custom texture.
LIBVLC_API void libvlc_media_player_set_video_title_display(libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned int timeout)
Set if, and how, the video title will be shown when media is played.
LIBVLC_API libvlc_media_track_t * libvlc_media_player_get_selected_track(libvlc_media_player_t *p_mi, libvlc_track_type_t type)
Get the selected track for one type.
LIBVLC_API libvlc_abloop_t libvlc_media_player_get_abloop(libvlc_media_player_t *p_mi, libvlc_time_t *a_time, double *a_pos, libvlc_time_t *b_time, double *b_pos)
Get the A to B loop status.
LIBVLC_API int libvlc_media_player_add_slave(libvlc_media_player_t *p_mi, libvlc_media_slave_type_t i_type, const char *psz_uri, bool b_select)
Add a slave to the current media player.
LIBVLC_API void libvlc_media_player_next_frame(libvlc_media_player_t *p_mi)
Pause and display the next video frame.
LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media(libvlc_instance_t *inst, libvlc_media_t *p_md, const struct libvlc_media_player_cbs *cbs, void *cbs_opaque)
Create a Media Player object from a Media.
LIBVLC_API void libvlc_media_player_set_media(libvlc_media_player_t *p_mi, libvlc_media_t *p_md)
Set the media that will be used by the media_player.
LIBVLC_API bool libvlc_media_player_is_seekable(libvlc_media_player_t *p_mi)
Is this media player seekable?
LIBVLC_API void libvlc_audio_set_format_callbacks(libvlc_media_player_t *mp, libvlc_audio_setup_cb setup, libvlc_audio_cleanup_cb cleanup)
Sets decoded audio format via callbacks.
unsigned(* libvlc_video_format_cb)(void **opaque, char *chroma, unsigned *width, unsigned *height, unsigned *pitches, unsigned *lines)
Callback prototype to configure picture buffers format.
Definition libvlc_media_player.h:918
void(* libvlc_video_swap_cb)(void *opaque)
Callback prototype called after performing drawing calls.
Definition libvlc_media_player.h:1153
LIBVLC_API size_t libvlc_player_programlist_count(const libvlc_player_programlist_t *list)
Get the number of programs in a programlist.
LIBVLC_API void libvlc_media_player_set_chapter(libvlc_media_player_t *p_mi, int i_chapter)
Set movie chapter (if applicable).
LIBVLC_API bool libvlc_media_player_program_scrambled(libvlc_media_player_t *p_mi)
Check if the current program is scrambled.
LIBVLC_API void libvlc_media_player_select_tracks(libvlc_media_player_t *p_mi, libvlc_track_type_t type, const libvlc_media_track_t **tracks, size_t track_count)
Select multiple tracks for one type.
libvlc_video_transfer_func_t
Enumeration of the Video transfer functions.
Definition libvlc_media_player.h:829
void(* libvlc_audio_drain_cb)(void *data)
Callback prototype for audio buffer drain.
Definition libvlc_media_player.h:1656
void *(* libvlc_video_getProcAddress_cb)(void *opaque, const char *fct_name)
Callback prototype to load opengl functions.
Definition libvlc_media_player.h:1189
LIBVLC_API void libvlc_audio_set_format(libvlc_media_player_t *mp, const char *format, unsigned rate, unsigned channels)
Sets a fixed decoded audio format.
LIBVLC_API void libvlc_video_set_format_callbacks(libvlc_media_player_t *mp, libvlc_video_format_cb setup, libvlc_video_cleanup_cb cleanup)
Set decoded video chroma and dimensions.
static bool libvlc_video_set_anw_callbacks(libvlc_media_player_t *mp, libvlc_video_output_setup_cb setup_cb, libvlc_video_output_cleanup_cb cleanup_cb, libvlc_video_update_output_cb update_output_cb, void *opaque)
Helper to setup output_callbacks for libvlc_video_engine_anw.
Definition libvlc_media_player.h:1412
LIBVLC_API int libvlc_media_player_get_title(libvlc_media_player_t *p_mi)
Get movie title.
LIBVLC_API int libvlc_media_player_jump_time(libvlc_media_player_t *p_mi, libvlc_time_t i_time)
Jump the movie time (in us).
@ libvlc_stopping_reason_user
media is stopping due to user request
Definition libvlc_media_player.h:217
@ libvlc_stopping_reason_eos
media has reached the end of stream
Definition libvlc_media_player.h:215
@ libvlc_stopping_reason_error
media is stopping due to an error (default)
Definition libvlc_media_player.h:213
@ libvlc_teletext_key_index
Definition libvlc_media_player.h:173
@ libvlc_teletext_key_green
Definition libvlc_media_player.h:170
@ libvlc_teletext_key_blue
Definition libvlc_media_player.h:172
@ libvlc_teletext_key_red
Definition libvlc_media_player.h:169
@ libvlc_teletext_key_yellow
Definition libvlc_media_player.h:171
@ libvlc_marquee_Color
string argument
Definition libvlc_media_player.h:114
@ libvlc_marquee_Position
Definition libvlc_media_player.h:116
@ libvlc_marquee_Y
Definition libvlc_media_player.h:121
@ libvlc_marquee_Timeout
Definition libvlc_media_player.h:119
@ libvlc_marquee_Enable
Definition libvlc_media_player.h:112
@ libvlc_marquee_Opacity
Definition libvlc_media_player.h:115
@ libvlc_marquee_X
Definition libvlc_media_player.h:120
@ libvlc_marquee_Size
Definition libvlc_media_player.h:118
@ libvlc_marquee_Refresh
Definition libvlc_media_player.h:117
@ libvlc_marquee_Text
Definition libvlc_media_player.h:113
@ libvlc_title_interactive
Definition libvlc_media_player.h:65
@ libvlc_title_menu
Definition libvlc_media_player.h:64
@ libvlc_video_fit_larger
Fit outside / to largest display dimension.
Definition libvlc_media_player.h:159
@ libvlc_video_fit_width
Fit to display width.
Definition libvlc_media_player.h:160
@ libvlc_video_fit_none
Explicit zoom set by libvlc_video_set_scale.
Definition libvlc_media_player.h:157
@ libvlc_video_fit_smaller
Fit inside / to smallest display dimension.
Definition libvlc_media_player.h:158
@ libvlc_video_fit_height
Fit to display height.
Definition libvlc_media_player.h:161
@ libvlc_video_colorspace_BT2020
Definition libvlc_media_player.h:823
@ libvlc_video_colorspace_BT709
Definition libvlc_media_player.h:822
@ libvlc_video_colorspace_BT601
Definition libvlc_media_player.h:821
@ libvlc_video_metadata_frame_hdr10
libvlc_video_frame_hdr10_metadata_t
Definition libvlc_media_player.h:1205
@ libvlc_video_output_mouse_button_middle
Definition libvlc_media_player.h:1268
@ libvlc_video_output_mouse_button_right
Definition libvlc_media_player.h:1269
@ libvlc_video_output_mouse_button_left
Definition libvlc_media_player.h:1267
@ libvlc_navigate_right
Definition libvlc_media_player.h:133
@ libvlc_navigate_left
Definition libvlc_media_player.h:132
@ libvlc_navigate_activate
Definition libvlc_media_player.h:129
@ libvlc_navigate_popup
Definition libvlc_media_player.h:134
@ libvlc_navigate_up
Definition libvlc_media_player.h:130
@ libvlc_navigate_down
Definition libvlc_media_player.h:131
@ libvlc_capability_pause
player can pause
Definition libvlc_media_player.h:192
@ libvlc_capability_seek
player can seek
Definition libvlc_media_player.h:190
@ libvlc_capability_change_rate
player can change rate
Definition libvlc_media_player.h:194
@ libvlc_capability_rewind
player can seek back
Definition libvlc_media_player.h:196
@ libvlc_list_action_added
Definition libvlc_media_player.h:203
@ libvlc_list_action_updated
Definition libvlc_media_player.h:205
@ libvlc_list_action_removed
Definition libvlc_media_player.h:204
@ libvlc_position_bottom_right
Definition libvlc_media_player.h:150
@ libvlc_position_top
Definition libvlc_media_player.h:145
@ libvlc_position_left
Definition libvlc_media_player.h:143
@ libvlc_position_top_left
Definition libvlc_media_player.h:146
@ libvlc_position_bottom_left
Definition libvlc_media_player.h:149
@ libvlc_position_right
Definition libvlc_media_player.h:144
@ libvlc_position_disable
Definition libvlc_media_player.h:141
@ libvlc_position_bottom
Definition libvlc_media_player.h:148
@ libvlc_position_center
Definition libvlc_media_player.h:142
@ libvlc_position_top_right
Definition libvlc_media_player.h:147
@ libvlc_video_engine_opengl
Definition libvlc_media_player.h:1225
@ libvlc_video_engine_anw
Android ANativeWindow.
Definition libvlc_media_player.h:1247
@ libvlc_video_engine_gles2
Definition libvlc_media_player.h:1226
@ libvlc_video_engine_d3d9
Direct3D9 rendering engine.
Definition libvlc_media_player.h:1230
@ libvlc_video_engine_disable
Disable rendering engine.
Definition libvlc_media_player.h:1224
@ libvlc_video_engine_d3d11
Direct3D11 rendering engine.
Definition libvlc_media_player.h:1228
@ libvlc_abloop_a
Definition libvlc_media_player.h:181
@ libvlc_abloop_b
Definition libvlc_media_player.h:182
@ libvlc_abloop_none
Definition libvlc_media_player.h:180
@ libvlc_video_primaries_BT709
Definition libvlc_media_player.h:811
@ libvlc_video_primaries_BT601_525
Definition libvlc_media_player.h:809
@ libvlc_video_primaries_BT2020
Definition libvlc_media_player.h:812
@ libvlc_video_primaries_BT601_625
Definition libvlc_media_player.h:810
@ libvlc_video_primaries_BT470_M
Definition libvlc_media_player.h:814
@ libvlc_video_primaries_DCI_P3
Definition libvlc_media_player.h:813
@ libvlc_video_transfer_func_HLG
Definition libvlc_media_player.h:837
@ libvlc_video_transfer_func_BT470_M
Definition libvlc_media_player.h:833
@ libvlc_video_transfer_func_BT709
Definition libvlc_media_player.h:834
@ libvlc_video_transfer_func_PQ
Definition libvlc_media_player.h:835
@ libvlc_video_transfer_func_SMPTE_240
Definition libvlc_media_player.h:836
@ libvlc_video_transfer_func_SRGB
Definition libvlc_media_player.h:831
@ libvlc_video_transfer_func_BT470_BG
Definition libvlc_media_player.h:832
@ libvlc_video_transfer_func_LINEAR
Definition libvlc_media_player.h:830
libvlc_track_type_t
Definition libvlc_media_track.h:45
struct libvlc_media_tracklist_t libvlc_media_tracklist_t
Opaque struct containing a list of tracks.
Definition libvlc_media_player.h:43
libvlc_media_slave_type_t
Type of a media slave: subtitle or audio.
Definition libvlc_media.h:144
libvlc_state_t
libvlc media or media_player state
Definition libvlc_media.h:84
struct libvlc_media_t libvlc_media_t
Definition libvlc_media.h:47
struct libvlc_picture_list_t libvlc_picture_list_t
Definition libvlc_media_player.h:47
struct libvlc_renderer_item_t libvlc_renderer_item_t
Renderer item.
Definition libvlc_media_player.h:45
LIBVLC_API void libvlc_video_set_aspect_ratio(libvlc_media_player_t *p_mi, const char *psz_aspect)
Set new video aspect ratio.
LIBVLC_API void libvlc_video_set_marquee_int(libvlc_media_player_t *p_mi, unsigned option, int i_val)
Enable, disable or set an integer marquee option.
LIBVLC_API void libvlc_video_set_teletext_transparency(libvlc_media_player_t *p_mi, bool transparent)
Set teletext background transparency.
libvlc_video_adjust_option_t
option values for libvlc_video_{get,set}_adjust_{int,float,bool}
Definition libvlc_media_player.h:2995
LIBVLC_API bool libvlc_get_fullscreen(libvlc_media_player_t *p_mi)
Get current fullscreen status.
LIBVLC_API libvlc_video_stereo_mode_t libvlc_video_get_video_stereo_mode(libvlc_media_player_t *p_mi)
Get current video stereo mode.
LIBVLC_API void libvlc_video_set_crop_border(libvlc_media_player_t *mp, unsigned left, unsigned right, unsigned top, unsigned bottom)
Set the video crop borders.
LIBVLC_API int libvlc_video_set_deinterlace(libvlc_media_player_t *p_mi, int deinterlace, const char *psz_mode)
Enable or disable deinterlace filter.
LIBVLC_API void libvlc_video_set_crop_ratio(libvlc_media_player_t *mp, unsigned num, unsigned den)
Set/unset the video crop ratio.
LIBVLC_API libvlc_time_t libvlc_video_get_spu_delay(libvlc_media_player_t *p_mi)
Get the current subtitle delay.
LIBVLC_API int libvlc_media_player_get_full_title_descriptions(libvlc_media_player_t *p_mi, libvlc_title_description_t ***titles)
Get the full description of available titles.
LIBVLC_API void libvlc_video_set_scale(libvlc_media_player_t *p_mi, float f_factor)
Set the video scaling factor.
LIBVLC_API int libvlc_video_get_size(libvlc_media_player_t *p_mi, unsigned num, unsigned *px, unsigned *py)
Get the pixel dimensions of a video.
LIBVLC_API libvlc_video_fit_mode_t libvlc_video_get_display_fit(libvlc_media_player_t *p_mi)
Get current video display fit mode.
LIBVLC_API int libvlc_video_get_deinterlace(libvlc_media_player_t *mp, char **modep)
Gets the deinterlacing parameters.
LIBVLC_API void libvlc_video_set_marquee_string(libvlc_media_player_t *p_mi, unsigned option, const char *psz_text)
Set a marquee string option.
LIBVLC_API void libvlc_video_set_video_stereo_mode(libvlc_media_player_t *p_mi, const libvlc_video_stereo_mode_t i_mode)
Set new video stereo mode.
LIBVLC_API void libvlc_video_set_logo_string(libvlc_media_player_t *p_mi, unsigned option, const char *psz_value)
Set logo option as string.
LIBVLC_API void libvlc_toggle_fullscreen(libvlc_media_player_t *p_mi)
Toggle fullscreen status on non-embedded video outputs.
LIBVLC_API void libvlc_video_set_display_fit(libvlc_media_player_t *p_mi, libvlc_video_fit_mode_t fit)
Set new video display fit.
LIBVLC_API float libvlc_video_get_adjust_float(libvlc_media_player_t *p_mi, unsigned option)
Get float adjust option.
LIBVLC_API libvlc_video_viewpoint_t * libvlc_video_new_viewpoint(void)
Create a video viewpoint structure.
LIBVLC_API void libvlc_video_set_adjust_int(libvlc_media_player_t *p_mi, unsigned option, int value)
Set adjust option as integer.
LIBVLC_API int libvlc_video_get_teletext(libvlc_media_player_t *p_mi)
Get current teletext page requested or 0 if it's disabled.
LIBVLC_API void libvlc_video_set_key_input(libvlc_media_player_t *p_mi, unsigned on)
Enable or disable key press events handling, according to the LibVLC hotkeys configuration.
LIBVLC_API int libvlc_media_player_get_full_chapter_descriptions(libvlc_media_player_t *p_mi, int i_chapters_of_title, libvlc_chapter_description_t ***pp_chapters)
Get the full description of available chapters.
LIBVLC_API float libvlc_video_get_spu_text_scale(libvlc_media_player_t *p_mi)
Get the current subtitle text scale.
LIBVLC_API void libvlc_video_set_projection_mode(libvlc_media_player_t *player, libvlc_video_projection_t projection_mode)
Change the projection mode used for rendering the source.
LIBVLC_API void libvlc_chapter_descriptions_release(libvlc_chapter_description_t **p_chapters, unsigned i_count)
Release a chapter description.
LIBVLC_API void libvlc_video_set_spu_text_scale(libvlc_media_player_t *p_mi, float f_scale)
Set the subtitle text scale.
LIBVLC_API int libvlc_video_get_logo_int(libvlc_media_player_t *p_mi, unsigned option)
Get integer logo option.
LIBVLC_API int libvlc_video_take_snapshot(libvlc_media_player_t *p_mi, unsigned num, const char *psz_filepath, unsigned int i_width, unsigned int i_height)
Take a snapshot of the current video window.
LIBVLC_API void libvlc_title_descriptions_release(libvlc_title_description_t **p_titles, unsigned i_count)
Release a title description.
LIBVLC_API void libvlc_video_set_crop_window(libvlc_media_player_t *mp, unsigned x, unsigned y, unsigned width, unsigned height)
Set the video crop window.
LIBVLC_API int libvlc_video_set_spu_delay(libvlc_media_player_t *p_mi, libvlc_time_t i_delay)
Set the subtitle delay.
LIBVLC_API float libvlc_video_get_scale(libvlc_media_player_t *p_mi)
Get the current video scaling factor.
libvlc_video_logo_option_t
option values for libvlc_video_{get,set}_logo_{int,string}
Definition libvlc_media_player.h:2949
LIBVLC_API int libvlc_video_update_viewpoint(libvlc_media_player_t *p_mi, const libvlc_video_viewpoint_t *p_viewpoint, bool b_absolute)
Update the video viewpoint information.
LIBVLC_API char * libvlc_video_get_aspect_ratio(libvlc_media_player_t *p_mi)
Get current video aspect ratio.
LIBVLC_API void libvlc_set_fullscreen(libvlc_media_player_t *p_mi, bool b_fullscreen)
Enable or disable fullscreen.
LIBVLC_API int libvlc_video_get_adjust_int(libvlc_media_player_t *p_mi, unsigned option)
Get integer adjust option.
LIBVLC_API void libvlc_video_set_teletext(libvlc_media_player_t *p_mi, int i_page)
Set new teletext page to retrieve.
libvlc_video_stereo_mode_t
Video stereo modes.
Definition libvlc_media_player.h:2611
LIBVLC_API int libvlc_video_get_marquee_int(libvlc_media_player_t *p_mi, unsigned option)
Get an integer marquee option value.
LIBVLC_API void libvlc_video_set_mouse_input(libvlc_media_player_t *p_mi, unsigned on)
Enable or disable mouse click events handling.
LIBVLC_API void libvlc_video_set_adjust_float(libvlc_media_player_t *p_mi, unsigned option, float value)
Set adjust option as float.
LIBVLC_API bool libvlc_video_get_teletext_transparency(libvlc_media_player_t *p_mi)
Get teletext background transparency.
LIBVLC_API void libvlc_video_unset_projection_mode(libvlc_media_player_t *player)
Remove previously set projection mode.
LIBVLC_API int libvlc_video_get_cursor(libvlc_media_player_t *p_mi, unsigned num, int *px, int *py)
Get the mouse pointer coordinates over a video.
LIBVLC_API void libvlc_video_set_logo_int(libvlc_media_player_t *p_mi, unsigned option, int value)
Set logo option as integer.
@ libvlc_adjust_Gamma
Definition libvlc_media_player.h:3001
@ libvlc_adjust_Hue
Definition libvlc_media_player.h:2999
@ libvlc_adjust_Enable
Definition libvlc_media_player.h:2996
@ libvlc_adjust_Brightness
Definition libvlc_media_player.h:2998
@ libvlc_adjust_Saturation
Definition libvlc_media_player.h:3000
@ libvlc_adjust_Contrast
Definition libvlc_media_player.h:2997
@ libvlc_logo_position
Definition libvlc_media_player.h:2957
@ libvlc_logo_repeat
Definition libvlc_media_player.h:2955
@ libvlc_logo_delay
Definition libvlc_media_player.h:2954
@ libvlc_logo_opacity
Definition libvlc_media_player.h:2956
@ libvlc_logo_y
Definition libvlc_media_player.h:2953
@ libvlc_logo_file
string argument, "file,d,t;file,d,t;..."
Definition libvlc_media_player.h:2951
@ libvlc_logo_x
Definition libvlc_media_player.h:2952
@ libvlc_logo_enable
Definition libvlc_media_player.h:2950
@ libvlc_VideoStereoLeftEye
Definition libvlc_media_player.h:2614
@ libvlc_VideoStereoSideBySide
Definition libvlc_media_player.h:2616
@ libvlc_VideoStereoRightEye
Definition libvlc_media_player.h:2615
@ libvlc_VideoStereoAuto
Definition libvlc_media_player.h:2612
@ libvlc_VideoStereoStereo
Definition libvlc_media_player.h:2613
#define LIBVLC_API
Definition libvlc.h:42
int i_type
Definition httpd.c:1299
enum libvlc_track_type_t libvlc_track_type_t
Definition libvlc_media_player.h:44
libvlc_video_orient_t
Definition libvlc_video.h:33
libvlc_video_projection_t
Definition libvlc_video.h:45
vlc_mutex_t lock
Definition rand.c:33
static struct @245270112310123223152303371220240150150304304342 state
Description for audio output device.
Definition libvlc_media_player.h:101
char * psz_device
Device identifier string.
Definition libvlc_media_player.h:103
struct libvlc_audio_output_device_t * p_next
Next entry in list.
Definition libvlc_media_player.h:102
char * psz_description
User-friendly device description.
Definition libvlc_media_player.h:104
Description for audio output.
Definition libvlc_media_player.h:90
char * psz_name
Definition libvlc_media_player.h:91
struct libvlc_audio_output_t * p_next
Definition libvlc_media_player.h:93
char * psz_description
Definition libvlc_media_player.h:92
Description for chapters.
Definition libvlc_media_player.h:79
char * psz_name
chapter name
Definition libvlc_media_player.h:82
libvlc_time_t i_time_offset
time-offset of the chapter in microseconds (us)
Definition libvlc_media_player.h:80
libvlc_time_t i_duration
duration of the chapter in microseconds (us), 0 if unknown
Definition libvlc_media_player.h:81
struct defining callbacks for libvlc_media_player_new()
Definition libvlc_media_player.h:231
void(* on_length_changed)(void *opaque, libvlc_time_t length)
Callback prototype that notify when the player length changed.
Definition libvlc_media_player.h:329
void(* on_buffering_changed)(void *opaque, float buffering)
Callback prototype that notify when the player buffering changed.
Definition libvlc_media_player.h:290
void(* on_media_attachments_added)(void *opaque, libvlc_media_t *media, libvlc_picture_list_t *list)
Callback prototype that notify when the player added new attachments to the current media.
Definition libvlc_media_player.h:522
void(* on_media_changed)(void *opaque, libvlc_media_t *media)
Callback prototype that notify when the player changed media.
Definition libvlc_media_player.h:246
void(* on_screenshot_taken)(void *opaque, const char *file_path)
Callback prototype that notify when the player took a screenshot.
Definition libvlc_media_player.h:465
void(* on_prev_frame_status)(void *opaque, int status)
Callback prototype that notify when the previous frame, following a call to libvlc_media_player_previ...
Definition libvlc_media_player.h:564
void(* on_media_meta_changed)(void *opaque, libvlc_media_t *media)
Callback prototype that notify when metadata were update by the player.
Definition libvlc_media_player.h:492
void(* on_capabilities_changed)(void *opaque, libvlc_capability_t old_caps, libvlc_capability_t new_caps)
Callback prototype that notify when the player capabilities changed.
Definition libvlc_media_player.h:302
void(* on_title_selection_changed)(void *opaque, const libvlc_title_description_t *title, unsigned idx)
Callback prototype that notify when the player selected a new title.
Definition libvlc_media_player.h:418
void(* on_recording_changed)(void *opaque, bool recording, const char *file_path)
Callback prototype that notify when the player recording state changed.
Definition libvlc_media_player.h:453
void(* on_program_list_changed)(void *opaque, libvlc_list_action_t action, int group_id)
Callback prototype that notify when the player added, removed or updated a program.
Definition libvlc_media_player.h:376
void(* on_track_list_changed)(void *opaque, libvlc_list_action_t action, libvlc_track_type_t type, const char *id)
Callback prototype that notify when the player added, removed or updated a track.
Definition libvlc_media_player.h:344
void(* on_audio_mute_changed)(void *opaque, bool muted)
Callback prototype that notify when the audio mute state has changed.
Definition libvlc_media_player.h:613
void(* on_audio_volume_changed)(void *opaque, float volume)
Callback prototype that notify when the audio volume has changed.
Definition libvlc_media_player.h:602
void(* on_titles_changed)(void *opaque)
Callback prototype that notify when the player changed titles.
Definition libvlc_media_player.h:405
void(* on_next_frame_status)(void *opaque, int status)
Callback prototype that notify when the next frame, following a call to libvlc_media_player_next_fram...
Definition libvlc_media_player.h:543
void(* on_media_stopping)(void *opaque, libvlc_media_t *media, libvlc_stopping_reason_t stopping_reason)
Callback prototype that notify when the player will stop the current media.
Definition libvlc_media_player.h:264
void(* on_audio_device_changed)(void *opaque, const char *device)
Callback prototype that notify when the audio device state has changed.
Definition libvlc_media_player.h:624
void(* on_media_parsed)(void *opaque, libvlc_media_t *media)
Callback prototype that notify when the player parsed the current media.
Definition libvlc_media_player.h:480
void(* on_state_changed)(void *opaque, libvlc_state_t state)
Callback prototype that notify when the player state changed.
Definition libvlc_media_player.h:276
void(* on_chapter_selection_changed)(void *opaque, const libvlc_title_description_t *title, unsigned title_idx, const libvlc_chapter_description_t *chapter, unsigned chapter_idx)
Callback prototype that notify when the player selected a new chapter.
Definition libvlc_media_player.h:436
void(* on_position_changed)(void *opaque, libvlc_time_t time, double pos)
Callback prototype that notify when the player position changed.
Definition libvlc_media_player.h:315
void(* on_vout_changed)(void *opaque, unsigned vout_count)
Callback prototype that notify when a new player vout is added or removed.
Definition libvlc_media_player.h:575
void(* on_media_subitems_changed)(void *opaque, libvlc_media_t *media)
Callback prototype that notify when the player added new subitems to the current media.
Definition libvlc_media_player.h:505
void(* on_track_selection_changed)(void *opaque, libvlc_track_type_t type, const char *unselected_id, const char *selected_id)
Callback prototype that notify when a track is selected or unselected by the player.
Definition libvlc_media_player.h:360
uint32_t version
Version of struct libvlc_media_player_cbs.
Definition libvlc_media_player.h:235
void(* on_program_selection_changed)(void *opaque, int unselected_group_id, int selected_group_id)
Callback prototype that notify when a program is selected or unselected by the player.
Definition libvlc_media_player.h:391
void(* on_cork_changed)(void *opaque, bool corked)
Callback prototype that notify when the player is corked/uncorked.
Definition libvlc_media_player.h:591
Media Player timer point.
Definition libvlc_media_player.h:3595
libvlc_time_t length_us
Valid length, in us >= 1 or 0.
Definition libvlc_media_player.h:3603
libvlc_time_t ts_us
Valid time, in us >= 0 or -1.
Definition libvlc_media_player.h:3601
libvlc_time_t system_date_us
System date, in us, of this record (always valid).
Definition libvlc_media_player.h:3612
double position
Position in the range [0.0f;1.0].
Definition libvlc_media_player.h:3597
double rate
Rate of the player.
Definition libvlc_media_player.h:3599
struct defining callbacks for libvlc_media_player_watch_time()
Definition libvlc_media_player.h:3618
void(* on_update)(void *opaque, const libvlc_media_player_time_point_t *value)
Callback prototype that notify when the player state or time changed.
Definition libvlc_media_player.h:3644
uint32_t version
Version of struct libvlc_media_player_watch_time_cbs.
Definition libvlc_media_player.h:3622
void(* on_seek)(void *opaque, const libvlc_media_player_time_point_t *value)
Callback prototype that notify when the player is seeking or finished seeking.
Definition libvlc_media_player.h:3683
void(* on_paused)(void *opaque, libvlc_time_t system_date_us)
Callback prototype that notify when the timer is paused.
Definition libvlc_media_player.h:3669
Definition libvlc_media_track.h:92
Definition libvlc_media_player.h:2271
bool b_scrambled
True if the program is scrambled.
Definition libvlc_media_player.h:2279
int i_group_id
Id used for libvlc_media_player_select_program().
Definition libvlc_media_player.h:2273
char * psz_name
Program name, always valid.
Definition libvlc_media_player.h:2275
bool b_selected
True if the program is selected.
Definition libvlc_media_player.h:2277
Definition libvlc_media_player.h:69
libvlc_time_t i_duration
duration in microseconds (us)
Definition libvlc_media_player.h:70
char * psz_name
title name
Definition libvlc_media_player.h:71
unsigned i_flags
info if item was recognized as a menu, interactive or plain content by the demuxer
Definition libvlc_media_player.h:72
Definition libvlc_media_player.h:1192
uint16_t BluePrimary[2]
[5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown
Definition libvlc_media_player.h:1196
unsigned int MinMasteringLuminance
[1, 50 000] minimum luminance in 0.0001 cd/m², 0=unknown
Definition libvlc_media_player.h:1199
uint16_t RedPrimary[2]
[5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown
Definition libvlc_media_player.h:1194
uint16_t WhitePoint[2]
[5,37 000] normalized x / [5,42 000] y white point in increments of 0.00002, 0=unknown
Definition libvlc_media_player.h:1197
uint16_t MaxFrameAverageLightLevel
[1, 50 000] Maximum Frame-Average Light Level in cd/m², 0=unknown
Definition libvlc_media_player.h:1201
uint16_t GreenPrimary[2]
[5,37 000] normalized x / [5,42 000] y chromacity in increments of 0.00002, 0=unknown
Definition libvlc_media_player.h:1195
uint16_t MaxContentLightLevel
[1, 50 000] Maximum Content Light Level in cd/m², 0=unknown
Definition libvlc_media_player.h:1200
unsigned int MaxMasteringLuminance
[50 000, 100 000 000] maximum luminance in 0.0001 cd/m², 0=unknown
Definition libvlc_media_player.h:1198
Definition libvlc_media_player.h:1090
libvlc_video_color_space_t colorspace
video color space
Definition libvlc_media_player.h:1114
bool full_range
Video is full range or studio/limited range.
Definition libvlc_media_player.h:1112
libvlc_video_color_primaries_t primaries
video color primaries
Definition libvlc_media_player.h:1116
libvlc_video_transfer_func_t transfer
video transfer function
Definition libvlc_media_player.h:1118
libvlc_video_orient_t orientation
video surface orientation
Definition libvlc_media_player.h:1120
union libvlc_video_output_cfg_t::libvlc_video_output_format u
Definition libvlc_media_player.h:1070
libvlc_video_transfer_func_t transfer
video transfer function
Definition libvlc_media_player.h:1084
libvlc_video_color_primaries_t primaries
video color primaries
Definition libvlc_media_player.h:1082
bool full_range
video is full range or studio/limited range
Definition libvlc_media_player.h:1078
libvlc_video_color_space_t colorspace
video color space
Definition libvlc_media_player.h:1080
void * device
device used for rendering, IDirect3DDevice9* for D3D9
Definition libvlc_media_player.h:1086
unsigned height
rendering video height in pixel
Definition libvlc_media_player.h:1074
unsigned bitdepth
rendering video bit depth in bits per channel
Definition libvlc_media_player.h:1076
unsigned width
rendering video width in pixel
Definition libvlc_media_player.h:1072
Definition libvlc_media_player.h:1013
bool hardware_decoding
Definition libvlc_media_player.h:1014
Definition libvlc_media_player.h:1018
union libvlc_video_setup_device_info_t::libvlc_video_setup_device_data u
Viewpoint.
Definition libvlc_media_track.h:64
const char * psz_name
Definition text_style.c:33
Definition libvlc_media_player.h:1091
int opengl_format
The rendering GLint GL_RGBA or GL_RGB for libvlc_video_engine_opengl and for libvlc_video_engine_gles...
Definition libvlc_media_player.h:1099
void * video
Pointer to an ANativeWindow, used for video rendering.
Definition libvlc_media_player.h:1104
void * subtitle
Pointer to an ANativeWindow, used for subtitles rendering, if blending subtitles into the video surfa...
Definition libvlc_media_player.h:1108
uint32_t d3d9_format
The rendering D3DFORMAT for libvlc_video_engine_d3d9.
Definition libvlc_media_player.h:1095
struct libvlc_video_output_cfg_t::libvlc_video_output_format::@110113027354041167372062043063000207217351057014 anw
int dxgi_format
The rendering DXGI_FORMAT for libvlc_video_engine_d3d11.
Definition libvlc_media_player.h:1093
void * p_surface
currently unused
Definition libvlc_media_player.h:1101
int adapter
IDirect3D9*.
Definition libvlc_media_player.h:1026
struct libvlc_video_setup_device_info_t::libvlc_video_setup_device_data::@317057244302206263306221236177065325234030267227 d3d9
struct libvlc_video_setup_device_info_t::libvlc_video_setup_device_data::@064022103153054060347271130376333060223100351307 d3d11
void * device_context
Definition libvlc_media_player.h:1021
void * device
Definition libvlc_media_player.h:1025
void * context_mutex
ID3D11DeviceContext*.
Definition libvlc_media_player.h:1022
enum vlc_video_fitting fit
Definition vout_intf.c:145
char psz_value[8]
Definition vout_intf.c:110