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