VLC  4.0.0-dev
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  *
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_H
26 #define VLC_LIBVLC_MEDIA_H 1
27 
28 #include <vlc/libvlc_media_track.h>
29 
30 # ifdef __cplusplus
31 extern "C" {
32 # else
33 # include <stdbool.h>
34 # endif
35 
36 /** \defgroup libvlc_media LibVLC media
37  * \ingroup libvlc
38  * @ref libvlc_media_t is an abstract representation of a playable media.
39  * It consists of a media location and various optional meta data.
40  * @{
41  * \file
42  * LibVLC media item/descriptor external API
43  */
44 
46 
47 /** Meta data types */
48 typedef enum libvlc_meta_t {
75  /* Add new meta types HERE */
77 
78 /**
79  * Note the order of libvlc_state_t enum must match exactly the order of
80  * \see mediacontrol_PlayerStatus, \see input_state_e enums,
81  * and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs).
82  *
83  * Expected states by web plugins are:
84  * IDLE/CLOSE=0, OPENING=1, PLAYING=3, PAUSED=4,
85  * STOPPING=5, ENDED=6, ERROR=7
86  */
87 typedef enum libvlc_state_t
88 {
91  libvlc_Buffering, /* XXX: Deprecated value. Check the
92  * libvlc_MediaPlayerBuffering event to know the
93  * buffering state of a libvlc_media_player */
100 
101 enum
102 {
105 };
106 
107 typedef struct libvlc_media_stats_t
108 {
109  /* Input */
112 
113  /* Demux */
118 
119  /* Decoders */
122 
123  /* Video Output */
127 
128  /* Audio output */
132 
133 /**
134  * Media type
135  *
136  * \see libvlc_media_get_type
137  */
138 typedef enum libvlc_media_type_t {
146 
147 /**
148  * Parse flags used by libvlc_media_parse_with_options()
149  *
150  * \see libvlc_media_parse_with_options
151  */
153 {
154  /**
155  * Parse media if it's a local file
156  */
158  /**
159  * Parse media even if it's a network file
160  */
162  /**
163  * Fetch meta and covert art using local resources
164  */
166  /**
167  * Fetch meta and covert art using network resources
168  */
170  /**
171  * Interact with the user (via libvlc_dialog_cbs) when preparsing this item
172  * (and not its sub items). Set this flag in order to receive a callback
173  * when the input is asking for credentials.
174  */
177 
178 /**
179  * Parse status used sent by libvlc_media_parse_with_options() or returned by
180  * libvlc_media_get_parsed_status()
181  *
182  * \see libvlc_media_parse_with_options
183  * \see libvlc_media_get_parsed_status
184  */
186 {
192 
193 /**
194  * Type of a media slave: subtitle or audio.
195  */
197 {
202 
203 /**
204  * A slave of a libvlc_media_t
205  * \see libvlc_media_slaves_get
206  */
207 typedef struct libvlc_media_slave_t
208 {
209  char * psz_uri;
211  unsigned int i_priority;
213 
214 /**
215  * Callback prototype to open a custom bitstream input media.
216  *
217  * The same media item can be opened multiple times. Each time, this callback
218  * is invoked. It should allocate and initialize any instance-specific
219  * resources, then store them in *datap. The instance resources can be freed
220  * in the @ref libvlc_media_close_cb callback.
221  *
222  * \param opaque private pointer as passed to libvlc_media_new_callbacks()
223  * \param datap storage space for a private data pointer [OUT]
224  * \param sizep byte length of the bitstream or UINT64_MAX if unknown [OUT]
225  *
226  * \note For convenience, *datap is initially NULL and *sizep is initially 0.
227  *
228  * \return 0 on success, non-zero on error. In case of failure, the other
229  * callbacks will not be invoked and any value stored in *datap and *sizep is
230  * discarded.
231  */
232 typedef int (*libvlc_media_open_cb)(void *opaque, void **datap,
233  uint64_t *sizep);
234 
235 /**
236  * Callback prototype to read data from a custom bitstream input media.
237  *
238  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
239  * callback
240  * \param buf start address of the buffer to read data into
241  * \param len bytes length of the buffer
242  *
243  * \return strictly positive number of bytes read, 0 on end-of-stream,
244  * or -1 on non-recoverable error
245  *
246  * \note If no data is immediately available, then the callback should sleep.
247  * \warning The application is responsible for avoiding deadlock situations.
248  */
249 typedef ssize_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf,
250  size_t len);
251 
252 /**
253  * Callback prototype to seek a custom bitstream input media.
254  *
255  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
256  * callback
257  * \param offset absolute byte offset to seek to
258  * \return 0 on success, -1 on error.
259  */
260 typedef int (*libvlc_media_seek_cb)(void *opaque, uint64_t offset);
261 
262 /**
263  * Callback prototype to close a custom bitstream input media.
264  *
265  * \param opaque private pointer as set by the @ref libvlc_media_open_cb
266  * callback
267  */
268 typedef void (*libvlc_media_close_cb)(void *opaque);
269 
270 /**
271  * Create a media with a certain given media resource location,
272  * for instance a valid URL.
273  *
274  * \note To refer to a local file with this function,
275  * the file://... URI syntax <b>must</b> be used (see IETF RFC3986).
276  * We recommend using libvlc_media_new_path() instead when dealing with
277  * local files.
278  *
279  * \see libvlc_media_release
280  *
281  * \param p_instance the instance
282  * \param psz_mrl the media location
283  * \return the newly created media or NULL on error
284  */
286  libvlc_instance_t *p_instance,
287  const char * psz_mrl );
288 
289 /**
290  * Create a media for a certain file path.
291  *
292  * \see libvlc_media_release
293  *
294  * \param p_instance the instance
295  * \param path local filesystem path
296  * \return the newly created media or NULL on error
297  */
299  libvlc_instance_t *p_instance,
300  const char *path );
301 
302 /**
303  * Create a media for an already open file descriptor.
304  * The file descriptor shall be open for reading (or reading and writing).
305  *
306  * Regular file descriptors, pipe read descriptors and character device
307  * descriptors (including TTYs) are supported on all platforms.
308  * Block device descriptors are supported where available.
309  * Directory descriptors are supported on systems that provide fdopendir().
310  * Sockets are supported on all platforms where they are file descriptors,
311  * i.e. all except Windows.
312  *
313  * \note This library will <b>not</b> automatically close the file descriptor
314  * under any circumstance. Nevertheless, a file descriptor can usually only be
315  * rendered once in a media player. To render it a second time, the file
316  * descriptor should probably be rewound to the beginning with lseek().
317  *
318  * \see libvlc_media_release
319  *
320  * \version LibVLC 1.1.5 and later.
321  *
322  * \param p_instance the instance
323  * \param fd open file descriptor
324  * \return the newly created media or NULL on error
325  */
327  libvlc_instance_t *p_instance,
328  int fd );
329 
330 /**
331  * Create a media with custom callbacks to read the data from.
332  *
333  * \param instance LibVLC instance
334  * \param open_cb callback to open the custom bitstream input media
335  * \param read_cb callback to read data (must not be NULL)
336  * \param seek_cb callback to seek, or NULL if seeking is not supported
337  * \param close_cb callback to close the media, or NULL if unnecessary
338  * \param opaque data pointer for the open callback
339  *
340  * \return the newly created media or NULL on error
341  *
342  * \note If open_cb is NULL, the opaque pointer will be passed to read_cb,
343  * seek_cb and close_cb, and the stream size will be treated as unknown.
344  *
345  * \note The callbacks may be called asynchronously (from another thread).
346  * A single stream instance need not be reentrant. However the open_cb needs to
347  * be reentrant if the media is used by multiple player instances.
348  *
349  * \warning The callbacks may be used until all or any player instances
350  * that were supplied the media item are stopped.
351  *
352  * \see libvlc_media_release
353  *
354  * \version LibVLC 3.0.0 and later.
355  */
357  libvlc_instance_t *instance,
358  libvlc_media_open_cb open_cb,
359  libvlc_media_read_cb read_cb,
360  libvlc_media_seek_cb seek_cb,
361  libvlc_media_close_cb close_cb,
362  void *opaque );
363 
364 /**
365  * Create a media as an empty node with a given name.
366  *
367  * \see libvlc_media_release
368  *
369  * \param p_instance the instance
370  * \param psz_name the name of the node
371  * \return the new empty media or NULL on error
372  */
374  libvlc_instance_t *p_instance,
375  const char * psz_name );
376 
377 /**
378  * Add an option to the media.
379  *
380  * This option will be used to determine how the media_player will
381  * read the media. This allows to use VLC's advanced
382  * reading/streaming options on a per-media basis.
383  *
384  * \note The options are listed in 'vlc --longhelp' from the command line,
385  * e.g. "--sout-all". Keep in mind that available options and their semantics
386  * vary across LibVLC versions and builds.
387  * \warning Not all options affects libvlc_media_t objects:
388  * Specifically, due to architectural issues most audio and video options,
389  * such as text renderer options, have no effects on an individual media.
390  * These options must be set through libvlc_new() instead.
391  *
392  * \param p_md the media descriptor
393  * \param psz_options the options (as a string)
394  */
396  libvlc_media_t *p_md,
397  const char * psz_options );
398 
399 /**
400  * Add an option to the media with configurable flags.
401  *
402  * This option will be used to determine how the media_player will
403  * read the media. This allows to use VLC's advanced
404  * reading/streaming options on a per-media basis.
405  *
406  * The options are detailed in vlc --longhelp, for instance
407  * "--sout-all". Note that all options are not usable on medias:
408  * specifically, due to architectural issues, video-related options
409  * such as text renderer options cannot be set on a single media. They
410  * must be set on the whole libvlc instance instead.
411  *
412  * \param p_md the media descriptor
413  * \param psz_options the options (as a string)
414  * \param i_flags the flags for this option
415  */
417  libvlc_media_t *p_md,
418  const char * psz_options,
419  unsigned i_flags );
420 
421 
422 /**
423  * Retain a reference to a media descriptor object (libvlc_media_t). Use
424  * libvlc_media_release() to decrement the reference count of a
425  * media descriptor object.
426  *
427  * \param p_md the media descriptor
428  */
430 
431 /**
432  * Decrement the reference count of a media descriptor object. If the
433  * reference count is 0, then libvlc_media_release() will release the
434  * media descriptor object. It will send out an libvlc_MediaFreed event
435  * to all listeners. If the media descriptor object has been released it
436  * should not be used again.
437  *
438  * \param p_md the media descriptor
439  */
441 
442 
443 /**
444  * Get the media resource locator (mrl) from a media descriptor object
445  *
446  * \param p_md a media descriptor object
447  * \return string with mrl of media descriptor object
448  */
450 
451 /**
452  * Duplicate a media descriptor object.
453  *
454  * \warning the duplicated media won't share forthcoming updates from the
455  * original one.
456  *
457  * \param p_md a media descriptor object.
458  */
460 
461 /**
462  * Read the meta of the media.
463  *
464  * Note, you need to call libvlc_media_parse_with_options() or play the media
465  * at least once before calling this function.
466  * If the media has not yet been parsed this will return NULL.
467  *
468  * \see libvlc_media_parse_with_options
469  * \see libvlc_MediaMetaChanged
470  *
471  * \param p_md the media descriptor
472  * \param e_meta the meta to read
473  * \return the media's meta
474  */
476  libvlc_meta_t e_meta );
477 
478 /**
479  * Set the meta of the media (this function will not save the meta, call
480  * libvlc_media_save_meta in order to save the meta)
481  *
482  * \param p_md the media descriptor
483  * \param e_meta the meta to write
484  * \param psz_value the media's meta
485  */
487  libvlc_meta_t e_meta,
488  const char *psz_value );
489 
490 
491 /**
492  * Save the meta previously set
493  *
494  * \param p_md the media desriptor
495  * \return true if the write operation was successful
496  */
498 
499 
500 /**
501  * Get current state of media descriptor object. Possible media states are
502  * libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused,
503  * libvlc_Stopped, libvlc_Ended, libvlc_Error.
504  *
505  * \see libvlc_state_t
506  * \param p_md a media descriptor object
507  * \return state of media descriptor object
508  */
510  libvlc_media_t *p_md );
511 
512 
513 /**
514  * Get the current statistics about the media
515  * \param p_md: media descriptor object
516  * \param p_stats: structure that contain the statistics about the media
517  * (this structure must be allocated by the caller)
518  * \retval true statistics are available
519  * \retval false otherwise
520  */
522  libvlc_media_stats_t *p_stats);
523 
524 /* The following method uses libvlc_media_list_t, however, media_list usage is optionnal
525  * and this is here for convenience */
526 #define VLC_FORWARD_DECLARE_OBJECT(a) struct a
527 
528 /**
529  * Get subitems of media descriptor object. This will increment
530  * the reference count of supplied media descriptor object. Use
531  * libvlc_media_list_release() to decrement the reference counting.
532  *
533  * \param p_md media descriptor object
534  * \return list of media descriptor subitems or NULL
535  */
538 
539 /**
540  * Get event manager from media descriptor object.
541  * NOTE: this function doesn't increment reference counting.
542  *
543  * \param p_md a media descriptor object
544  * \return event manager object
545  */
548 
549 /**
550  * Get duration (in ms) of media descriptor object item.
551  *
552  * Note, you need to call libvlc_media_parse_with_options() or play the media
553  * at least once before calling this function.
554  * Not doing this will result in an undefined result.
555  *
556  * \see libvlc_media_parse_with_options
557  *
558  * \param p_md media descriptor object
559  * \return duration of media item or -1 on error
560  */
563 
564 /**
565  * Parse the media asynchronously with options.
566  *
567  * This fetches (local or network) art, meta data and/or tracks information.
568  *
569  * To track when this is over you can listen to libvlc_MediaParsedChanged
570  * event. However if this functions returns an error, you will not receive any
571  * events.
572  *
573  * It uses a flag to specify parse options (see libvlc_media_parse_flag_t). All
574  * these flags can be combined. By default, media is parsed if it's a local
575  * file.
576  *
577  * \note Parsing can be aborted with libvlc_media_parse_stop().
578  *
579  * \see libvlc_MediaParsedChanged
580  * \see libvlc_media_get_meta
581  * \see libvlc_media_get_tracklist
582  * \see libvlc_media_get_parsed_status
583  * \see libvlc_media_parse_flag_t
584  *
585  * \param p_md media descriptor object
586  * \param parse_flag parse options:
587  * \param timeout maximum time allowed to preparse the media. If -1, the
588  * default "preparse-timeout" option will be used as a timeout. If 0, it will
589  * wait indefinitely. If > 0, the timeout will be used (in milliseconds).
590  * \return -1 in case of error, 0 otherwise
591  * \version LibVLC 3.0.0 or later
592  */
593 LIBVLC_API int
595  libvlc_media_parse_flag_t parse_flag,
596  int timeout );
597 
598 /**
599  * Stop the parsing of the media
600  *
601  * When the media parsing is stopped, the libvlc_MediaParsedChanged event will
602  * be sent with the libvlc_media_parsed_status_timeout status.
603  *
604  * \see libvlc_media_parse_with_options
605  *
606  * \param p_md media descriptor object
607  * \version LibVLC 3.0.0 or later
608  */
609 LIBVLC_API void
611 
612 /**
613  * Get Parsed status for media descriptor object.
614  *
615  * \see libvlc_MediaParsedChanged
616  * \see libvlc_media_parsed_status_t
617  * \see libvlc_media_parse_with_options
618  *
619  * \param p_md media descriptor object
620  * \return a value of the libvlc_media_parsed_status_t enum
621  * \version LibVLC 3.0.0 or later
622  */
625 
626 /**
627  * Sets media descriptor's user_data. user_data is specialized data
628  * accessed by the host application, VLC.framework uses it as a pointer to
629  * an native object that references a libvlc_media_t pointer
630  *
631  * \param p_md media descriptor object
632  * \param p_new_user_data pointer to user data
633  */
634 LIBVLC_API void
635  libvlc_media_set_user_data( libvlc_media_t *p_md, void *p_new_user_data );
636 
637 /**
638  * Get media descriptor's user_data. user_data is specialized data
639  * accessed by the host application, VLC.framework uses it as a pointer to
640  * an native object that references a libvlc_media_t pointer
641  *
642  * \see libvlc_media_set_user_data
643  *
644  * \param p_md media descriptor object
645  */
647 
648 /**
649  * Get the track list for one type
650  *
651  * \version LibVLC 4.0.0 and later.
652  *
653  * \note You need to call libvlc_media_parse_with_options() or play the media
654  * at least once before calling this function. Not doing this will result in
655  * an empty list.
656  *
657  * \see libvlc_media_parse_with_options
658  * \see libvlc_media_tracklist_count
659  * \see libvlc_media_tracklist_at
660  *
661  * \param p_md media descriptor object
662  * \param type type of the track list to request
663  *
664  * \return a valid libvlc_media_tracklist_t or NULL in case of error, if there
665  * is no track for a category, the returned list will have a size of 0, delete
666  * with libvlc_media_tracklist_delete()
667  */
670 
671 /**
672  * Get codec description from media elementary stream
673  *
674  * Note, you need to call libvlc_media_parse_with_options() or play the media
675  * at least once before calling this function.
676  *
677  * \version LibVLC 3.0.0 and later.
678  *
679  * \see libvlc_media_track_t
680  * \see libvlc_media_parse_with_options
681  *
682  * \param i_type i_type from libvlc_media_track_t
683  * \param i_codec i_codec or i_original_fourcc from libvlc_media_track_t
684  *
685  * \return codec description
686  */
689  uint32_t i_codec );
690 
691 /**
692  * Get the media type of the media descriptor object
693  *
694  * \version LibVLC 3.0.0 and later.
695  *
696  * \see libvlc_media_type_t
697  *
698  * \param p_md media descriptor object
699  *
700  * \return media type
701  */
704 
705 /**
706  * \brief libvlc_media_thumbnail_request_t An opaque thumbnail request object
707  */
709 
711 {
715 
716 /**
717  * \brief libvlc_media_get_thumbnail_by_time Start an asynchronous thumbnail generation
718  *
719  * If the request is successfuly queued, the libvlc_MediaThumbnailGenerated
720  * is guaranteed to be emited.
721  * The resulting thumbnail size can either be:
722  * - Hardcoded by providing both width & height. In which case, the image will
723  * be stretched to match the provided aspect ratio, or cropped if crop is true.
724  * - Derived from the media aspect ratio if only width or height is provided and
725  * the other one is set to 0.
726  *
727  * \param md media descriptor object
728  * \param time The time at which the thumbnail should be generated
729  * \param speed The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
730  * \param width The thumbnail width
731  * \param height the thumbnail height
732  * \param crop Should the picture be cropped to preserve source aspect ratio
733  * \param picture_type The thumbnail picture type \sa{libvlc_picture_type_t}
734  * \param timeout A timeout value in ms, or 0 to disable timeout
735  *
736  * \return A valid opaque request object, or NULL in case of failure.
737  * It may be cancelled by libvlc_media_thumbnail_request_cancel().
738  * It must be released by libvlc_media_thumbnail_request_destroy().
739  *
740  * \version libvlc 4.0 or later
741  *
742  * \see libvlc_picture_t
743  * \see libvlc_picture_type_t
744  */
747  libvlc_time_t time,
749  unsigned int width, unsigned int height,
750  bool crop, libvlc_picture_type_t picture_type,
751  libvlc_time_t timeout );
752 
753 /**
754  * \brief libvlc_media_get_thumbnail_by_pos Start an asynchronous thumbnail generation
755  *
756  * If the request is successfuly queued, the libvlc_MediaThumbnailGenerated
757  * is guaranteed to be emited.
758  * The resulting thumbnail size can either be:
759  * - Hardcoded by providing both width & height. In which case, the image will
760  * be stretched to match the provided aspect ratio, or cropped if crop is true.
761  * - Derived from the media aspect ratio if only width or height is provided and
762  * the other one is set to 0.
763  *
764  * \param md media descriptor object
765  * \param pos The position at which the thumbnail should be generated
766  * \param speed The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
767  * \param width The thumbnail width
768  * \param height the thumbnail height
769  * \param crop Should the picture be cropped to preserve source aspect ratio
770  * \param picture_type The thumbnail picture type \sa{libvlc_picture_type_t}
771  * \param timeout A timeout value in ms, or 0 to disable timeout
772  *
773  * \return A valid opaque request object, or NULL in case of failure.
774  * It may be cancelled by libvlc_media_thumbnail_request_cancel().
775  * It must be released by libvlc_media_thumbnail_request_destroy().
776  *
777  * \version libvlc 4.0 or later
778  *
779  * \see libvlc_picture_t
780  * \see libvlc_picture_type_t
781  */
784  float pos,
786  unsigned int width, unsigned int height,
787  bool crop, libvlc_picture_type_t picture_type,
788  libvlc_time_t timeout );
789 
790 /**
791  * @brief libvlc_media_thumbnail_cancel cancels a thumbnailing request
792  * @param p_req An opaque thumbnail request object.
793  *
794  * Cancelling the request will still cause libvlc_MediaThumbnailGenerated event
795  * to be emited, with a NULL libvlc_picture_t
796  * If the request is cancelled after its completion, the behavior is undefined.
797  */
798 LIBVLC_API void
800 
801 /**
802  * @brief libvlc_media_thumbnail_destroy destroys a thumbnail request
803  * @param p_req An opaque thumbnail request object.
804  *
805  * If the request has not completed or hasn't been cancelled yet, the behavior
806  * is undefined
807  */
808 LIBVLC_API void
810 
811 /**
812  * Add a slave to the current media.
813  *
814  * A slave is an external input source that may contains an additional subtitle
815  * track (like a .srt) or an additional audio track (like a .ac3).
816  *
817  * \note This function must be called before the media is parsed (via
818  * libvlc_media_parse_with_options()) or before the media is played (via
819  * libvlc_media_player_play())
820  *
821  * \version LibVLC 3.0.0 and later.
822  *
823  * \param p_md media descriptor object
824  * \param i_type subtitle or audio
825  * \param i_priority from 0 (low priority) to 4 (high priority)
826  * \param psz_uri Uri of the slave (should contain a valid scheme).
827  *
828  * \return 0 on success, -1 on error.
829  */
833  unsigned int i_priority,
834  const char *psz_uri );
835 
836 /**
837  * Clear all slaves previously added by libvlc_media_slaves_add() or
838  * internally.
839  *
840  * \version LibVLC 3.0.0 and later.
841  *
842  * \param p_md media descriptor object
843  */
846 
847 /**
848  * Get a media descriptor's slave list
849  *
850  * The list will contain slaves parsed by VLC or previously added by
851  * libvlc_media_slaves_add(). The typical use case of this function is to save
852  * a list of slave in a database for a later use.
853  *
854  * \version LibVLC 3.0.0 and later.
855  *
856  * \see libvlc_media_slaves_add
857  *
858  * \param p_md media descriptor object
859  * \param ppp_slaves address to store an allocated array of slaves (must be
860  * freed with libvlc_media_slaves_release()) [OUT]
861  *
862  * \return the number of slaves (zero on error)
863  */
865 unsigned int libvlc_media_slaves_get( libvlc_media_t *p_md,
866  libvlc_media_slave_t ***ppp_slaves );
867 
868 /**
869  * Release a media descriptor's slave list
870  *
871  * \version LibVLC 3.0.0 and later.
872  *
873  * \param pp_slaves slave array to release
874  * \param i_count number of elements in the array
875  */
878  unsigned int i_count );
879 
880 /** @}*/
881 
882 # ifdef __cplusplus
883 }
884 # endif
885 
886 #endif /* VLC_LIBVLC_MEDIA_H */
libvlc_media_stats_t::i_demux_discontinuity
int i_demux_discontinuity
Definition: libvlc_media.h:117
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_meta_ArtworkURL
@ libvlc_meta_ArtworkURL
Definition: libvlc_media.h:64
libvlc_media_slave_t
struct libvlc_media_slave_t libvlc_media_slave_t
A slave of a libvlc_media_t.
libvlc_meta_Director
@ libvlc_meta_Director
Definition: libvlc_media.h:67
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.
psz_name
const char * psz_name
Definition: text_style.c:53
libvlc_media_stats_t::i_demux_corrupted
int i_demux_corrupted
Definition: libvlc_media.h:116
libvlc_media_thumbnail_seek_precise
@ libvlc_media_thumbnail_seek_precise
Definition: libvlc_media.h:712
VLC_FORWARD_DECLARE_OBJECT
#define VLC_FORWARD_DECLARE_OBJECT(a)
Definition: libvlc_media.h:526
libvlc_picture_type_t
libvlc_picture_type_t
Definition: libvlc_picture.h:33
libvlc_meta_DiscNumber
@ libvlc_meta_DiscNumber
Definition: libvlc_media.h:73
libvlc_media_t
struct libvlc_media_t libvlc_media_t
Definition: libvlc_media.h:45
libvlc_meta_Actors
@ libvlc_meta_Actors
Definition: libvlc_media.h:71
libvlc_media_slave_t::i_priority
unsigned int i_priority
Definition: libvlc_media.h:211
libvlc_meta_Copyright
@ libvlc_meta_Copyright
Definition: libvlc_media.h:52
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_meta_Genre
@ libvlc_meta_Genre
Definition: libvlc_media.h:51
libvlc_Opening
@ libvlc_Opening
Definition: libvlc_media.h:90
libvlc_media_slave_type_subtitle
@ libvlc_media_slave_type_subtitle
Definition: libvlc_media.h:198
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_media_type_file
@ libvlc_media_type_file
Definition: libvlc_media.h:140
libvlc_state_t
libvlc_state_t
Note the order of libvlc_state_t enum must match exactly the order of.
Definition: libvlc_media.h:87
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
@ libvlc_NothingSpecial
Definition: libvlc_media.h:89
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:304
libvlc_media_slave_type_audio
@ libvlc_media_slave_type_audio
Definition: libvlc_media.h:200
libvlc_meta_Rating
@ libvlc_meta_Rating
Definition: libvlc_media.h:56
libvlc_media_save_meta
LIBVLC_API int libvlc_media_save_meta(libvlc_media_t *p_md)
Save the meta previously set.
libvlc_thumbnailer_seek_speed_t
libvlc_thumbnailer_seek_speed_t
Definition: libvlc_media.h:710
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:260
libvlc_media_parse_stop
LIBVLC_API void libvlc_media_parse_stop(libvlc_media_t *p_md)
Stop the parsing of the media.
libvlc_media_stats_t::f_input_bitrate
float f_input_bitrate
Definition: libvlc_media.h:111
libvlc_media_stats_t::i_read_bytes
int i_read_bytes
Definition: libvlc_media.h:110
libvlc_media_option_trusted
@ libvlc_media_option_trusted
Definition: libvlc_media.h:103
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:107
libvlc_media_parsed_status_timeout
@ libvlc_media_parsed_status_timeout
Definition: libvlc_media.h:189
libvlc_media_type_playlist
@ libvlc_media_type_playlist
Definition: libvlc_media.h:144
libvlc_media_stats_t::f_demux_bitrate
float f_demux_bitrate
Definition: libvlc_media.h:115
libvlc_media_type_unknown
@ libvlc_media_type_unknown
Definition: libvlc_media.h:139
libvlc_media_slave_type_t
libvlc_media_slave_type_t
Type of a media slave: subtitle or audio.
Definition: libvlc_media.h:196
libvlc_Buffering
@ libvlc_Buffering
Definition: libvlc_media.h:91
libvlc_media_stats_t::i_decoded_video
int i_decoded_video
Definition: libvlc_media.h:120
libvlc_meta_Season
@ libvlc_meta_Season
Definition: libvlc_media.h:68
libvlc_meta_t
libvlc_meta_t
Meta data types.
Definition: libvlc_media.h:48
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_track_type_t
libvlc_track_type_t
Definition: libvlc_media_track.h:42
libvlc_media_stats_t
struct libvlc_media_stats_t libvlc_media_stats_t
libvlc_media_stats_t::i_displayed_pictures
int i_displayed_pictures
Definition: libvlc_media.h:124
libvlc_media_stats_t::i_late_pictures
int i_late_pictures
Definition: libvlc_media.h:125
libvlc_media_thumbnail_request_by_pos
LIBVLC_API libvlc_media_thumbnail_request_t * libvlc_media_thumbnail_request_by_pos(libvlc_media_t *md, float pos, libvlc_thumbnailer_seek_speed_t speed, unsigned int width, unsigned int height, bool crop, libvlc_picture_type_t picture_type, libvlc_time_t timeout)
libvlc_media_get_thumbnail_by_pos Start an asynchronous thumbnail generation
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_media_get_tracklist
LIBVLC_API libvlc_media_tracklist_t * libvlc_media_get_tracklist(libvlc_media_t *p_md, libvlc_track_type_t type)
Get the track list for one type.
libvlc_meta_AlbumArtist
@ libvlc_meta_AlbumArtist
Definition: libvlc_media.h:72
libvlc_media_parsed_status_failed
@ libvlc_media_parsed_status_failed
Definition: libvlc_media.h:188
i_type
int i_type
Definition: httpd.c:1269
libvlc_media_stats_t::i_lost_pictures
int i_lost_pictures
Definition: libvlc_media.h:126
libvlc_media_thumbnail_request_by_time
LIBVLC_API libvlc_media_thumbnail_request_t * libvlc_media_thumbnail_request_by_time(libvlc_media_t *md, libvlc_time_t time, libvlc_thumbnailer_seek_speed_t speed, unsigned int width, unsigned int height, bool crop, libvlc_picture_type_t picture_type, libvlc_time_t timeout)
libvlc_media_get_thumbnail_by_time Start an asynchronous thumbnail generation
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
@ libvlc_Error
Definition: libvlc_media.h:98
libvlc_meta_Language
@ libvlc_meta_Language
Definition: libvlc_media.h:60
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
@ libvlc_meta_Description
Definition: libvlc_media.h:55
libvlc_media_type_stream
@ libvlc_media_type_stream
Definition: libvlc_media.h:143
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
@ libvlc_meta_DiscTotal
Definition: libvlc_media.h:74
libvlc_media_get_stats
LIBVLC_API bool libvlc_media_get_stats(libvlc_media_t *p_md, libvlc_media_stats_t *p_stats)
Get the current statistics about the media.
libvlc_meta_EncodedBy
@ libvlc_meta_EncodedBy
Definition: libvlc_media.h:63
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:185
libvlc_media_slave_t::psz_uri
char * psz_uri
Definition: libvlc_media.h:209
libvlc_media_stats_t::i_decoded_audio
int i_decoded_audio
Definition: libvlc_media.h:121
libvlc_media_do_interact
@ 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:175
libvlc_media_duplicate
LIBVLC_API libvlc_media_t * libvlc_media_duplicate(libvlc_media_t *p_md)
Duplicate a media descriptor object.
libvlc_meta_Episode
@ libvlc_meta_Episode
Definition: libvlc_media.h:69
libvlc_Playing
@ libvlc_Playing
Definition: libvlc_media.h:94
libvlc_meta_ShowName
@ libvlc_meta_ShowName
Definition: libvlc_media.h:70
libvlc_media_fetch_local
@ libvlc_media_fetch_local
Fetch meta and covert art using local resources.
Definition: libvlc_media.h:165
libvlc_media_parsed_status_skipped
@ libvlc_media_parsed_status_skipped
Definition: libvlc_media.h:187
libvlc_meta_TrackNumber
@ libvlc_meta_TrackNumber
Definition: libvlc_media.h:54
libvlc_media_list_t
struct libvlc_media_list_t libvlc_media_list_t
Definition: libvlc_media_list.h:38
libvlc_media_track.h
libvlc_media_slave_t::i_type
libvlc_media_slave_type_t i_type
Definition: libvlc_media.h:210
LIBVLC_API
#define LIBVLC_API
Definition: libvlc.h:42
libvlc_media_slave_t
A slave of a libvlc_media_t.
Definition: libvlc_media.h:207
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
@ libvlc_media_parse_network
Parse media even if it's a network file.
Definition: libvlc_media.h:161
libvlc_meta_URL
@ libvlc_meta_URL
Definition: libvlc_media.h:59
libvlc_media_thumbnail_request_cancel
LIBVLC_API void libvlc_media_thumbnail_request_cancel(libvlc_media_thumbnail_request_t *p_req)
libvlc_media_thumbnail_cancel cancels a thumbnailing request
libvlc_media_type_disc
@ libvlc_media_type_disc
Definition: libvlc_media.h:142
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_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:232
libvlc_media_thumbnail_seek_fast
@ libvlc_media_thumbnail_seek_fast
Definition: libvlc_media.h:713
libvlc_media_parse_local
@ libvlc_media_parse_local
Parse media if it's a local file.
Definition: libvlc_media.h:157
libvlc_meta_TrackID
@ libvlc_meta_TrackID
Definition: libvlc_media.h:65
psz_value
char psz_value[8]
Definition: vout_intf.c:99
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
@ libvlc_meta_Setting
Definition: libvlc_media.h:58
libvlc_meta_Publisher
@ libvlc_meta_Publisher
Definition: libvlc_media.h:62
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:249
libvlc_meta_Title
@ libvlc_meta_Title
Definition: libvlc_media.h:49
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
@ libvlc_meta_Artist
Definition: libvlc_media.h:50
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_meta_NowPlaying
@ libvlc_meta_NowPlaying
Definition: libvlc_media.h:61
libvlc_Paused
@ libvlc_Paused
Definition: libvlc_media.h:95
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_meta_TrackTotal
@ libvlc_meta_TrackTotal
Definition: libvlc_media.h:66
libvlc_media_option_unique
@ libvlc_media_option_unique
Definition: libvlc_media.h:104
libvlc_instance_t
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition: libvlc.h:76
libvlc_media_slave_type_generic
@ libvlc_media_slave_type_generic
Definition: libvlc_media.h:199
libvlc_media_fetch_network
@ libvlc_media_fetch_network
Fetch meta and covert art using network resources.
Definition: libvlc_media.h:169
libvlc_media_close_cb
void(* libvlc_media_close_cb)(void *opaque)
Callback prototype to close a custom bitstream input media.
Definition: libvlc_media.h:268
i_codec
vlc_fourcc_t i_codec
Definition: image.c:585
libvlc_media_thumbnail_request_t
struct libvlc_media_thumbnail_request_t libvlc_media_thumbnail_request_t
libvlc_media_thumbnail_request_t An opaque thumbnail request object
Definition: libvlc_media.h:708
libvlc_media_thumbnail_request_destroy
LIBVLC_API void libvlc_media_thumbnail_request_destroy(libvlc_media_thumbnail_request_t *p_req)
libvlc_media_thumbnail_destroy destroys a thumbnail request
libvlc_Stopped
@ libvlc_Stopped
Definition: libvlc_media.h:96
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:130
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_parse_flag_t
libvlc_media_parse_flag_t
Parse flags used by libvlc_media_parse_with_options()
Definition: libvlc_media.h:152
libvlc_Ended
@ libvlc_Ended
Definition: libvlc_media.h:97
libvlc_media_tracklist_t
struct libvlc_media_tracklist_t libvlc_media_tracklist_t
Opaque struct containing a list of tracks.
Definition: libvlc_media_track.h:162
libvlc_meta_Date
@ libvlc_meta_Date
Definition: libvlc_media.h:57
libvlc_media_stats_t::i_played_abuffers
int i_played_abuffers
Definition: libvlc_media.h:129
libvlc_media_type_t
libvlc_media_type_t
Media type.
Definition: libvlc_media.h:138
libvlc_media_type_directory
@ libvlc_media_type_directory
Definition: libvlc_media.h:141
libvlc_meta_Album
@ libvlc_meta_Album
Definition: libvlc_media.h:53
libvlc_media_stats_t::i_demux_read_bytes
int i_demux_read_bytes
Definition: libvlc_media.h:114
libvlc_media_parsed_status_done
@ libvlc_media_parsed_status_done
Definition: libvlc_media.h:190
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_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.