VLC  3.0.21
libvlc_media.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * libvlc_media.h: libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2009 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  * Jean-Paul Saman <jpsaman@videolan.org>
9  * Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 2.1 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25 
26 #ifndef VLC_LIBVLC_MEDIA_H
27 #define VLC_LIBVLC_MEDIA_H 1
28 
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32 
33 #if defined(_MSC_VER)
34 #include <basetsd.h>
35 typedef SSIZE_T ssize_t;
36 #endif
37 
38 
39 /** \defgroup libvlc_media LibVLC media
40  * \ingroup libvlc
41  * @ref libvlc_media_t is an abstract representation of a playable media.
42  * It consists of a media location and various optional meta data.
43  * @{
44  * \file
45  * LibVLC media item/descriptor external API
46  */
47 
48 typedef struct libvlc_media_t libvlc_media_t;
49 
50 /** Meta data types */
51 typedef enum libvlc_meta_t {
78  /* Add new meta types HERE */
80 
81 /**
82  * Note the order of libvlc_state_t enum must match exactly the order of
83  * \see mediacontrol_PlayerStatus, \see input_state_e enums,
84  * and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs).
85  *
86  * Expected states by web plugins are:
87  * IDLE/CLOSE=0, OPENING=1, PLAYING=3, PAUSED=4,
88  * STOPPING=5, ENDED=6, ERROR=7
89  */
90 typedef enum libvlc_state_t
91 {
94  libvlc_Buffering, /* XXX: Deprecated value. Check the
95  * libvlc_MediaPlayerBuffering event to know the
96  * buffering state of a libvlc_media_player */
103 
104 enum
105 {
108 };
109 
110 typedef enum libvlc_track_type_t
111 {
117 
118 typedef struct libvlc_media_stats_t
119 {
120  /* Input */
122  float f_input_bitrate;
123 
124  /* Demux */
129 
130  /* Decoders */
132  int i_decoded_audio;
133 
134  /* Video Output */
136  int i_lost_pictures;
137 
138  /* Audio output */
140  int i_lost_abuffers;
141 
142  /* Stream output */
145  float f_send_bitrate;
147 
148 typedef struct libvlc_media_track_info_t
149 {
150  /* Codec fourcc */
151  uint32_t i_codec;
152  int i_id;
154 
155  /* Codec specific */
157  int i_level;
158 
159  union {
160  struct {
161  /* Audio specific */
162  unsigned i_channels;
163  unsigned i_rate;
164  } audio;
165  struct {
166  /* Video specific */
167  unsigned i_height;
168  unsigned i_width;
169  } video;
170  } u;
171 
173 
174 
175 typedef struct libvlc_audio_track_t
176 {
177  unsigned i_channels;
178  unsigned i_rate;
180 
181 typedef enum libvlc_video_orient_t
182 {
183  libvlc_video_orient_top_left, /**< Normal. Top line represents top, left column left. */
184  libvlc_video_orient_top_right, /**< Flipped horizontally */
185  libvlc_video_orient_bottom_left, /**< Flipped vertically */
186  libvlc_video_orient_bottom_right, /**< Rotated 180 degrees */
187  libvlc_video_orient_left_top, /**< Transposed */
188  libvlc_video_orient_left_bottom, /**< Rotated 90 degrees clockwise (or 270 anti-clockwise) */
189  libvlc_video_orient_right_top, /**< Rotated 90 degrees anti-clockwise */
190  libvlc_video_orient_right_bottom /**< Anti-transposed */
192 
193 typedef enum libvlc_video_projection_t
194 {
196  libvlc_video_projection_equirectangular, /**< 360 spherical */
197 
200 
201 /**
202  * Viewpoint
203  *
204  * \warning allocate using libvlc_video_new_viewpoint()
205  */
206 typedef struct libvlc_video_viewpoint_t
207 {
208  float f_yaw; /**< view point yaw in degrees ]-180;180] */
209  float f_pitch; /**< view point pitch in degrees ]-90;90] */
210  float f_roll; /**< view point roll in degrees ]-180;180] */
211  float f_field_of_view; /**< field of view in degrees ]0;180[ (default 80.)*/
213 
214 typedef struct libvlc_video_track_t
215 {
216  unsigned i_height;
217  unsigned i_width;
218  unsigned i_sar_num;
219  unsigned i_sar_den;
221  unsigned i_frame_rate_den;
222 
225  libvlc_video_viewpoint_t pose; /**< Initial view point */
227 
228 typedef struct libvlc_subtitle_track_t
229 {
230  char *psz_encoding;
232 
233 typedef struct libvlc_media_track_t
234 {
235  /* Codec fourcc */
236  uint32_t i_codec;
238  int i_id;
240 
241  /* Codec specific */
243  int i_level;
244 
245  union {
249  };
250 
251  unsigned int i_bitrate;
253  char *psz_description;
254 
256 
257 /**
258  * Media type
259  *
260  * \see libvlc_media_get_type
261  */
262 typedef enum libvlc_media_type_t {
270 
271 /**
272  * Parse flags used by libvlc_media_parse_with_options()
273  *
274  * \see libvlc_media_parse_with_options
275  */
276 typedef enum libvlc_media_parse_flag_t
277 {
278  /**
279  * Parse media if it's a local file
280  */
282  /**
283  * Parse media even if it's a network file
284  */
286  /**
287  * Fetch meta and covert art using local resources
288  */
290  /**
291  * Fetch meta and covert art using network resources
292  */
294  /**
295  * Interact with the user (via libvlc_dialog_cbs) when preparsing this item
296  * (and not its sub items). Set this flag in order to receive a callback
297  * when the input is asking for credentials.
298  */
301 
302 /**
303  * Parse status used sent by libvlc_media_parse_with_options() or returned by
304  * libvlc_media_get_parsed_status()
305  *
306  * \see libvlc_media_parse_with_options
307  * \see libvlc_media_get_parsed_status
308  */
309 typedef enum libvlc_media_parsed_status_t
310 {
316 
317 /**
318  * Type of a media slave: subtitle or audio.
319  */
320 typedef enum libvlc_media_slave_type_t
321 {
325 
326 /**
327  * A slave of a libvlc_media_t
328  * \see libvlc_media_slaves_get
329  */
330 typedef struct libvlc_media_slave_t
331 {
332  char * psz_uri;
334  unsigned int i_priority;
336 
337 /**
338  * Callback prototype to open a custom bitstream input media.
339  *
340  * The same media item can be opened multiple times. Each time, this callback
341  * is invoked. It should allocate and initialize any instance-specific
342  * resources, then store them in *datap. The instance resources can be freed
343  * in the @ref libvlc_media_close_cb callback.
344  *
345  * \param opaque private pointer as passed to libvlc_media_new_callbacks()
346  * \param datap storage space for a private data pointer [OUT]
347  * \param sizep byte length of the bitstream or UINT64_MAX if unknown [OUT]
348  *
349  * \note For convenience, *datap is initially NULL and *sizep is initially 0.
350  *
351  * \return 0 on success, non-zero on error. In case of failure, the other
352  * callbacks will not be invoked and any value stored in *datap and *sizep is
353  * discarded.
354  */
355 typedef int (*libvlc_media_open_cb)(void *opaque, void **datap,
356  uint64_t *sizep);
357 
358 /**
359  * Callback prototype to read data from a custom bitstream input media.
360  *
361  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
362  * callback
363  * \param buf start address of the buffer to read data into
364  * \param len bytes length of the buffer
365  *
366  * \return strictly positive number of bytes read, 0 on end-of-stream,
367  * or -1 on non-recoverable error
368  *
369  * \note If no data is immediately available, then the callback should sleep.
370  * \warning The application is responsible for avoiding deadlock situations.
371  * In particular, the callback should return an error if playback is stopped;
372  * if it does not return, then libvlc_media_player_stop() will never return.
373  */
374 typedef ssize_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf,
375  size_t len);
376 
377 /**
378  * Callback prototype to seek a custom bitstream input media.
379  *
380  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
381  * callback
382  * \param offset absolute byte offset to seek to
383  * \return 0 on success, -1 on error.
384  */
385 typedef int (*libvlc_media_seek_cb)(void *opaque, uint64_t offset);
386 
387 /**
388  * Callback prototype to close a custom bitstream input media.
389  *
390  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
391  * callback
392  */
393 typedef void (*libvlc_media_close_cb)(void *opaque);
394 
395 /**
396  * Create a media with a certain given media resource location,
397  * for instance a valid URL.
398  *
399  * \note To refer to a local file with this function,
400  * the file://... URI syntax <b>must</b> be used (see IETF RFC3986).
401  * We recommend using libvlc_media_new_path() instead when dealing with
402  * local files.
403  *
404  * \see libvlc_media_release
405  *
406  * \param p_instance the instance
407  * \param psz_mrl the media location
408  * \return the newly created media or NULL on error
409  */
411  libvlc_instance_t *p_instance,
412  const char * psz_mrl );
413 
414 /**
415  * Create a media for a certain file path.
416  *
417  * \see libvlc_media_release
418  *
419  * \param p_instance the instance
420  * \param path local filesystem path
421  * \return the newly created media or NULL on error
422  */
424  libvlc_instance_t *p_instance,
425  const char *path );
426 
427 /**
428  * Create a media for an already open file descriptor.
429  * The file descriptor shall be open for reading (or reading and writing).
430  *
431  * Regular file descriptors, pipe read descriptors and character device
432  * descriptors (including TTYs) are supported on all platforms.
433  * Block device descriptors are supported where available.
434  * Directory descriptors are supported on systems that provide fdopendir().
435  * Sockets are supported on all platforms where they are file descriptors,
436  * i.e. all except Windows.
437  *
438  * \note This library will <b>not</b> automatically close the file descriptor
439  * under any circumstance. Nevertheless, a file descriptor can usually only be
440  * rendered once in a media player. To render it a second time, the file
441  * descriptor should probably be rewound to the beginning with lseek().
442  *
443  * \see libvlc_media_release
444  *
445  * \version LibVLC 1.1.5 and later.
446  *
447  * \param p_instance the instance
448  * \param fd open file descriptor
449  * \return the newly created media or NULL on error
450  */
452  libvlc_instance_t *p_instance,
453  int fd );
454 
455 /**
456  * Create a media with custom callbacks to read the data from.
457  *
458  * \param instance LibVLC instance
459  * \param open_cb callback to open the custom bitstream input media
460  * \param read_cb callback to read data (must not be NULL)
461  * \param seek_cb callback to seek, or NULL if seeking is not supported
462  * \param close_cb callback to close the media, or NULL if unnecessary
463  * \param opaque data pointer for the open callback
464  *
465  * \return the newly created media or NULL on error
466  *
467  * \note If open_cb is NULL, the opaque pointer will be passed to read_cb,
468  * seek_cb and close_cb, and the stream size will be treated as unknown.
469  *
470  * \note The callbacks may be called asynchronously (from another thread).
471  * A single stream instance need not be reentrant. However the open_cb needs to
472  * be reentrant if the media is used by multiple player instances.
473  *
474  * \warning The callbacks may be used until all or any player instances
475  * that were supplied the media item are stopped.
476  *
477  * \see libvlc_media_release
478  *
479  * \version LibVLC 3.0.0 and later.
480  */
482  libvlc_instance_t *instance,
483  libvlc_media_open_cb open_cb,
484  libvlc_media_read_cb read_cb,
485  libvlc_media_seek_cb seek_cb,
486  libvlc_media_close_cb close_cb,
487  void *opaque );
488 
489 /**
490  * Create a media as an empty node with a given name.
491  *
492  * \see libvlc_media_release
493  *
494  * \param p_instance the instance
495  * \param psz_name the name of the node
496  * \return the new empty media or NULL on error
497  */
499  libvlc_instance_t *p_instance,
500  const char * psz_name );
501 
502 /**
503  * Add an option to the media.
504  *
505  * This option will be used to determine how the media_player will
506  * read the media. This allows to use VLC's advanced
507  * reading/streaming options on a per-media basis.
508  *
509  * \note The options are listed in 'vlc --long-help' from the command line,
510  * e.g. "-sout-all". Keep in mind that available options and their semantics
511  * vary across LibVLC versions and builds.
512  * \warning Not all options affects libvlc_media_t objects:
513  * Specifically, due to architectural issues most audio and video options,
514  * such as text renderer options, have no effects on an individual media.
515  * These options must be set through libvlc_new() instead.
516  *
517  * \param p_md the media descriptor
518  * \param psz_options the options (as a string)
519  */
521  libvlc_media_t *p_md,
522  const char * psz_options );
523 
524 /**
525  * Add an option to the media with configurable flags.
526  *
527  * This option will be used to determine how the media_player will
528  * read the media. This allows to use VLC's advanced
529  * reading/streaming options on a per-media basis.
530  *
531  * The options are detailed in vlc --long-help, for instance
532  * "--sout-all". Note that all options are not usable on medias:
533  * specifically, due to architectural issues, video-related options
534  * such as text renderer options cannot be set on a single media. They
535  * must be set on the whole libvlc instance instead.
536  *
537  * \param p_md the media descriptor
538  * \param psz_options the options (as a string)
539  * \param i_flags the flags for this option
540  */
542  libvlc_media_t *p_md,
543  const char * psz_options,
544  unsigned i_flags );
545 
546 
547 /**
548  * Retain a reference to a media descriptor object (libvlc_media_t). Use
549  * libvlc_media_release() to decrement the reference count of a
550  * media descriptor object.
551  *
552  * \param p_md the media descriptor
553  */
555 
556 /**
557  * Decrement the reference count of a media descriptor object. If the
558  * reference count is 0, then libvlc_media_release() will release the
559  * media descriptor object. It will send out an libvlc_MediaFreed event
560  * to all listeners. If the media descriptor object has been released it
561  * should not be used again.
562  *
563  * \param p_md the media descriptor
564  */
566 
567 
568 /**
569  * Get the media resource locator (mrl) from a media descriptor object
570  *
571  * \param p_md a media descriptor object
572  * \return string with mrl of media descriptor object
573  */
575 
576 /**
577  * Duplicate a media descriptor object.
578  *
579  * \param p_md a media descriptor object.
580  */
582 
583 /**
584  * Read the meta of the media.
585  *
586  * If the media has not yet been parsed this will return NULL.
587  *
588  * \see libvlc_media_parse
589  * \see libvlc_media_parse_with_options
590  * \see libvlc_MediaMetaChanged
591  *
592  * \param p_md the media descriptor
593  * \param e_meta the meta to read
594  * \return the media's meta
595  */
597  libvlc_meta_t e_meta );
598 
599 /**
600  * Set the meta of the media (this function will not save the meta, call
601  * libvlc_media_save_meta in order to save the meta)
602  *
603  * \param p_md the media descriptor
604  * \param e_meta the meta to write
605  * \param psz_value the media's meta
606  */
608  libvlc_meta_t e_meta,
609  const char *psz_value );
610 
611 
612 /**
613  * Save the meta previously set
614  *
615  * \param p_md the media desriptor
616  * \return true if the write operation was successful
617  */
619 
620 
621 /**
622  * Get current state of media descriptor object. Possible media states are
623  * libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused,
624  * libvlc_Stopped, libvlc_Ended, libvlc_Error.
625  *
626  * \see libvlc_state_t
627  * \param p_md a media descriptor object
628  * \return state of media descriptor object
629  */
631  libvlc_media_t *p_md );
632 
633 
634 /**
635  * Get the current statistics about the media
636  * \param p_md: media descriptor object
637  * \param p_stats: structure that contain the statistics about the media
638  * (this structure must be allocated by the caller)
639  * \return true if the statistics are available, false otherwise
640  *
641  * \libvlc_return_bool
642  */
644  libvlc_media_stats_t *p_stats );
645 
646 /* The following method uses libvlc_media_list_t, however, media_list usage is optionnal
647  * and this is here for convenience */
648 #define VLC_FORWARD_DECLARE_OBJECT(a) struct a
649 
650 /**
651  * Get subitems of media descriptor object. This will increment
652  * the reference count of supplied media descriptor object. Use
653  * libvlc_media_list_release() to decrement the reference counting.
654  *
655  * \param p_md media descriptor object
656  * \return list of media descriptor subitems or NULL
657  */
660 
661 /**
662  * Get event manager from media descriptor object.
663  * NOTE: this function doesn't increment reference counting.
664  *
665  * \param p_md a media descriptor object
666  * \return event manager object
667  */
670 
671 /**
672  * Get duration (in ms) of media descriptor object item.
673  *
674  * \param p_md media descriptor object
675  * \return duration of media item or -1 on error
676  */
679 
680 /**
681  * Parse the media asynchronously with options.
682  *
683  * This fetches (local or network) art, meta data and/or tracks information.
684  * This method is the extended version of libvlc_media_parse_with_options().
685  *
686  * To track when this is over you can listen to libvlc_MediaParsedChanged
687  * event. However if this functions returns an error, you will not receive any
688  * events.
689  *
690  * It uses a flag to specify parse options (see libvlc_media_parse_flag_t). All
691  * these flags can be combined. By default, media is parsed if it's a local
692  * file.
693  *
694  * \note Parsing can be aborted with libvlc_media_parse_stop().
695  *
696  * \see libvlc_MediaParsedChanged
697  * \see libvlc_media_get_meta
698  * \see libvlc_media_tracks_get
699  * \see libvlc_media_get_parsed_status
700  * \see libvlc_media_parse_flag_t
701  *
702  * \param p_md media descriptor object
703  * \param parse_flag parse options:
704  * \param timeout maximum time allowed to preparse the media. If -1, the
705  * default "preparse-timeout" option will be used as a timeout. If 0, it will
706  * wait indefinitely. If > 0, the timeout will be used (in milliseconds).
707  * \return -1 in case of error, 0 otherwise
708  * \version LibVLC 3.0.0 or later
709  */
710 LIBVLC_API int
712  libvlc_media_parse_flag_t parse_flag,
713  int timeout );
714 
715 /**
716  * Stop the parsing of the media
717  *
718  * When the media parsing is stopped, the libvlc_MediaParsedChanged event will
719  * be sent with the libvlc_media_parsed_status_timeout status.
720  *
721  * \see libvlc_media_parse_with_options
722  *
723  * \param p_md media descriptor object
724  * \version LibVLC 3.0.0 or later
725  */
726 LIBVLC_API void
728 
729 /**
730  * Get Parsed status for media descriptor object.
731  *
732  * \see libvlc_MediaParsedChanged
733  * \see libvlc_media_parsed_status_t
734  *
735  * \param p_md media descriptor object
736  * \return a value of the libvlc_media_parsed_status_t enum
737  * \version LibVLC 3.0.0 or later
738  */
741 
742 /**
743  * Sets media descriptor's user_data. user_data is specialized data
744  * accessed by the host application, VLC.framework uses it as a pointer to
745  * an native object that references a libvlc_media_t pointer
746  *
747  * \param p_md media descriptor object
748  * \param p_new_user_data pointer to user data
749  */
750 LIBVLC_API void
751  libvlc_media_set_user_data( libvlc_media_t *p_md, void *p_new_user_data );
752 
753 /**
754  * Get media descriptor's user_data. user_data is specialized data
755  * accessed by the host application, VLC.framework uses it as a pointer to
756  * an native object that references a libvlc_media_t pointer
757  *
758  * \param p_md media descriptor object
759  */
761 
762 /**
763  * Get media descriptor's elementary streams description
764  *
765  * Note, you need to call libvlc_media_parse() or play the media at least once
766  * before calling this function.
767  * Not doing this will result in an empty array.
768  *
769  * \version LibVLC 2.1.0 and later.
770  *
771  * \param p_md media descriptor object
772  * \param tracks address to store an allocated array of Elementary Streams
773  * descriptions (must be freed with libvlc_media_tracks_release
774  by the caller) [OUT]
775  *
776  * \return the number of Elementary Streams (zero on error)
777  */
780  libvlc_media_track_t ***tracks );
781 
782 /**
783  * Get codec description from media elementary stream
784  *
785  * \version LibVLC 3.0.0 and later.
786  *
787  * \see libvlc_media_track_t
788  *
789  * \param i_type i_type from libvlc_media_track_t
790  * \param i_codec i_codec or i_original_fourcc from libvlc_media_track_t
791  *
792  * \return codec description
793  */
796  uint32_t i_codec );
797 
798 /**
799  * Release media descriptor's elementary streams description array
800  *
801  * \version LibVLC 2.1.0 and later.
802  *
803  * \param p_tracks tracks info array to release
804  * \param i_count number of elements in the array
805  */
808  unsigned i_count );
809 
810 /**
811  * Get the media type of the media descriptor object
812  *
813  * \version LibVLC 3.0.0 and later.
814  *
815  * \see libvlc_media_type_t
816  *
817  * \param p_md media descriptor object
818  *
819  * \return media type
820  */
823 
824 /**
825  * Add a slave to the current media.
826  *
827  * A slave is an external input source that may contains an additional subtitle
828  * track (like a .srt) or an additional audio track (like a .ac3).
829  *
830  * \note This function must be called before the media is parsed (via
831  * libvlc_media_parse_with_options()) or before the media is played (via
832  * libvlc_media_player_play())
833  *
834  * \version LibVLC 3.0.0 and later.
835  *
836  * \param p_md media descriptor object
837  * \param i_type subtitle or audio
838  * \param i_priority from 0 (low priority) to 4 (high priority)
839  * \param psz_uri Uri of the slave (should contain a valid scheme).
840  *
841  * \return 0 on success, -1 on error.
842  */
846  unsigned int i_priority,
847  const char *psz_uri );
848 
849 /**
850  * Clear all slaves previously added by libvlc_media_slaves_add() or
851  * internally.
852  *
853  * \version LibVLC 3.0.0 and later.
854  *
855  * \param p_md media descriptor object
856  */
859 
860 /**
861  * Get a media descriptor's slave list
862  *
863  * The list will contain slaves parsed by VLC or previously added by
864  * libvlc_media_slaves_add(). The typical use case of this function is to save
865  * a list of slave in a database for a later use.
866  *
867  * \version LibVLC 3.0.0 and later.
868  *
869  * \see libvlc_media_slaves_add
870  *
871  * \param p_md media descriptor object
872  * \param ppp_slaves address to store an allocated array of slaves (must be
873  * freed with libvlc_media_slaves_release()) [OUT]
874  *
875  * \return the number of slaves (zero on error)
876  */
878 unsigned int libvlc_media_slaves_get( libvlc_media_t *p_md,
879  libvlc_media_slave_t ***ppp_slaves );
880 
881 /**
882  * Release a media descriptor's slave list
883  *
884  * \version LibVLC 3.0.0 and later.
885  *
886  * \param pp_slaves slave array to release
887  * \param i_count number of elements in the array
888  */
891  unsigned int i_count );
892 
893 /** @}*/
894 
895 # ifdef __cplusplus
896 }
897 # endif
898 
899 #endif /* VLC_LIBVLC_MEDIA_H */
libvlc_media_stats_t::i_demux_discontinuity
int i_demux_discontinuity
Definition: libvlc_media.h:127
libvlc_video_track_t::i_height
unsigned i_height
Definition: libvlc_media.h:215
libvlc_video_orient_t
libvlc_video_orient_t
Definition: libvlc_media.h:180
libvlc_media_retain
LIBVLC_API void libvlc_media_retain(libvlc_media_t *p_md)
Retain a reference to a media descriptor object (libvlc_media_t).
libvlc_video_orient_top_right
Flipped horizontally.
Definition: libvlc_media.h:183
libvlc_meta_ArtworkURL
Definition: libvlc_media.h:66
libvlc_meta_Director
Definition: libvlc_media.h:69
libvlc_media_add_option_flag
LIBVLC_API void libvlc_media_add_option_flag(libvlc_media_t *p_md, const char *psz_options, unsigned i_flags)
Add an option to the media with configurable flags.
libvlc_track_type_t
libvlc_track_type_t
Definition: libvlc_media.h:109
libvlc_media_track_info_t::i_level
int i_level
Definition: libvlc_media.h:156
libvlc_media_stats_t::i_demux_corrupted
int i_demux_corrupted
Definition: libvlc_media.h:126
VLC_FORWARD_DECLARE_OBJECT
#define VLC_FORWARD_DECLARE_OBJECT(a)
Definition: libvlc_media.h:647
libvlc_subtitle_track_t::psz_encoding
char * psz_encoding
Definition: libvlc_media.h:229
libvlc_video_viewpoint_t::f_field_of_view
float f_field_of_view
field of view in degrees ]0;180[ (default 80.)
Definition: libvlc_media.h:210
libvlc_meta_DiscNumber
Definition: libvlc_media.h:75
libvlc_media_track_info_t::i_channels
unsigned i_channels
Definition: libvlc_media.h:161
libvlc_media_track_info_t::i_type
libvlc_track_type_t i_type
Definition: libvlc_media.h:152
libvlc_media_track_t::audio
libvlc_audio_track_t * audio
Definition: libvlc_media.h:245
libvlc_media_t
struct libvlc_media_t libvlc_media_t
Definition: libvlc_media.h:47
libvlc_meta_Actors
Definition: libvlc_media.h:73
libvlc_media_slave_t::i_priority
unsigned int i_priority
Definition: libvlc_media.h:333
libvlc_meta_Copyright
Definition: libvlc_media.h:54
libvlc_media_track_t::psz_language
char * psz_language
Definition: libvlc_media.h:251
libvlc_media_new_as_node
LIBVLC_API libvlc_media_t * libvlc_media_new_as_node(libvlc_instance_t *p_instance, const char *psz_name)
Create a media as an empty node with a given name.
libvlc_video_projection_equirectangular
360 spherical
Definition: libvlc_media.h:195
libvlc_meta_Genre
Definition: libvlc_media.h:53
libvlc_media_track_t::i_original_fourcc
uint32_t i_original_fourcc
Definition: libvlc_media.h:236
libvlc_Opening
Definition: libvlc_media.h:92
libvlc_media_slave_type_subtitle
Definition: libvlc_media.h:321
libvlc_media_slaves_add
LIBVLC_API int libvlc_media_slaves_add(libvlc_media_t *p_md, libvlc_media_slave_type_t i_type, unsigned int i_priority, const char *psz_uri)
Add a slave to the current media.
libvlc_media_set_meta
LIBVLC_API void libvlc_media_set_meta(libvlc_media_t *p_md, libvlc_meta_t e_meta, const char *psz_value)
Set the meta of the media (this function will not save the meta, call libvlc_media_save_meta in order...
libvlc_audio_track_t::i_channels
unsigned i_channels
Definition: libvlc_media.h:176
libvlc_media_type_file
Definition: libvlc_media.h:263
libvlc_state_t
libvlc_state_t
Note the order of libvlc_state_t enum must match exactly the order of.
Definition: libvlc_media.h:89
libvlc_video_track_t::i_frame_rate_num
unsigned i_frame_rate_num
Definition: libvlc_media.h:219
libvlc_media_slaves_get
LIBVLC_API unsigned int libvlc_media_slaves_get(libvlc_media_t *p_md, libvlc_media_slave_t ***ppp_slaves)
Get a media descriptor's slave list.
libvlc_NothingSpecial
Definition: libvlc_media.h:91
libvlc_video_projection_rectangular
Definition: libvlc_media.h:194
libvlc_video_track_t::i_orientation
libvlc_video_orient_t i_orientation
Definition: libvlc_media.h:222
libvlc_track_video
Definition: libvlc_media.h:113
libvlc_video_viewpoint_t
Viewpoint.
Definition: libvlc_media.h:205
libvlc_media_track_t::i_type
libvlc_track_type_t i_type
Definition: libvlc_media.h:238
libvlc_audio_track_t::i_rate
unsigned i_rate
Definition: libvlc_media.h:177
libvlc_video_track_t::i_frame_rate_den
unsigned i_frame_rate_den
Definition: libvlc_media.h:220
libvlc_video_orient_right_top
Rotated 90 degrees anti-clockwise.
Definition: libvlc_media.h:188
libvlc_video_track_t
Definition: libvlc_media.h:213
libvlc_media_track_info_t::i_profile
int i_profile
Definition: libvlc_media.h:155
libvlc_event_manager_t
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:310
libvlc_media_tracks_get
LIBVLC_API unsigned libvlc_media_tracks_get(libvlc_media_t *p_md, libvlc_media_track_t ***tracks)
Get media descriptor's elementary streams description.
libvlc_media_track_t::psz_description
char * psz_description
Definition: libvlc_media.h:252
libvlc_media_slave_type_audio
Definition: libvlc_media.h:322
libvlc_meta_Rating
Definition: libvlc_media.h:58
libvlc_media_save_meta
LIBVLC_API int libvlc_media_save_meta(libvlc_media_t *p_md)
Save the meta previously set.
libvlc_media_track_info_t::audio
struct libvlc_media_track_info_t::@133::@134 audio
libvlc_media_seek_cb
int(* libvlc_media_seek_cb)(void *opaque, uint64_t offset)
Callback prototype to seek a custom bitstream input media.
Definition: libvlc_media.h:384
libvlc_media_parse_stop
LIBVLC_API void libvlc_media_parse_stop(libvlc_media_t *p_md)
Stop the parsing of the media.
libvlc_track_audio
Definition: libvlc_media.h:112
libvlc_media_stats_t::f_input_bitrate
float f_input_bitrate
Definition: libvlc_media.h:121
libvlc_media_stats_t
struct libvlc_media_stats_t libvlc_media_stats_t
libvlc_media_stats_t::i_read_bytes
int i_read_bytes
Definition: libvlc_media.h:120
libvlc_media_get_mrl
LIBVLC_API char * libvlc_media_get_mrl(libvlc_media_t *p_md)
Get the media resource locator (mrl) from a media descriptor object.
libvlc_media_slaves_release
LIBVLC_API void libvlc_media_slaves_release(libvlc_media_slave_t **pp_slaves, unsigned int i_count)
Release a media descriptor's slave list.
libvlc_media_stats_t
Definition: libvlc_media.h:117
libvlc_media_parsed_status_timeout
Definition: libvlc_media.h:312
libvlc_video_track_t::i_width
unsigned i_width
Definition: libvlc_media.h:216
libvlc_video_track_t::pose
libvlc_video_viewpoint_t pose
Initial view point.
Definition: libvlc_media.h:224
libvlc_media_track_info_t::video
struct libvlc_media_track_info_t::@133::@135 video
libvlc_media_type_playlist
Definition: libvlc_media.h:267
libvlc_media_stats_t::f_demux_bitrate
float f_demux_bitrate
Definition: libvlc_media.h:125
libvlc_media_type_unknown
Definition: libvlc_media.h:262
libvlc_media_slave_type_t
libvlc_media_slave_type_t
Type of a media slave: subtitle or audio.
Definition: libvlc_media.h:319
libvlc_Buffering
Definition: libvlc_media.h:93
libvlc_media_slave_t
struct libvlc_media_slave_t libvlc_media_slave_t
A slave of a libvlc_media_t.
libvlc_media_stats_t::i_decoded_video
int i_decoded_video
Definition: libvlc_media.h:130
libvlc_meta_Season
Definition: libvlc_media.h:70
libvlc_audio_track_t
struct libvlc_audio_track_t libvlc_audio_track_t
libvlc_meta_t
libvlc_meta_t
Meta data types.
Definition: libvlc_media.h:50
libvlc_media_get_parsed_status
LIBVLC_API libvlc_media_parsed_status_t libvlc_media_get_parsed_status(libvlc_media_t *p_md)
Get Parsed status for media descriptor object.
libvlc_video_orient_left_top
Transposed.
Definition: libvlc_media.h:186
libvlc_media_track_info_t::i_rate
unsigned i_rate
Definition: libvlc_media.h:162
libvlc_media_option_unique
Definition: libvlc_media.h:106
libvlc_media_stats_t::i_displayed_pictures
int i_displayed_pictures
Definition: libvlc_media.h:134
libvlc_media_tracks_release
LIBVLC_API void libvlc_media_tracks_release(libvlc_media_track_t **p_tracks, unsigned i_count)
Release media descriptor's elementary streams description array.
libvlc_media_track_info_t::i_codec
uint32_t i_codec
Definition: libvlc_media.h:150
libvlc_media_get_user_data
LIBVLC_API void * libvlc_media_get_user_data(libvlc_media_t *p_md)
Get media descriptor's user_data.
libvlc_meta_AlbumArtist
Definition: libvlc_media.h:74
libvlc_media_parsed_status_failed
Definition: libvlc_media.h:311
libvlc_media_track_info_t::i_id
int i_id
Definition: libvlc_media.h:151
i_type
int i_type
Definition: httpd.c:1252
libvlc_media_track_t::video
libvlc_video_track_t * video
Definition: libvlc_media.h:246
libvlc_media_stats_t::i_lost_pictures
int i_lost_pictures
Definition: libvlc_media.h:135
libvlc_subtitle_track_t
Definition: libvlc_media.h:227
libvlc_media_option_trusted
Definition: libvlc_media.h:105
libvlc_media_new_callbacks
LIBVLC_API libvlc_media_t * libvlc_media_new_callbacks(libvlc_instance_t *instance, libvlc_media_open_cb open_cb, libvlc_media_read_cb read_cb, libvlc_media_seek_cb seek_cb, libvlc_media_close_cb close_cb, void *opaque)
Create a media with custom callbacks to read the data from.
libvlc_Error
Definition: libvlc_media.h:100
libvlc_meta_Language
Definition: libvlc_media.h:62
libvlc_media_parse_with_options
LIBVLC_API int libvlc_media_parse_with_options(libvlc_media_t *p_md, libvlc_media_parse_flag_t parse_flag, int timeout)
Parse the media asynchronously with options.
libvlc_meta_Description
Definition: libvlc_media.h:57
libvlc_media_type_stream
Definition: libvlc_media.h:266
libvlc_media_get_state
LIBVLC_API libvlc_state_t libvlc_media_get_state(libvlc_media_t *p_md)
Get current state of media descriptor object.
libvlc_meta_DiscTotal
Definition: libvlc_media.h:76
libvlc_video_track_t
struct libvlc_video_track_t libvlc_video_track_t
libvlc_meta_EncodedBy
Definition: libvlc_media.h:65
libvlc_media_track_info_t::u
union libvlc_media_track_info_t::@133 u
libvlc_media_get_meta
LIBVLC_API char * libvlc_media_get_meta(libvlc_media_t *p_md, libvlc_meta_t e_meta)
Read the meta of the media.
libvlc_media_set_user_data
LIBVLC_API void libvlc_media_set_user_data(libvlc_media_t *p_md, void *p_new_user_data)
Sets media descriptor's user_data.
libvlc_media_parsed_status_t
libvlc_media_parsed_status_t
Parse status used sent by libvlc_media_parse_with_options() or returned by libvlc_media_get_parsed_st...
Definition: libvlc_media.h:308
libvlc_media_slave_t::psz_uri
char * psz_uri
Definition: libvlc_media.h:331
psz_name
const char * psz_name
Definition: vlc_codecs.h:315
libvlc_media_stats_t::i_decoded_audio
int i_decoded_audio
Definition: libvlc_media.h:131
libvlc_audio_track_t
Definition: libvlc_media.h:174
libvlc_media_do_interact
Interact with the user (via libvlc_dialog_cbs) when preparsing this item (and not its sub items).
Definition: libvlc_media.h:298
libvlc_media_duplicate
LIBVLC_API libvlc_media_t * libvlc_media_duplicate(libvlc_media_t *p_md)
Duplicate a media descriptor object.
libvlc_meta_Episode
Definition: libvlc_media.h:71
libvlc_Playing
Definition: libvlc_media.h:96
libvlc_video_orient_top_left
Normal.
Definition: libvlc_media.h:182
libvlc_meta_ShowName
Definition: libvlc_media.h:72
libvlc_track_unknown
Definition: libvlc_media.h:111
libvlc_video_viewpoint_t::f_roll
float f_roll
view point roll in degrees ]-180;180]
Definition: libvlc_media.h:209
libvlc_media_fetch_local
Fetch meta and covert art using local resources.
Definition: libvlc_media.h:288
libvlc_media_track_info_t
Definition: libvlc_media.h:147
libvlc_media_parsed_status_skipped
Definition: libvlc_media.h:310
libvlc_meta_TrackNumber
Definition: libvlc_media.h:56
libvlc_media_list_t
struct libvlc_media_list_t libvlc_media_list_t
Definition: libvlc_media_list.h:38
libvlc_media_stats_t::i_sent_bytes
int i_sent_bytes
Definition: libvlc_media.h:143
libvlc_video_track_t::i_sar_num
unsigned i_sar_num
Definition: libvlc_media.h:217
libvlc_media_slave_t::i_type
libvlc_media_slave_type_t i_type
Definition: libvlc_media.h:332
LIBVLC_API
#define LIBVLC_API
Definition: libvlc.h:42
libvlc_media_slave_t
A slave of a libvlc_media_t.
Definition: libvlc_media.h:329
libvlc_media_get_codec_description
const LIBVLC_API char * libvlc_media_get_codec_description(libvlc_track_type_t i_type, uint32_t i_codec)
Get codec description from media elementary stream.
libvlc_media_parse_network
Parse media even if it's a network file.
Definition: libvlc_media.h:284
libvlc_subtitle_track_t
struct libvlc_subtitle_track_t libvlc_subtitle_track_t
libvlc_meta_URL
Definition: libvlc_media.h:61
libvlc_video_orient_bottom_left
Flipped vertically.
Definition: libvlc_media.h:184
libvlc_media_track_t::i_codec
uint32_t i_codec
Definition: libvlc_media.h:235
libvlc_track_text
Definition: libvlc_media.h:114
libvlc_media_type_disc
Definition: libvlc_media.h:265
libvlc_media_stats_t::f_send_bitrate
float f_send_bitrate
Definition: libvlc_media.h:144
libvlc_video_viewpoint_t::f_pitch
float f_pitch
view point pitch in degrees ]-90;90]
Definition: libvlc_media.h:208
libvlc_media_subitems
LIBVLC_API struct libvlc_media_list_t * libvlc_media_subitems(libvlc_media_t *p_md)
Get subitems of media descriptor object.
libvlc_media_track_t
Definition: libvlc_media.h:232
libvlc_video_viewpoint_t::f_yaw
float f_yaw
view point yaw in degrees ]-180;180]
Definition: libvlc_media.h:207
libvlc_media_open_cb
int(* libvlc_media_open_cb)(void *opaque, void **datap, uint64_t *sizep)
Callback prototype to open a custom bitstream input media.
Definition: libvlc_media.h:354
libvlc_media_parse_local
Parse media if it's a local file.
Definition: libvlc_media.h:280
libvlc_meta_TrackID
Definition: libvlc_media.h:67
psz_value
char psz_value[8]
Definition: vout_intf.c:91
libvlc_media_event_manager
LIBVLC_API libvlc_event_manager_t * libvlc_media_event_manager(libvlc_media_t *p_md)
Get event manager from media descriptor object.
libvlc_meta_Setting
Definition: libvlc_media.h:60
libvlc_video_track_t::i_sar_den
unsigned i_sar_den
Definition: libvlc_media.h:218
libvlc_video_viewpoint_t
struct libvlc_video_viewpoint_t libvlc_video_viewpoint_t
Viewpoint.
libvlc_media_track_t::i_profile
int i_profile
Definition: libvlc_media.h:241
libvlc_video_track_t::i_projection
libvlc_video_projection_t i_projection
Definition: libvlc_media.h:223
libvlc_meta_Publisher
Definition: libvlc_media.h:64
libvlc_media_track_t::i_bitrate
unsigned int i_bitrate
Definition: libvlc_media.h:250
libvlc_time_t
int64_t libvlc_time_t
Definition: libvlc.h:78
libvlc_media_read_cb
ssize_t(* libvlc_media_read_cb)(void *opaque, unsigned char *buf, size_t len)
Callback prototype to read data from a custom bitstream input media.
Definition: libvlc_media.h:373
libvlc_video_orient_left_bottom
Rotated 90 degrees clockwise (or 270 anti-clockwise)
Definition: libvlc_media.h:187
libvlc_meta_Title
Definition: libvlc_media.h:51
libvlc_video_orient_right_bottom
Anti-transposed.
Definition: libvlc_media.h:189
libvlc_media_release
LIBVLC_API void libvlc_media_release(libvlc_media_t *p_md)
Decrement the reference count of a media descriptor object.
libvlc_meta_Artist
Definition: libvlc_media.h:52
libvlc_media_track_info_t::i_width
unsigned i_width
Definition: libvlc_media.h:167
libvlc_media_get_type
LIBVLC_API libvlc_media_type_t libvlc_media_get_type(libvlc_media_t *p_md)
Get the media type of the media descriptor object.
libvlc_video_projection_t
libvlc_video_projection_t
Definition: libvlc_media.h:192
libvlc_meta_NowPlaying
Definition: libvlc_media.h:63
libvlc_Paused
Definition: libvlc_media.h:97
libvlc_media_new_location
LIBVLC_API libvlc_media_t * libvlc_media_new_location(libvlc_instance_t *p_instance, const char *psz_mrl)
Create a media with a certain given media resource location, for instance a valid URL.
libvlc_media_track_t
struct libvlc_media_track_t libvlc_media_track_t
libvlc_meta_TrackTotal
Definition: libvlc_media.h:68
libvlc_media_track_info_t
struct libvlc_media_track_info_t libvlc_media_track_info_t
libvlc_instance_t
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition: libvlc.h:76
libvlc_media_fetch_network
Fetch meta and covert art using network resources.
Definition: libvlc_media.h:292
libvlc_media_close_cb
void(* libvlc_media_close_cb)(void *opaque)
Callback prototype to close a custom bitstream input media.
Definition: libvlc_media.h:392
i_codec
vlc_fourcc_t i_codec
Definition: image.c:580
libvlc_Stopped
Definition: libvlc_media.h:98
libvlc_media_slaves_clear
LIBVLC_API void libvlc_media_slaves_clear(libvlc_media_t *p_md)
Clear all slaves previously added by libvlc_media_slaves_add() or internally.
libvlc_media_stats_t::i_lost_abuffers
int i_lost_abuffers
Definition: libvlc_media.h:139
libvlc_media_new_fd
LIBVLC_API libvlc_media_t * libvlc_media_new_fd(libvlc_instance_t *p_instance, int fd)
Create a media for an already open file descriptor.
libvlc_media_stats_t::i_sent_packets
int i_sent_packets
Definition: libvlc_media.h:142
libvlc_media_parse_flag_t
libvlc_media_parse_flag_t
Parse flags used by libvlc_media_parse_with_options()
Definition: libvlc_media.h:275
libvlc_Ended
Definition: libvlc_media.h:99
libvlc_meta_Date
Definition: libvlc_media.h:59
libvlc_video_orient_bottom_right
Rotated 180 degrees.
Definition: libvlc_media.h:185
libvlc_media_track_t::i_level
int i_level
Definition: libvlc_media.h:242
libvlc_media_get_stats
LIBVLC_API int libvlc_media_get_stats(libvlc_media_t *p_md, libvlc_media_stats_t *p_stats)
Get the current statistics about the media.
libvlc_media_stats_t::i_played_abuffers
int i_played_abuffers
Definition: libvlc_media.h:138
libvlc_media_track_t::i_id
int i_id
Definition: libvlc_media.h:237
libvlc_media_type_t
libvlc_media_type_t
Media type.
Definition: libvlc_media.h:261
libvlc_media_type_directory
Definition: libvlc_media.h:264
libvlc_meta_Album
Definition: libvlc_media.h:55
libvlc_media_stats_t::i_demux_read_bytes
int i_demux_read_bytes
Definition: libvlc_media.h:124
libvlc_media_parsed_status_done
Definition: libvlc_media.h:313
libvlc_media_new_path
LIBVLC_API libvlc_media_t * libvlc_media_new_path(libvlc_instance_t *p_instance, const char *path)
Create a media for a certain file path.
libvlc_media_track_t::subtitle
libvlc_subtitle_track_t * subtitle
Definition: libvlc_media.h:247
libvlc_video_projection_cubemap_layout_standard
Definition: libvlc_media.h:197
libvlc_media_track_info_t::i_height
unsigned i_height
Definition: libvlc_media.h:166
libvlc_media_get_duration
LIBVLC_API libvlc_time_t libvlc_media_get_duration(libvlc_media_t *p_md)
Get duration (in ms) of media descriptor object item.
libvlc_media_add_option
LIBVLC_API void libvlc_media_add_option(libvlc_media_t *p_md, const char *psz_options)
Add an option to the media.