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