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