VLC  4.0.0-dev
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 # ifdef __cplusplus
29 extern "C" {
30 # else
31 # include <stdbool.h>
32 # endif
33 
34 /** \defgroup libvlc_media_player LibVLC media player
35  * \ingroup libvlc
36  * A LibVLC media player plays one media (usually in a custom drawable).
37  * @{
38  * \file
39  * LibVLC simple media player external API
40  */
41 
43 
44 /**
45  * Description for video, audio tracks and subtitles. It contains
46  * id, name (description string) and pointer to next record.
47  */
49 {
50  int i_id;
51  char *psz_name;
53 
55 
56 /**
57  * Description for titles
58  */
59 enum
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  */
86 typedef struct libvlc_audio_output_t
87 {
88  char *psz_name;
91 
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  */
110  libvlc_marquee_Text, /** string argument */
120 
121 /**
122  * Navigation mode
123  */
125 {
133 
134 /**
135  * Enumeration of values used to set position (e.g. of video title).
136  */
137 typedef enum libvlc_position_t {
149 
150 /**
151  * Enumeration of teletext keys than can be passed via
152  * libvlc_video_set_teletext()
153  */
154 typedef enum libvlc_teletext_key_t {
161 
162 /**
163  * Opaque equalizer handle.
164  *
165  * Equalizer settings can be applied to a media player.
166  */
168 
169 /**
170  * Create an empty Media Player object
171  *
172  * \param p_libvlc_instance the libvlc instance in which the Media Player
173  * should be created.
174  * \return a new media player object, or NULL on error.
175  * It must be released by libvlc_media_player_release().
176  */
178 
179 /**
180  * Create a Media Player object from a Media
181  *
182  * \param p_md the media. Afterwards the p_md can be safely
183  * destroyed.
184  * \return a new media player object, or NULL on error.
185  * It must be released by libvlc_media_player_release().
186  */
188 
189 /**
190  * Release a media_player after use
191  * Decrement the reference count of a media player object. If the
192  * reference count is 0, then libvlc_media_player_release() will
193  * release the media player object. If the media player object
194  * has been released, then it should not be used again.
195  *
196  * \param p_mi the Media Player to free
197  */
199 
200 /**
201  * Retain a reference to a media player object. Use
202  * libvlc_media_player_release() to decrement reference count.
203  *
204  * \param p_mi media player object
205  */
207 
208 /**
209  * Set the media that will be used by the media_player. If any,
210  * previous md will be released.
211  *
212  * \param p_mi the Media Player
213  * \param p_md the Media. Afterwards the p_md can be safely
214  * destroyed.
215  */
217  libvlc_media_t *p_md );
218 
219 /**
220  * Get the media used by the media_player.
221  *
222  * \param p_mi the Media Player
223  * \return the media associated with p_mi, or NULL if no
224  * media is associated
225  */
227 
228 /**
229  * Get the Event Manager from which the media player send event.
230  *
231  * \param p_mi the Media Player
232  * \return the event manager associated with p_mi
233  */
235 
236 /**
237  * is_playing
238  *
239  * \param p_mi the Media Player
240  * \retval true media player is playing
241  * \retval false media player is not playing
242  */
244 
245 /**
246  * Play
247  *
248  * \param p_mi the Media Player
249  * \return 0 if playback started (and was already started), or -1 on error.
250  */
252 
253 /**
254  * Pause or resume (no effect if there is no media)
255  *
256  * \param mp the Media Player
257  * \param do_pause play/resume if zero, pause if non-zero
258  * \version LibVLC 1.1.1 or later
259  */
261  int do_pause );
262 
263 /**
264  * Toggle pause (no effect if there is no media)
265  *
266  * \param p_mi the Media Player
267  */
269 
270 /**
271  * Stop asynchronously
272  *
273  * \note This function is asynchronous. In case of success, the user should
274  * wait for the libvlc_MediaPlayerStopped event to know when the stop is
275  * finished.
276  *
277  * \param p_mi the Media Player
278  * \return 0 if the player is being stopped, -1 otherwise (no-op)
279  * \version LibVLC 4.0.0 or later
280  */
282 
283 /**
284  * Set a renderer to the media player
285  *
286  * \note must be called before the first call of libvlc_media_player_play() to
287  * take effect.
288  *
289  * \see libvlc_renderer_discoverer_new
290  *
291  * \param p_mi the Media Player
292  * \param p_item an item discovered by libvlc_renderer_discoverer_start()
293  * \return 0 on success, -1 on error.
294  * \version LibVLC 3.0.0 or later
295  */
297  libvlc_renderer_item_t *p_item );
298 
299 /**
300  * Enumeration of the Video color primaries.
301  */
310 
311 /**
312  * Enumeration of the Video color spaces.
313  */
319 
320 /**
321  * Enumeration of the Video transfer functions.
322  */
333 
334 
335 /**
336  * Callback prototype to allocate and lock a picture buffer.
337  *
338  * Whenever a new video frame needs to be decoded, the lock callback is
339  * invoked. Depending on the video chroma, one or three pixel planes of
340  * adequate dimensions must be returned via the second parameter. Those
341  * planes must be aligned on 32-bytes boundaries.
342  *
343  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
344  * \param planes start address of the pixel planes (LibVLC allocates the array
345  * of void pointers, this callback must initialize the array) [OUT]
346  * \return a private pointer for the display and unlock callbacks to identify
347  * the picture buffers
348  */
349 typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
350 
351 /**
352  * Callback prototype to unlock a picture buffer.
353  *
354  * When the video frame decoding is complete, the unlock callback is invoked.
355  * This callback might not be needed at all. It is only an indication that the
356  * application can now read the pixel values if it needs to.
357  *
358  * \note A picture buffer is unlocked after the picture is decoded,
359  * but before the picture is displayed.
360  *
361  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
362  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
363  * callback [IN]
364  * \param planes pixel planes as defined by the @ref libvlc_video_lock_cb
365  * callback (this parameter is only for convenience) [IN]
366  */
367 typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
368  void *const *planes);
369 
370 /**
371  * Callback prototype to display a picture.
372  *
373  * When the video frame needs to be shown, as determined by the media playback
374  * clock, the display callback is invoked.
375  *
376  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
377  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
378  * callback [IN]
379  */
380 typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
381 
382 /**
383  * Callback prototype to configure picture buffers format.
384  * This callback gets the format of the video as output by the video decoder
385  * and the chain of video filters (if any). It can opt to change any parameter
386  * as it needs. In that case, LibVLC will attempt to convert the video format
387  * (rescaling and chroma conversion) but these operations can be CPU intensive.
388  *
389  * \param opaque pointer to the private pointer passed to
390  * libvlc_video_set_callbacks() [IN/OUT]
391  * \param chroma pointer to the 4 bytes video format identifier [IN/OUT]
392  * \param width pointer to the buffer width in pixels[IN/OUT]
393  * \param height pointer to the buffer height in pixels[IN/OUT]
394  * \param pitches table of scanline pitches in bytes for each pixel plane
395  * (the table is allocated by LibVLC) [OUT]
396  * \param lines table of scanlines count for each plane [OUT]
397  * \return the number of picture buffers allocated, 0 indicates failure
398  *
399  * \version LibVLC 4.0.0 and later.
400  * \param (width+1) - pointer to display width in pixels[IN]
401  * \param (height+1) - pointer to display height in pixels[IN]
402  *
403  * \note
404  * For each pixels plane, the scanline pitch must be bigger than or equal to
405  * the number of bytes per pixel multiplied by the pixel width.
406  * Similarly, the number of scanlines must be bigger than of equal to
407  * the pixel height.
408  * Furthermore, we recommend that pitches and lines be multiple of 32
409  * to not break assumptions that might be held by optimized code
410  * in the video decoders, video filters and/or video converters.
411  */
412 typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
413  unsigned *width, unsigned *height,
414  unsigned *pitches,
415  unsigned *lines);
416 
417 /**
418  * Callback prototype to configure picture buffers format.
419  *
420  * \param opaque private pointer as passed to libvlc_video_set_format_callbacks()
421  * (and possibly modified by @ref libvlc_video_format_cb) [IN]
422  */
423 typedef void (*libvlc_video_cleanup_cb)(void *opaque);
424 
425 
426 /**
427  * Set callbacks and private data to render decoded video to a custom area
428  * in memory.
429  * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
430  * to configure the decoded format.
431  *
432  * \warning Rendering video into custom memory buffers is considerably less
433  * efficient than rendering in a custom window as normal.
434  *
435  * For optimal perfomances, VLC media player renders into a custom window, and
436  * does not use this function and associated callbacks. It is <b>highly
437  * recommended</b> that other LibVLC-based application do likewise.
438  * To embed video in a window, use libvlc_media_player_set_xid() or equivalent
439  * depending on the operating system.
440  *
441  * If window embedding does not fit the application use case, then a custom
442  * LibVLC video output display plugin is required to maintain optimal video
443  * rendering performances.
444  *
445  * The following limitations affect performance:
446  * - Hardware video decoding acceleration will either be disabled completely,
447  * or require (relatively slow) copy from video/DSP memory to main memory.
448  * - Sub-pictures (subtitles, on-screen display, etc.) must be blent into the
449  * main picture by the CPU instead of the GPU.
450  * - Depending on the video format, pixel format conversion, picture scaling,
451  * cropping and/or picture re-orientation, must be performed by the CPU
452  * instead of the GPU.
453  * - Memory copying is required between LibVLC reference picture buffers and
454  * application buffers (between lock and unlock callbacks).
455  *
456  * \param mp the media player
457  * \param lock callback to lock video memory (must not be NULL)
458  * \param unlock callback to unlock video memory (or NULL if not needed)
459  * \param display callback to display video (or NULL if not needed)
460  * \param opaque private pointer for the three callbacks (as first parameter)
461  * \version LibVLC 1.1.1 or later
462  */
466  libvlc_video_unlock_cb unlock,
467  libvlc_video_display_cb display,
468  void *opaque );
469 
470 /**
471  * Set decoded video chroma and dimensions.
472  * This only works in combination with libvlc_video_set_callbacks(),
473  * and is mutually exclusive with libvlc_video_set_format_callbacks().
474  *
475  * \param mp the media player
476  * \param chroma a four-characters string identifying the chroma
477  * (e.g. "RV32" or "YUYV")
478  * \param width pixel width
479  * \param height pixel height
480  * \param pitch line pitch (in bytes)
481  * \version LibVLC 1.1.1 or later
482  * \bug All pixel planes are expected to have the same pitch.
483  * To use the YCbCr color space with chrominance subsampling,
484  * consider using libvlc_video_set_format_callbacks() instead.
485  */
487 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
488  unsigned width, unsigned height,
489  unsigned pitch );
490 
491 /**
492  * Set decoded video chroma and dimensions. This only works in combination with
493  * libvlc_video_set_callbacks().
494  *
495  * \param mp the media player
496  * \param setup callback to select the video format (cannot be NULL)
497  * \param cleanup callback to release any allocated resources (or NULL)
498  * \version LibVLC 2.0.0 or later
499  */
503  libvlc_video_cleanup_cb cleanup );
504 
505 
506 typedef struct
507 {
508  bool hardware_decoding; /** set if D3D11_CREATE_DEVICE_VIDEO_SUPPORT is needed for D3D11 */
510 
511 typedef struct
512 {
513  union {
514  struct {
515  void *device_context; /** ID3D11DeviceContext* */
516  } d3d11;
517  struct {
518  void *device; /** IDirect3D9* */
519  int adapter; /** Adapter to use with the IDirect3D9* */
520  } d3d9;
521  };
523 
524 /**
525  * Callback prototype called to initialize user data.
526  * Setup the rendering environment.
527  *
528  * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks()
529  * on input. The callback can change this value on output to be
530  * passed to all the other callbacks set on @a libvlc_video_set_output_callbacks().
531  * [IN/OUT]
532  * \param cfg requested configuration of the video device [IN]
533  * \param out libvlc_video_setup_device_info_t* to fill [OUT]
534  * \return true on success
535  * \version LibVLC 4.0.0 or later
536  *
537  * For \ref libvlc_video_engine_d3d9 the output must be a IDirect3D9*.
538  * A reference to this object is held until the \ref LIBVLC_VIDEO_DEVICE_CLEANUP is called.
539  * the device must be created with D3DPRESENT_PARAMETERS.hDeviceWindow set to 0.
540  *
541  * For \ref libvlc_video_engine_d3d11 the output must be a ID3D11DeviceContext*.
542  * A reference to this object is held until the \ref LIBVLC_VIDEO_DEVICE_CLEANUP is called.
543  * The ID3D11Device used to create ID3D11DeviceContext must have multithreading enabled.
544  */
545 typedef bool (*libvlc_video_output_setup_cb)(void **opaque,
548 
549 
550 /**
551  * Callback prototype called to release user data
552  *
553  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
554  * \version LibVLC 4.0.0 or later
555  */
556 typedef void (*libvlc_video_output_cleanup_cb)(void* opaque);
557 
558 typedef struct
559 {
560  unsigned width; /** rendering video width in pixel */
561  unsigned height; /** rendering video height in pixel */
562  unsigned bitdepth; /** rendering video bit depth in bits per channel */
563  bool full_range; /** video is full range or studio/limited range */
564  libvlc_video_color_space_t colorspace; /** video color space */
565  libvlc_video_color_primaries_t primaries; /** video color primaries */
566  libvlc_video_transfer_func_t transfer; /** video transfer function */
567  void *device; /** device used for rendering, IDirect3DDevice9* for D3D9 */
569 
570 typedef struct
571 {
572  union {
573  int dxgi_format; /** the rendering DXGI_FORMAT for \ref libvlc_video_engine_d3d11*/
574  uint32_t d3d9_format; /** the rendering D3DFORMAT for \ref libvlc_video_engine_d3d9 */
575  int opengl_format; /** the rendering GLint GL_RGBA or GL_RGB for \ref libvlc_video_engine_opengl and
576  for \ref libvlc_video_engine_gles2 */
577  void *p_surface; /** currently unused */
578  };
579  bool full_range; /** video is full range or studio/limited range */
580  libvlc_video_color_space_t colorspace; /** video color space */
581  libvlc_video_color_primaries_t primaries; /** video color primaries */
582  libvlc_video_transfer_func_t transfer; /** video transfer function */
584 
585 /**
586  * Callback prototype called on video size changes.
587  * Update the rendering output setup.
588  *
589  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
590  * \param cfg configuration of the video that will be rendered [IN]
591  * \param output configuration describing with how the rendering is setup [OUT]
592  * \version LibVLC 4.0.0 or later
593  *
594  * \note the configuration device for Direct3D9 is the IDirect3DDevice9 that VLC
595  * uses to render. The host must set a Render target and call Present()
596  * when it needs the drawing from VLC to be done. This object is not valid
597  * anymore after Cleanup is called.
598  *
599  * Tone mapping, range and color conversion will be done depending on the values
600  * set in the output structure.
601  */
602 typedef bool (*libvlc_video_update_output_cb)(void* opaque, const libvlc_video_render_cfg_t *cfg,
603  libvlc_video_output_cfg_t *output );
604 
605 
606 /**
607  * Callback prototype called after performing drawing calls.
608  *
609  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
610  * \version LibVLC 4.0.0 or later
611  */
612 typedef void (*libvlc_video_swap_cb)(void* opaque);
613 
614 /**
615  * Callback prototype to set up the OpenGL context for rendering.
616  * Tell the host the rendering is about to start/has finished.
617  *
618  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
619  * \param enter true to set the context as current, false to unset it [IN]
620  * \return true on success
621  * \version LibVLC 4.0.0 or later
622  *
623  * On Direct3D11 the following may change on the provided ID3D11DeviceContext*
624  * between \ref enter being true and \ref enter being false:
625  * - IASetPrimitiveTopology()
626  * - IASetInputLayout()
627  * - IASetVertexBuffers()
628  * - IASetIndexBuffer()
629  * - VSSetConstantBuffers()
630  * - VSSetShader()
631  * - PSSetSamplers()
632  * - PSSetConstantBuffers()
633  * - PSSetShaderResources()
634  * - PSSetShader()
635  * - RSSetViewports()
636  * - DrawIndexed()
637  */
638 typedef bool (*libvlc_video_makeCurrent_cb)(void* opaque, bool enter);
639 
640 /**
641  * Callback prototype to load opengl functions
642  *
643  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
644  * \param fct_name name of the opengl function to load
645  * \return a pointer to the named OpenGL function the NULL otherwise
646  * \version LibVLC 4.0.0 or later
647  */
648 typedef void* (*libvlc_video_getProcAddress_cb)(void* opaque, const char* fct_name);
649 
650 typedef struct
651 {
652  /* similar to SMPTE ST 2086 mastering display color volume */
653  uint16_t RedPrimary[2];
654  uint16_t GreenPrimary[2];
655  uint16_t BluePrimary[2];
656  uint16_t WhitePoint[2];
657  unsigned int MaxMasteringLuminance;
658  unsigned int MinMasteringLuminance;
662 
664  libvlc_video_metadata_frame_hdr10, /**< libvlc_video_frame_hdr10_metadata_t */
666 
667 /**
668  * Callback prototype to receive metadata before rendering.
669  *
670  * \param opaque private pointer passed to the @a libvlc_video_set_output_callbacks() [IN]
671  * \param type type of data passed in metadata [IN]
672  * \param metadata the type of metadata [IN]
673  * \version LibVLC 4.0.0 or later
674  */
675 typedef void (*libvlc_video_frameMetadata_cb)(void* opaque, libvlc_video_metadata_type_t type, const void *metadata);
676 
677 /**
678  * Enumeration of the Video engine to be used on output.
679  * can be passed to @a libvlc_video_set_output_callbacks
680  */
681 typedef enum libvlc_video_engine_t {
682  /** Disable rendering engine */
686  /** Direct3D11 rendering engine */
688  /** Direct3D9 rendering engine */
691 
692 /** Set the callback to call when the host app resizes the rendering area.
693  *
694  * This allows text rendering and aspect ratio to be handled properly when the host
695  * rendering size changes.
696  *
697  * It may be called before the \ref libvlc_video_output_setup_cb callback.
698  *
699  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
700  * \param report_size_change callback which must be called when the host size changes. [IN]
701  * The callback is valid until another call to \ref libvlc_video_output_set_resize_cb
702  * is done. This may be called from any thread.
703  * \param report_opaque private pointer to pass to the \ref report_size_change callback. [IN]
704  */
705 typedef void( *libvlc_video_output_set_resize_cb )( void *opaque,
706  void (*report_size_change)(void *report_opaque, unsigned width, unsigned height),
707  void *report_opaque );
708 
709 /** Tell the host the rendering for the given plane is about to start
710  *
711  * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]
712  * \param plane number of the rendering plane to select
713  * \return true on success
714  * \version LibVLC 4.0.0 or later
715  *
716  * \note This is only used with \ref libvlc_video_engine_d3d11.
717  *
718  * The host should call OMSetRenderTargets for Direct3D11. If this callback is
719  * not used (set to NULL in @a libvlc_video_set_output_callbacks()) OMSetRenderTargets
720  * has to be set during the @a libvlc_video_makeCurrent_cb()
721  * entering call.
722  *
723  * The number of planes depend on the DXGI_FORMAT returned during the
724  * \ref LIBVLC_VIDEO_UPDATE_OUTPUT call. It's usually one plane except for
725  * semi-planar formats like DXGI_FORMAT_NV12 or DXGI_FORMAT_P010.
726  */
727 typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane );
728 
729 /**
730  * Set callbacks and data to render decoded video to a custom texture
731  *
732  * \warning VLC will perform video rendering in its own thread and at its own rate,
733  * You need to provide your own synchronisation mechanism.
734  *
735  * \param mp the media player
736  * \param engine the GPU engine to use
737  * \param setup_cb callback called to initialize user data
738  * \param cleanup_cb callback called to clean up user data
739  * \param resize_cb callback to set the resize callback
740  * \param update_output_cb callback to get the rendering format of the host (cannot be NULL)
741  * \param swap_cb callback called after rendering a video frame (cannot be NULL)
742  * \param makeCurrent_cb callback called to enter/leave the rendering context (cannot be NULL)
743  * \param getProcAddress_cb opengl function loading callback (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
744  * \param metadata_cb callback to provide frame metadata (D3D11 only)
745  * \param select_plane_cb callback to select different D3D11 rendering targets
746  * \param opaque private pointer passed to callbacks
747  *
748  * \retval true engine selected and callbacks set
749  * \retval false engine type unknown, callbacks not set
750  * \version LibVLC 4.0.0 or later
751  */
754  libvlc_video_engine_t engine,
758  libvlc_video_update_output_cb update_output_cb,
759  libvlc_video_swap_cb swap_cb,
760  libvlc_video_makeCurrent_cb makeCurrent_cb,
761  libvlc_video_getProcAddress_cb getProcAddress_cb,
762  libvlc_video_frameMetadata_cb metadata_cb,
763  libvlc_video_output_select_plane_cb select_plane_cb,
764  void* opaque );
765 
766 /**
767  * Set the NSView handler where the media player should render its video output.
768  *
769  * Use the vout called "macosx".
770  *
771  * The drawable is an NSObject that follow the VLCVideoViewEmbedding
772  * protocol:
773  *
774  * @code{.m}
775  * @protocol VLCVideoViewEmbedding <NSObject>
776  * - (void)addVoutSubview:(NSView *)view;
777  * - (void)removeVoutSubview:(NSView *)view;
778  * @end
779  * @endcode
780  *
781  * Or it can be an NSView object.
782  *
783  * If you want to use it along with Qt see the QMacCocoaViewContainer. Then
784  * the following code should work:
785  * @code{.mm}
786  * {
787  * NSView *video = [[NSView alloc] init];
788  * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
789  * libvlc_media_player_set_nsobject(mp, video);
790  * [video release];
791  * }
792  * @endcode
793  *
794  * You can find a live example in VLCVideoView in VLCKit.framework.
795  *
796  * \param p_mi the Media Player
797  * \param drawable the drawable that is either an NSView or an object following
798  * the VLCVideoViewEmbedding protocol.
799  */
801 
802 /**
803  * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
804  *
805  * \param p_mi the Media Player
806  * \return the NSView handler or 0 if none where set
807  */
809 
810 /**
811  * Set an X Window System drawable where the media player should render its
812  * video output. The call takes effect when the playback starts. If it is
813  * already started, it might need to be stopped before changes apply.
814  * If LibVLC was built without X11 output support, then this function has no
815  * effects.
816  *
817  * By default, LibVLC will capture input events on the video rendering area.
818  * Use libvlc_video_set_mouse_input() and libvlc_video_set_key_input() to
819  * disable that and deliver events to the parent window / to the application
820  * instead. By design, the X11 protocol delivers input events to only one
821  * recipient.
822  *
823  * \warning
824  * The application must call the XInitThreads() function from Xlib before
825  * libvlc_new(), and before any call to XOpenDisplay() directly or via any
826  * other library. Failure to call XInitThreads() will seriously impede LibVLC
827  * performance. Calling XOpenDisplay() before XInitThreads() will eventually
828  * crash the process. That is a limitation of Xlib.
829  *
830  * \param p_mi media player
831  * \param drawable X11 window ID
832  *
833  * \note
834  * The specified identifier must correspond to an existing Input/Output class
835  * X11 window. Pixmaps are <b>not</b> currently supported. The default X11
836  * server is assumed, i.e. that specified in the DISPLAY environment variable.
837  *
838  * \warning
839  * LibVLC can deal with invalid X11 handle errors, however some display drivers
840  * (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle
841  * must remain valid until playback is stopped, otherwise the process may
842  * abort or crash.
843  *
844  * \bug
845  * No more than one window handle per media player instance can be specified.
846  * If the media has multiple simultaneously active video tracks, extra tracks
847  * will be rendered into external windows beyond the control of the
848  * application.
849  */
851  uint32_t drawable);
852 
853 /**
854  * Get the X Window System window identifier previously set with
855  * libvlc_media_player_set_xwindow(). Note that this will return the identifier
856  * even if VLC is not currently using it (for instance if it is playing an
857  * audio-only input).
858  *
859  * \param p_mi the Media Player
860  * \return an X window ID, or 0 if none where set.
861  */
863 
864 /**
865  * Set a Win32/Win64 API window handle (HWND) where the media player should
866  * render its video output. If LibVLC was built without Win32/Win64 API output
867  * support, then this has no effects.
868  *
869  * \param p_mi the Media Player
870  * \param drawable windows handle of the drawable
871  */
872 LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
873 
874 /**
875  * Get the Windows API window handle (HWND) previously set with
876  * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
877  * is not currently outputting any video to it.
878  *
879  * \param p_mi the Media Player
880  * \return a window handle or NULL if there are none.
881  */
883 
884 /**
885  * Set the android context.
886  *
887  * \version LibVLC 3.0.0 and later.
888  *
889  * \param p_mi the media player
890  * \param p_awindow_handler org.videolan.libvlc.AWindow jobject owned by the
891  * org.videolan.libvlc.MediaPlayer class from the libvlc-android project.
892  */
894  void *p_awindow_handler );
895 
896 /**
897  * Callback prototype for audio playback.
898  *
899  * The LibVLC media player decodes and post-processes the audio signal
900  * asynchronously (in an internal thread). Whenever audio samples are ready
901  * to be queued to the output, this callback is invoked.
902  *
903  * The number of samples provided per invocation may depend on the file format,
904  * the audio coding algorithm, the decoder plug-in, the post-processing
905  * filters and timing. Application must not assume a certain number of samples.
906  *
907  * The exact format of audio samples is determined by libvlc_audio_set_format()
908  * or libvlc_audio_set_format_callbacks() as is the channels layout.
909  *
910  * Note that the number of samples is per channel. For instance, if the audio
911  * track sampling rate is 48000 Hz, then 1200 samples represent 25 milliseconds
912  * of audio signal - regardless of the number of audio channels.
913  *
914  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
915  * \param samples pointer to a table of audio samples to play back [IN]
916  * \param count number of audio samples to play back
917  * \param pts expected play time stamp (see libvlc_delay())
918  */
919 typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
920  unsigned count, int64_t pts);
921 
922 /**
923  * Callback prototype for audio pause.
924  *
925  * LibVLC invokes this callback to pause audio playback.
926  *
927  * \note The pause callback is never called if the audio is already paused.
928  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
929  * \param pts time stamp of the pause request (should be elapsed already)
930  */
931 typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
932 
933 /**
934  * Callback prototype for audio resumption.
935  *
936  * LibVLC invokes this callback to resume audio playback after it was
937  * previously paused.
938  *
939  * \note The resume callback is never called if the audio is not paused.
940  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
941  * \param pts time stamp of the resumption request (should be elapsed already)
942  */
943 typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
944 
945 /**
946  * Callback prototype for audio buffer flush.
947  *
948  * LibVLC invokes this callback if it needs to discard all pending buffers and
949  * stop playback as soon as possible. This typically occurs when the media is
950  * stopped.
951  *
952  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
953  */
954 typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
955 
956 /**
957  * Callback prototype for audio buffer drain.
958  *
959  * LibVLC may invoke this callback when the decoded audio track is ending.
960  * There will be no further decoded samples for the track, but playback should
961  * nevertheless continue until all already pending buffers are rendered.
962  *
963  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
964  */
965 typedef void (*libvlc_audio_drain_cb)(void *data);
966 
967 /**
968  * Callback prototype for audio volume change.
969  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
970  * \param volume software volume (1. = nominal, 0. = mute)
971  * \param mute muted flag
972  */
973 typedef void (*libvlc_audio_set_volume_cb)(void *data,
974  float volume, bool mute);
975 
976 /**
977  * Sets callbacks and private data for decoded audio.
978  *
979  * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
980  * to configure the decoded audio format.
981  *
982  * \note The audio callbacks override any other audio output mechanism.
983  * If the callbacks are set, LibVLC will <b>not</b> output audio in any way.
984  *
985  * \param mp the media player
986  * \param play callback to play audio samples (must not be NULL)
987  * \param pause callback to pause playback (or NULL to ignore)
988  * \param resume callback to resume playback (or NULL to ignore)
989  * \param flush callback to flush audio buffers (or NULL to ignore)
990  * \param drain callback to drain audio buffers (or NULL to ignore)
991  * \param opaque private pointer for the audio callbacks (as first parameter)
992  * \version LibVLC 2.0.0 or later
993  */
997  libvlc_audio_pause_cb pause,
998  libvlc_audio_resume_cb resume,
999  libvlc_audio_flush_cb flush,
1000  libvlc_audio_drain_cb drain,
1001  void *opaque );
1002 
1003 /**
1004  * Set callbacks and private data for decoded audio. This only works in
1005  * combination with libvlc_audio_set_callbacks().
1006  * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
1007  * to configure the decoded audio format.
1008  *
1009  * \param mp the media player
1010  * \param set_volume callback to apply audio volume,
1011  * or NULL to apply volume in software
1012  * \version LibVLC 2.0.0 or later
1013  */
1014 LIBVLC_API
1016  libvlc_audio_set_volume_cb set_volume );
1017 
1018 /**
1019  * Callback prototype to setup the audio playback.
1020  *
1021  * This is called when the media player needs to create a new audio output.
1022  * \param opaque pointer to the data pointer passed to
1023  * libvlc_audio_set_callbacks() [IN/OUT]
1024  * \param format 4 bytes sample format [IN/OUT]
1025  * \param rate sample rate [IN/OUT]
1026  * \param channels channels count [IN/OUT]
1027  * \return 0 on success, anything else to skip audio playback
1028  */
1029 typedef int (*libvlc_audio_setup_cb)(void **opaque, char *format, unsigned *rate,
1030  unsigned *channels);
1031 
1032 /**
1033  * Callback prototype for audio playback cleanup.
1034  *
1035  * This is called when the media player no longer needs an audio output.
1036  * \param opaque data pointer as passed to libvlc_audio_set_callbacks() [IN]
1037  */
1038 typedef void (*libvlc_audio_cleanup_cb)(void *data);
1039 
1040 /**
1041  * Sets decoded audio format via callbacks.
1042  *
1043  * This only works in combination with libvlc_audio_set_callbacks().
1044  *
1045  * \param mp the media player
1046  * \param setup callback to select the audio format (cannot be NULL)
1047  * \param cleanup callback to release any allocated resources (or NULL)
1048  * \version LibVLC 2.0.0 or later
1049  */
1050 LIBVLC_API
1052  libvlc_audio_setup_cb setup,
1053  libvlc_audio_cleanup_cb cleanup );
1054 
1055 /**
1056  * Sets a fixed decoded audio format.
1057  *
1058  * This only works in combination with libvlc_audio_set_callbacks(),
1059  * and is mutually exclusive with libvlc_audio_set_format_callbacks().
1060  *
1061  * \param mp the media player
1062  * \param format a four-characters string identifying the sample format
1063  * (e.g. "S16N" or "f32l")
1064  * \param rate sample rate (expressed in Hz)
1065  * \param channels channels count
1066  * \version LibVLC 2.0.0 or later
1067  */
1068 LIBVLC_API
1069 void libvlc_audio_set_format( libvlc_media_player_t *mp, const char *format,
1070  unsigned rate, unsigned channels );
1071 
1072 /** \bug This might go away ... to be replaced by a broader system */
1073 
1074 /**
1075  * Get the current movie length (in ms).
1076  *
1077  * \param p_mi the Media Player
1078  * \return the movie length (in ms), or -1 if there is no media.
1079  */
1081 
1082 /**
1083  * Get the current movie time (in ms).
1084  *
1085  * \param p_mi the Media Player
1086  * \return the movie time (in ms), or -1 if there is no media.
1087  */
1089 
1090 /**
1091  * Set the movie time (in ms). This has no effect if no media is being played.
1092  * Not all formats and protocols support this.
1093  *
1094  * \param p_mi the Media Player
1095  * \param b_fast prefer fast seeking or precise seeking
1096  * \param i_time the movie time (in ms).
1097  * \return 0 on success, -1 on error
1098  */
1100  libvlc_time_t i_time, bool b_fast );
1101 
1102 /**
1103  * Get movie position as percentage between 0.0 and 1.0.
1104  *
1105  * \param p_mi the Media Player
1106  * \return movie position, or -1. in case of error
1107  */
1109 
1110 /**
1111  * Set movie position as percentage between 0.0 and 1.0.
1112  * This has no effect if playback is not enabled.
1113  * This might not work depending on the underlying input format and protocol.
1114  *
1115  * \param p_mi the Media Player
1116  * \param b_fast prefer fast seeking or precise seeking
1117  * \param f_pos the position
1118  * \return 0 on success, -1 on error
1119  */
1121  float f_pos, bool b_fast );
1122 
1123 /**
1124  * Set movie chapter (if applicable).
1125  *
1126  * \param p_mi the Media Player
1127  * \param i_chapter chapter number to play
1128  */
1130 
1131 /**
1132  * Get movie chapter.
1133  *
1134  * \param p_mi the Media Player
1135  * \return chapter number currently playing, or -1 if there is no media.
1136  */
1138 
1139 /**
1140  * Get movie chapter count
1141  *
1142  * \param p_mi the Media Player
1143  * \return number of chapters in movie, or -1.
1144  */
1146 
1147 /**
1148  * Get title chapter count
1149  *
1150  * \param p_mi the Media Player
1151  * \param i_title title
1152  * \return number of chapters in title, or -1
1153  */
1155  libvlc_media_player_t *p_mi, int i_title );
1156 
1157 /**
1158  * Set movie title
1159  *
1160  * \param p_mi the Media Player
1161  * \param i_title title number to play
1162  */
1164 
1165 /**
1166  * Get movie title
1167  *
1168  * \param p_mi the Media Player
1169  * \return title number currently playing, or -1
1170  */
1172 
1173 /**
1174  * Get movie title count
1175  *
1176  * \param p_mi the Media Player
1177  * \return title number count, or -1
1178  */
1180 
1181 /**
1182  * Set previous chapter (if applicable)
1183  *
1184  * \param p_mi the Media Player
1185  */
1187 
1188 /**
1189  * Set next chapter (if applicable)
1190  *
1191  * \param p_mi the Media Player
1192  */
1194 
1195 /**
1196  * Get the requested movie play rate.
1197  * @warning Depending on the underlying media, the requested rate may be
1198  * different from the real playback rate.
1199  *
1200  * \param p_mi the Media Player
1201  * \return movie play rate
1202  */
1204 
1205 /**
1206  * Set movie play rate
1207  *
1208  * \param p_mi the Media Player
1209  * \param rate movie play rate to set
1210  * \return -1 if an error was detected, 0 otherwise (but even then, it might
1211  * not actually work depending on the underlying media protocol)
1212  */
1214 
1215 /**
1216  * Get current movie state
1217  *
1218  * \param p_mi the Media Player
1219  * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
1220  */
1222 
1223 /**
1224  * How many video outputs does this media player have?
1225  *
1226  * \param p_mi the media player
1227  * \return the number of video outputs
1228  */
1230 
1231 /**
1232  * Is this media player seekable?
1233  *
1234  * \param p_mi the media player
1235  * \retval true media player can seek
1236  * \retval false media player cannot seek
1237  */
1239 
1240 /**
1241  * Can this media player be paused?
1242  *
1243  * \param p_mi the media player
1244  * \retval true media player can be paused
1245  * \retval false media player cannot be paused
1246  */
1248 
1249 /**
1250  * Check if the current program is scrambled
1251  *
1252  * \param p_mi the media player
1253  * \retval true current program is scrambled
1254  * \retval false current program is not scrambled
1255  *
1256  * \version LibVLC 2.2.0 or later
1257  */
1259 
1260 /**
1261  * Display the next frame (if supported)
1262  *
1263  * \param p_mi the media player
1264  */
1266 
1267 /**
1268  * Navigate through DVD Menu
1269  *
1270  * \param p_mi the Media Player
1271  * \param navigate the Navigation mode
1272  * \version libVLC 2.0.0 or later
1273  */
1275  unsigned navigate );
1276 
1277 /**
1278  * Set if, and how, the video title will be shown when media is played.
1279  *
1280  * \param p_mi the media player
1281  * \param position position at which to display the title, or libvlc_position_disable to prevent the title from being displayed
1282  * \param timeout title display timeout in milliseconds (ignored if libvlc_position_disable)
1283  * \version libVLC 2.1.0 or later
1284  */
1285 LIBVLC_API void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned int timeout );
1286 
1287 /**
1288  * Add a slave to the current media player.
1289  *
1290  * \note If the player is playing, the slave will be added directly. This call
1291  * will also update the slave list of the attached libvlc_media_t.
1292  *
1293  * \version LibVLC 3.0.0 and later.
1294  *
1295  * \see libvlc_media_slaves_add
1296  *
1297  * \param p_mi the media player
1298  * \param i_type subtitle or audio
1299  * \param psz_uri Uri of the slave (should contain a valid scheme).
1300  * \param b_select True if this slave should be selected when it's loaded
1301  *
1302  * \return 0 on success, -1 on error.
1303  */
1304 LIBVLC_API
1307  const char *psz_uri, bool b_select );
1308 
1309 /**
1310  * Release (free) libvlc_track_description_t
1311  *
1312  * \param p_track_description the structure to release
1313  */
1315 
1316 /** \defgroup libvlc_video LibVLC video controls
1317  * @{
1318  */
1319 
1320 /**
1321  * Toggle fullscreen status on non-embedded video outputs.
1322  *
1323  * @warning The same limitations applies to this function
1324  * as to libvlc_set_fullscreen().
1325  *
1326  * \param p_mi the media player
1327  */
1329 
1330 /**
1331  * Enable or disable fullscreen.
1332  *
1333  * @warning With most window managers, only a top-level windows can be in
1334  * full-screen mode. Hence, this function will not operate properly if
1335  * libvlc_media_player_set_xwindow() was used to embed the video in a
1336  * non-top-level window. In that case, the embedding window must be reparented
1337  * to the root window <b>before</b> fullscreen mode is enabled. You will want
1338  * to reparent it back to its normal parent when disabling fullscreen.
1339  *
1340  * \note This setting applies to any and all current or future active video
1341  * tracks and windows for the given media player. The choice of fullscreen
1342  * output for each window is left to the operating system.
1343  *
1344  * \param p_mi the media player
1345  * \param b_fullscreen boolean for fullscreen status
1346  */
1347 LIBVLC_API void libvlc_set_fullscreen(libvlc_media_player_t *p_mi, bool b_fullscreen);
1348 
1349 /**
1350  * Get current fullscreen status.
1351  *
1352  * \param p_mi the media player
1353  * \return the fullscreen status (boolean)
1354  *
1355  * \retval false media player is windowed
1356  * \retval true media player is in fullscreen mode
1357  */
1359 
1360 /**
1361  * Enable or disable key press events handling, according to the LibVLC hotkeys
1362  * configuration. By default and for historical reasons, keyboard events are
1363  * handled by the LibVLC video widget.
1364  *
1365  * \note On X11, there can be only one subscriber for key press and mouse
1366  * click events per window. If your application has subscribed to those events
1367  * for the X window ID of the video widget, then LibVLC will not be able to
1368  * handle key presses and mouse clicks in any case.
1369  *
1370  * \warning This function is only implemented for X11 and Win32 at the moment.
1371  *
1372  * \param p_mi the media player
1373  * \param on true to handle key press events, false to ignore them.
1374  */
1375 LIBVLC_API
1376 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
1377 
1378 /**
1379  * Enable or disable mouse click events handling. By default, those events are
1380  * handled. This is needed for DVD menus to work, as well as a few video
1381  * filters such as "puzzle".
1382  *
1383  * \see libvlc_video_set_key_input().
1384  *
1385  * \warning This function is only implemented for X11 and Win32 at the moment.
1386  *
1387  * \param p_mi the media player
1388  * \param on true to handle mouse click events, false to ignore them.
1389  */
1390 LIBVLC_API
1391 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
1392 
1393 /**
1394  * Get the pixel dimensions of a video.
1395  *
1396  * \param p_mi media player
1397  * \param num number of the video (starting from, and most commonly 0)
1398  * \param px pointer to get the pixel width [OUT]
1399  * \param py pointer to get the pixel height [OUT]
1400  * \return 0 on success, -1 if the specified video does not exist
1401  */
1402 LIBVLC_API
1403 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
1404  unsigned *px, unsigned *py );
1405 
1406 /**
1407  * Get the mouse pointer coordinates over a video.
1408  * Coordinates are expressed in terms of the decoded video resolution,
1409  * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
1410  * you can query your windowing system directly).
1411  *
1412  * Either of the coordinates may be negative or larger than the corresponding
1413  * dimension of the video, if the cursor is outside the rendering area.
1414  *
1415  * @warning The coordinates may be out-of-date if the pointer is not located
1416  * on the video rendering area. LibVLC does not track the pointer if it is
1417  * outside of the video widget.
1418  *
1419  * @note LibVLC does not support multiple pointers (it does of course support
1420  * multiple input devices sharing the same pointer) at the moment.
1421  *
1422  * \param p_mi media player
1423  * \param num number of the video (starting from, and most commonly 0)
1424  * \param px pointer to get the abscissa [OUT]
1425  * \param py pointer to get the ordinate [OUT]
1426  * \return 0 on success, -1 if the specified video does not exist
1427  */
1428 LIBVLC_API
1429 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
1430  int *px, int *py );
1431 
1432 /**
1433  * Get the current video scaling factor.
1434  * See also libvlc_video_set_scale().
1435  *
1436  * \param p_mi the media player
1437  * \return the currently configured zoom factor, or 0. if the video is set
1438  * to fit to the output window/drawable automatically.
1439  */
1441 
1442 /**
1443  * Set the video scaling factor. That is the ratio of the number of pixels on
1444  * screen to the number of pixels in the original decoded video in each
1445  * dimension. Zero is a special value; it will adjust the video to the output
1446  * window/drawable (in windowed mode) or the entire screen.
1447  *
1448  * Note that not all video outputs support scaling.
1449  *
1450  * \param p_mi the media player
1451  * \param f_factor the scaling factor, or zero
1452  */
1453 LIBVLC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
1454 
1455 /**
1456  * Get current video aspect ratio.
1457  *
1458  * \param p_mi the media player
1459  * \return the video aspect ratio or NULL if unspecified
1460  * (the result must be released with free() or libvlc_free()).
1461  */
1463 
1464 /**
1465  * Set new video aspect ratio.
1466  *
1467  * \param p_mi the media player
1468  * \param psz_aspect new video aspect-ratio or NULL to reset to default
1469  * \note Invalid aspect ratios are ignored.
1470  */
1471 LIBVLC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
1472 
1473 /**
1474  * Create a video viewpoint structure.
1475  *
1476  * \version LibVLC 3.0.0 and later
1477  *
1478  * \return video viewpoint or NULL
1479  * (the result must be released with free()).
1480  */
1482 
1483 /**
1484  * Update the video viewpoint information.
1485  *
1486  * \note It is safe to call this function before the media player is started.
1487  *
1488  * \version LibVLC 3.0.0 and later
1489  *
1490  * \param p_mi the media player
1491  * \param p_viewpoint video viewpoint allocated via libvlc_video_new_viewpoint()
1492  * \param b_absolute if true replace the old viewpoint with the new one. If
1493  * false, increase/decrease it.
1494  * \return -1 in case of error, 0 otherwise
1495  *
1496  * \note the values are set asynchronously, it will be used by the next frame displayed.
1497  */
1499  const libvlc_video_viewpoint_t *p_viewpoint,
1500  bool b_absolute);
1501 
1502 /**
1503  * Get current video subtitle.
1504  *
1505  * \param p_mi the media player
1506  * \return the video subtitle selected, or -1 if none
1507  */
1509 
1510 /**
1511  * Get the number of available video subtitles.
1512  *
1513  * \param p_mi the media player
1514  * \return the number of available video subtitles
1515  */
1517 
1518 /**
1519  * Get the description of available video subtitles.
1520  *
1521  * \param p_mi the media player
1522  * \return list containing description of available video subtitles.
1523  * It must be freed with libvlc_track_description_list_release()
1524  */
1527 
1528 /**
1529  * Set new video subtitle.
1530  *
1531  * \param p_mi the media player
1532  * \param i_spu video subtitle track to select (i_id from track description)
1533  * \return 0 on success, -1 if out of range
1534  */
1535 LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
1536 
1537 /**
1538  * Get the current subtitle delay. Positive values means subtitles are being
1539  * displayed later, negative values earlier.
1540  *
1541  * \param p_mi media player
1542  * \return time (in microseconds) the display of subtitles is being delayed
1543  * \version LibVLC 2.0.0 or later
1544  */
1546 
1547 /**
1548  * Set the subtitle delay. This affects the timing of when the subtitle will
1549  * be displayed. Positive values result in subtitles being displayed later,
1550  * while negative values will result in subtitles being displayed earlier.
1551  *
1552  * The subtitle delay will be reset to zero each time the media changes.
1553  *
1554  * \param p_mi media player
1555  * \param i_delay time (in microseconds) the display of subtitles should be delayed
1556  * \return 0 on success, -1 on error
1557  * \version LibVLC 2.0.0 or later
1558  */
1559 LIBVLC_API int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1560 
1561 /**
1562  * Get the full description of available titles
1563  *
1564  * \version LibVLC 3.0.0 and later.
1565  *
1566  * \param p_mi the media player
1567  * \param titles address to store an allocated array of title descriptions
1568  * descriptions (must be freed with libvlc_title_descriptions_release()
1569  * by the caller) [OUT]
1570  *
1571  * \return the number of titles (-1 on error)
1572  */
1574  libvlc_title_description_t ***titles );
1575 
1576 /**
1577  * Release a title description
1578  *
1579  * \version LibVLC 3.0.0 and later
1580  *
1581  * \param p_titles title description array to release
1582  * \param i_count number of title descriptions to release
1583  */
1584 LIBVLC_API
1586  unsigned i_count );
1587 
1588 /**
1589  * Get the full description of available chapters
1590  *
1591  * \version LibVLC 3.0.0 and later.
1592  *
1593  * \param p_mi the media player
1594  * \param i_chapters_of_title index of the title to query for chapters (uses current title if set to -1)
1595  * \param pp_chapters address to store an allocated array of chapter descriptions
1596  * descriptions (must be freed with libvlc_chapter_descriptions_release()
1597  * by the caller) [OUT]
1598  *
1599  * \return the number of chapters (-1 on error)
1600  */
1602  int i_chapters_of_title,
1603  libvlc_chapter_description_t *** pp_chapters );
1604 
1605 /**
1606  * Release a chapter description
1607  *
1608  * \version LibVLC 3.0.0 and later
1609  *
1610  * \param p_chapters chapter description array to release
1611  * \param i_count number of chapter descriptions to release
1612  */
1613 LIBVLC_API
1615  unsigned i_count );
1616 
1617 /**
1618  * Set/unset the video crop ratio.
1619  *
1620  * This function forces a crop ratio on any and all video tracks rendered by
1621  * the media player. If the display aspect ratio of a video does not match the
1622  * crop ratio, either the top and bottom, or the left and right of the video
1623  * will be cut out to fit the crop ratio.
1624  *
1625  * For instance, a ratio of 1:1 will force the video to a square shape.
1626  *
1627  * To disable video crop, set a crop ratio with zero as denominator.
1628  *
1629  * A call to this function overrides any previous call to any of
1630  * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
1631  * libvlc_video_set_crop_window().
1632  *
1633  * \see libvlc_video_set_aspect_ratio()
1634  *
1635  * \param mp the media player
1636  * \param num crop ratio numerator (ignored if denominator is 0)
1637  * \param den crop ratio denominator (or 0 to unset the crop ratio)
1638  *
1639  * \version LibVLC 4.0.0 and later
1640  */
1641 LIBVLC_API
1643  unsigned num, unsigned den);
1644 
1645 /**
1646  * Set the video crop window.
1647  *
1648  * This function selects a sub-rectangle of video to show. Any pixels outside
1649  * the rectangle will not be shown.
1650  *
1651  * To unset the video crop window, use libvlc_video_set_crop_ratio() or
1652  * libvlc_video_set_crop_border().
1653  *
1654  * A call to this function overrides any previous call to any of
1655  * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
1656  * libvlc_video_set_crop_window().
1657  *
1658  * \param mp the media player
1659  * \param x abscissa (i.e. leftmost sample column offset) of the crop window
1660  * \param y ordinate (i.e. topmost sample row offset) of the crop window
1661  * \param width sample width of the crop window (cannot be zero)
1662  * \param height sample height of the crop window (cannot be zero)
1663  *
1664  * \version LibVLC 4.0.0 and later
1665  */
1666 LIBVLC_API
1668  unsigned x, unsigned y,
1669  unsigned width, unsigned height);
1670 
1671 /**
1672  * Set the video crop borders.
1673  *
1674  * This function selects the size of video edges to be cropped out.
1675  *
1676  * To unset the video crop borders, set all borders to zero.
1677  *
1678  * A call to this function overrides any previous call to any of
1679  * libvlc_video_set_crop_ratio(), libvlc_video_set_crop_border() and/or
1680  * libvlc_video_set_crop_window().
1681  *
1682  * \param mp the media player
1683  * \param left number of sample columns to crop on the left
1684  * \param right number of sample columns to crop on the right
1685  * \param top number of sample rows to crop on the top
1686  * \param bottom number of sample rows to corp on the bottom
1687  *
1688  * \version LibVLC 4.0.0 and later
1689  */
1690 LIBVLC_API
1692  unsigned left, unsigned right,
1693  unsigned top, unsigned bottom);
1694 
1695 /**
1696  * Get current teletext page requested or 0 if it's disabled.
1697  *
1698  * Teletext is disabled by default, call libvlc_video_set_teletext() to enable
1699  * it.
1700  *
1701  * \param p_mi the media player
1702  * \return the current teletext page requested.
1703  */
1705 
1706 /**
1707  * Set new teletext page to retrieve.
1708  *
1709  * This function can also be used to send a teletext key.
1710  *
1711  * \param p_mi the media player
1712  * \param i_page teletex page number requested. This value can be 0 to disable
1713  * teletext, a number in the range ]0;1000[ to show the requested page, or a
1714  * \ref libvlc_teletext_key_t. 100 is the default teletext page.
1715  */
1717 
1718 /**
1719  * Get number of available video tracks.
1720  *
1721  * \param p_mi media player
1722  * \return the number of available video tracks (int)
1723  */
1725 
1726 /**
1727  * Get the description of available video tracks.
1728  *
1729  * \param p_mi media player
1730  * \return list with description of available video tracks, or NULL on error.
1731  * It must be freed with libvlc_track_description_list_release()
1732  */
1735 
1736 /**
1737  * Get current video track.
1738  *
1739  * \param p_mi media player
1740  * \return the video track ID (int) or -1 if no active input
1741  */
1743 
1744 /**
1745  * Set video track.
1746  *
1747  * \param p_mi media player
1748  * \param i_track the track ID (i_id field from track description)
1749  * \return 0 on success, -1 if out of range
1750  */
1751 LIBVLC_API
1752 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
1753 
1754 /**
1755  * Take a snapshot of the current video window.
1756  *
1757  * If i_width AND i_height is 0, original size is used.
1758  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
1759  *
1760  * \param p_mi media player instance
1761  * \param num number of video output (typically 0 for the first/only one)
1762  * \param psz_filepath the path of a file or a folder to save the screenshot into
1763  * \param i_width the snapshot's width
1764  * \param i_height the snapshot's height
1765  * \return 0 on success, -1 if the video was not found
1766  */
1767 LIBVLC_API
1768 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
1769  const char *psz_filepath, unsigned int i_width,
1770  unsigned int i_height );
1771 
1772 /**
1773  * Enable or disable deinterlace filter
1774  *
1775  * \param p_mi libvlc media player
1776  * \param deinterlace state -1: auto (default), 0: disabled, 1: enabled
1777  * \param psz_mode type of deinterlace filter, NULL for current/default filter
1778  * \version LibVLC 4.0.0 and later
1779  */
1781  int deinterlace,
1782  const char *psz_mode );
1783 
1784 /**
1785  * Get an integer marquee option value
1786  *
1787  * \param p_mi libvlc media player
1788  * \param option marq option to get \see libvlc_video_marquee_option_t
1789  */
1791  unsigned option );
1792 
1793 /**
1794  * Enable, disable or set an integer marquee option
1795  *
1796  * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
1797  * or disabling (arg 0) the marq filter.
1798  *
1799  * \param p_mi libvlc media player
1800  * \param option marq option to set \see libvlc_video_marquee_option_t
1801  * \param i_val marq option value
1802  */
1804  unsigned option, int i_val );
1805 
1806 /**
1807  * Set a marquee string option
1808  *
1809  * \param p_mi libvlc media player
1810  * \param option marq option to set \see libvlc_video_marquee_option_t
1811  * \param psz_text marq option value
1812  */
1814  unsigned option, const char *psz_text );
1815 
1816 /** option values for libvlc_video_{get,set}_logo_{int,string} */
1819  libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
1826 };
1827 
1828 /**
1829  * Get integer logo option.
1830  *
1831  * \param p_mi libvlc media player instance
1832  * \param option logo option to get, values of libvlc_video_logo_option_t
1833  */
1835  unsigned option );
1836 
1837 /**
1838  * Set logo option as integer. Options that take a different type value
1839  * are ignored.
1840  * Passing libvlc_logo_enable as option value has the side effect of
1841  * starting (arg !0) or stopping (arg 0) the logo filter.
1842  *
1843  * \param p_mi libvlc media player instance
1844  * \param option logo option to set, values of libvlc_video_logo_option_t
1845  * \param value logo option value
1846  */
1848  unsigned option, int value );
1849 
1850 /**
1851  * Set logo option as string. Options that take a different type value
1852  * are ignored.
1853  *
1854  * \param p_mi libvlc media player instance
1855  * \param option logo option to set, values of libvlc_video_logo_option_t
1856  * \param psz_value logo option value
1857  */
1859  unsigned option, const char *psz_value );
1860 
1861 
1862 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
1870 };
1871 
1872 /**
1873  * Get integer adjust option.
1874  *
1875  * \param p_mi libvlc media player instance
1876  * \param option adjust option to get, values of libvlc_video_adjust_option_t
1877  * \version LibVLC 1.1.1 and later.
1878  */
1880  unsigned option );
1881 
1882 /**
1883  * Set adjust option as integer. Options that take a different type value
1884  * are ignored.
1885  * Passing libvlc_adjust_enable as option value has the side effect of
1886  * starting (arg !0) or stopping (arg 0) the adjust filter.
1887  *
1888  * \param p_mi libvlc media player instance
1889  * \param option adust option to set, values of libvlc_video_adjust_option_t
1890  * \param value adjust option value
1891  * \version LibVLC 1.1.1 and later.
1892  */
1894  unsigned option, int value );
1895 
1896 /**
1897  * Get float adjust option.
1898  *
1899  * \param p_mi libvlc media player instance
1900  * \param option adjust option to get, values of libvlc_video_adjust_option_t
1901  * \version LibVLC 1.1.1 and later.
1902  */
1904  unsigned option );
1905 
1906 /**
1907  * Set adjust option as float. Options that take a different type value
1908  * are ignored.
1909  *
1910  * \param p_mi libvlc media player instance
1911  * \param option adust option to set, values of libvlc_video_adjust_option_t
1912  * \param value adjust option value
1913  * \version LibVLC 1.1.1 and later.
1914  */
1916  unsigned option, float value );
1917 
1918 /** @} video */
1919 
1920 /** \defgroup libvlc_audio LibVLC audio controls
1921  * @{
1922  */
1923 
1924 /**
1925  * Audio channels
1926  */
1935 
1936 
1937 /**
1938  * Gets the list of available audio output modules.
1939  *
1940  * \param p_instance libvlc instance
1941  * \return list of available audio outputs. It must be freed with
1942 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1943  * In case of error, NULL is returned.
1944  */
1947 
1948 /**
1949  * Frees the list of available audio output modules.
1950  *
1951  * \param p_list list with audio outputs for release
1952  */
1953 LIBVLC_API
1955 
1956 /**
1957  * Selects an audio output module.
1958  * \note Any change will take be effect only after playback is stopped and
1959  * restarted. Audio output cannot be changed while playing.
1960  *
1961  * \param p_mi media player
1962  * \param psz_name name of audio output,
1963  * use psz_name of \see libvlc_audio_output_t
1964  * \return 0 if function succeeded, -1 on error
1965  */
1967  const char *psz_name );
1968 
1969 /**
1970  * Gets a list of potential audio output devices,
1971  * \see libvlc_audio_output_device_set().
1972  *
1973  * \note Not all audio outputs support enumerating devices.
1974  * The audio output may be functional even if the list is empty (NULL).
1975  *
1976  * \note The list may not be exhaustive.
1977  *
1978  * \warning Some audio output devices in the list might not actually work in
1979  * some circumstances. By default, it is recommended to not specify any
1980  * explicit audio device.
1981  *
1982  * \param mp media player
1983  * \return A NULL-terminated linked list of potential audio output devices.
1984  * It must be freed with libvlc_audio_output_device_list_release()
1985  * \version LibVLC 2.2.0 or later.
1986  */
1989 
1990 /**
1991  * Gets a list of audio output devices for a given audio output module,
1992  * \see libvlc_audio_output_device_set().
1993  *
1994  * \note Not all audio outputs support this. In particular, an empty (NULL)
1995  * list of devices does <b>not</b> imply that the specified audio output does
1996  * not work.
1997  *
1998  * \note The list might not be exhaustive.
1999  *
2000  * \warning Some audio output devices in the list might not actually work in
2001  * some circumstances. By default, it is recommended to not specify any
2002  * explicit audio device.
2003  *
2004  * \param p_instance libvlc instance
2005  * \param aout audio output name
2006  * (as returned by libvlc_audio_output_list_get())
2007  * \return A NULL-terminated linked list of potential audio output devices.
2008  * It must be freed with libvlc_audio_output_device_list_release()
2009  * \version LibVLC 2.1.0 or later.
2010  */
2013  const char *aout );
2014 
2015 /**
2016  * Frees a list of available audio output devices.
2017  *
2018  * \param p_list list with audio outputs for release
2019  * \version LibVLC 2.1.0 or later.
2020  */
2022  libvlc_audio_output_device_t *p_list );
2023 
2024 /**
2025  * Configures an explicit audio output device.
2026  *
2027  * If the module paramater is NULL, audio output will be moved to the device
2028  * specified by the device identifier string immediately. This is the
2029  * recommended usage.
2030  *
2031  * A list of adequate potential device strings can be obtained with
2032  * libvlc_audio_output_device_enum().
2033  *
2034  * However passing NULL is supported in LibVLC version 2.2.0 and later only;
2035  * in earlier versions, this function would have no effects when the module
2036  * parameter was NULL.
2037  *
2038  * If the module parameter is not NULL, the device parameter of the
2039  * corresponding audio output, if it exists, will be set to the specified
2040  * string. Note that some audio output modules do not have such a parameter
2041  * (notably MMDevice and PulseAudio).
2042  *
2043  * A list of adequate potential device strings can be obtained with
2044  * libvlc_audio_output_device_list_get().
2045  *
2046  * \note This function does not select the specified audio output plugin.
2047  * libvlc_audio_output_set() is used for that purpose.
2048  *
2049  * \warning The syntax for the device parameter depends on the audio output.
2050  *
2051  * Some audio output modules require further parameters (e.g. a channels map
2052  * in the case of ALSA).
2053  *
2054  * \param mp media player
2055  * \param module If NULL, current audio output module.
2056  * if non-NULL, name of audio output module
2057  (\see libvlc_audio_output_t)
2058  * \param device_id device identifier string
2059  * \return Nothing. Errors are ignored (this is a design bug).
2060  */
2062  const char *module,
2063  const char *device_id );
2064 
2065 /**
2066  * Get the current audio output device identifier.
2067  *
2068  * This complements libvlc_audio_output_device_set().
2069  *
2070  * \warning The initial value for the current audio output device identifier
2071  * may not be set or may be some unknown value. A LibVLC application should
2072  * compare this value against the known device identifiers (e.g. those that
2073  * were previously retrieved by a call to libvlc_audio_output_device_enum or
2074  * libvlc_audio_output_device_list_get) to find the current audio output device.
2075  *
2076  * It is possible that the selected audio output device changes (an external
2077  * change) without a call to libvlc_audio_output_device_set. That may make this
2078  * method unsuitable to use if a LibVLC application is attempting to track
2079  * dynamic audio device changes as they happen.
2080  *
2081  * \param mp media player
2082  * \return the current audio output device identifier
2083  * NULL if no device is selected or in case of error
2084  * (the result must be released with free()).
2085  * \version LibVLC 3.0.0 or later.
2086  */
2088 
2089 /**
2090  * Toggle mute status.
2091  *
2092  * \param p_mi media player
2093  * \warning Toggling mute atomically is not always possible: On some platforms,
2094  * other processes can mute the VLC audio playback stream asynchronously. Thus,
2095  * there is a small race condition where toggling will not work.
2096  * See also the limitations of libvlc_audio_set_mute().
2097  */
2099 
2100 /**
2101  * Get current mute status.
2102  *
2103  * \param p_mi media player
2104  * \return the mute status (boolean) if defined, -1 if undefined/unapplicable
2105  */
2107 
2108 /**
2109  * Set mute status.
2110  *
2111  * \param p_mi media player
2112  * \param status If status is true then mute, otherwise unmute
2113  * \warning This function does not always work. If there are no active audio
2114  * playback stream, the mute status might not be available. If digital
2115  * pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also
2116  * some audio output plugins do not support muting at all.
2117  * \note To force silent playback, disable all audio tracks. This is more
2118  * efficient and reliable than mute.
2119  */
2120 LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
2121 
2122 /**
2123  * Get current software audio volume.
2124  *
2125  * \param p_mi media player
2126  * \return the software volume in percents
2127  * (0 = mute, 100 = nominal / 0dB)
2128  */
2130 
2131 /**
2132  * Set current software audio volume.
2133  *
2134  * \param p_mi media player
2135  * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
2136  * \return 0 if the volume was set, -1 if it was out of range
2137  */
2138 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
2139 
2140 /**
2141  * Get number of available audio tracks.
2142  *
2143  * \param p_mi media player
2144  * \return the number of available audio tracks (int), or -1 if unavailable
2145  */
2147 
2148 /**
2149  * Get the description of available audio tracks.
2150  *
2151  * \param p_mi media player
2152  * \return list with description of available audio tracks, or NULL.
2153  * It must be freed with libvlc_track_description_list_release()
2154  */
2157 
2158 /**
2159  * Get current audio track.
2160  *
2161  * \param p_mi media player
2162  * \return the audio track ID or -1 if no active input.
2163  */
2165 
2166 /**
2167  * Set current audio track.
2168  *
2169  * \param p_mi media player
2170  * \param i_track the track ID (i_id field from track description)
2171  * \return 0 on success, -1 on error
2172  */
2173 LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
2174 
2175 /**
2176  * Get current audio channel.
2177  *
2178  * \param p_mi media player
2179  * \return the audio channel \see libvlc_audio_output_channel_t
2180  */
2182 
2183 /**
2184  * Set current audio channel.
2185  *
2186  * \param p_mi media player
2187  * \param channel the audio channel, \see libvlc_audio_output_channel_t
2188  * \return 0 on success, -1 on error
2189  */
2191 
2192 /**
2193  * Get current audio delay.
2194  *
2195  * \param p_mi media player
2196  * \return the audio delay (microseconds)
2197  * \version LibVLC 1.1.1 or later
2198  */
2200 
2201 /**
2202  * Set current audio delay. The audio delay will be reset to zero each time the media changes.
2203  *
2204  * \param p_mi media player
2205  * \param i_delay the audio delay (microseconds)
2206  * \return 0 on success, -1 on error
2207  * \version LibVLC 1.1.1 or later
2208  */
2209 LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
2210 
2211 /**
2212  * Get the number of equalizer presets.
2213  *
2214  * \return number of presets
2215  * \version LibVLC 2.2.0 or later
2216  */
2218 
2219 /**
2220  * Get the name of a particular equalizer preset.
2221  *
2222  * This name can be used, for example, to prepare a preset label or menu in a user
2223  * interface.
2224  *
2225  * \param u_index index of the preset, counting from zero
2226  * \return preset name, or NULL if there is no such preset
2227  * \version LibVLC 2.2.0 or later
2228  */
2229 LIBVLC_API const char *libvlc_audio_equalizer_get_preset_name( unsigned u_index );
2230 
2231 /**
2232  * Get the number of distinct frequency bands for an equalizer.
2233  *
2234  * \return number of frequency bands
2235  * \version LibVLC 2.2.0 or later
2236  */
2238 
2239 /**
2240  * Get a particular equalizer band frequency.
2241  *
2242  * This value can be used, for example, to create a label for an equalizer band control
2243  * in a user interface.
2244  *
2245  * \param u_index index of the band, counting from zero
2246  * \return equalizer band frequency (Hz), or -1 if there is no such band
2247  * \version LibVLC 2.2.0 or later
2248  */
2249 LIBVLC_API float libvlc_audio_equalizer_get_band_frequency( unsigned u_index );
2250 
2251 /**
2252  * Create a new default equalizer, with all frequency values zeroed.
2253  *
2254  * The new equalizer can subsequently be applied to a media player by invoking
2255  * libvlc_media_player_set_equalizer().
2256  *
2257  * The returned handle should be freed via libvlc_audio_equalizer_release() when
2258  * it is no longer needed.
2259  *
2260  * \return opaque equalizer handle, or NULL on error
2261  * \version LibVLC 2.2.0 or later
2262  */
2264 
2265 /**
2266  * Create a new equalizer, with initial frequency values copied from an existing
2267  * preset.
2268  *
2269  * The new equalizer can subsequently be applied to a media player by invoking
2270  * libvlc_media_player_set_equalizer().
2271  *
2272  * The returned handle should be freed via libvlc_audio_equalizer_release() when
2273  * it is no longer needed.
2274  *
2275  * \param u_index index of the preset, counting from zero
2276  * \return opaque equalizer handle, or NULL on error
2277  * (it must be released with libvlc_audio_equalizer_release())
2278  * \version LibVLC 2.2.0 or later
2279  */
2281 
2282 /**
2283  * Release a previously created equalizer instance.
2284  *
2285  * The equalizer was previously created by using libvlc_audio_equalizer_new() or
2286  * libvlc_audio_equalizer_new_from_preset().
2287  *
2288  * It is safe to invoke this method with a NULL p_equalizer parameter for no effect.
2289  *
2290  * \param p_equalizer opaque equalizer handle, or NULL
2291  * \version LibVLC 2.2.0 or later
2292  */
2294 
2295 /**
2296  * Set a new pre-amplification value for an equalizer.
2297  *
2298  * The new equalizer settings are subsequently applied to a media player by invoking
2299  * libvlc_media_player_set_equalizer().
2300  *
2301  * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
2302  *
2303  * \param p_equalizer valid equalizer handle, must not be NULL
2304  * \param f_preamp preamp value (-20.0 to 20.0 Hz)
2305  * \return zero on success, -1 on error
2306  * \version LibVLC 2.2.0 or later
2307  */
2308 LIBVLC_API int libvlc_audio_equalizer_set_preamp( libvlc_equalizer_t *p_equalizer, float f_preamp );
2309 
2310 /**
2311  * Get the current pre-amplification value from an equalizer.
2312  *
2313  * \param p_equalizer valid equalizer handle, must not be NULL
2314  * \return preamp value (Hz)
2315  * \version LibVLC 2.2.0 or later
2316  */
2318 
2319 /**
2320  * Set a new amplification value for a particular equalizer frequency band.
2321  *
2322  * The new equalizer settings are subsequently applied to a media player by invoking
2323  * libvlc_media_player_set_equalizer().
2324  *
2325  * The supplied amplification value will be clamped to the -20.0 to +20.0 range.
2326  *
2327  * \param p_equalizer valid equalizer handle, must not be NULL
2328  * \param f_amp amplification value (-20.0 to 20.0 Hz)
2329  * \param u_band index, counting from zero, of the frequency band to set
2330  * \return zero on success, -1 on error
2331  * \version LibVLC 2.2.0 or later
2332  */
2333 LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index( libvlc_equalizer_t *p_equalizer, float f_amp, unsigned u_band );
2334 
2335 /**
2336  * Get the amplification value for a particular equalizer frequency band.
2337  *
2338  * \param p_equalizer valid equalizer handle, must not be NULL
2339  * \param u_band index, counting from zero, of the frequency band to get
2340  * \return amplification value (Hz); NaN if there is no such frequency band
2341  * \version LibVLC 2.2.0 or later
2342  */
2343 LIBVLC_API float libvlc_audio_equalizer_get_amp_at_index( libvlc_equalizer_t *p_equalizer, unsigned u_band );
2344 
2345 /**
2346  * Apply new equalizer settings to a media player.
2347  *
2348  * The equalizer is first created by invoking libvlc_audio_equalizer_new() or
2349  * libvlc_audio_equalizer_new_from_preset().
2350  *
2351  * It is possible to apply new equalizer settings to a media player whether the media
2352  * player is currently playing media or not.
2353  *
2354  * Invoking this method will immediately apply the new equalizer settings to the audio
2355  * output of the currently playing media if there is any.
2356  *
2357  * If there is no currently playing media, the new equalizer settings will be applied
2358  * later if and when new media is played.
2359  *
2360  * Equalizer settings will automatically be applied to subsequently played media.
2361  *
2362  * To disable the equalizer for a media player invoke this method passing NULL for the
2363  * p_equalizer parameter.
2364  *
2365  * The media player does not keep a reference to the supplied equalizer so it is safe
2366  * for an application to release the equalizer reference any time after this method
2367  * returns.
2368  *
2369  * \param p_mi opaque media player handle
2370  * \param p_equalizer opaque equalizer handle, or NULL to disable the equalizer for this media player
2371  * \return zero on success, -1 on error
2372  * \version LibVLC 2.2.0 or later
2373  */
2375 
2376 /**
2377  * Media player roles.
2378  *
2379  * \version LibVLC 3.0.0 and later.
2380  *
2381  * See \ref libvlc_media_player_set_role()
2382  */
2384  libvlc_role_None = 0, /**< Don't use a media player role */
2385  libvlc_role_Music, /**< Music (or radio) playback */
2386  libvlc_role_Video, /**< Video playback */
2387  libvlc_role_Communication, /**< Speech, real-time communication */
2388  libvlc_role_Game, /**< Video game */
2389  libvlc_role_Notification, /**< User interaction feedback */
2390  libvlc_role_Animation, /**< Embedded animation (e.g. in web page) */
2391  libvlc_role_Production, /**< Audio editting/production */
2392  libvlc_role_Accessibility, /**< Accessibility */
2393  libvlc_role_Test /** Testing */
2394 #define libvlc_role_Last libvlc_role_Test
2396 
2397 /**
2398  * Gets the media role.
2399  *
2400  * \version LibVLC 3.0.0 and later.
2401  *
2402  * \param p_mi media player
2403  * \return the media player role (\ref libvlc_media_player_role_t)
2404  */
2406 
2407 /**
2408  * Sets the media role.
2409  *
2410  * \param p_mi media player
2411  * \param role the media player role (\ref libvlc_media_player_role_t)
2412  * \return 0 on success, -1 on error
2413  */
2415  unsigned role);
2416 
2417 /** @} audio */
2418 
2419 /** @} media_player */
2420 
2421 # ifdef __cplusplus
2422 }
2423 # endif
2424 
2425 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */
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.
Music (or radio) playback.
Definition: libvlc_media_player.h:2385
LIBVLC_API int libvlc_video_get_track(libvlc_media_player_t *p_mi)
Get current video track.
Definition: libvlc_media_player.h:159
LIBVLC_API void libvlc_video_set_crop_ratio(libvlc_media_player_t *mp, unsigned num, unsigned den)
Set/unset the video crop ratio.
Definition: libvlc_media_player.h:116
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_video_metadata_type_t
Definition: libvlc_media_player.h:663
int dxgi_format
Definition: libvlc_media_player.h:573
Definition: libvlc_media_player.h:139
Definition: libvlc_media_player.h:126
Definition: libvlc_media_player.h:558
Definition: libvlc_media_player.h:1822
Definition: libvlc_media_player.h:330
LIBVLC_API unsigned libvlc_audio_equalizer_get_band_count(void)
Get the number of distinct frequency bands for an equalizer.
string argument, "file,d,t;file,d,t;..."
Definition: libvlc_media_player.h:1819
Definition: libvlc_media_player.h:1930
LIBVLC_API float libvlc_media_player_get_position(libvlc_media_player_t *p_mi)
Get movie position as percentage between 0.0 and 1.0.
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:675
Direct3D9 rendering engine.
Definition: libvlc_media_player.h:689
struct libvlc_track_description_t libvlc_track_description_t
Description for video, audio tracks and subtitles.
Definition: libvlc_media_player.h:65
LIBVLC_API int libvlc_media_player_get_chapter(libvlc_media_player_t *p_mi)
Get movie chapter.
LIBVLC_API void libvlc_video_set_crop_window(libvlc_media_player_t *mp, unsigned x, unsigned y, unsigned width, unsigned height)
Set the video crop window.
LIBVLC_API int libvlc_audio_set_track(libvlc_media_player_t *p_mi, int i_track)
Set current audio track.
char * psz_name
chapter name
Definition: libvlc_media_player.h:79
libvlc_video_color_primaries_t primaries
video color space
Definition: libvlc_media_player.h:565
unsigned height
rendering video width in pixel
Definition: libvlc_media_player.h:561
libvlc_video_adjust_option_t
option values for libvlc_video_{get,set}_adjust_{int,float,bool}
Definition: libvlc_media_player.h:1863
LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media(libvlc_media_t *p_md)
Create a Media Player object from a Media.
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_resize_cb resize_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.
Definition: libvlc_media_player.h:306
Definition: libvlc_media_player.h:1866
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:545
Definition: libvlc_media_player.h:684
LIBVLC_API int libvlc_video_get_spu(libvlc_media_player_t *p_mi)
Get current video subtitle.
int64_t i_duration
duration of the chapter in milliseconds
Definition: libvlc_media_player.h:78
libvlc_video_color_space_t colorspace
video is full range or studio/limited range
Definition: libvlc_media_player.h:580
Definition: libvlc_media_player.h:317
Definition: libvlc_media_player.h:316
int opengl_format
the rendering D3DFORMAT for libvlc_video_engine_d3d9
Definition: libvlc_media_player.h:575
LIBVLC_API int libvlc_video_get_track_count(libvlc_media_player_t *p_mi)
Get number of available video tracks.
void(* libvlc_audio_pause_cb)(void *data, int64_t pts)
Callback prototype for audio pause.
Definition: libvlc_media_player.h:931
libvlc_position_t
Enumeration of values used to set position (e.g.
Definition: libvlc_media_player.h:137
LIBVLC_API libvlc_time_t libvlc_media_player_get_time(libvlc_media_player_t *p_mi)
Get the current movie time (in ms).
bool hardware_decoding
Definition: libvlc_media_player.h:508
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.
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:1029
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:412
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_state_t
Note the order of libvlc_state_t enum must match exactly the order of.
Definition: libvlc_media.h:85
Definition: libvlc_media_player.h:144
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).
LIBVLC_API void libvlc_video_set_scale(libvlc_media_player_t *p_mi, float f_factor)
Set the video scaling factor.
void *(* libvlc_video_lock_cb)(void *opaque, void **planes)
Callback prototype to allocate and lock a picture buffer.
Definition: libvlc_media_player.h:349
libvlc_video_marquee_option_t
Marq options definition.
Definition: libvlc_media_player.h:108
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:304
Definition: libvlc_media_player.h:140
LIBVLC_API void libvlc_audio_output_device_list_release(libvlc_audio_output_device_t *p_list)
Frees a list of available audio output devices.
Audio editting/production.
Definition: libvlc_media_player.h:2391
Definition: libvlc_media_player.h:110
LIBVLC_API int libvlc_video_set_spu_delay(libvlc_media_player_t *p_mi, int64_t i_delay)
Set the subtitle delay.
void * device
Definition: libvlc_media_player.h:518
Definition: libvlc_media_player.h:303
Definition: libvlc_media_player.h:1821
Description for video, audio tracks and subtitles.
Definition: libvlc_media_player.h:48
libvlc_teletext_key_t
Enumeration of teletext keys than can be passed via libvlc_video_set_teletext()
Definition: libvlc_media_player.h:154
Definition: libvlc_media_player.h:115
LIBVLC_API void libvlc_video_set_aspect_ratio(libvlc_media_player_t *p_mi, const char *psz_aspect)
Set new video aspect ratio.
Definition: libvlc_media_player.h:328
libvlc_media_slave_type_t
Type of a media slave: subtitle or audio.
Definition: libvlc_media.h:295
struct libvlc_title_description_t libvlc_title_description_t
vlc_mutex_t lock
Definition: rand.c:32
Disable rendering engine.
Definition: libvlc_media_player.h:683
Definition: libvlc_media_player.h:1928
LIBVLC_API void libvlc_audio_set_mute(libvlc_media_player_t *p_mi, int status)
Set mute status.
struct libvlc_media_t libvlc_media_t
Definition: libvlc_media.h:43
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 libvlc_equalizer_t * libvlc_audio_equalizer_new(void)
Create a new default equalizer, with all frequency values zeroed.
bool full_range
Definition: libvlc_media_player.h:579
#define LIBVLC_API
Definition: libvlc.h:42
uint32_t d3d9_format
the rendering DXGI_FORMAT for libvlc_video_engine_d3d11
Definition: libvlc_media_player.h:574
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_toggle_fullscreen(libvlc_media_player_t *p_mi)
Toggle fullscreen status on non-embedded video outputs.
LIBVLC_API int libvlc_audio_get_volume(libvlc_media_player_t *p_mi)
Get current software audio volume.
Definition: libvlc_media_player.h:61
LIBVLC_API float libvlc_audio_equalizer_get_preamp(libvlc_equalizer_t *p_equalizer)
Get the current pre-amplification value from an equalizer.
libvlc_media_player_role
Media player roles.
Definition: libvlc_media_player.h:2383
string argument
Definition: libvlc_media_player.h:111
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.
Definition: libvlc_media_player.h:157
Definition: libvlc_media_player.h:1865
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_set_volume_cb)(void *data, float volume, bool mute)
Callback prototype for audio volume change.
Definition: libvlc_media_player.h:973
LIBVLC_API void libvlc_audio_equalizer_release(libvlc_equalizer_t *p_equalizer)
Release a previously created equalizer instance.
LIBVLC_API int libvlc_media_player_get_role(libvlc_media_player_t *p_mi)
Gets the media role.
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_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 int libvlc_audio_get_track_count(libvlc_media_player_t *p_mi)
Get number of available audio tracks.
LIBVLC_API void libvlc_media_player_next_frame(libvlc_media_player_t *p_mi)
Display the next frame (if supported)
Definition: libvlc_media_player.h:1932
Description for audio output.
Definition: libvlc_media_player.h:86
LIBVLC_API int libvlc_media_player_set_role(libvlc_media_player_t *p_mi, unsigned role)
Sets the media role.
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 void libvlc_video_set_deinterlace(libvlc_media_player_t *p_mi, int deinterlace, const char *psz_mode)
Enable or disable deinterlace filter.
void(* libvlc_audio_cleanup_cb)(void *data)
Callback prototype for audio playback cleanup.
Definition: libvlc_media_player.h:1038
LIBVLC_API libvlc_media_player_t * libvlc_media_player_new(libvlc_instance_t *p_libvlc_instance)
Create an empty Media Player object.
Definition: libvlc_media_player.h:145
Definition: libvlc_media_player.h:141
unsigned int MaxMasteringLuminance
Definition: libvlc_media_player.h:657
LIBVLC_API int libvlc_audio_get_mute(libvlc_media_player_t *p_mi)
Get current mute status.
libvlc_video_color_space_t colorspace
video is full range or studio/limited range
Definition: libvlc_media_player.h:564
LIBVLC_API int64_t libvlc_audio_get_delay(libvlc_media_player_t *p_mi)
Get current audio delay.
LIBVLC_API float libvlc_media_player_get_rate(libvlc_media_player_t *p_mi)
Get the requested movie play rate.
libvlc_video_frame_hdr10_metadata_t
Definition: libvlc_media_player.h:664
Definition: libvlc_media_player.h:1933
LIBVLC_API bool libvlc_media_player_is_seekable(libvlc_media_player_t *p_mi)
Is this media player seekable?
Definition: libvlc_media_player.h:146
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_next_chapter(libvlc_media_player_t *p_mi)
Set next chapter (if applicable)
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 int libvlc_media_player_stop_async(libvlc_media_player_t *p_mi)
Stop asynchronously.
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.
Description for audio output device.
Definition: libvlc_media_player.h:97
Video game.
Definition: libvlc_media_player.h:2388
LIBVLC_API void libvlc_media_player_previous_chapter(libvlc_media_player_t *p_mi)
Set previous chapter (if applicable)
Definition: libvlc_media_player.h:304
Definition: libvlc_media_player.h:113
libvlc_video_color_space_t
Enumeration of the Video color spaces.
Definition: libvlc_media_player.h:314
Definition: libvlc_media_player.h:305
LIBVLC_API void libvlc_video_set_adjust_float(libvlc_media_player_t *p_mi, unsigned option, float value)
Set adjust option as float.
int64_t i_time_offset
time-offset of the chapter in milliseconds
Definition: libvlc_media_player.h:77
Definition: libvlc_media_player.h:329
Definition: libvlc_media_player.h:131
uint16_t MaxContentLightLevel
Definition: libvlc_media_player.h:659
struct libvlc_track_description_t * p_next
Definition: libvlc_media_player.h:52
LIBVLC_API void libvlc_media_player_set_title(libvlc_media_player_t *p_mi, int i_title)
Set movie title.
void(* libvlc_video_swap_cb)(void *opaque)
Callback prototype called after performing drawing calls.
Definition: libvlc_media_player.h:612
Definition: libvlc_media_player.h:685
LIBVLC_API void libvlc_set_fullscreen(libvlc_media_player_t *p_mi, bool b_fullscreen)
Enable or disable fullscreen.
LIBVLC_API unsigned libvlc_audio_equalizer_get_preset_count(void)
Get the number of equalizer presets.
LIBVLC_API int libvlc_audio_set_channel(libvlc_media_player_t *p_mi, int channel)
Set current audio channel.
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.
LIBVLC_API int64_t libvlc_video_get_spu_delay(libvlc_media_player_t *p_mi)
Get the current subtitle delay.
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_teletext(libvlc_media_player_t *p_mi, int i_page)
Set new teletext page to retrieve.
LIBVLC_API const char * libvlc_audio_equalizer_get_preset_name(unsigned u_index)
Get the name of a particular equalizer preset.
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.
int adapter
IDirect3D9*.
Definition: libvlc_media_player.h:519
void(* libvlc_video_cleanup_cb)(void *opaque)
Callback prototype to configure picture buffers format.
Definition: libvlc_media_player.h:423
int i_type
Definition: httpd.c:1270
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.
char * psz_name
Definition: libvlc_media_player.h:88
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.
int64_t i_duration
duration in milliseconds
Definition: libvlc_media_player.h:67
LIBVLC_API float libvlc_video_get_scale(libvlc_media_player_t *p_mi)
Get the current video scaling factor.
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.
Definition: libvlc_media_player.h:109
Definition: libvlc_media_player.h:129
LIBVLC_API int libvlc_video_get_adjust_int(libvlc_media_player_t *p_mi, unsigned option)
Get integer adjust option.
libvlc_video_transfer_func_t transfer
video color primaries
Definition: libvlc_media_player.h:566
bool(* libvlc_video_makeCurrent_cb)(void *opaque, bool enter)
Callback prototype to set up the OpenGL context for rendering.
Definition: libvlc_media_player.h:638
LIBVLC_API int libvlc_video_get_logo_int(libvlc_media_player_t *p_mi, unsigned option)
Get integer logo option.
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.
struct libvlc_audio_output_t * p_next
Definition: libvlc_media_player.h:90
libvlc_video_color_primaries_t
Enumeration of the Video color primaries.
Definition: libvlc_media_player.h:302
struct libvlc_audio_output_device_t libvlc_audio_output_device_t
Description for audio output device.
Definition: libvlc_media_player.h:1929
LIBVLC_API int libvlc_audio_get_track(libvlc_media_player_t *p_mi)
Get current audio track.
size_t count
Definition: core.c:402
LIBVLC_API float libvlc_audio_equalizer_get_band_frequency(unsigned u_index)
Get a particular equalizer band frequency.
LIBVLC_API void libvlc_media_player_pause(libvlc_media_player_t *p_mi)
Toggle pause (no effect if there is no media)
unsigned width
Definition: libvlc_media_player.h:560
Embedded animation (e.g.
Definition: libvlc_media_player.h:2390
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_video_get_teletext(libvlc_media_player_t *p_mi)
Get current teletext page requested or 0 if it&#39;s disabled.
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.
Definition: libvlc_media_player.h:315
Definition: libvlc_media_player.h:1931
LIBVLC_API char * libvlc_video_get_aspect_ratio(libvlc_media_player_t *p_mi)
Get current video aspect ratio.
void(* libvlc_video_display_cb)(void *opaque, void *picture)
Callback prototype to display a picture.
Definition: libvlc_media_player.h:380
unsigned int MinMasteringLuminance
Definition: libvlc_media_player.h:658
Definition: libvlc_media_player.h:1820
char * psz_name
Definition: libvlc_media_player.h:51
Definition: libvlc_media_player.h:308
LIBVLC_API void libvlc_media_player_navigate(libvlc_media_player_t *p_mi, unsigned navigate)
Navigate through DVD Menu.
Definition: libvlc_media_player.h:114
void * device
video transfer function
Definition: libvlc_media_player.h:567
Definition: libvlc_media_player.h:1825
Definition: libvlc_media_player.h:326
Definition: libvlc_media_player.h:1868
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.
struct libvlc_audio_output_device_t * p_next
Next entry in list.
Definition: libvlc_media_player.h:99
User interaction feedback.
Definition: libvlc_media_player.h:2389
Definition: libvlc_media_player.h:143
LIBVLC_API void libvlc_media_player_set_chapter(libvlc_media_player_t *p_mi, int i_chapter)
Set movie chapter (if applicable).
LIBVLC_API libvlc_track_description_t * libvlc_video_get_track_description(libvlc_media_player_t *p_mi)
Get the description of available video tracks.
bool full_range
rendering video bit depth in bits per channel
Definition: libvlc_media_player.h:563
Definition: libvlc_media_player.h:1864
libvlc_video_transfer_func_t
Enumeration of the Video transfer functions.
Definition: libvlc_media_player.h:323
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.
Definition: libvlc_media_player.h:511
char psz_value[8]
Definition: vout_intf.c:99
char * psz_device
Device identifier string.
Definition: libvlc_media_player.h:100
LIBVLC_API void libvlc_title_descriptions_release(libvlc_title_description_t **p_titles, unsigned i_count)
Release a title description.
Description for chapters.
Definition: libvlc_media_player.h:75
Definition: libvlc_media_player.h:1869
Definition: libvlc_media_player.h:62
void(* libvlc_video_output_set_resize_cb)(void *opaque, void(*report_size_change)(void *report_opaque, unsigned width, unsigned height), void *report_opaque)
Set the callback to call when the host app resizes the rendering area.
Definition: libvlc_media_player.h:705
Viewpoint.
Definition: libvlc_media.h:169
Definition: libvlc_media_player.h:570
LIBVLC_API int libvlc_audio_output_set(libvlc_media_player_t *p_mi, const char *psz_name)
Selects an audio output module.
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.
LIBVLC_API int libvlc_media_player_set_position(libvlc_media_player_t *p_mi, float f_pos, bool b_fast)
Set movie position as percentage between 0.0 and 1.0.
LIBVLC_API void libvlc_audio_toggle_mute(libvlc_media_player_t *p_mi)
Toggle mute status.
LIBVLC_API libvlc_time_t libvlc_media_player_get_length(libvlc_media_player_t *p_mi)
Get the current movie length (in ms).
struct libvlc_chapter_description_t libvlc_chapter_description_t
Description for chapters.
Definition: libvlc_media_player.h:142
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.
Definition: libvlc_media_player.h:1824
void(* libvlc_audio_resume_cb)(void *data, int64_t pts)
Callback prototype for audio resumption.
Definition: libvlc_media_player.h:943
struct libvlc_equalizer_t libvlc_equalizer_t
Opaque equalizer handle.
Definition: libvlc_media_player.h:167
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.
Definition: libvlc_media_player.h:1818
char * psz_description
User-friendly device description.
Definition: libvlc_media_player.h:101
libvlc_navigate_mode_t
Navigation mode.
Definition: libvlc_media_player.h:124
Definition: libvlc_media_player.h:307
LIBVLC_API int libvlc_video_set_spu(libvlc_media_player_t *p_mi, int i_spu)
Set new video subtitle.
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.
Definition: libvlc_media_player.h:1823
LIBVLC_API int libvlc_audio_set_delay(libvlc_media_player_t *p_mi, int64_t i_delay)
Set current audio delay.
unsigned i_flags
info if item was recognized as a menu, interactive or plain content by the demuxer ...
Definition: libvlc_media_player.h:69
Don&#39;t use a media player role.
Definition: libvlc_media_player.h:2384
void(* libvlc_audio_drain_cb)(void *data)
Callback prototype for audio buffer drain.
Definition: libvlc_media_player.h:965
LIBVLC_API int libvlc_media_player_get_chapter_count(libvlc_media_player_t *p_mi)
Get movie chapter count.
void(* libvlc_audio_flush_cb)(void *data, int64_t pts)
Callback prototype for audio buffer flush.
Definition: libvlc_media_player.h:954
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 int libvlc_video_get_size(libvlc_media_player_t *p_mi, unsigned num, unsigned *px, unsigned *py)
Get the pixel dimensions of a video.
Definition: libvlc_media_player.h:650
LIBVLC_API int libvlc_media_player_get_title_count(libvlc_media_player_t *p_mi)
Get movie title count.
LIBVLC_API int libvlc_video_set_track(libvlc_media_player_t *p_mi, int i_track)
Set video track.
LIBVLC_API bool libvlc_media_player_is_playing(libvlc_media_player_t *p_mi)
is_playing
LIBVLC_API int libvlc_video_get_marquee_int(libvlc_media_player_t *p_mi, unsigned option)
Get an integer marquee option value.
Definition: libvlc_media_player.h:127
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.
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition: libvlc.h:76
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 void libvlc_video_set_adjust_int(libvlc_media_player_t *p_mi, unsigned option, int value)
Set adjust option as integer.
struct libvlc_audio_output_t libvlc_audio_output_t
Description for audio output.
bool(* libvlc_video_output_select_plane_cb)(void *opaque, size_t plane)
Tell the host the rendering for the given plane is about to start.
Definition: libvlc_media_player.h:727
LIBVLC_API float libvlc_video_get_adjust_float(libvlc_media_player_t *p_mi, unsigned option)
Get float adjust option.
LIBVLC_API libvlc_state_t libvlc_media_player_get_state(libvlc_media_player_t *p_mi)
Get current movie state.
void * device_context
Definition: libvlc_media_player.h:515
LIBVLC_API int libvlc_media_player_play(libvlc_media_player_t *p_mi)
Play.
Speech, real-time communication.
Definition: libvlc_media_player.h:2387
Definition: libvlc_media_player.h:1867
struct libvlc_renderer_item_t libvlc_renderer_item_t
Definition: libvlc_events.h:36
Definition: libvlc_media_player.h:147
Definition: libvlc_media_player.h:118
void *(* libvlc_video_getProcAddress_cb)(void *opaque, const char *fct_name)
Callback prototype to load opengl functions.
Definition: libvlc_media_player.h:648
int i_id
Definition: libvlc_media_player.h:50
Definition: libvlc_media_player.h:155
LIBVLC_API void libvlc_media_player_retain(libvlc_media_player_t *p_mi)
Retain a reference to a media player object.
Definition: libvlc_media_player.h:117
uint16_t MaxFrameAverageLightLevel
Definition: libvlc_media_player.h:660
Definition: libvlc_media_player.h:324
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_set_renderer(libvlc_media_player_t *p_mi, libvlc_renderer_item_t *p_item)
Set a renderer to the media player.
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_track_description_t * libvlc_video_get_spu_description(libvlc_media_player_t *p_mi)
Get the description of available video subtitles.
unsigned bitdepth
rendering video height in pixel
Definition: libvlc_media_player.h:562
int64_t libvlc_time_t
Definition: libvlc.h:78
Definition: libvlc_media_player.h:128
LIBVLC_API bool libvlc_get_fullscreen(libvlc_media_player_t *p_mi)
Get current fullscreen status.
LIBVLC_API int libvlc_media_player_set_rate(libvlc_media_player_t *p_mi, float rate)
Set movie play rate.
Definition: libvlc_media_player.h:130
Definition: libvlc_media_player.h:506
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 libvlc_track_description_t * libvlc_audio_get_track_description(libvlc_media_player_t *p_mi)
Get the description of available audio tracks.
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 void libvlc_video_set_logo_int(libvlc_media_player_t *p_mi, unsigned option, int value)
Set logo option as integer.
Definition: libvlc_media_player.h:327
Definition: libvlc_media_player.h:112
libvlc_video_engine_t
Enumeration of the Video engine to be used on output.
Definition: libvlc_media_player.h:681
LIBVLC_API libvlc_video_viewpoint_t * libvlc_video_new_viewpoint(void)
Create a video viewpoint structure.
void(* libvlc_video_unlock_cb)(void *opaque, void *picture, void *const *planes)
Callback prototype to unlock a picture buffer.
Definition: libvlc_media_player.h:367
LIBVLC_API char * libvlc_audio_output_device_get(libvlc_media_player_t *mp)
Get the current audio output device identifier.
Definition: libvlc_media_player.h:325
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:919
LIBVLC_API libvlc_audio_output_device_t * libvlc_audio_output_device_list_get(libvlc_instance_t *p_instance, const char *aout)
Gets a list of audio output devices for a given audio output module,.
LIBVLC_API void libvlc_audio_output_list_release(libvlc_audio_output_t *p_list)
Frees the list of available audio output modules.
LIBVLC_API void libvlc_track_description_list_release(libvlc_track_description_t *p_track_description)
Release (free) libvlc_track_description_t.
struct libvlc_media_player_t libvlc_media_player_t
Definition: libvlc_media_player.h:42
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().
Video playback.
Definition: libvlc_media_player.h:2386
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_output_device_set(libvlc_media_player_t *mp, const char *module, const char *device_id)
Configures an explicit audio output device.
LIBVLC_API bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi)
Can this media player be paused?
LIBVLC_API bool libvlc_media_player_program_scrambled(libvlc_media_player_t *p_mi)
Check if the current program is scrambled.
Direct3D11 rendering engine.
Definition: libvlc_media_player.h:687
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.
char * psz_name
title name
Definition: libvlc_media_player.h:68
Definition: libvlc_media_player.h:158
libvlc_video_color_primaries_t primaries
video color space
Definition: libvlc_media_player.h:581
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 int libvlc_audio_get_channel(libvlc_media_player_t *p_mi)
Get current audio channel.
libvlc_video_logo_option_t
option values for libvlc_video_{get,set}_logo_{int,string}
Definition: libvlc_media_player.h:1817
Definition: libvlc_media_player.h:331
enum libvlc_media_player_role libvlc_media_player_role_t
Media player roles.
Definition: libvlc_media_player.h:156
LIBVLC_API int libvlc_media_player_get_title(libvlc_media_player_t *p_mi)
Get movie title.
void(* libvlc_video_output_cleanup_cb)(void *opaque)
Callback prototype called to release user data.
Definition: libvlc_media_player.h:556
Definition: libvlc_media_player.h:138
libvlc_video_transfer_func_t transfer
video color primaries
Definition: libvlc_media_player.h:582
LIBVLC_API void libvlc_chapter_descriptions_release(libvlc_chapter_description_t **p_chapters, unsigned i_count)
Release a chapter description.
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:602
LIBVLC_API libvlc_media_t * libvlc_media_player_get_media(libvlc_media_player_t *p_mi)
Get the media used by the media_player.
void * p_surface
the rendering GLint GL_RGBA or GL_RGB for libvlc_video_engine_opengl and for libvlc_video_engine_gles...
Definition: libvlc_media_player.h:577
Accessibility.
Definition: libvlc_media_player.h:2392
LIBVLC_API int libvlc_video_get_spu_count(libvlc_media_player_t *p_mi)
Get the number of available video subtitles.
libvlc_audio_output_channel_t
Audio channels.
Definition: libvlc_media_player.h:1927
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.
char * psz_description
Definition: libvlc_media_player.h:89