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 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
25
26#ifndef VLC_LIBVLC_MEDIA_PLAYER_H
27#define VLC_LIBVLC_MEDIA_PLAYER_H 1
28
29/* Definitions of enum properties for video */
30#include "libvlc_video.h"
31
32# ifdef __cplusplus
33extern "C" {
34# else
35# include <stdbool.h>
36# endif
37
46
47/** \defgroup libvlc_media_player LibVLC media player
48 * \ingroup libvlc
49 * A LibVLC media player plays one media (usually in a custom drawable).
50 * @{
51 * \file
52 * LibVLC simple media player external API
53 */
54
56
57/**
58 * Description for titles
59 */
60enum
61{
64};
65
67{
68 int64_t i_duration; /**< duration in milliseconds */
69 char *psz_name; /**< title name */
70 unsigned i_flags; /**< info if item was recognized as a menu, interactive or plain content by the demuxer */
72
73/**
74 * Description for chapters
75 */
77{
78 int64_t i_time_offset; /**< time-offset of the chapter in milliseconds */
79 int64_t i_duration; /**< duration of the chapter in milliseconds */
80 char *psz_name; /**< chapter name */
82
83/**
84 * Description for audio output. It contains
85 * name, description and pointer to next record.
86 */
94
95/**
96 * Description for audio output device.
97 */
99{
100 struct libvlc_audio_output_device_t *p_next; /**< Next entry in list */
101 char *psz_device; /**< Device identifier string */
102 char *psz_description; /**< User-friendly device description */
103 /* More fields may be added here in later versions */
105
106/**
107 * Marq options definition
108 */
121
122/**
123 * Navigation mode
124 */
134
135/**
136 * Enumeration of values used to set position (e.g. of video title).
137 */
150
151/**
152 * Enumeration of values used to set the video fitting inside the display area.
153 */
155 libvlc_video_fit_none = 0, /**< Explicit zoom set by \ref libvlc_video_set_scale */
156 libvlc_video_fit_smaller, /**< Fit inside / to smallest display dimension */
157 libvlc_video_fit_larger, /**< Fit outside / to largest display dimension */
158 libvlc_video_fit_width, /**< Fit to display width */
159 libvlc_video_fit_height, /**< Fit to display height */
161
162/**
163 * Enumeration of teletext keys than can be passed via
164 * libvlc_video_set_teletext()
165 */
173
174/**
175 * Opaque equalizer handle.
176 *
177 * Equalizer settings can be applied to a media player.
178 */
180
181/**
182 * Create an empty Media Player object
183 *
184 * \param p_libvlc_instance the libvlc instance in which the Media Player
185 * should be created.
186 * \return a new media player object, or NULL on error.
187 * It must be released by libvlc_media_player_release().
188 */
190
191/**
192 * Create a Media Player object from a Media
193 *
194 * \param inst LibVLC instance to create a media player with
195 * \param p_md the media. Afterwards the p_md can be safely
196 * destroyed.
197 * \return a new media player object, or NULL on error.
198 * It must be released by libvlc_media_player_release().
199 */
201
202/**
203 * Release a media_player after use
204 * Decrement the reference count of a media player object. If the
205 * reference count is 0, then libvlc_media_player_release() will
206 * release the media player object. If the media player object
207 * has been released, then it should not be used again.
208 *
209 * \param p_mi the Media Player to free
210 */
212
213/**
214 * Retain a reference to a media player object. Use
215 * libvlc_media_player_release() to decrement reference count.
216 *
217 * \param p_mi media player object
218 * \return the same object
219 */
221
222/**
223 * Set the media that will be used by the media_player. If any,
224 * previous md will be released.
225 *
226 * \note The user should listen to the libvlc_MediaPlayerMediaChanged event, to
227 * know when the new media is actually used by the player (or to known that the
228 * older media is no longer used).
229 *
230 * \param p_mi the Media Player
231 * \param p_md the Media. Afterwards the p_md can be safely
232 * destroyed.
233 */
235 libvlc_media_t *p_md );
236
237/**
238 * Get the media used by the media_player.
239 *
240 * \warning Calling this function just after libvlc_media_player_set_media()
241 * will return the media that was just set, but this media might not be
242 * currently used internally by the player. To detect such case, the user
243 * should listen to the libvlc_MediaPlayerMediaChanged event.
244 *
245 * \param p_mi the Media Player
246 * \return the media associated with p_mi, or NULL if no
247 * media is associated
248 */
250
251/**
252 * Get the Event Manager from which the media player send event.
253 *
254 * \param p_mi the Media Player
255 * \return the event manager associated with p_mi
256 */
258
259/**
260 * is_playing
261 *
262 * \param p_mi the Media Player
263 * \retval true media player is playing
264 * \retval false media player is not playing
265 */
267
268/**
269 * Play
270 *
271 * \param p_mi the Media Player
272 * \return 0 if playback started (and was already started), or -1 on error.
273 */
275
276/**
277 * Pause or resume (no effect if there is no media)
278 *
279 * \param mp the Media Player
280 * \param do_pause play/resume if zero, pause if non-zero
281 * \version LibVLC 1.1.1 or later
282 */
284 int do_pause );
285
286/**
287 * Toggle pause (no effect if there is no media)
288 *
289 * \param p_mi the Media Player
290 */
292
293/**
294 * Stop asynchronously
295 *
296 * \note This function is asynchronous. In case of success, the user should
297 * wait for the libvlc_MediaPlayerStopped event to know when the stop is
298 * finished.
299 *
300 * \param p_mi the Media Player
301 * \return 0 if the player is being stopped, -1 otherwise (no-op)
302 * \version LibVLC 4.0.0 or later
303 */
305
306/**
307 * Set a renderer to the media player
308 *
309 * \note must be called before the first call of libvlc_media_player_play() to
310 * take effect.
311 *
312 * \see libvlc_renderer_discoverer_new
313 *
314 * \param p_mi the Media Player
315 * \param p_item an item discovered by libvlc_renderer_discoverer_start()
316 * \return 0 on success, -1 on error.
317 * \version LibVLC 3.0.0 or later
318 */
320 libvlc_renderer_item_t *p_item );
321
322/**
323 * Enumeration of the Video color primaries.
324 */
333
334/**
335 * Enumeration of the Video color spaces.
336 */
342
343/**
344 * Enumeration of the Video transfer functions.
345 */
356
357
358/**
359 * Callback prototype to allocate and lock a picture buffer.
360 *
361 * Whenever a new video frame needs to be decoded, the lock callback is
362 * invoked. Depending on the video chroma, one or three pixel planes of
363 * adequate dimensions must be returned via the second parameter. Those
364 * planes must be aligned on 32-bytes boundaries.
365 *
366 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
367 * \param[out] planes start address of the pixel planes (LibVLC allocates the array
368 * of void pointers, this callback must initialize the array)
369 * \return a private pointer for the display and unlock callbacks to identify
370 * the picture buffers
371 */
372typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
373
374/**
375 * Callback prototype to unlock a picture buffer.
376 *
377 * When the video frame decoding is complete, the unlock callback is invoked.
378 * This callback might not be needed at all. It is only an indication that the
379 * application can now read the pixel values if it needs to.
380 *
381 * \note A picture buffer is unlocked after the picture is decoded,
382 * but before the picture is displayed.
383 *
384 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
385 * \param[in] picture private pointer returned from the @ref libvlc_video_lock_cb
386 * callback
387 * \param[in] planes pixel planes as defined by the @ref libvlc_video_lock_cb
388 * callback (this parameter is only for convenience)
389 */
390typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
391 void *const *planes);
392
393/**
394 * Callback prototype to display a picture.
395 *
396 * When the video frame needs to be shown, as determined by the media playback
397 * clock, the display callback is invoked.
398 *
399 * \param[in] opaque private pointer as passed to libvlc_video_set_callbacks()
400 * \param[in] picture private pointer returned from the @ref libvlc_video_lock_cb
401 * callback
402 */
403typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
404
405/**
406 * Callback prototype to configure picture buffers format.
407 * This callback gets the format of the video as output by the video decoder
408 * and the chain of video filters (if any). It can opt to change any parameter
409 * as it needs. In that case, LibVLC will attempt to convert the video format
410 * (rescaling and chroma conversion) but these operations can be CPU intensive.
411 *
412 * \param[in,out] opaque pointer to the private pointer passed to
413 * libvlc_video_set_callbacks()
414 * \param[in,out] chroma pointer to the 4 bytes video format identifier
415 * \param[in,out] width pointer to the buffer width in pixels
416 * \param[in,out] height pointer to the buffer height in pixels
417 * \param[out] pitches table of scanline pitches in bytes for each pixel plane
418 * (the table is allocated by LibVLC)
419 * \param[out] lines table of scanlines count for each plane
420 * \return the number of picture buffers allocated, 0 indicates failure
421 *
422 * \version LibVLC 4.0.0 and later.
423 * \param[in] width pointer to display width - 1 in pixels
424 * \param[in] height pointer to display height - 1 in pixels
425 *
426 * \note
427 * For each pixels plane, the scanline pitch must be bigger than or equal to
428 * the number of bytes per pixel multiplied by the pixel width.
429 * Similarly, the number of scanlines must be bigger than of equal to
430 * the pixel height.
431 * Furthermore, we recommend that pitches and lines be multiple of 32
432 * to not break assumptions that might be held by optimized code
433 * in the video decoders, video filters and/or video converters.
434 */
435typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
436 unsigned *width, unsigned *height,
437 unsigned *pitches,
438 unsigned *lines);
439
440/**
441 * Callback prototype to configure picture buffers format.
442 *
443 * \param[in] opaque private pointer as passed to libvlc_video_set_format_callbacks()
444 * (and possibly modified by @ref libvlc_video_format_cb)
445 */
446typedef void (*libvlc_video_cleanup_cb)(void *opaque);
447
448
449/**
450 * Set callbacks and private data to render decoded video to a custom area
451 * in memory.
452 * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
453 * to configure the decoded format.
454 *
455 * \warning Rendering video into custom memory buffers is considerably less
456 * efficient than rendering in a custom window as normal.
457 *
458 * For optimal performances, VLC media player renders into a custom window, and
459 * does not use this function and associated callbacks. It is <b>highly
460 * recommended</b> that other LibVLC-based application do likewise.
461 * To embed video in a window, use libvlc_media_player_set_xwindow() or
462 * equivalent depending on the operating system.
463 *
464 * If window embedding does not fit the application use case, then a custom
465 * LibVLC video output display plugin is required to maintain optimal video
466 * rendering performances.
467 *
468 * The following limitations affect performance:
469 * - Hardware video decoding acceleration will either be disabled completely,
470 * or require (relatively slow) copy from video/DSP memory to main memory.
471 * - Sub-pictures (subtitles, on-screen display, etc.) must be blent into the
472 * main picture by the CPU instead of the GPU.
473 * - Depending on the video format, pixel format conversion, picture scaling,
474 * cropping and/or picture re-orientation, must be performed by the CPU
475 * instead of the GPU.
476 * - Memory copying is required between LibVLC reference picture buffers and
477 * application buffers (between lock and unlock callbacks).
478 *
479 * \param mp the media player
480 * \param lock callback to lock video memory (must not be NULL)
481 * \param unlock callback to unlock video memory (or NULL if not needed)
482 * \param display callback to display video (or NULL if not needed)
483 * \param opaque private pointer for the three callbacks (as first parameter)
484 * \version LibVLC 1.1.1 or later
485 */
491 void *opaque );
492
493/**
494 * Set decoded video chroma and dimensions.
495 * This only works in combination with libvlc_video_set_callbacks(),
496 * and is mutually exclusive with libvlc_video_set_format_callbacks().
497 *
498 * \param mp the media player
499 * \param chroma a four-characters string identifying the chroma
500 * (e.g. "RV32" or "YUYV")
501 * \param width pixel width
502 * \param height pixel height
503 * \param pitch line pitch (in bytes)
504 * \version LibVLC 1.1.1 or later
505 * \bug All pixel planes are expected to have the same pitch.
506 * To use the YCbCr color space with chrominance subsampling,
507 * consider using libvlc_video_set_format_callbacks() instead.
508 */
510void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
511 unsigned width, unsigned height,
512 unsigned pitch );
513
514/**
515 * Set decoded video chroma and dimensions. This only works in combination with
516 * libvlc_video_set_callbacks().
517 *
518 * \param mp the media player
519 * \param setup callback to select the video format (cannot be NULL)
520 * \param cleanup callback to release any allocated resources (or NULL)
521 * \version LibVLC 2.0.0 or later
522 */
526 libvlc_video_cleanup_cb cleanup );
527
528
530{
531 bool hardware_decoding; /** set if D3D11_CREATE_DEVICE_VIDEO_SUPPORT is needed for D3D11 */
533
535{
536 union {
537 struct {
538 void *device_context; /** ID3D11DeviceContext* */
539 void *context_mutex; /** Windows Mutex HANDLE to protect ID3D11DeviceContext usage */
541 struct {
542 void *device; /** IDirect3D9* */
543 int adapter; /** Adapter to use with the IDirect3D9* */
545 };
547
548/**
549 * Callback prototype called to initialize user data.
550 * Setup the rendering environment.
551 *
552 * \param[in,out] opaque private pointer passed to the @a libvlc_video_set_output_callbacks()
553 * on input. The callback can change this value on output to be
554 * passed to all the other callbacks set on @a libvlc_video_set_output_callbacks().
555 * \param[in] cfg requested configuration of the video device
556 * \param[out] out libvlc_video_setup_device_info_t* to fill
557 * \return true on success
558 * \version LibVLC 4.0.0 or later
559 *
560 * For \ref libvlc_video_engine_d3d9 the output must be a IDirect3D9*.
561 * A reference to this object is held until the \ref libvlc_video_output_cleanup_cb is called.
562 * the device must be created with D3DPRESENT_PARAMETERS.hDeviceWindow set to 0.
563 *
564 * For \ref libvlc_video_engine_d3d11 the output must be a ID3D11DeviceContext*.
565 * A reference to this object is held until the \ref libvlc_video_output_cleanup_cb is called.
566 * The ID3D11Device used to create ID3D11DeviceContext must have multithreading enabled.
567 *
568 * If the ID3D11DeviceContext is used outside of the callbacks called by libvlc, the host
569 * MUST use a mutex to protect the access to the ID3D11DeviceContext of libvlc. This mutex
570 * value is set on d3d11.context_mutex. If the ID3D11DeviceContext is not used outside of
571 * the callbacks, the mutex d3d11.context_mutex may be NULL.
572 */
573typedef bool (*libvlc_video_output_setup_cb)(void **opaque,
576
577
578/**
579 * Callback prototype called to release user data
580 *
581 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
582 * \version LibVLC 4.0.0 or later
583 */
584typedef void (*libvlc_video_output_cleanup_cb)(void* opaque);
585
587{
588 /** rendering video width in pixel */
589 unsigned width;
590 /** rendering video height in pixel */
591 unsigned height;
592 /** rendering video bit depth in bits per channel */
593 unsigned bitdepth;
594 /** video is full range or studio/limited range */
596 /** video color space */
598 /** video color primaries */
600 /** video transfer function */
602 /** device used for rendering, IDirect3DDevice9* for D3D9 */
603 void *device;
605
607{
608 union {
609 /** The rendering DXGI_FORMAT for \ref libvlc_video_engine_d3d11. */
611 /** The rendering D3DFORMAT for \ref libvlc_video_engine_d3d9. */
612 uint32_t d3d9_format;
613 /** The rendering GLint GL_RGBA or GL_RGB for
614 * \ref libvlc_video_engine_opengl and for
615 * \ref libvlc_video_engine_gles2. */
617 /** currently unused */
619 };
620 /** Video is full range or studio/limited range. */
622 /** video color space */
624 /** video color primaries */
626 /** video transfer function */
628 /** video surface orientation */
631
632/**
633 * Callback prototype called on video size changes.
634 * Update the rendering output setup.
635 *
636 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
637 * \param[in] cfg configuration of the video that will be rendered
638 * \param[out] output configuration describing with how the rendering is setup
639 * \version LibVLC 4.0.0 or later
640 *
641 * \note the configuration device for Direct3D9 is the IDirect3DDevice9 that VLC
642 * uses to render. The host must set a Render target and call Present()
643 * when it needs the drawing from VLC to be done. This object is not valid
644 * anymore after Cleanup is called.
645 *
646 * Tone mapping, range and color conversion will be done depending on the values
647 * set in the output structure.
648 */
649typedef bool (*libvlc_video_update_output_cb)(void* opaque, const libvlc_video_render_cfg_t *cfg,
651
652
653/**
654 * Callback prototype called after performing drawing calls.
655 *
656 * This callback is called outside of libvlc_video_makeCurrent_cb current/not-current
657 * calls.
658 *
659 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
660 * \version LibVLC 4.0.0 or later
661 */
662typedef void (*libvlc_video_swap_cb)(void* opaque);
663
664/**
665 * Callback prototype to set up the OpenGL context for rendering.
666 * Tell the host the rendering is about to start/has finished.
667 *
668 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
669 * \param[in] enter true to set the context as current, false to unset it
670 * \return true on success
671 * \version LibVLC 4.0.0 or later
672 *
673 * On Direct3D11 the following may change on the provided ID3D11DeviceContext*
674 * between \p enter being true and \p enter being false:
675 * - IASetPrimitiveTopology()
676 * - IASetInputLayout()
677 * - IASetVertexBuffers()
678 * - IASetIndexBuffer()
679 * - VSSetConstantBuffers()
680 * - VSSetShader()
681 * - PSSetSamplers()
682 * - PSSetConstantBuffers()
683 * - PSSetShaderResources()
684 * - PSSetShader()
685 * - RSSetViewports()
686 * - DrawIndexed()
687 */
688typedef bool (*libvlc_video_makeCurrent_cb)(void* opaque, bool enter);
689
690/**
691 * Callback prototype to load opengl functions
692 *
693 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
694 * \param fct_name name of the opengl function to load
695 * \return a pointer to the named OpenGL function the NULL otherwise
696 * \version LibVLC 4.0.0 or later
697 */
698typedef void* (*libvlc_video_getProcAddress_cb)(void* opaque, const char* fct_name);
699
701{
702 /* similar to SMPTE ST 2086 mastering display color volume */
703 uint16_t RedPrimary[2];
704 uint16_t GreenPrimary[2];
705 uint16_t BluePrimary[2];
706 uint16_t WhitePoint[2];
712
716
717/**
718 * Callback prototype to receive metadata before rendering.
719 *
720 * \param[in] opaque private pointer passed to the @a libvlc_video_set_output_callbacks()
721 * \param[in] type type of data passed in metadata
722 * \param[in] metadata the type of metadata
723 * \version LibVLC 4.0.0 or later
724 */
725typedef void (*libvlc_video_frameMetadata_cb)(void* opaque, libvlc_video_metadata_type_t type, const void *metadata);
726
727/**
728 * Enumeration of the Video engine to be used on output.
729 * can be passed to @a libvlc_video_set_output_callbacks
730 */
732 /** Disable rendering engine */
736 /** Direct3D11 rendering engine */
738 /** Direct3D9 rendering engine */
741
742
743/** Callback type that can be called to request a render size changes.
744 *
745 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
746 *
747 * \param report_opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
748 * \param width new rendering width requested. [IN]
749 * \param height new rendering height requested. [IN]
750 */
751typedef void( *libvlc_video_output_resize_cb )( void *report_opaque, unsigned width, unsigned height );
752
753
754/**
755 * Enumeration of the different mouse buttons that can be reported for user interaction
756 * can be passed to \ref libvlc_video_output_mouse_press_cb and \ref libvlc_video_output_mouse_release_cb.
757 */
763
764
765/** Callback type that can be called to notify the mouse position when hovering the render surface.
766 *
767 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
768 *
769 * The position (0,0) denotes the top left corner, bottom right corner position
770 * is (width,height) as reported by \ref libvlc_video_output_resize_cb.
771 *
772 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
773 * \param x horizontal mouse position in \ref libvlc_video_output_resize_cb coordinates. [IN]
774 * \param y vertical mouse position in \ref libvlc_video_output_resize_cb coordinates. [IN]
775 */
776typedef void (*libvlc_video_output_mouse_move_cb)(void *opaque, int x, int y);
777
778/** Callback type that can be called to notify when a mouse button is pressed in the rendering surface.
779 *
780 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
781 *
782 * The button event will be reported at the last position provided by \ref libvlc_video_output_mouse_move_cb
783 *
784 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
785 * \param button represent the button pressed, see \ref libvlc_video_output_mouse_button_t for available buttons. [IN]
786 */
788
789/** Callback type that can be called to notify when a mouse button is released in the rendering surface.
790 *
791 * libvlc will provide a callback of this type when calling \ref libvlc_video_output_set_window_cb.
792 *
793 * The button event will be reported at the last position provided by \ref libvlc_video_output_mouse_move_cb.
794 *
795 * \param opaque parameter passed to \ref libvlc_video_output_set_window_cb. [IN]
796 * \param button represent the button released, see \ref libvlc_video_output_mouse_button_t for available buttons. [IN]
797 */
799
800/** Set the callback to call when the host app resizes the rendering area.
801 *
802 * This allows text rendering and aspect ratio to be handled properly when the host
803 * rendering size changes and to provide mouse.
804 *
805 * It may be called before the \ref libvlc_video_output_setup_cb callback.
806 *
807 * \warning These callbacks cannot be called concurrently, the caller is responsible for serialization
808 *
809 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
810 * \param[in] report_size_change callback which must be called when the host size changes.
811 * The callback is valid until another call to \ref libvlc_video_output_set_window_cb
812 * is done. This may be called from any thread.
813 * \param[in] report_mouse_move callback which must be called when the mouse position change on the video surface.
814 * The coordinates are relative to the size reported through the \p report_size_change.
815 * This may be called from any thread.
816 * \param[in] report_mouse_pressed callback which must be called when a mouse button is pressed on the video surface,
817 * The position of the event is the last position reported by the report_mouse_move callback. This may be
818 * called from any thread.
819 * \param[in] report_mouse_released callback which must be called when a mouse button is released on the video surface,
820 * The position of the event is the last position reported by the report_mouse_move callback. This may be
821 * called from any thread.
822 * \param[in] report_opaque private pointer to pass to the \p report_size_change callback.
823 */
824typedef void( *libvlc_video_output_set_window_cb )( void *opaque,
825 libvlc_video_output_resize_cb report_size_change,
826 libvlc_video_output_mouse_move_cb report_mouse_move,
827 libvlc_video_output_mouse_press_cb report_mouse_pressed,
828 libvlc_video_output_mouse_release_cb report_mouse_released,
829 void *report_opaque );
830
831/** Tell the host the rendering for the given plane is about to start
832 *
833 * \param[in] opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb()
834 * \param plane number of the rendering plane to select
835 * \param output handle of the rendering output for the given plane
836 * \return true on success
837 * \version LibVLC 4.0.0 or later
838 *
839 * \note This is only used with \ref libvlc_video_engine_d3d11.
840 *
841 * The output parameter receives the ID3D11RenderTargetView* to use for rendering
842 * the plane.
843 *
844 * If this callback is not used (set to NULL in @a libvlc_video_set_output_callbacks())
845 * OMSetRenderTargets has to be set during the @a libvlc_video_makeCurrent_cb()
846 * entering call.
847 *
848 * The number of planes depend on the DXGI_FORMAT returned during the
849 * @a libvlc_video_update_output_cb() call. It's usually one plane except for
850 * semi-planar formats like DXGI_FORMAT_NV12 or DXGI_FORMAT_P010.
851 *
852 * This callback is called between libvlc_video_makeCurrent_cb current/not-current
853 * calls.
854 */
855typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane, void *output );
856
857/**
858 * Set callbacks and data to render decoded video to a custom texture
859 *
860 * \warning VLC will perform video rendering in its own thread and at its own rate,
861 * You need to provide your own synchronisation mechanism.
862 *
863 * \param mp the media player
864 * \param engine the GPU engine to use
865 * \param setup_cb callback called to initialize user data
866 * \param cleanup_cb callback called to clean up user data
867 * \param window_cb callback called to setup the window
868 * \param update_output_cb callback to get the rendering format of the host (cannot be NULL)
869 * \param swap_cb callback called after rendering a video frame (cannot be NULL)
870 * \param makeCurrent_cb callback called to enter/leave the rendering context (cannot be NULL)
871 * \param getProcAddress_cb opengl function loading callback (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
872 * \param metadata_cb callback to provide frame metadata (D3D11 only)
873 * \param select_plane_cb callback to select different D3D11 rendering targets
874 * \param opaque private pointer passed to callbacks
875 *
876 * \note the \p setup_cb and \p cleanup_cb may be called more than once per
877 * playback.
878 *
879 * \retval true engine selected and callbacks set
880 * \retval false engine type unknown, callbacks not set
881 * \version LibVLC 4.0.0 or later
882 */
889 libvlc_video_update_output_cb update_output_cb,
890 libvlc_video_swap_cb swap_cb,
891 libvlc_video_makeCurrent_cb makeCurrent_cb,
892 libvlc_video_getProcAddress_cb getProcAddress_cb,
895 void* opaque );
896
897/**
898 * Set the handler where the media player should display its video output.
899 *
900 * The drawable is an `NSObject` that require responding to two selectors
901 * like in this protocol:
902 *
903 * @code{.m}
904 * @protocol VLCDrawable <NSObject>
905 * - (void)addSubview:(VLCView *)view;
906 * - (CGRect)bounds;
907 * @end
908 * @endcode
909 *
910 * In this protocol `VLCView` type can either be a `UIView` or a `NSView` type
911 * class.
912 * VLCDrawable protocol conformance isn't mandatory but a drawable must respond
913 * to both `addSubview:` and `bounds` selectors.
914 *
915 * Additionally, a drawable can also conform to the `VLCPictureInPictureDrawable`
916 * protocol to allow picture in picture support :
917 *
918 * @code{.m}
919 * @protocol VLCPictureInPictureMediaControlling <NSObject>
920 * - (void)play;
921 * - (void)pause;
922 * - (void)seekBy:(int64_t)offset;
923 * - (int64_t)mediaLength;
924 * - (int64_t)mediaTime;
925 * - (BOOL)isMediaPlaying;
926 * @end
927 *
928 * @protocol VLCPictureInPictureWindowControlling <NSObject>
929 * - (void)startPictureInPicture;
930 * - (void)stopPictureInPicture;
931 * - (void)invalidatePlaybackState;
932 * @end
933 *
934 * @protocol VLCPictureInPictureDrawable <NSObject>
935 * - (id<VLCPictureInPictureMediaControlling>) mediaController;
936 * - (void (^)(id<VLCPictureInPictureWindowControlling>)) pictureInPictureReady;
937 * @end
938 * @endcode
939 *
940 * Be aware that full `VLCPictureInPictureDrawable` conformance is mandatory to
941 * enable picture in picture support and that time values in
942 * `VLCPictureInPictureMediaControlling` methods are expressed in milliseconds.
943 *
944 * If you want to use it along with Qt see the QMacCocoaViewContainer. Then
945 * the following code should work:
946 * @code{.mm}
947 * {
948 * NSView *video = [[NSView alloc] init];
949 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
950 * libvlc_media_player_set_nsobject(mp, video);
951 * [video release];
952 * }
953 * @endcode
954 *
955 * You can find a live example in VLCVideoView in VLCKit.framework.
956 *
957 * \param p_mi the Media Player
958 * \param drawable the drawable that is either an NSView, a UIView or any
959 * NSObject responding to `addSubview:` and `bounds` selectors
960 */
962
963/**
964 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
965 *
966 * \param p_mi the Media Player
967 * \return the NSView handler or 0 if none where set
968 */
970
971/**
972 * Set an X Window System drawable where the media player should render its
973 * video output. The call takes effect when the playback starts. If it is
974 * already started, it might need to be stopped before changes apply.
975 * If LibVLC was built without X11 output support, then this function has no
976 * effects.
977 *
978 * By default, LibVLC will capture input events on the video rendering area.
979 * Use libvlc_video_set_mouse_input() and libvlc_video_set_key_input() to
980 * disable that and deliver events to the parent window / to the application
981 * instead. By design, the X11 protocol delivers input events to only one
982 * recipient.
983 *
984 * \warning
985 * The application must call the XInitThreads() function from Xlib before
986 * libvlc_new(), and before any call to XOpenDisplay() directly or via any
987 * other library. Failure to call XInitThreads() will seriously impede LibVLC
988 * performance. Calling XOpenDisplay() before XInitThreads() will eventually
989 * crash the process. That is a limitation of Xlib.
990 *
991 * \param p_mi media player
992 * \param drawable X11 window ID
993 *
994 * \note
995 * The specified identifier must correspond to an existing Input/Output class
996 * X11 window. Pixmaps are <b>not</b> currently supported. The default X11
997 * server is assumed, i.e. that specified in the DISPLAY environment variable.
998 *
999 * \warning
1000 * LibVLC can deal with invalid X11 handle errors, however some display drivers
1001 * (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle
1002 * must remain valid until playback is stopped, otherwise the process may
1003 * abort or crash.
1004 *
1005 * \bug
1006 * No more than one window handle per media player instance can be specified.
1007 * If the media has multiple simultaneously active video tracks, extra tracks
1008 * will be rendered into external windows beyond the control of the
1009 * application.
1010 */
1012 uint32_t drawable);
1013
1014/**
1015 * Get the X Window System window identifier previously set with
1016 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
1017 * even if VLC is not currently using it (for instance if it is playing an
1018 * audio-only input).
1019 *
1020 * \param p_mi the Media Player
1021 * \return an X window ID, or 0 if none where set.
1022 */
1024
1025/**
1026 * Set a Win32/Win64 API window handle (HWND) where the media player should
1027 * render its video output. If LibVLC was built without Win32/Win64 API output
1028 * support, then this has no effects.
1029 *
1030 * \warning the HWND must have the WS_CLIPCHILDREN set in its style.
1031 *
1032 * \param p_mi the Media Player
1033 * \param drawable windows handle of the drawable
1034 */
1036
1037/**
1038 * Get the Windows API window handle (HWND) previously set with
1039 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
1040 * is not currently outputting any video to it.
1041 *
1042 * \param p_mi the Media Player
1043 * \return a window handle or NULL if there are none.
1044 */
1046
1047/**
1048 * Set the android context.
1049 *
1050 * \version LibVLC 3.0.0 and later.
1051 *
1052 * \param p_mi the media player
1053 * \param p_awindow_handler org.videolan.libvlc.AWindow jobject owned by the
1054 * org.videolan.libvlc.MediaPlayer class from the libvlc-android project.
1055 */
1057 void *p_awindow_handler );
1058
1059/**
1060 * Callback prototype for audio playback.
1061 *
1062 * The LibVLC media player decodes and post-processes the audio signal
1063 * asynchronously (in an internal thread). Whenever audio samples are ready
1064 * to be queued to the output, this callback is invoked.
1065 *
1066 * The number of samples provided per invocation may depend on the file format,
1067 * the audio coding algorithm, the decoder plug-in, the post-processing
1068 * filters and timing. Application must not assume a certain number of samples.
1069 *
1070 * The exact format of audio samples is determined by libvlc_audio_set_format()
1071 * or libvlc_audio_set_format_callbacks() as is the channels layout.
1072 *
1073 * Note that the number of samples is per channel. For instance, if the audio
1074 * track sampling rate is 48000 Hz, then 1200 samples represent 25 milliseconds
1075 * of audio signal - regardless of the number of audio channels.
1076 *
1077 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1078 * \param[in] samples pointer to a table of audio samples to play back
1079 * \param count number of audio samples to play back
1080 * \param pts expected play time stamp (see libvlc_delay())
1081 */
1082typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
1083 unsigned count, int64_t pts);
1084
1085/**
1086 * Callback prototype for audio pause.
1087 *
1088 * LibVLC invokes this callback to pause audio playback.
1089 *
1090 * \note The pause callback is never called if the audio is already paused.
1091 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1092 * \param pts time stamp of the pause request (should be elapsed already)
1093 */
1094typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
1095
1096/**
1097 * Callback prototype for audio resumption.
1098 *
1099 * LibVLC invokes this callback to resume audio playback after it was
1100 * previously paused.
1101 *
1102 * \note The resume callback is never called if the audio is not paused.
1103 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1104 * \param pts time stamp of the resumption request (should be elapsed already)
1105 */
1106typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
1107
1108/**
1109 * Callback prototype for audio buffer flush.
1110 *
1111 * LibVLC invokes this callback if it needs to discard all pending buffers and
1112 * stop playback as soon as possible. This typically occurs when the media is
1113 * stopped.
1114 *
1115 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1116 */
1117typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
1118
1119/**
1120 * Callback prototype for audio buffer drain.
1121 *
1122 * LibVLC may invoke this callback when the decoded audio track is ending.
1123 * There will be no further decoded samples for the track, but playback should
1124 * nevertheless continue until all already pending buffers are rendered.
1125 *
1126 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1127 */
1128typedef void (*libvlc_audio_drain_cb)(void *data);
1129
1130/**
1131 * Callback prototype for audio volume change.
1132 * \param[in] data data pointer as passed to libvlc_audio_set_callbacks()
1133 * \param volume software volume (1. = nominal, 0. = mute)
1134 * \param mute muted flag
1135 */
1136typedef void (*libvlc_audio_set_volume_cb)(void *data,
1137 float volume, bool mute);
1138
1139/**
1140 * Sets callbacks and private data for decoded audio.
1141 *
1142 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
1143 * to configure the decoded audio format.
1144 *
1145 * \note The audio callbacks override any other audio output mechanism.
1146 * If the callbacks are set, LibVLC will <b>not</b> output audio in any way.
1147 *
1148 * \param mp the media player
1149 * \param play callback to play audio samples (must not be NULL)
1150 * \param pause callback to pause playback (or NULL to ignore)
1151 * \param resume callback to resume playback (or NULL to ignore)
1152 * \param flush callback to flush audio buffers (or NULL to ignore)
1153 * \param drain callback to drain audio buffers (or NULL to ignore)
1154 * \param opaque private pointer for the audio callbacks (as first parameter)
1155 * \version LibVLC 2.0.0 or later
1156 */
1164 void *opaque );
1165
1166/**
1167 * Set callbacks and private data for decoded audio. This only works in
1168 * combination with libvlc_audio_set_callbacks().
1169 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
1170 * to configure the decoded audio format.
1171 *
1172 * \param mp the media player
1173 * \param set_volume callback to apply audio volume,
1174 * or NULL to apply volume in software
1175 * \version LibVLC 2.0.0 or later
1176 */
1179 libvlc_audio_set_volume_cb set_volume );
1180
1181/**
1182 * Callback prototype to setup the audio playback.
1183 *
1184 * This is called when the media player needs to create a new audio output.
1185 * \param[in,out] opaque pointer to the data pointer passed to
1186 * libvlc_audio_set_callbacks()
1187 * \param[in,out] format 4 bytes sample format
1188 * \param[in,out] rate sample rate
1189 * \param[in,out] channels channels count
1190 * \return 0 on success, anything else to skip audio playback
1191 */
1192typedef int (*libvlc_audio_setup_cb)(void **opaque, char *format, unsigned *rate,
1193 unsigned *channels);
1194
1195/**
1196 * Callback prototype for audio playback cleanup.
1197 *
1198 * This is called when the media player no longer needs an audio output.
1199 * \param[in] opaque data pointer as passed to libvlc_audio_set_callbacks()
1200 */
1201typedef void (*libvlc_audio_cleanup_cb)(void *opaque);
1202
1203/**
1204 * Sets decoded audio format via callbacks.
1205 *
1206 * This only works in combination with libvlc_audio_set_callbacks().
1207 *
1208 * \param mp the media player
1209 * \param setup callback to select the audio format (cannot be NULL)
1210 * \param cleanup callback to release any allocated resources (or NULL)
1211 * \version LibVLC 2.0.0 or later
1212 */
1216 libvlc_audio_cleanup_cb cleanup );
1217
1218/**
1219 * Sets a fixed decoded audio format.
1220 *
1221 * This only works in combination with libvlc_audio_set_callbacks(),
1222 * and is mutually exclusive with libvlc_audio_set_format_callbacks().
1223 *
1224 * The supported formats are:
1225 * - "S16N" for signed 16-bit PCM
1226 * - "S32N" for signed 32-bit PCM
1227 * - "FL32" for single precision IEEE 754
1228 *
1229 * All supported formats use the native endianness.
1230 * If there are more than one channel, samples are interleaved.
1231 *
1232 * \param mp the media player
1233 * \param format a four-characters string identifying the sample format
1234 * \param rate sample rate (expressed in Hz)
1235 * \param channels channels count
1236 * \version LibVLC 2.0.0 or later
1237 */
1240 unsigned rate, unsigned channels );
1241
1242/** \bug This might go away ... to be replaced by a broader system */
1243
1244/**
1245 * Get the current movie length (in ms).
1246 *
1247 * \param p_mi the Media Player
1248 * \return the movie length (in ms), or -1 if there is no media.
1249 */
1251
1252/**
1253 * Get the current movie time (in ms).
1254 *
1255 * \param p_mi the Media Player
1256 * \return the movie time (in ms), or -1 if there is no media.
1257 */
1259
1260/**
1261 * Set the movie time (in ms).
1262 *
1263 * This has no effect if no media is being played.
1264 * Not all formats and protocols support this.
1265 *
1266 * \param p_mi the Media Player
1267 * \param i_time the movie time (in ms).
1268 * \param b_fast prefer fast seeking or precise seeking
1269 * \return 0 on success, -1 on error
1270 */
1272 libvlc_time_t i_time, bool b_fast );
1273
1274/**
1275 * Jump the movie time (in ms).
1276 *
1277 * This will trigger a precise and relative seek (from the current time).
1278 * This has no effect if no media is being played.
1279 * Not all formats and protocols support this.
1280 *
1281 * \param p_mi the Media Player
1282 * \param i_time the movie time (in ms).
1283 * \return 0 on success, -1 on error
1284 * \version LibVLC 4.0.0 and later.
1285 */
1287 libvlc_time_t i_time );
1288
1289/**
1290 * Get movie position as percentage between 0.0 and 1.0.
1291 *
1292 * \param p_mi the Media Player
1293 * \return movie position, or -1. in case of error
1294 */
1296
1297/**
1298 * Set movie position as percentage between 0.0 and 1.0.
1299 * This has no effect if playback is not enabled.
1300 * This might not work depending on the underlying input format and protocol.
1301 *
1302 * \param p_mi the Media Player
1303 * \param b_fast prefer fast seeking or precise seeking
1304 * \param f_pos the position
1305 * \return 0 on success, -1 on error
1306 */
1308 double f_pos, bool b_fast );
1309
1310/**
1311 * Set movie chapter (if applicable).
1312 *
1313 * \param p_mi the Media Player
1314 * \param i_chapter chapter number to play
1315 */
1317
1318/**
1319 * Get movie chapter.
1320 *
1321 * \param p_mi the Media Player
1322 * \return chapter number currently playing, or -1 if there is no media.
1323 */
1325
1326/**
1327 * Get movie chapter count
1328 *
1329 * \param p_mi the Media Player
1330 * \return number of chapters in movie, or -1.
1331 */
1333
1334/**
1335 * Get title chapter count
1336 *
1337 * \param p_mi the Media Player
1338 * \param i_title title
1339 * \return number of chapters in title, or -1
1340 */
1342 libvlc_media_player_t *p_mi, int i_title );
1343
1344/**
1345 * Set movie title
1346 *
1347 * \param p_mi the Media Player
1348 * \param i_title title number to play
1349 */
1351
1352/**
1353 * Get movie title
1354 *
1355 * \param p_mi the Media Player
1356 * \return title number currently playing, or -1
1357 */
1359
1360/**
1361 * Get movie title count
1362 *
1363 * \param p_mi the Media Player
1364 * \return title number count, or -1
1365 */
1367
1368/**
1369 * Set previous chapter (if applicable)
1370 *
1371 * \param p_mi the Media Player
1372 */
1374
1375/**
1376 * Set next chapter (if applicable)
1377 *
1378 * \param p_mi the Media Player
1379 */
1381
1382/**
1383 * Get the requested movie play rate.
1384 * @warning Depending on the underlying media, the requested rate may be
1385 * different from the real playback rate.
1386 *
1387 * \param p_mi the Media Player
1388 * \return movie play rate
1389 */
1391
1392/**
1393 * Set movie play rate
1394 *
1395 * \param p_mi the Media Player
1396 * \param rate movie play rate to set
1397 * \return -1 if an error was detected, 0 otherwise (but even then, it might
1398 * not actually work depending on the underlying media protocol)
1399 */
1401
1402/**
1403 * Get current movie state
1404 *
1405 * \param p_mi the Media Player
1406 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
1407 */
1409
1410/**
1411 * How many video outputs does this media player have?
1412 *
1413 * \param p_mi the media player
1414 * \return the number of video outputs
1415 */
1417
1418/**
1419 * Is this media player seekable?
1420 *
1421 * \param p_mi the media player
1422 * \retval true media player can seek
1423 * \retval false media player cannot seek
1424 */
1426
1427/**
1428 * Can this media player be paused?
1429 *
1430 * \param p_mi the media player
1431 * \retval true media player can be paused
1432 * \retval false media player cannot be paused
1433 */
1435
1436/**
1437 * Check if the current program is scrambled
1438 *
1439 * \param p_mi the media player
1440 * \retval true current program is scrambled
1441 * \retval false current program is not scrambled
1442 *
1443 * \version LibVLC 2.2.0 or later
1444 */
1446
1447/**
1448 * Display the next frame (if supported)
1449 *
1450 * \param p_mi the media player
1451 */
1453
1454/**
1455 * Navigate through DVD Menu
1456 *
1457 * \param p_mi the Media Player
1458 * \param navigate the Navigation mode
1459 * \version libVLC 2.0.0 or later
1460 */
1462 unsigned navigate );
1463
1464/**
1465 * Set if, and how, the video title will be shown when media is played.
1466 *
1467 * \param p_mi the media player
1468 * \param position position at which to display the title, or libvlc_position_disable to prevent the title from being displayed
1469 * \param timeout title display timeout in milliseconds (ignored if libvlc_position_disable)
1470 * \version libVLC 2.1.0 or later
1471 */
1473
1474/**
1475 * Get the track list for one type
1476 *
1477 * \version LibVLC 4.0.0 and later.
1478 *
1479 * \note You need to call libvlc_media_parse_request() or play the media
1480 * at least once before calling this function. Not doing this will result in
1481 * an empty list.
1482 *
1483 * \note This track list is a snapshot of the current tracks when this function
1484 * is called. If a track is updated after this call, the user will need to call
1485 * this function again to get the updated track.
1486 *
1487 *
1488 * The track list can be used to get track information and to select specific
1489 * tracks.
1490 *
1491 * \param p_mi the media player
1492 * \param type type of the track list to request
1493 * \param selected filter only selected tracks if true (return all tracks, even
1494 * selected ones if false)
1495 *
1496 * \return a valid libvlc_media_tracklist_t or NULL in case of error, if there
1497 * is no track for a category, the returned list will have a size of 0, delete
1498 * with libvlc_media_tracklist_delete()
1499 */
1502 libvlc_track_type_t type, bool selected );
1503
1504/**
1505 * Get the selected track for one type
1506 *
1507 * \version LibVLC 4.0.0 and later.
1508 *
1509 * \warning More than one tracks can be selected for one type. In that case,
1510 * libvlc_media_player_get_tracklist() should be used.
1511 *
1512 * \param p_mi the media player
1513 * \param type type of the selected track
1514 *
1515 * \return a valid track or NULL if there is no selected tracks for this type,
1516 * release it with libvlc_media_track_release().
1517 */
1520 libvlc_track_type_t type );
1521
1522/*
1523 * Get a track from a track id
1524 *
1525 * \version LibVLC 4.0.0 and later.
1526 *
1527 * This function can be used to get the last updated information of a track.
1528 *
1529 * \param p_mi the media player
1530 * \param psz_id valid string representing a track id (cf. psz_id from \ref
1531 * libvlc_media_track_t)
1532 *
1533 * \return a valid track or NULL if there is currently no tracks identified by
1534 * the string id, release it with libvlc_media_track_release().
1535 */
1538 const char *psz_id );
1539
1540
1541/**
1542 * Select a track
1543 *
1544 * This will unselected the current track.
1545 *
1546 * \version LibVLC 4.0.0 and later.
1547 *
1548 * \note Use libvlc_media_player_select_tracks() for multiple selection
1549 *
1550 * \warning Only use a \ref libvlc_media_track_t retrieved with \ref libvlc_media_player_get_tracklist
1551 *
1552 * \param p_mi the media player
1553 * \param track track to select, can't be NULL
1554 */
1555LIBVLC_API void
1557 const libvlc_media_track_t *track );
1558
1559/**
1560 * Unselect all tracks for a given type
1561 *
1562 * \version LibVLC 4.0.0 and later.
1563 *
1564 * \param p_mi the media player
1565 * \param type type to unselect
1566 */
1567LIBVLC_API void
1569 libvlc_track_type_t type );
1570
1571/**
1572 * Select multiple tracks for one type
1573 *
1574 * \version LibVLC 4.0.0 and later.
1575 *
1576 * \note The internal track list can change between the calls of
1577 * libvlc_media_player_get_tracklist() and
1578 * libvlc_media_player_set_tracks(). If a track selection change but the
1579 * track is not present anymore, the player will just ignore it.
1580 *
1581 * \note selecting multiple audio tracks is currently not supported.
1582 *
1583 * \warning Only use a \ref libvlc_media_track_t retrieved with \ref libvlc_media_player_get_tracklist
1584 *
1585 * \param p_mi the media player
1586 * \param type type of the selected track
1587 * \param tracks pointer to the track array, or NULL if track_count is 0
1588 * \param track_count number of tracks in the track array
1589 */
1590LIBVLC_API void
1593 const libvlc_media_track_t **tracks,
1594 size_t track_count );
1595
1596/**
1597 * Select tracks by their string identifier
1598 *
1599 * \version LibVLC 4.0.0 and later.
1600 *
1601 * This function can be used pre-select a list of tracks before starting the
1602 * player. It has only effect for the current media. It can also be used when
1603 * the player is already started.
1604 *
1605 * 'str_ids' can contain more than one track id, delimited with ','. "" or any
1606 * invalid track id will cause the player to unselect all tracks of that
1607 * category. NULL will disable the preference for newer tracks without
1608 * unselecting any current tracks.
1609 *
1610 * Example:
1611 * - (libvlc_track_video, "video/1,video/2") will select these 2 video tracks.
1612 * If there is only one video track with the id "video/0", no tracks will be
1613 * selected.
1614 * - (libvlc_track_type_t, "${slave_url_md5sum}/spu/0) will select one spu
1615 * added by an input slave with the corresponding url.
1616 *
1617 * \note The string identifier of a track can be found via psz_id from \ref
1618 * libvlc_media_track_t
1619 *
1620 * \note selecting multiple audio tracks is currently not supported.
1621 *
1622 * \warning Only use a \ref libvlc_media_track_t id retrieved with \ref libvlc_media_player_get_tracklist
1623 *
1624 * \param p_mi the media player
1625 * \param type type to select
1626 * \param psz_ids list of string identifier or NULL
1627 */
1628LIBVLC_API void
1631 const char *psz_ids );
1632
1633/**
1634 * Add a slave to the current media player.
1635 *
1636 * \note If the player is playing, the slave will be added directly. This call
1637 * will also update the slave list of the attached libvlc_media_t.
1638 *
1639 * \version LibVLC 3.0.0 and later.
1640 *
1641 * \see libvlc_media_slaves_add
1642 *
1643 * \param p_mi the media player
1644 * \param i_type subtitle or audio
1645 * \param psz_uri Uri of the slave (should contain a valid scheme).
1646 * \param b_select True if this slave should be selected when it's loaded
1647 *
1648 * \return 0 on success, -1 on error.
1649 */
1653 const char *psz_uri, bool b_select );
1654
1656{
1657 /** Id used for libvlc_media_player_select_program() */
1659 /** Program name, always valid */
1661 /** True if the program is selected */
1663 /** True if the program is scrambled */
1666
1667/**
1668 * Opaque struct containing a list of program
1669 */
1671
1672/**
1673 * Delete a program struct
1674 *
1675 * \version LibVLC 4.0.0 and later.
1676 *
1677 * \param program returned by libvlc_media_player_get_selected_program() or
1678 * libvlc_media_player_get_program_from_id()
1679 *
1680 */
1681LIBVLC_API void
1683
1684/**
1685 * Get the number of programs in a programlist
1686 *
1687 * \version LibVLC 4.0.0 and later.
1688 *
1689 * \param list valid programlist
1690 *
1691 * \return number of programs, or 0 if the list is empty
1692 */
1693LIBVLC_API size_t
1695
1696/**
1697 * Get a program at a specific index
1698 *
1699 * \warning The behaviour is undefined if the index is not valid.
1700 *
1701 * \version LibVLC 4.0.0 and later.
1702 *
1703 * \param list valid programlist
1704 * \param index valid index in the range [0; count[
1705 *
1706 * \return a valid program (can't be NULL if libvlc_player_programlist_count()
1707 * returned a valid count)
1708 */
1711
1712/**
1713 * Release a programlist
1714 *
1715 * \note program structs from the list are also deleted.
1716 *
1717 * \version LibVLC 4.0.0 and later.
1718 *
1719 * \see libvlc_media_player_get_programlist
1720 *
1721 * \param list valid programlist
1722 */
1723LIBVLC_API void
1725
1726/**
1727 * Select program with a given program id.
1728 *
1729 * \note program ids are sent via the libvlc_MediaPlayerProgramAdded event or
1730 * can be fetch via libvlc_media_player_get_programlist()
1731 *
1732 * \version LibVLC 4.0.0 or later
1733 *
1734 * \param p_mi opaque media player handle
1735 * \param i_group_id program id
1736 */
1738
1739/**
1740 * Get the selected program
1741 *
1742 * \version LibVLC 4.0.0 or later
1743 *
1744 * \param p_mi opaque media player handle
1745 *
1746 * \return a valid program struct or NULL if no programs are selected. The
1747 * program need to be freed with libvlc_player_program_delete().
1748 */
1751
1752/**
1753 * Get a program struct from a program id
1754 *
1755 * \version LibVLC 4.0.0 or later
1756 *
1757 * \param p_mi opaque media player handle
1758 * \param i_group_id program id
1759 *
1760 * \return a valid program struct or NULL if the i_group_id is not found. The
1761 * program need to be freed with libvlc_player_program_delete().
1762 */
1765
1766/**
1767 * Get the program list
1768 *
1769 * \version LibVLC 4.0.0 and later.
1770 * \note This program list is a snapshot of the current programs when this
1771 * function is called. If a program is updated after this call, the user will
1772 * need to call this function again to get the updated program.
1773 *
1774 * The program list can be used to get program information and to select
1775 * specific programs.
1776 *
1777 * \param p_mi the media player
1778 *
1779 * \return a valid libvlc_media_programlist_t or NULL in case of error or empty
1780 * list, delete with libvlc_media_programlist_delete()
1781 */
1784
1785
1786/** \defgroup libvlc_video LibVLC video controls
1787 * @{
1788 */
1789
1790/**
1791 * Toggle fullscreen status on non-embedded video outputs.
1792 *
1793 * @warning The same limitations applies to this function
1794 * as to libvlc_set_fullscreen().
1795 *
1796 * \param p_mi the media player
1797 */
1799
1800/**
1801 * Enable or disable fullscreen.
1802 *
1803 * @warning With most window managers, only a top-level windows can be in
1804 * full-screen mode. Hence, this function will not operate properly if
1805 * libvlc_media_player_set_xwindow() was used to embed the video in a
1806 * non-top-level window. In that case, the embedding window must be reparented
1807 * to the root window <b>before</b> fullscreen mode is enabled. You will want
1808 * to reparent it back to its normal parent when disabling fullscreen.
1809 *
1810 * \note This setting applies to any and all current or future active video
1811 * tracks and windows for the given media player. The choice of fullscreen
1812 * output for each window is left to the operating system.
1813 *
1814 * \param p_mi the media player
1815 * \param b_fullscreen boolean for fullscreen status
1816 */
1818
1819/**
1820 * Get current fullscreen status.
1821 *
1822 * \param p_mi the media player
1823 * \return the fullscreen status (boolean)
1824 *
1825 * \retval false media player is windowed
1826 * \retval true media player is in fullscreen mode
1827 */
1829
1830/**
1831 * Enable or disable key press events handling, according to the LibVLC hotkeys
1832 * configuration. By default and for historical reasons, keyboard events are
1833 * handled by the LibVLC video widget.
1834 *
1835 * \note On X11, there can be only one subscriber for key press and mouse
1836 * click events per window. If your application has subscribed to those events
1837 * for the X window ID of the video widget, then LibVLC will not be able to
1838 * handle key presses and mouse clicks in any case.
1839 *
1840 * \warning This function is only implemented for X11 and Win32 at the moment.
1841 *
1842 * \param p_mi the media player
1843 * \param on true to handle key press events, false to ignore them.
1844 */
1847
1848/**
1849 * Enable or disable mouse click events handling. By default, those events are
1850 * handled. This is needed for DVD menus to work, as well as a few video
1851 * filters such as "puzzle".
1852 *
1853 * \see libvlc_video_set_key_input().
1854 *
1855 * \warning This function is only implemented for X11 and Win32 at the moment.
1856 *
1857 * \param p_mi the media player
1858 * \param on true to handle mouse click events, false to ignore them.
1859 */
1862
1863/**
1864 * Get the pixel dimensions of a video.
1865 *
1866 * \param p_mi media player
1867 * \param num number of the video (starting from, and most commonly 0)
1868 * \param[out] px pointer to get the pixel width
1869 * \param[out] py pointer to get the pixel height
1870 * \return 0 on success, -1 if the specified video does not exist
1871 */
1874 unsigned *px, unsigned *py );
1875
1876/**
1877 * Get the mouse pointer coordinates over a video.
1878 * Coordinates are expressed in terms of the decoded video resolution,
1879 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
1880 * you can query your windowing system directly).
1881 *
1882 * Either of the coordinates may be negative or larger than the corresponding
1883 * dimension of the video, if the cursor is outside the rendering area.
1884 *
1885 * @warning The coordinates may be out-of-date if the pointer is not located
1886 * on the video rendering area. LibVLC does not track the pointer if it is
1887 * outside of the video widget.
1888 *
1889 * @note LibVLC does not support multiple pointers (it does of course support
1890 * multiple input devices sharing the same pointer) at the moment.
1891 *
1892 * \param p_mi media player
1893 * \param num number of the video (starting from, and most commonly 0)
1894 * \param[out] px pointer to get the abscissa
1895 * \param[out] py pointer to get the ordinate
1896 * \return 0 on success, -1 if the specified video does not exist
1897 */
1900 int *px, int *py );
1901
1902/**
1903 * Get the current video scaling factor.
1904 * See also libvlc_video_set_scale().
1905 *
1906 * \param p_mi the media player
1907 * \return the currently configured zoom factor, or 0. if the video is set
1908 * to fit to the output window/drawable automatically.
1909 */
1911
1912/**
1913 * Set the video scaling factor. That is the ratio of the number of pixels on
1914 * screen to the number of pixels in the original decoded video in each
1915 * dimension. Zero is a special value; it will adjust the video to the output
1916 * window/drawable (in windowed mode) or the entire screen.
1917 *
1918 * Note that not all video outputs support scaling.
1919 *
1920 * \param p_mi the media player
1921 * \param f_factor the scaling factor, or zero
1922 */
1924
1925/**
1926 * Get current video aspect ratio.
1927 *
1928 * \param p_mi the media player
1929 * \return the video aspect ratio or NULL if unspecified
1930 * (the result must be released with free() or libvlc_free()).
1931 */
1933
1934/**
1935 * Set new video aspect ratio.
1936 *
1937 * \param p_mi the media player
1938 * \param psz_aspect new video aspect-ratio or NULL to reset to source aspect ratio
1939 * \note Invalid aspect ratios are ignored.
1940 */
1942
1943/**
1944 * Get current video display fit mode.
1945 *
1946 * \version LibVLC 4.0.0 or later
1947 *
1948 * \param p_mi the media player
1949 * \return the video display fit mode.
1950 */
1952
1953/**
1954 * Set new video display fit.
1955 *
1956 * \version LibVLC 4.0.0 or later
1957 *
1958 * \param p_mi the media player
1959 * \param fit new display fit mode
1960 * \note Invalid fit mode are ignored.
1961 */
1963
1964/**
1965 * Create a video viewpoint structure.
1966 *
1967 * \version LibVLC 3.0.0 and later
1968 *
1969 * \return video viewpoint or NULL
1970 * (the result must be released with free()).
1971 */
1973
1974/**
1975 * Update the video viewpoint information.
1976 *
1977 * \note It is safe to call this function before the media player is started.
1978 *
1979 * \version LibVLC 3.0.0 and later
1980 *
1981 * \param p_mi the media player
1982 * \param p_viewpoint video viewpoint allocated via libvlc_video_new_viewpoint()
1983 * \param b_absolute if true replace the old viewpoint with the new one. If
1984 * false, increase/decrease it.
1985 * \return -1 in case of error, 0 otherwise
1986 *
1987 * \note the values are set asynchronously, it will be used by the next frame displayed.
1988 */
1990 const libvlc_video_viewpoint_t *p_viewpoint,
1991 bool b_absolute);
1992
1993/**
1994 * Get the current subtitle delay. Positive values means subtitles are being
1995 * displayed later, negative values earlier.
1996 *
1997 * \param p_mi media player
1998 * \return time (in microseconds) the display of subtitles is being delayed
1999 * \version LibVLC 2.0.0 or later
2000 */
2002
2003/**
2004 * Get the current subtitle text scale
2005 *
2006 * The scale factor is expressed as a percentage of the default size, where
2007 * 1.0 represents 100 percent.
2008 *
2009 * \param p_mi media player
2010 * \version LibVLC 4.0.0 or later
2011 */
2013
2014/**
2015 * Set the subtitle text scale.
2016 *
2017 * The scale factor is expressed as a percentage of the default size, where
2018 * 1.0 represents 100 percent.
2019 *
2020 * A value of 0.5 would result in text half the normal size, and a value of 2.0
2021 * would result in text twice the normal size.
2022 *
2023 * The minimum acceptable value for the scale factor is 0.1.
2024 *
2025 * The maximum is 5.0 (five times normal size).
2026 *
2027 * \param p_mi media player
2028 * \param f_scale scale factor in the range [0.1;5.0] (default: 1.0)
2029 * \version LibVLC 4.0.0 or later
2030 */
2032
2033/**
2034 * Set the subtitle delay. This affects the timing of when the subtitle will
2035 * be displayed. Positive values result in subtitles being displayed later,
2036 * while negative values will result in subtitles being displayed earlier.
2037 *
2038 * The subtitle delay will be reset to zero each time the media changes.
2039 *
2040 * \param p_mi media player
2041 * \param i_delay time (in microseconds) the display of subtitles should be delayed
2042 * \return 0 on success, -1 on error
2043 * \version LibVLC 2.0.0 or later
2044 */
2046
2047/**
2048 * Get the full description of available titles
2049 *
2050 * \version LibVLC 3.0.0 and later.
2051 *
2052 * \param p_mi the media player
2053 * \param[out] titles address to store an allocated array of title descriptions
2054 * descriptions (must be freed with libvlc_title_descriptions_release()
2055 * by the caller)
2056 *
2057 * \return the number of titles (-1 on error)
2058 */
2060 libvlc_title_description_t ***titles );
2061
2062/**
2063 * Release a title description
2064 *
2065 * \version LibVLC 3.0.0 and later
2066 *
2067 * \param p_titles title description array to release
2068 * \param i_count number of title descriptions to release
2069 */
2072 unsigned i_count );
2073
2074/**
2075 * Get the full description of available chapters
2076 *
2077 * \version LibVLC 3.0.0 and later.
2078 *
2079 * \param p_mi the media player
2080 * \param i_chapters_of_title index of the title to query for chapters (uses current title if set to -1)
2081 * \param[out] pp_chapters address to store an allocated array of chapter descriptions
2082 * descriptions (must be freed with libvlc_chapter_descriptions_release()
2083 * by the caller)
2084 *
2085 * \return the number of chapters (-1 on error)
2086 */
2088 int i_chapters_of_title,
2089 libvlc_chapter_description_t *** pp_chapters );
2090
2091/**
2092 * Release a chapter description
2093 *
2094 * \version LibVLC 3.0.0 and later
2095 *
2096 * \param p_chapters chapter description array to release
2097 * \param i_count number of chapter descriptions to release
2098 */
2101 unsigned i_count );
2102
2103/**
2104 * Set/unset the video crop ratio.
2105 *
2106 * This function forces a crop ratio on any and all video tracks rendered by
2107 * the media player. If the display aspect ratio of a video does not match the
2108 * crop ratio, either the top and bottom, or the left and right of the video
2109 * will be cut out to fit the crop ratio.
2110 *
2111 * For instance, a ratio of 1:1 will force the video to a square shape.
2112 *
2113 * To disable video crop, set a crop ratio with zero as denominator.
2114 *
2115 * A call to this function overrides any previous call to any of
2116 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2117 * libvlc_video_set_crop_window().
2118 *
2119 * \see libvlc_video_set_aspect_ratio()
2120 *
2121 * \param mp the media player
2122 * \param num crop ratio numerator (ignored if denominator is 0)
2123 * \param den crop ratio denominator (or 0 to unset the crop ratio)
2124 *
2125 * \version LibVLC 4.0.0 and later
2126 */
2129 unsigned num, unsigned den);
2130
2131/**
2132 * Set the video crop window.
2133 *
2134 * This function selects a sub-rectangle of video to show. Any pixels outside
2135 * the rectangle will not be shown.
2136 *
2137 * To unset the video crop window, use libvlc_video_set_crop_ratio() or
2138 * libvlc_video_set_crop_border().
2139 *
2140 * A call to this function overrides any previous call to any of
2141 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2142 * libvlc_video_set_crop_window().
2143 *
2144 * \param mp the media player
2145 * \param x abscissa (i.e. leftmost sample column offset) of the crop window
2146 * \param y ordinate (i.e. topmost sample row offset) of the crop window
2147 * \param width sample width of the crop window (cannot be zero)
2148 * \param height sample height of the crop window (cannot be zero)
2149 *
2150 * \version LibVLC 4.0.0 and later
2151 */
2154 unsigned x, unsigned y,
2155 unsigned width, unsigned height);
2156
2157/**
2158 * Set the video crop borders.
2159 *
2160 * This function selects the size of video edges to be cropped out.
2161 *
2162 * To unset the video crop borders, set all borders to zero.
2163 *
2164 * A call to this function overrides any previous call to any of
2165 * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
2166 * libvlc_video_set_crop_window().
2167 *
2168 * \param mp the media player
2169 * \param left number of sample columns to crop on the left
2170 * \param right number of sample columns to crop on the right
2171 * \param top number of sample rows to crop on the top
2172 * \param bottom number of sample rows to corp on the bottom
2173 *
2174 * \version LibVLC 4.0.0 and later
2175 */
2178 unsigned left, unsigned right,
2179 unsigned top, unsigned bottom);
2180
2181/**
2182 * Get current teletext page requested or 0 if it's disabled.
2183 *
2184 * Teletext is disabled by default, call libvlc_video_set_teletext() to enable
2185 * it.
2186 *
2187 * \param p_mi the media player
2188 * \return the current teletext page requested.
2189 */
2191
2192/**
2193 * Set new teletext page to retrieve.
2194 *
2195 * This function can also be used to send a teletext key.
2196 *
2197 * \param p_mi the media player
2198 * \param i_page teletex page number requested. This value can be 0 to disable
2199 * teletext, a number in the range ]0;1000[ to show the requested page, or a
2200 * \ref libvlc_teletext_key_t. 100 is the default teletext page.
2201 */
2203
2204/**
2205 * Set teletext background transparency.
2206 *
2207 * \param p_mi the media player
2208 * \param transparent whether background should be transparent.
2209 * \version LibVLC 4.0.0 or later
2210 */
2212
2213/**
2214 * Get teletext background transparency.
2215 *
2216 * \param p_mi the media player
2217 * \retval true teletext has transparent background
2218 * \retval false teletext has opaque background
2219 * \version LibVLC 4.0.0 or later
2220 */
2222
2223/**
2224 * Take a snapshot of the current video window.
2225 *
2226 * If i_width AND i_height is 0, original size is used.
2227 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
2228 *
2229 * \param p_mi media player instance
2230 * \param num number of video output (typically 0 for the first/only one)
2231 * \param psz_filepath the path of a file or a folder to save the screenshot into
2232 * \param i_width the snapshot's width
2233 * \param i_height the snapshot's height
2234 * \return 0 on success, -1 if the video was not found
2235 */
2238 const char *psz_filepath, unsigned int i_width,
2239 unsigned int i_height );
2240
2241/**
2242 * Enable or disable deinterlace filter
2243 *
2244 * \param p_mi libvlc media player
2245 * \param deinterlace state -1: auto (default), 0: disabled, 1: enabled
2246 * \param psz_mode type of deinterlace filter, NULL for current/default filter
2247 * \version LibVLC 4.0.0 and later
2248 */
2250 int deinterlace,
2251 const char *psz_mode );
2252
2253/**
2254 * Get an integer marquee option value
2255 *
2256 * \param p_mi libvlc media player
2257 * \param option marq option to get \see libvlc_video_marquee_option_t
2258 */
2260 unsigned option );
2261
2262/**
2263 * Enable, disable or set an integer marquee option
2264 *
2265 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
2266 * or disabling (arg 0) the marq filter.
2267 *
2268 * \param p_mi libvlc media player
2269 * \param option marq option to set \see libvlc_video_marquee_option_t
2270 * \param i_val marq option value
2271 */
2273 unsigned option, int i_val );
2274
2275/**
2276 * Set a marquee string option
2277 *
2278 * \param p_mi libvlc media player
2279 * \param option marq option to set \see libvlc_video_marquee_option_t
2280 * \param psz_text marq option value
2281 */
2283 unsigned option, const char *psz_text );
2284
2285/** option values for libvlc_video_{get,set}_logo_{int,string} */
2296
2297/**
2298 * Get integer logo option.
2299 *
2300 * \param p_mi libvlc media player instance
2301 * \param option logo option to get, values of libvlc_video_logo_option_t
2302 */
2304 unsigned option );
2305
2306/**
2307 * Set logo option as integer. Options that take a different type value
2308 * are ignored.
2309 * Passing libvlc_logo_enable as option value has the side effect of
2310 * starting (arg !0) or stopping (arg 0) the logo filter.
2311 *
2312 * \param p_mi libvlc media player instance
2313 * \param option logo option to set, values of libvlc_video_logo_option_t
2314 * \param value logo option value
2315 */
2317 unsigned option, int value );
2318
2319/**
2320 * Set logo option as string. Options that take a different type value
2321 * are ignored.
2322 *
2323 * \param p_mi libvlc media player instance
2324 * \param option logo option to set, values of libvlc_video_logo_option_t
2325 * \param psz_value logo option value
2326 */
2328 unsigned option, const char *psz_value );
2329
2330
2331/** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
2340
2341/**
2342 * Get integer adjust option.
2343 *
2344 * \param p_mi libvlc media player instance
2345 * \param option adjust option to get, values of libvlc_video_adjust_option_t
2346 * \version LibVLC 1.1.1 and later.
2347 */
2349 unsigned option );
2350
2351/**
2352 * Set adjust option as integer. Options that take a different type value
2353 * are ignored.
2354 * Passing libvlc_adjust_enable as option value has the side effect of
2355 * starting (arg !0) or stopping (arg 0) the adjust filter.
2356 *
2357 * \param p_mi libvlc media player instance
2358 * \param option adjust option to set, values of libvlc_video_adjust_option_t
2359 * \param value adjust option value
2360 * \version LibVLC 1.1.1 and later.
2361 */
2363 unsigned option, int value );
2364
2365/**
2366 * Get float adjust option.
2367 *
2368 * \param p_mi libvlc media player instance
2369 * \param option adjust option to get, values of libvlc_video_adjust_option_t
2370 * \version LibVLC 1.1.1 and later.
2371 */
2373 unsigned option );
2374
2375/**
2376 * Set adjust option as float. Options that take a different type value
2377 * are ignored.
2378 *
2379 * \param p_mi libvlc media player instance
2380 * \param option adjust option to set, values of libvlc_video_adjust_option_t
2381 * \param value adjust option value
2382 * \version LibVLC 1.1.1 and later.
2383 */
2385 unsigned option, float value );
2386
2387/** @} video */
2388
2389/** \defgroup libvlc_audio LibVLC audio controls
2390 * @{
2391 */
2392
2393/**
2394 * Audio stereo modes
2395 */
2405
2406/**
2407 * Audio mix modes
2408 */
2417
2418/**
2419 * Gets the list of available audio output modules.
2420 *
2421 * \param p_instance libvlc instance
2422 * \return list of available audio outputs. It must be freed with
2423* \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
2424 * In case of error, NULL is returned.
2425 */
2428
2429/**
2430 * Frees the list of available audio output modules.
2431 *
2432 * \param p_list list with audio outputs for release
2433 */
2436
2437/**
2438 * Selects an audio output module.
2439 * \note Any change will take be effect only after playback is stopped and
2440 * restarted. Audio output cannot be changed while playing.
2441 *
2442 * \param p_mi media player
2443 * \param psz_name name of audio output,
2444 * use psz_name of \see libvlc_audio_output_t
2445 * \return 0 if function succeeded, -1 on error
2446 */
2448 const char *psz_name );
2449
2450/**
2451 * Gets a list of potential audio output devices.
2452 *
2453 * See also libvlc_audio_output_device_set().
2454 *
2455 * \note Not all audio outputs support enumerating devices.
2456 * The audio output may be functional even if the list is empty (NULL).
2457 *
2458 * \note The list may not be exhaustive.
2459 *
2460 * \warning Some audio output devices in the list might not actually work in
2461 * some circumstances. By default, it is recommended to not specify any
2462 * explicit audio device.
2463 *
2464 * \param mp media player
2465 * \return A NULL-terminated linked list of potential audio output devices.
2466 * It must be freed with libvlc_audio_output_device_list_release()
2467 * \version LibVLC 2.2.0 or later.
2468 */
2471
2472#if defined (__GNUC__) && !defined (__clang__)
2473__attribute__((unused))
2474__attribute__((noinline))
2475__attribute__((error("Use libvlc_audio_output_device_enum() instead")))
2477libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
2478 const char *aout )
2479{
2480 (void) p_instance; (void) aout;
2481 return NULL;
2482}
2483#endif
2484
2485/**
2486 * Frees a list of available audio output devices.
2487 *
2488 * \param p_list list with audio outputs for release
2489 * \version LibVLC 2.1.0 or later.
2490 */
2493
2494/**
2495 * Configures an explicit audio output device.
2496 *
2497 * A list of adequate potential device strings can be obtained with
2498 * libvlc_audio_output_device_enum().
2499 *
2500 * \note This function does not select the specified audio output plugin.
2501 * libvlc_audio_output_set() is used for that purpose.
2502 *
2503 * \warning The syntax for the device parameter depends on the audio output.
2504 *
2505 * Some audio output modules require further parameters (e.g. a channels map
2506 * in the case of ALSA).
2507 *
2508 * \version This function originally expected three parameters.
2509 * The middle parameter was removed from LibVLC 4.0 onward.
2510 *
2511 * \param mp media player
2512 * \param device_id device identifier string
2513 * (see \ref libvlc_audio_output_device_t::psz_device)
2514 *
2515 * \return If the change of device was requested successfully, zero is returned
2516 * (the actual change is asynchronous and not guaranteed to succeed).
2517 * On error, a non-zero value is returned.
2518 */
2520 const char *device_id );
2521
2522/**
2523 * Get the current audio output device identifier.
2524 *
2525 * This complements libvlc_audio_output_device_set().
2526 *
2527 * \warning The initial value for the current audio output device identifier
2528 * may not be set or may be some unknown value. A LibVLC application should
2529 * compare this value against the known device identifiers (e.g. those that
2530 * were previously retrieved by a call to libvlc_audio_output_device_enum) to
2531 * find the current audio output device.
2532 *
2533 * It is possible that the selected audio output device changes (an external
2534 * change) without a call to libvlc_audio_output_device_set. That may make this
2535 * method unsuitable to use if a LibVLC application is attempting to track
2536 * dynamic audio device changes as they happen.
2537 *
2538 * \param mp media player
2539 * \return the current audio output device identifier
2540 * NULL if no device is selected or in case of error
2541 * (the result must be released with free()).
2542 * \version LibVLC 3.0.0 or later.
2543 */
2545
2546/**
2547 * Toggle mute status.
2548 *
2549 * \param p_mi media player
2550 * \warning Toggling mute atomically is not always possible: On some platforms,
2551 * other processes can mute the VLC audio playback stream asynchronously. Thus,
2552 * there is a small race condition where toggling will not work.
2553 * See also the limitations of libvlc_audio_set_mute().
2554 */
2556
2557/**
2558 * Get current mute status.
2559 *
2560 * \param p_mi media player
2561 * \return the mute status (boolean) if defined, -1 if undefined/unapplicable
2562 */
2564
2565/**
2566 * Set mute status.
2567 *
2568 * \param p_mi media player
2569 * \param status If status is true then mute, otherwise unmute
2570 * \warning This function does not always work. If there are no active audio
2571 * playback stream, the mute status might not be available. If digital
2572 * pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also
2573 * some audio output plugins do not support muting at all.
2574 * \note To force silent playback, disable all audio tracks. This is more
2575 * efficient and reliable than mute.
2576 */
2578
2579/**
2580 * Get current software audio volume.
2581 *
2582 * \param p_mi media player
2583 * \return the software volume in percents
2584 * (0 = mute, 100 = nominal / 0dB)
2585 */
2587
2588/**
2589 * Set current software audio volume.
2590 *
2591 * \param p_mi media player
2592 * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
2593 * \return 0 if the volume was set, -1 if it was out of range
2594 */
2596
2597/**
2598 * Get current audio stereo-mode.
2599 *
2600 * \param p_mi media player
2601 * \return the audio stereo-mode, \see libvlc_audio_output_stereomode_t
2602 * \version LibVLC 4.0.0 or later
2603 */
2605
2606/**
2607 * Set current audio stereo-mode.
2608 *
2609 * \param p_mi media player
2610 * \param mode the audio stereo-mode, \see libvlc_audio_output_stereomode_t
2611 * \return 0 on success, -1 on error
2612 * \version LibVLC 4.0.0 or later
2613 */
2616
2617/**
2618 * Get current audio mix-mode.
2619 *
2620 * \param p_mi media player
2621 * \return the audio mix-mode, \see libvlc_audio_output_mixmode_t
2622 * \version LibVLC 4.0.0 or later
2623 */
2625
2626/**
2627 * Set current audio mix-mode.
2628 *
2629 * By default (::libvlc_AudioMixMode_Unset), the audio output will keep its
2630 * original channel configuration (play stereo as stereo, or 5.1 as 5.1). Yet,
2631 * the OS and Audio API might refuse a channel configuration and asks VLC to
2632 * adapt (Stereo played as 5.1 or vice-versa).
2633 *
2634 * This function allows to force a channel configuration, it will only work if
2635 * the OS and Audio API accept this configuration (otherwise, it won't have any
2636 * effects). Here are some examples:
2637 * - Play multi-channels (5.1, 7.1...) as stereo (::libvlc_AudioMixMode_Stereo)
2638 * - Play Stereo or 5.1 as 7.1 (::libvlc_AudioMixMode_7_1)
2639 * - Play multi-channels as stereo with a binaural effect
2640 * (::libvlc_AudioMixMode_Binaural). It might be selected automatically if the
2641 * OS and Audio API can detect if a headphone is plugged.
2642 *
2643 * \param p_mi media player
2644 * \param mode the audio mix-mode, \see libvlc_audio_output_mixmode_t
2645 * \return 0 on success, -1 on error
2646 * \version LibVLC 4.0.0 or later
2647 */
2650
2651
2652/**
2653 * Get current audio delay.
2654 *
2655 * \param p_mi media player
2656 * \return the audio delay (microseconds)
2657 * \version LibVLC 1.1.1 or later
2658 */
2660
2661/**
2662 * Set current audio delay. The audio delay will be reset to zero each time the media changes.
2663 *
2664 * \param p_mi media player
2665 * \param i_delay the audio delay (microseconds)
2666 * \return 0 on success, -1 on error
2667 * \version LibVLC 1.1.1 or later
2668 */
2670
2671/**
2672 * Get the number of equalizer presets.
2673 *
2674 * \return number of presets
2675 * \version LibVLC 2.2.0 or later
2676 */
2678
2679/**
2680 * Get the name of a particular equalizer preset.
2681 *
2682 * This name can be used, for example, to prepare a preset label or menu in a user
2683 * interface.
2684 *
2685 * \param u_index index of the preset, counting from zero
2686 * \return preset name, or NULL if there is no such preset
2687 * \version LibVLC 2.2.0 or later
2688 */
2690
2691/**
2692 * Get the number of distinct frequency bands for an equalizer.
2693 *
2694 * \return number of frequency bands
2695 * \version LibVLC 2.2.0 or later
2696 */
2698
2699/**
2700 * Get a particular equalizer band frequency.
2701 *
2702 * This value can be used, for example, to create a label for an equalizer band control
2703 * in a user interface.
2704 *
2705 * \param u_index index of the band, counting from zero
2706 * \return equalizer band frequency (Hz), or -1 if there is no such band
2707 * \version LibVLC 2.2.0 or later
2708 */
2710
2711/**
2712 * Create a new default equalizer, with all frequency values zeroed.
2713 *
2714 * The new equalizer can subsequently be applied to a media player by invoking
2715 * libvlc_media_player_set_equalizer().
2716 *
2717 * The returned handle should be freed via libvlc_audio_equalizer_release() when
2718 * it is no longer needed.
2719 *
2720 * \return opaque equalizer handle, or NULL on error
2721 * \version LibVLC 2.2.0 or later
2722 */
2724
2725/**
2726 * Create a new equalizer, with initial frequency values copied from an existing
2727 * preset.
2728 *
2729 * The new equalizer can subsequently be applied to a media player by invoking
2730 * libvlc_media_player_set_equalizer().
2731 *
2732 * The returned handle should be freed via libvlc_audio_equalizer_release() when
2733 * it is no longer needed.
2734 *
2735 * \param u_index index of the preset, counting from zero
2736 * \return opaque equalizer handle, or NULL on error
2737 * (it must be released with libvlc_audio_equalizer_release())
2738 * \version LibVLC 2.2.0 or later
2739 */
2741
2742/**
2743 * Release a previously created equalizer instance.
2744 *
2745 * The equalizer was previously created by using libvlc_audio_equalizer_new() or
2746 * libvlc_audio_equalizer_new_from_preset().
2747 *
2748 * It is safe to invoke this method with a NULL p_equalizer parameter for no effect.
2749 *
2750 * \param p_equalizer opaque equalizer handle, or NULL
2751 * \version LibVLC 2.2.0 or later
2752 */
2754
2755/**
2756 * Set a new pre-amplification value for an equalizer.
2757 *
2758 * The new equalizer settings are subsequently applied to a media player by invoking
2759 * libvlc_media_player_set_equalizer().
2760 *
2761 * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
2762 *
2763 * \param p_equalizer valid equalizer handle, must not be NULL
2764 * \param f_preamp preamp value (-20.0 to 20.0 Hz)
2765 * \return zero on success, -1 on error
2766 * \version LibVLC 2.2.0 or later
2767 */
2769
2770/**
2771 * Get the current pre-amplification value from an equalizer.
2772 *
2773 * \param p_equalizer valid equalizer handle, must not be NULL
2774 * \return preamp value (Hz)
2775 * \version LibVLC 2.2.0 or later
2776 */
2778
2779/**
2780 * Set a new amplification value for a particular equalizer frequency band.
2781 *
2782 * The new equalizer settings are subsequently applied to a media player by invoking
2783 * libvlc_media_player_set_equalizer().
2784 *
2785 * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
2786 *
2787 * \param p_equalizer valid equalizer handle, must not be NULL
2788 * \param f_amp amplification value (-20.0 to 20.0 Hz)
2789 * \param u_band index, counting from zero, of the frequency band to set
2790 * \return zero on success, -1 on error
2791 * \version LibVLC 2.2.0 or later
2792 */
2793LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index( libvlc_equalizer_t *p_equalizer, float f_amp, unsigned u_band );
2794
2795/**
2796 * Get the amplification value for a particular equalizer frequency band.
2797 *
2798 * \param p_equalizer valid equalizer handle, must not be NULL
2799 * \param u_band index, counting from zero, of the frequency band to get
2800 * \return amplification value (Hz); NaN if there is no such frequency band
2801 * \version LibVLC 2.2.0 or later
2802 */
2804
2805/**
2806 * Apply new equalizer settings to a media player.
2807 *
2808 * The equalizer is first created by invoking libvlc_audio_equalizer_new() or
2809 * libvlc_audio_equalizer_new_from_preset().
2810 *
2811 * It is possible to apply new equalizer settings to a media player whether the media
2812 * player is currently playing media or not.
2813 *
2814 * Invoking this method will immediately apply the new equalizer settings to the audio
2815 * output of the currently playing media if there is any.
2816 *
2817 * If there is no currently playing media, the new equalizer settings will be applied
2818 * later if and when new media is played.
2819 *
2820 * Equalizer settings will automatically be applied to subsequently played media.
2821 *
2822 * To disable the equalizer for a media player invoke this method passing NULL for the
2823 * p_equalizer parameter.
2824 *
2825 * The media player does not keep a reference to the supplied equalizer so it is safe
2826 * for an application to release the equalizer reference any time after this method
2827 * returns.
2828 *
2829 * \param p_mi opaque media player handle
2830 * \param p_equalizer opaque equalizer handle, or NULL to disable the equalizer for this media player
2831 * \return zero on success, -1 on error
2832 * \version LibVLC 2.2.0 or later
2833 */
2835
2836/**
2837 * Media player roles.
2838 *
2839 * \version LibVLC 3.0.0 and later.
2840 *
2841 * See \ref libvlc_media_player_set_role()
2842 */
2844 libvlc_role_None = 0, /**< Don't use a media player role */
2845 libvlc_role_Music, /**< Music (or radio) playback */
2846 libvlc_role_Video, /**< Video playback */
2847 libvlc_role_Communication, /**< Speech, real-time communication */
2848 libvlc_role_Game, /**< Video game */
2849 libvlc_role_Notification, /**< User interaction feedback */
2850 libvlc_role_Animation, /**< Embedded animation (e.g. in web page) */
2851 libvlc_role_Production, /**< Audio editing/production */
2852 libvlc_role_Accessibility, /**< Accessibility */
2853 libvlc_role_Test /** Testing */
2854#define libvlc_role_Last libvlc_role_Test
2856
2857/**
2858 * Gets the media role.
2859 *
2860 * \version LibVLC 3.0.0 and later.
2861 *
2862 * \param p_mi media player
2863 * \return the media player role (\ref libvlc_media_player_role_t)
2864 */
2866
2867/**
2868 * Sets the media role.
2869 *
2870 * \param p_mi media player
2871 * \param role the media player role (\ref libvlc_media_player_role_t)
2872 * \return 0 on success, -1 on error
2873 */
2875 unsigned role);
2876
2877/**
2878 * Start/stop recording
2879 *
2880 * \note The user should listen to the libvlc_MediaPlayerRecordChanged event,
2881 * to monitor the recording state.
2882 *
2883 * \version LibVLC 4.0.0 and later.
2884 *
2885 * \param p_mi media player
2886 * \param enable true to start recording, false to stop
2887 * \param dir_path path of the recording directory or NULL (use default path),
2888 * has only an effect when first enabling recording.
2889 */
2891 bool enable, const char *dir_path);
2892
2893/** @} audio */
2894
2895/** \defgroup libvlc_media_player_watch_time LibVLC media player time watch API
2896 * @{
2897 */
2898
2899/**
2900 * Media Player timer point
2901 *
2902 * \note ts and system_date values should not be used directly by the user.
2903 * libvlc_media_player_time_point_interpolate() will read these values and
2904 * return an interpolated ts.
2905 *
2906 * @see libvlc_media_player_watch_time_on_update
2907 */
2909{
2910 /** Position in the range [0.0f;1.0] */
2911 double position;
2912 /** Rate of the player */
2913 double rate;
2914 /** Valid time, in us >= 0 or -1 */
2915 int64_t ts_us;
2916 /** Valid length, in us >= 1 or 0 */
2917 int64_t length_us;
2918 /**
2919 * System date, in us, of this record (always valid).
2920 * Based on libvlc_clock(). This date can be in the future or in the past.
2921 * The special value of INT64_MAX mean that the clock was paused when this
2922 * point was updated. In that case,
2923 * libvlc_media_player_time_point_interpolate() will return the current
2924 * ts/pos of this point (there is nothing to interpolate).
2925 * */
2928
2929/**
2930 * Callback prototype that notify when the player state or time changed.
2931 *
2932 * Get notified when the time is updated by the input or output source. The
2933 * input source is the 'demux' or the 'access_demux'. The output source are
2934 * audio and video outputs: an update is received each time a video frame is
2935 * displayed or an audio sample is written. The delay between each updates may
2936 * depend on the input and source type (it can be every 5ms, 30ms, 1s or
2937 * 10s...). Users of this timer may need to update the position at a higher
2938 * frequency from their own mainloop via
2939 * libvlc_media_player_time_point_interpolate().
2940 *
2941 * \warning It is forbidden to call any Media Player functions from here.
2942 *
2943 * \param value always valid, the time corresponding to the state
2944 * \param data opaque pointer set by libvlc_media_player_watch_time()
2945 */
2947 const libvlc_media_player_time_point_t *value, void *data);
2948
2949/**
2950 * Callback prototype that notify when the timer is paused.
2951 *
2952 * This event is sent when the player is paused or stopping. The player
2953 * user should stop its "interpolate" timer.
2954 *
2955 * \note libvlc_media_player_watch_time_on_update() can be called when paused
2956 * for those 2 reasons:
2957 * - playback is resumed (libvlc_media_player_time_point_t.system_date is valid)
2958 * - a track, likely video (next-frame) is outputted when paused
2959 * (libvlc_media_player_time_point_t.system_date = INT64_MAX)
2960 *
2961 * \warning It is forbidden to call any Media Player functions from here.
2962 *
2963 * \param system_date_us system date, in us, of this event, only valid (> 0)
2964 * when paused. It can be used to interpolate the last updated point to this
2965 * date in order to get the last paused ts/position.
2966 * \param data opaque pointer set by libvlc_media_player_watch_time()
2967 */
2969 int64_t system_date_us, void *data);
2970
2971/**
2972 * Callback prototype that notify when the player is seeking or finished
2973 * seeking
2974 *
2975 * \warning It is forbidden to call any Media Player functions from here.
2976 *
2977 * \note It is not possible to receive points via on_update() while seeking.
2978 *
2979 * \param value point of the seek request or NULL when seeking is finished
2980 * \param data opaque pointer set by libvlc_media_player_watch_time()
2981 */
2983 const libvlc_media_player_time_point_t *value, void *data);
2984
2985/**
2986 * Watch for times updates
2987 *
2988 * \warning Only one watcher can be registered at a time. Calling this function
2989 * a second time (if libvlc_media_player_unwatch_time() was not called
2990 * in-between) will fail.
2991 *
2992 * \param p_mi the media player
2993 * \param min_period_us corresponds to the minimum period, in us, between each
2994 * updates, use it to avoid flood from too many source updates, set it to 0 to
2995 * receive all updates.
2996 * \param on_update callback to listen to update events (must not be NULL)
2997 * \param on_paused callback to listen to paused events (can be NULL)
2998 * \param cbs_data opaque pointer used by the callbacks
2999 * \return 0 on success, -1 on error (allocation error, or if already watching)
3000 * \version LibVLC 4.0.0 or later
3001 */
3002LIBVLC_API int
3004 int64_t min_period_us,
3008 void *cbs_data);
3009
3010/**
3011 * Unwatch time updates
3012 *
3013 * \param p_mi the media player
3014 * \version LibVLC 4.0.0 or later
3015 */
3016LIBVLC_API void
3018
3019/**
3020 * Interpolate a timer value to now
3021
3022 * \param point time update obtained via the
3023 * libvlc_media_player_watch_time_on_update() callback
3024 * \param system_now_us current system date, in us, returned by libvlc_clock()
3025 * \param out_ts_us pointer where to set the interpolated ts, in us
3026 * \param out_pos pointer where to set the interpolated position
3027 * \return 0 in case of success, -1 if the interpolated ts is negative (could
3028 * happen during the buffering step)
3029 * \version LibVLC 4.0.0 or later
3030 */
3031LIBVLC_API int
3033 int64_t system_now_us,
3034 int64_t *out_ts_us, double *out_pos);
3035
3036/**
3037 * Get the date of the next interval
3038 *
3039 * Can be used to setup an UI timer in order to update some widgets at specific
3040 * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3041 * time widget when the media reaches a new second.
3042 *
3043 * \note The media time doesn't necessarily correspond to the system time, that
3044 * is why this function is needed and uses the rate of the current point.
3045 *
3046 * \param point time update obtained via the
3047 * libvlc_media_player_watch_time_on_update()
3048 * \param system_now_us same system date used by
3049 * libvlc_media_player_time_point_interpolate()
3050 * \param interpolated_ts_us ts returned by
3051 * libvlc_media_player_time_point_interpolate()
3052 * \param next_interval_us next interval, in us
3053 * \return the absolute system date, in us, of the next interval,
3054 * use libvlc_delay() to get a relative delay.
3055 * \version LibVLC 4.0.0 or later
3056 */
3057LIBVLC_API int64_t
3059 int64_t system_now_us,
3060 int64_t interpolated_ts_us,
3061 int64_t next_interval_us);
3062
3063/** @} libvlc_media_player_watch_time */
3064
3065/** \defgroup libvlc_media_player_concurrency LibVLC media player concurrency API
3066 * @{
3067 */
3068
3069/**
3070 * Lock the media_player internal lock
3071
3072 * The lock is recursive, so it's safe to use it multiple times from the same
3073 * thread. You must call libvlc_media_player_unlock() the same number of times
3074 * you called libvlc_media_player_lock().
3075 *
3076 * Locking is not mandatory before calling a libvlc_media_player_t function
3077 * since they will automatically hold the lock internally.
3078 *
3079 * This lock can be used to synchronise user variables that interact with the
3080 * libvlc_media_player_t or can be used to call several functions together.
3081 *
3082 * \param mp media player object
3083 * \version LibVLC 4.0.0 or later
3084 */
3086
3087/**
3088 * Unlock the media_player internal lock
3089 *
3090 * \see libvlc_media_player_lock
3091 *
3092 * \param mp media player object locked using /ref libvlc_media_player_lock
3093 * \version LibVLC 4.0.0 or later
3094 */
3096
3097/**
3098 * Wait for an event to be signalled
3099 *
3100 * \note this is equivalent to pthread_cond_wait() with the
3101 * libvlc_media_player_t internal mutex and condition variable. This function
3102 * may spuriously wake up even without libvlc_media_player_signal() being
3103 * called.
3104 *
3105 * \warning this function must not be called from any libvlc callbacks and
3106 * events. The lock should be held only one time before waiting.
3107 *
3108 * \param mp media player object locked using /ref libvlc_media_player_lock
3109 * \version LibVLC 4.0.0 or later
3110 */
3112
3113/**
3114 * Signal all threads waiting for a signalling event
3115 *
3116 * \note this is equivalent to pthread_cond_broadcast() with the
3117 * libvlc_media_player_t internal condition variable.
3118 *
3119 * \param mp media player object locked using /ref libvlc_media_player_lock
3120 * \version LibVLC 4.0.0 or later
3121 */
3123
3124/** @} libvlc_media_player_concurrency */
3125
3126/** @} media_player */
3127
3128# ifdef __cplusplus
3129}
3130# endif
3131
3132#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:2409
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:2843
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:2396
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 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 libvlc_equalizer_t * libvlc_audio_equalizer_new(void)
Create a new default equalizer, with all frequency values zeroed.
LIBVLC_API int libvlc_audio_set_delay(libvlc_media_player_t *p_mi, int64_t i_delay)
Set current audio delay.
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 int64_t libvlc_audio_get_delay(libvlc_media_player_t *p_mi)
Get current audio delay.
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:2413
@ libvlc_AudioMixMode_Unset
Definition libvlc_media_player.h:2410
@ libvlc_AudioMixMode_5_1
Definition libvlc_media_player.h:2414
@ libvlc_AudioMixMode_Stereo
Definition libvlc_media_player.h:2411
@ libvlc_AudioMixMode_7_1
Definition libvlc_media_player.h:2415
@ libvlc_AudioMixMode_Binaural
Definition libvlc_media_player.h:2412
@ libvlc_role_Game
Video game.
Definition libvlc_media_player.h:2848
@ libvlc_role_None
Don't use a media player role.
Definition libvlc_media_player.h:2844
@ libvlc_role_Notification
User interaction feedback.
Definition libvlc_media_player.h:2849
@ libvlc_role_Production
Audio editing/production.
Definition libvlc_media_player.h:2851
@ libvlc_role_Communication
Speech, real-time communication.
Definition libvlc_media_player.h:2847
@ libvlc_role_Music
Music (or radio) playback.
Definition libvlc_media_player.h:2845
@ libvlc_role_Accessibility
Accessibility.
Definition libvlc_media_player.h:2852
@ libvlc_role_Video
Video playback.
Definition libvlc_media_player.h:2846
@ libvlc_role_Animation
Embedded animation (e.g.
Definition libvlc_media_player.h:2850
@ libvlc_AudioStereoMode_Stereo
Definition libvlc_media_player.h:2398
@ libvlc_AudioStereoMode_Right
Definition libvlc_media_player.h:2401
@ libvlc_AudioStereoMode_Unset
Definition libvlc_media_player.h:2397
@ libvlc_AudioStereoMode_Mono
Definition libvlc_media_player.h:2403
@ libvlc_AudioStereoMode_Dolbys
Definition libvlc_media_player.h:2402
@ libvlc_AudioStereoMode_Left
Definition libvlc_media_player.h:2400
@ libvlc_AudioStereoMode_RStereo
Definition libvlc_media_player.h:2399
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
int64_t libvlc_time_t
Definition libvlc.h:78
struct libvlc_event_manager_t libvlc_event_manager_t
Event manager that belongs to a libvlc object, and from whom events can be received.
Definition libvlc.h:283
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 int64_t libvlc_media_player_time_point_get_next_date(const libvlc_media_player_time_point_t *point, int64_t system_now_us, int64_t interpolated_ts_us, int64_t next_interval_us)
Get the date of the next interval.
void(* libvlc_media_player_watch_time_on_update)(const libvlc_media_player_time_point_t *value, void *data)
Callback prototype that notify when the player state or time changed.
Definition libvlc_media_player.h:2946
void(* libvlc_media_player_watch_time_on_paused)(int64_t system_date_us, void *data)
Callback prototype that notify when the timer is paused.
Definition libvlc_media_player.h:2968
void(* libvlc_media_player_watch_time_on_seek)(const libvlc_media_player_time_point_t *value, void *data)
Callback prototype that notify when the player is seeking or finished seeking.
Definition libvlc_media_player.h:2982
LIBVLC_API int libvlc_media_player_watch_time(libvlc_media_player_t *p_mi, int64_t min_period_us, libvlc_media_player_watch_time_on_update on_update, libvlc_media_player_watch_time_on_paused on_paused, libvlc_media_player_watch_time_on_seek on_seek, void *cbs_data)
Watch for times updates.
LIBVLC_API void libvlc_media_player_unwatch_time(libvlc_media_player_t *p_mi)
Unwatch time updates.
LIBVLC_API int libvlc_media_player_time_point_interpolate(const libvlc_media_player_time_point_t *point, int64_t system_now_us, int64_t *out_ts_us, double *out_pos)
Interpolate a timer value to now.
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:855
void(* libvlc_video_unlock_cb)(void *opaque, void *picture, void *const *planes)
Callback prototype to unlock a picture buffer.
Definition libvlc_media_player.h:390
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:776
LIBVLC_API libvlc_time_t libvlc_media_player_get_length(libvlc_media_player_t *p_mi)
Get the current movie length (in ms).
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 ms).
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 ms).
struct libvlc_equalizer_t libvlc_equalizer_t
Opaque equalizer handle.
Definition libvlc_media_player.h:179
void(* libvlc_audio_set_volume_cb)(void *data, float volume, bool mute)
Callback prototype for audio volume change.
Definition libvlc_media_player.h:1136
libvlc_teletext_key_t
Enumeration of teletext keys than can be passed via libvlc_video_set_teletext()
Definition libvlc_media_player.h:166
void(* libvlc_video_display_cb)(void *opaque, void *picture)
Callback prototype to display a picture.
Definition libvlc_media_player.h:403
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)
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:725
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:1201
LIBVLC_API libvlc_media_track_t * libvlc_media_player_get_track_from_id(libvlc_media_player_t *p_mi, const char *psz_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:824
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:787
LIBVLC_API void libvlc_media_player_set_title(libvlc_media_player_t *p_mi, int i_title)
Set movie title.
libvlc_video_marquee_option_t
Marq options definition.
Definition libvlc_media_player.h:109
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.
void(* libvlc_video_cleanup_cb)(void *opaque)
Callback prototype to configure picture buffers format.
Definition libvlc_media_player.h:446
void(* libvlc_audio_resume_cb)(void *data, int64_t pts)
Callback prototype for audio resumption.
Definition libvlc_media_player.h:1106
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 libvlc_media_player_t * libvlc_media_player_new(libvlc_instance_t *p_libvlc_instance)
Create an empty Media Player object.
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:751
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:154
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:337
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:372
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:798
libvlc_video_metadata_type_t
Definition libvlc_media_player.h:713
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:758
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:126
LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager(libvlc_media_player_t *p_mi)
Get the Event Manager from which the media player send event.
void(* libvlc_audio_flush_cb)(void *data, int64_t pts)
Callback prototype for audio buffer flush.
Definition libvlc_media_player.h:1117
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.
struct libvlc_player_programlist_t libvlc_player_programlist_t
Opaque struct containing a list of program.
Definition libvlc_media_player.h:1670
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:584
libvlc_position_t
Enumeration of values used to set position (e.g.
Definition libvlc_media_player.h:138
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:1082
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 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:688
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:649
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:731
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:1094
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_player_t * libvlc_media_player_new_from_media(libvlc_instance_t *inst, libvlc_media_t *p_md)
Create a Media Player object from a Media.
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:1192
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:325
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:573
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 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)
Display the next frame (if supported)
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:435
void(* libvlc_video_swap_cb)(void *opaque)
Callback prototype called after performing drawing calls.
Definition libvlc_media_player.h:662
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:346
void(* libvlc_audio_drain_cb)(void *data)
Callback prototype for audio buffer drain.
Definition libvlc_media_player.h:1128
void *(* libvlc_video_getProcAddress_cb)(void *opaque, const char *fct_name)
Callback prototype to load opengl functions.
Definition libvlc_media_player.h:698
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.
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 ms).
@ libvlc_teletext_key_index
Definition libvlc_media_player.h:171
@ libvlc_teletext_key_green
Definition libvlc_media_player.h:168
@ libvlc_teletext_key_blue
Definition libvlc_media_player.h:170
@ libvlc_teletext_key_red
Definition libvlc_media_player.h:167
@ libvlc_teletext_key_yellow
Definition libvlc_media_player.h:169
@ libvlc_marquee_Color
string argument
Definition libvlc_media_player.h:112
@ libvlc_marquee_Position
Definition libvlc_media_player.h:114
@ libvlc_marquee_Y
Definition libvlc_media_player.h:119
@ libvlc_marquee_Timeout
Definition libvlc_media_player.h:117
@ libvlc_marquee_Enable
Definition libvlc_media_player.h:110
@ libvlc_marquee_Opacity
Definition libvlc_media_player.h:113
@ libvlc_marquee_X
Definition libvlc_media_player.h:118
@ libvlc_marquee_Size
Definition libvlc_media_player.h:116
@ libvlc_marquee_Refresh
Definition libvlc_media_player.h:115
@ libvlc_marquee_Text
Definition libvlc_media_player.h:111
@ libvlc_video_fit_larger
Fit outside / to largest display dimension.
Definition libvlc_media_player.h:157
@ libvlc_video_fit_width
Fit to display width.
Definition libvlc_media_player.h:158
@ libvlc_video_fit_none
Explicit zoom set by libvlc_video_set_scale.
Definition libvlc_media_player.h:155
@ libvlc_video_fit_smaller
Fit inside / to smallest display dimension.
Definition libvlc_media_player.h:156
@ libvlc_video_fit_height
Fit to display height.
Definition libvlc_media_player.h:159
@ libvlc_video_colorspace_BT2020
Definition libvlc_media_player.h:340
@ libvlc_video_colorspace_BT709
Definition libvlc_media_player.h:339
@ libvlc_video_colorspace_BT601
Definition libvlc_media_player.h:338
@ libvlc_video_metadata_frame_hdr10
libvlc_video_frame_hdr10_metadata_t
Definition libvlc_media_player.h:714
@ libvlc_video_output_mouse_button_middle
Definition libvlc_media_player.h:760
@ libvlc_video_output_mouse_button_right
Definition libvlc_media_player.h:761
@ libvlc_video_output_mouse_button_left
Definition libvlc_media_player.h:759
@ libvlc_navigate_right
Definition libvlc_media_player.h:131
@ libvlc_navigate_left
Definition libvlc_media_player.h:130
@ libvlc_navigate_activate
Definition libvlc_media_player.h:127
@ libvlc_navigate_popup
Definition libvlc_media_player.h:132
@ libvlc_navigate_up
Definition libvlc_media_player.h:128
@ libvlc_navigate_down
Definition libvlc_media_player.h:129
@ libvlc_title_interactive
Definition libvlc_media_player.h:63
@ libvlc_title_menu
Definition libvlc_media_player.h:62
@ libvlc_position_bottom_right
Definition libvlc_media_player.h:148
@ libvlc_position_top
Definition libvlc_media_player.h:143
@ libvlc_position_left
Definition libvlc_media_player.h:141
@ libvlc_position_top_left
Definition libvlc_media_player.h:144
@ libvlc_position_bottom_left
Definition libvlc_media_player.h:147
@ libvlc_position_right
Definition libvlc_media_player.h:142
@ libvlc_position_disable
Definition libvlc_media_player.h:139
@ libvlc_position_bottom
Definition libvlc_media_player.h:146
@ libvlc_position_center
Definition libvlc_media_player.h:140
@ libvlc_position_top_right
Definition libvlc_media_player.h:145
@ libvlc_video_engine_opengl
Definition libvlc_media_player.h:734
@ libvlc_video_engine_gles2
Definition libvlc_media_player.h:735
@ libvlc_video_engine_d3d9
Direct3D9 rendering engine.
Definition libvlc_media_player.h:739
@ libvlc_video_engine_disable
Disable rendering engine.
Definition libvlc_media_player.h:733
@ libvlc_video_engine_d3d11
Direct3D11 rendering engine.
Definition libvlc_media_player.h:737
@ libvlc_video_primaries_BT709
Definition libvlc_media_player.h:328
@ libvlc_video_primaries_BT601_525
Definition libvlc_media_player.h:326
@ libvlc_video_primaries_BT2020
Definition libvlc_media_player.h:329
@ libvlc_video_primaries_BT601_625
Definition libvlc_media_player.h:327
@ libvlc_video_primaries_BT470_M
Definition libvlc_media_player.h:331
@ libvlc_video_primaries_DCI_P3
Definition libvlc_media_player.h:330
@ libvlc_video_transfer_func_HLG
Definition libvlc_media_player.h:354
@ libvlc_video_transfer_func_BT470_M
Definition libvlc_media_player.h:350
@ libvlc_video_transfer_func_BT709
Definition libvlc_media_player.h:351
@ libvlc_video_transfer_func_PQ
Definition libvlc_media_player.h:352
@ libvlc_video_transfer_func_SMPTE_240
Definition libvlc_media_player.h:353
@ libvlc_video_transfer_func_SRGB
Definition libvlc_media_player.h:348
@ libvlc_video_transfer_func_BT470_BG
Definition libvlc_media_player.h:349
@ libvlc_video_transfer_func_LINEAR
Definition libvlc_media_player.h:347
libvlc_track_type_t
Definition libvlc_media_track.h:45
libvlc_media_slave_type_t
Type of a media slave: subtitle or audio.
Definition libvlc_media.h:194
libvlc_state_t
libvlc media or media_player state
Definition libvlc_media.h:84
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:2332
LIBVLC_API bool libvlc_get_fullscreen(libvlc_media_player_t *p_mi)
Get current fullscreen status.
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 void 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 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 int64_t libvlc_video_get_spu_delay(libvlc_media_player_t *p_mi)
Get the current subtitle delay.
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_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_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_set_spu_delay(libvlc_media_player_t *p_mi, int64_t i_delay)
Set the subtitle delay.
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 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:2286
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_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 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:2338
@ libvlc_adjust_Hue
Definition libvlc_media_player.h:2336
@ libvlc_adjust_Enable
Definition libvlc_media_player.h:2333
@ libvlc_adjust_Brightness
Definition libvlc_media_player.h:2335
@ libvlc_adjust_Saturation
Definition libvlc_media_player.h:2337
@ libvlc_adjust_Contrast
Definition libvlc_media_player.h:2334
@ libvlc_logo_position
Definition libvlc_media_player.h:2294
@ libvlc_logo_repeat
Definition libvlc_media_player.h:2292
@ libvlc_logo_delay
Definition libvlc_media_player.h:2291
@ libvlc_logo_opacity
Definition libvlc_media_player.h:2293
@ libvlc_logo_y
Definition libvlc_media_player.h:2290
@ libvlc_logo_file
string argument, "file,d,t;file,d,t;..."
Definition libvlc_media_player.h:2288
@ libvlc_logo_x
Definition libvlc_media_player.h:2289
@ libvlc_logo_enable
Definition libvlc_media_player.h:2287
#define LIBVLC_API
Definition libvlc.h:42
int i_type
Definition httpd.c:1299
struct libvlc_renderer_item_t libvlc_renderer_item_t
Definition libvlc_events.h:43
struct libvlc_media_t libvlc_media_t
Definition libvlc_events.h:47
struct libvlc_media_player_t libvlc_media_player_t
Definition libvlc_media_list_player.h:34
enum libvlc_state_t libvlc_state_t
Definition libvlc_media_player.h:45
struct libvlc_media_tracklist_t libvlc_media_tracklist_t
Definition libvlc_media_player.h:42
enum libvlc_track_type_t libvlc_track_type_t
Definition libvlc_media_player.h:43
enum libvlc_media_slave_type_t libvlc_media_slave_type_t
Definition libvlc_media_player.h:39
libvlc_video_orient_t
Definition libvlc_video.h:33
vlc_mutex_t lock
Definition rand.c:33
Description for audio output device.
Definition libvlc_media_player.h:99
char * psz_device
Device identifier string.
Definition libvlc_media_player.h:101
struct libvlc_audio_output_device_t * p_next
Next entry in list.
Definition libvlc_media_player.h:100
char * psz_description
User-friendly device description.
Definition libvlc_media_player.h:102
Description for audio output.
Definition libvlc_media_player.h:88
char * psz_name
Definition libvlc_media_player.h:89
struct libvlc_audio_output_t * p_next
Definition libvlc_media_player.h:91
char * psz_description
Definition libvlc_media_player.h:90
Description for chapters.
Definition libvlc_media_player.h:77
char * psz_name
chapter name
Definition libvlc_media_player.h:80
int64_t i_time_offset
time-offset of the chapter in milliseconds
Definition libvlc_media_player.h:78
int64_t i_duration
duration of the chapter in milliseconds
Definition libvlc_media_player.h:79
Media Player timer point.
Definition libvlc_media_player.h:2909
int64_t system_date_us
System date, in us, of this record (always valid).
Definition libvlc_media_player.h:2926
int64_t ts_us
Valid time, in us >= 0 or -1.
Definition libvlc_media_player.h:2915
double position
Position in the range [0.0f;1.0].
Definition libvlc_media_player.h:2911
int64_t length_us
Valid length, in us >= 1 or 0.
Definition libvlc_media_player.h:2917
double rate
Rate of the player.
Definition libvlc_media_player.h:2913
Definition libvlc_media_track.h:92
Definition libvlc_media_player.h:1656
bool b_scrambled
True if the program is scrambled.
Definition libvlc_media_player.h:1664
int i_group_id
Id used for libvlc_media_player_select_program()
Definition libvlc_media_player.h:1658
char * psz_name
Program name, always valid.
Definition libvlc_media_player.h:1660
bool b_selected
True if the program is selected.
Definition libvlc_media_player.h:1662
Definition libvlc_media_player.h:67
char * psz_name
title name
Definition libvlc_media_player.h:69
unsigned i_flags
info if item was recognized as a menu, interactive or plain content by the demuxer
Definition libvlc_media_player.h:70
int64_t i_duration
duration in milliseconds
Definition libvlc_media_player.h:68
Definition libvlc_media_player.h:701
uint16_t BluePrimary[2]
Definition libvlc_media_player.h:705
unsigned int MinMasteringLuminance
Definition libvlc_media_player.h:708
uint16_t RedPrimary[2]
Definition libvlc_media_player.h:703
uint16_t WhitePoint[2]
Definition libvlc_media_player.h:706
uint16_t MaxFrameAverageLightLevel
Definition libvlc_media_player.h:710
uint16_t GreenPrimary[2]
Definition libvlc_media_player.h:704
uint16_t MaxContentLightLevel
Definition libvlc_media_player.h:709
unsigned int MaxMasteringLuminance
Definition libvlc_media_player.h:707
Definition libvlc_media_player.h:607
libvlc_video_color_space_t colorspace
video color space
Definition libvlc_media_player.h:623
bool full_range
Video is full range or studio/limited range.
Definition libvlc_media_player.h:621
libvlc_video_color_primaries_t primaries
video color primaries
Definition libvlc_media_player.h:625
void * p_surface
currently unused
Definition libvlc_media_player.h:618
libvlc_video_transfer_func_t transfer
video transfer function
Definition libvlc_media_player.h:627
int dxgi_format
The rendering DXGI_FORMAT for libvlc_video_engine_d3d11.
Definition libvlc_media_player.h:610
uint32_t d3d9_format
The rendering D3DFORMAT for libvlc_video_engine_d3d9.
Definition libvlc_media_player.h:612
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:616
libvlc_video_orient_t orientation
video surface orientation
Definition libvlc_media_player.h:629
Definition libvlc_media_player.h:587
libvlc_video_transfer_func_t transfer
video transfer function
Definition libvlc_media_player.h:601
libvlc_video_color_primaries_t primaries
video color primaries
Definition libvlc_media_player.h:599
bool full_range
video is full range or studio/limited range
Definition libvlc_media_player.h:595
libvlc_video_color_space_t colorspace
video color space
Definition libvlc_media_player.h:597
void * device
device used for rendering, IDirect3DDevice9* for D3D9
Definition libvlc_media_player.h:603
unsigned height
rendering video height in pixel
Definition libvlc_media_player.h:591
unsigned bitdepth
rendering video bit depth in bits per channel
Definition libvlc_media_player.h:593
unsigned width
rendering video width in pixel
Definition libvlc_media_player.h:589
Definition libvlc_media_player.h:530
bool hardware_decoding
Definition libvlc_media_player.h:531
Definition libvlc_media_player.h:535
void * device
Definition libvlc_media_player.h:542
void * device_context
Definition libvlc_media_player.h:538
struct libvlc_video_setup_device_info_t::@183::@186 d3d9
struct libvlc_video_setup_device_info_t::@183::@185 d3d11
void * context_mutex
ID3D11DeviceContext*.
Definition libvlc_media_player.h:539
int adapter
IDirect3D9*.
Definition libvlc_media_player.h:543
Viewpoint.
Definition libvlc_media_track.h:64
const char * psz_name
Definition text_style.c:33
enum vlc_video_fitting fit
Definition vout_intf.c:136
char psz_value[8]
Definition vout_intf.c:102