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