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