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 */
190
191/**
192 * Type of a media slave: subtitle or audio.
193 */
200
201/**
202 * A slave of a libvlc_media_t
203 * \see libvlc_media_slaves_get
204 */
211
212/**
213 * Type of stat that can be requested from libvlc_media_get_filestat()
214 */
215#define libvlc_media_filestat_mtime 0
216#define libvlc_media_filestat_size 1
217
218/**
219 * Callback prototype to open a custom bitstream input media.
220 *
221 * The same media item can be opened multiple times. Each time, this callback
222 * is invoked. It should allocate and initialize any instance-specific
223 * resources, then store them in *datap. The instance resources can be freed
224 * in the @ref libvlc_media_close_cb callback.
225 *
226 * \param opaque private pointer as passed to libvlc_media_new_callbacks()
227 * \param datap storage space for a private data pointer [OUT]
228 * \param sizep byte length of the bitstream or UINT64_MAX if unknown [OUT]
229 *
230 * \note For convenience, *datap is initially NULL and *sizep is initially 0.
231 *
232 * \return 0 on success, non-zero on error. In case of failure, the other
233 * callbacks will not be invoked and any value stored in *datap and *sizep is
234 * discarded.
235 */
236typedef int (*libvlc_media_open_cb)(void *opaque, void **datap,
237 uint64_t *sizep);
238
239/**
240 * Callback prototype to read data from a custom bitstream input media.
241 *
242 * \param opaque private pointer as set by the @ref libvlc_media_open_cb
243 * callback
244 * \param buf start address of the buffer to read data into
245 * \param len bytes length of the buffer
246 *
247 * \return strictly positive number of bytes read, 0 on end-of-stream,
248 * or -1 on non-recoverable error
249 *
250 * \note If no data is immediately available, then the callback should sleep.
251 * \warning The application is responsible for avoiding deadlock situations.
252 */
253typedef ptrdiff_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf,
254 size_t len);
255
256/**
257 * Callback prototype to seek a custom bitstream input media.
258 *
259 * \param opaque private pointer as set by the @ref libvlc_media_open_cb
260 * callback
261 * \param offset absolute byte offset to seek to
262 * \return 0 on success, -1 on error.
263 */
264typedef int (*libvlc_media_seek_cb)(void *opaque, uint64_t offset);
265
266/**
267 * Callback prototype to close a custom bitstream input media.
268 *
269 * \param opaque private pointer as set by the @ref libvlc_media_open_cb
270 * callback
271 */
272typedef void (*libvlc_media_close_cb)(void *opaque);
273
274/**
275 * Create a media with a certain given media resource location,
276 * for instance a valid URL.
277 *
278 * \note To refer to a local file with this function,
279 * the file://... URI syntax <b>must</b> be used (see IETF RFC3986).
280 * We recommend using libvlc_media_new_path() instead when dealing with
281 * local files.
282 *
283 * \see libvlc_media_release
284 *
285 * \param psz_mrl the media location
286 * \return the newly created media or NULL on error
287 */
289
290/**
291 * Create a media for a certain file path.
292 *
293 * \see libvlc_media_release
294 *
295 * \param path local filesystem path
296 * \return the newly created media or NULL on error
297 */
299
300/**
301 * Create a media for an already open file descriptor.
302 * The file descriptor shall be open for reading (or reading and writing).
303 *
304 * Regular file descriptors, pipe read descriptors and character device
305 * descriptors (including TTYs) are supported on all platforms.
306 * Block device descriptors are supported where available.
307 * Directory descriptors are supported on systems that provide fdopendir().
308 * Sockets are supported on all platforms where they are file descriptors,
309 * i.e. all except Windows.
310 *
311 * \note This library will <b>not</b> automatically close the file descriptor
312 * under any circumstance. Nevertheless, a file descriptor can usually only be
313 * rendered once in a media player. To render it a second time, the file
314 * descriptor should probably be rewound to the beginning with lseek().
315 *
316 * \see libvlc_media_release
317 *
318 * \version LibVLC 1.1.5 and later.
319 *
320 * \param fd open file descriptor
321 * \return the newly created media or NULL on error
322 */
324
325/**
326 * Create a media with custom callbacks to read the data from.
327 *
328 * \param open_cb callback to open the custom bitstream input media
329 * \param read_cb callback to read data (must not be NULL)
330 * \param seek_cb callback to seek, or NULL if seeking is not supported
331 * \param close_cb callback to close the media, or NULL if unnecessary
332 * \param opaque data pointer for the open callback
333 *
334 * \return the newly created media or NULL on error
335 *
336 * \note If open_cb is NULL, the opaque pointer will be passed to read_cb,
337 * seek_cb and close_cb, and the stream size will be treated as unknown.
338 *
339 * \note The callbacks may be called asynchronously (from another thread).
340 * A single stream instance need not be reentrant. However the open_cb needs to
341 * be reentrant if the media is used by multiple player instances.
342 *
343 * \warning The callbacks may be used until all or any player instances
344 * that were supplied the media item are stopped.
345 *
346 * \see libvlc_media_release
347 *
348 * \version LibVLC 3.0.0 and later.
349 */
351 libvlc_media_open_cb open_cb,
352 libvlc_media_read_cb read_cb,
353 libvlc_media_seek_cb seek_cb,
354 libvlc_media_close_cb close_cb,
355 void *opaque );
356
357/**
358 * Create a media as an empty node with a given name.
359 *
360 * \see libvlc_media_release
361 *
362 * \param psz_name the name of the node
363 * \return the new empty media or NULL on error
364 */
366
367/**
368 * Add an option to the media.
369 *
370 * This option will be used to determine how the media_player will
371 * read the media. This allows to use VLC's advanced
372 * reading/streaming options on a per-media basis.
373 *
374 * \note The options are listed in 'vlc --longhelp' from the command line,
375 * e.g. "--sout-all". Keep in mind that available options and their semantics
376 * vary across LibVLC versions and builds.
377 * \warning Not all options affects libvlc_media_t objects:
378 * Specifically, due to architectural issues most audio and video options,
379 * such as text renderer options, have no effects on an individual media.
380 * These options must be set through libvlc_new() instead.
381 *
382 * \param p_md the media descriptor
383 * \param psz_options the options (as a string)
384 */
386 libvlc_media_t *p_md,
387 const char * psz_options );
388
389/**
390 * Add an option to the media with configurable flags.
391 *
392 * This option will be used to determine how the media_player will
393 * read the media. This allows to use VLC's advanced
394 * reading/streaming options on a per-media basis.
395 *
396 * The options are detailed in vlc --longhelp, for instance
397 * "--sout-all". Note that all options are not usable on medias:
398 * specifically, due to architectural issues, video-related options
399 * such as text renderer options cannot be set on a single media. They
400 * must be set on the whole libvlc instance instead.
401 *
402 * \param p_md the media descriptor
403 * \param psz_options the options (as a string)
404 * \param i_flags the flags for this option
405 */
407 libvlc_media_t *p_md,
408 const char * psz_options,
409 unsigned i_flags );
410
411
412/**
413 * Retain a reference to a media descriptor object (libvlc_media_t). Use
414 * libvlc_media_release() to decrement the reference count of a
415 * media descriptor object.
416 *
417 * \param p_md the media descriptor
418 * \return the same object
419 */
421
422/**
423 * Decrement the reference count of a media descriptor object. If the
424 * reference count is 0, then libvlc_media_release() will release the
425 * media descriptor object. If the media descriptor object has been released it
426 * should not be used again.
427 *
428 * \param p_md the media descriptor
429 */
431
432
433/**
434 * Get the media resource locator (mrl) from a media descriptor object
435 *
436 * \param p_md a media descriptor object
437 * \return string with mrl of media descriptor object
438 */
440
441/**
442 * Duplicate a media descriptor object.
443 *
444 * \warning the duplicated media won't share forthcoming updates from the
445 * original one.
446 *
447 * \param p_md a media descriptor object.
448 */
450
451/**
452 * Read the meta of the media.
453 *
454 * Note, you need to call libvlc_media_parse_request() or play the media
455 * at least once before calling this function.
456 * If the media has not yet been parsed this will return NULL.
457 *
458 * \see libvlc_MediaMetaChanged
459 *
460 * \param p_md the media descriptor
461 * \param e_meta the meta to read
462 * \return the media's meta
463 */
465 libvlc_meta_t e_meta );
466
467/**
468 * Set the meta of the media (this function will not save the meta, call
469 * libvlc_media_save_meta in order to save the meta)
470 *
471 * \param p_md the media descriptor
472 * \param e_meta the meta to write
473 * \param psz_value the media's meta
474 */
476 libvlc_meta_t e_meta,
477 const char *psz_value );
478
479/**
480 * Read the meta extra of the media.
481 *
482 * If the media has not yet been parsed this will return NULL.
483 *
484 * \see libvlc_media_parse
485 * \see libvlc_media_parse_with_options
486 *
487 * \param p_md the media descriptor
488 * \param psz_name the meta extra to read (nonnullable)
489 * \return the media's meta extra or NULL
490 */
492 const char *psz_name );
493
494/**
495 * Set the meta of the media (this function will not save the meta, call
496 * libvlc_media_save_meta in order to save the meta)
497 *
498 * \param p_md the media descriptor
499 * \param psz_name the meta extra to write (nonnullable)
500 * \param psz_value the media's meta extra (nullable)
501 * Removed from meta extra if set to NULL
502 */
504 const char *psz_name,
505 const char *psz_value );
506
507/**
508 * Read the meta extra names of the media.
509 *
510 * \param p_md the media descriptor
511 * \param pppsz_names the media's meta extra name array
512 * you can access the elements using the return value (count)
513 * must be released with libvlc_media_meta_extra_names_release()
514 * \return the meta extra count
515 */
517 char ***pppsz_names );
518
519/**
520 * Release a media meta extra names
521 *
522 * \param ppsz_names meta extra names array to release
523 * \param i_count number of elements in the array
524 */
526 unsigned i_count );
527
528/**
529 * Save the meta previously set
530 *
531 * \param inst LibVLC instance
532 * \param p_md the media descriptor
533 * \return true if the write operation was successful
534 */
536 libvlc_media_t *p_md );
537
538/**
539 * Get the current statistics about the media
540 * \param p_md media descriptor object
541 * \param p_stats structure that contain the statistics about the media
542 * (this structure must be allocated by the caller)
543 * \retval true statistics are available
544 * \retval false otherwise
545 */
547 libvlc_media_stats_t *p_stats);
548
549/* The following method uses libvlc_media_list_t, however, media_list usage is optional
550 * and this is here for convenience */
551#define VLC_FORWARD_DECLARE_OBJECT(a) struct a
552
553/**
554 * Get subitems of media descriptor object. This will increment
555 * the reference count of supplied media descriptor object. Use
556 * libvlc_media_list_release() to decrement the reference counting.
557 *
558 * \param p_md media descriptor object
559 * \return list of media descriptor subitems or NULL
560 */
563
564/**
565 * Get event manager from media descriptor object.
566 * NOTE: this function doesn't increment reference counting.
567 *
568 * \param p_md a media descriptor object
569 * \return event manager object
570 */
573
574/**
575 * Get duration (in ms) of media descriptor object item.
576 *
577 * Note, you need to call libvlc_media_parse_request() or play the media
578 * at least once before calling this function.
579 * Not doing this will result in an undefined result.
580 *
581 * \param p_md media descriptor object
582 * \return duration of media item or -1 on error
583 */
586
587/**
588 * Get a 'stat' value of media descriptor object item.
589 *
590 * \note 'stat' values are currently only parsed by directory accesses. This
591 * mean that only sub medias of a directory media, parsed with
592 * libvlc_media_parse_request() can have valid 'stat' properties.
593 * \version LibVLC 4.0.0 and later.
594 *
595 * \param p_md media descriptor object
596 * \param type a valid libvlc_media_stat_ define
597 * \param out field in which the value will be stored
598 * \return 1 on success, 0 if not found, -1 on error.
599 */
600LIBVLC_API int
601 libvlc_media_get_filestat( libvlc_media_t *p_md, unsigned type, uint64_t *out );
602
603/**
604 * Parse the media asynchronously with options.
605 *
606 * This fetches (local or network) art, meta data and/or tracks information.
607 *
608 * To track when this is over you can listen to libvlc_MediaParsedChanged
609 * event. However if this functions returns an error, you will not receive any
610 * events.
611 *
612 * It uses a flag to specify parse options (see libvlc_media_parse_flag_t). All
613 * these flags can be combined. By default, media is parsed if it's a local
614 * file.
615 *
616 * \note Parsing can be aborted with libvlc_media_parse_stop().
617 *
618 * \see libvlc_MediaParsedChanged
619 * \see libvlc_media_get_meta
620 * \see libvlc_media_get_tracklist
621 * \see libvlc_media_get_parsed_status
622 * \see libvlc_media_parse_flag_t
623 *
624 * \param inst LibVLC instance that is to parse the media
625 * \param p_md media descriptor object
626 * \param parse_flag parse options:
627 * \param timeout maximum time allowed to preparse the media. If -1, the
628 * default "preparse-timeout" option will be used as a timeout. If 0, it will
629 * wait indefinitely. If > 0, the timeout will be used (in milliseconds).
630 * \return -1 in case of error, 0 otherwise
631 * \version LibVLC 4.0.0 or later
632 */
633LIBVLC_API int
635 libvlc_media_parse_flag_t parse_flag,
636 int timeout );
637
638/**
639 * Stop the parsing of the media
640 *
641 * When the media parsing is stopped, the libvlc_MediaParsedChanged event will
642 * be sent with the libvlc_media_parsed_status_timeout status.
643 *
644 * \see libvlc_media_parse_request()
645 *
646 * \param inst LibVLC instance that is to cease or give up parsing the media
647 * \param p_md media descriptor object
648 * \version LibVLC 3.0.0 or later
649 */
650LIBVLC_API void
652
653/**
654 * Get Parsed status for media descriptor object.
655 *
656 * \see libvlc_MediaParsedChanged
657 * \see libvlc_media_parsed_status_t
658 * \see libvlc_media_parse_request()
659 *
660 * \param p_md media descriptor object
661 * \return a value of the libvlc_media_parsed_status_t enum
662 * \version LibVLC 3.0.0 or later
663 */
666
667/**
668 * Sets media descriptor's user_data. user_data is specialized data
669 * accessed by the host application, VLC.framework uses it as a pointer to
670 * an native object that references a libvlc_media_t pointer
671 *
672 * \param p_md media descriptor object
673 * \param p_new_user_data pointer to user data
674 */
675LIBVLC_API void
676 libvlc_media_set_user_data( libvlc_media_t *p_md, void *p_new_user_data );
677
678/**
679 * Get media descriptor's user_data. user_data is specialized data
680 * accessed by the host application, VLC.framework uses it as a pointer to
681 * an native object that references a libvlc_media_t pointer
682 *
683 * \see libvlc_media_set_user_data
684 *
685 * \param p_md media descriptor object
686 */
688
689/**
690 * Get the track list for one type
691 *
692 * \version LibVLC 4.0.0 and later.
693 *
694 * \note You need to call libvlc_media_parse_request() or play the media
695 * at least once before calling this function. Not doing this will result in
696 * an empty list.
697 *
698 * \see libvlc_media_tracklist_count
699 * \see libvlc_media_tracklist_at
700 *
701 * \param p_md media descriptor object
702 * \param type type of the track list to request
703 *
704 * \return a valid libvlc_media_tracklist_t or NULL in case of error, if there
705 * is no track for a category, the returned list will have a size of 0, delete
706 * with libvlc_media_tracklist_delete()
707 */
710
711/**
712 * Get codec description from media elementary stream
713 *
714 * Note, you need to call libvlc_media_parse_request() or play the media
715 * at least once before calling this function.
716 *
717 * \version LibVLC 3.0.0 and later.
718 *
719 * \see libvlc_media_track_t
720 *
721 * \param i_type i_type from libvlc_media_track_t
722 * \param i_codec i_codec or i_original_fourcc from libvlc_media_track_t
723 *
724 * \return codec description
725 */
728 uint32_t i_codec );
729
730/**
731 * Get the media type of the media descriptor object
732 *
733 * \version LibVLC 3.0.0 and later.
734 *
735 * \see libvlc_media_type_t
736 *
737 * \param p_md media descriptor object
738 *
739 * \return media type
740 */
743
744/**
745 * \brief libvlc_media_thumbnail_request_t An opaque thumbnail request object
746 */
748
754
755/**
756 * \brief libvlc_media_request_thumbnail_by_time Start an asynchronous thumbnail generation
757 *
758 * If the request is successfully queued, the libvlc_MediaThumbnailGenerated is
759 * guaranteed to be emitted (except if the request is destroyed early by the
760 * user).
761 * The resulting thumbnail size can either be:
762 * - Hardcoded by providing both width & height. In which case, the image will
763 * be stretched to match the provided aspect ratio, or cropped if crop is true.
764 * - Derived from the media aspect ratio if only width or height is provided and
765 * the other one is set to 0.
766 *
767 * \param inst LibVLC instance to generate the thumbnail with
768 * \param md media descriptor object
769 * \param time The time at which the thumbnail should be generated
770 * \param speed The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
771 * \param width The thumbnail width
772 * \param height the thumbnail height
773 * \param crop Should the picture be cropped to preserve source aspect ratio
774 * \param picture_type The thumbnail picture type \sa{libvlc_picture_type_t}
775 * \param timeout A timeout value in ms, or 0 to disable timeout
776 *
777 * \return A valid opaque request object, or NULL in case of failure.
778 * It must be released by libvlc_media_thumbnail_request_destroy() and
779 * can be cancelled by calling it early.
780 *
781 * \version libvlc 4.0 or later
782 *
783 * \see libvlc_picture_t
784 * \see libvlc_picture_type_t
785 */
790 unsigned int width, unsigned int height,
791 bool crop, libvlc_picture_type_t picture_type,
792 libvlc_time_t timeout );
793
794/**
795 * \brief libvlc_media_request_thumbnail_by_pos Start an asynchronous thumbnail generation
796 *
797 * If the request is successfully queued, the libvlc_MediaThumbnailGenerated is
798 * guaranteed to be emitted (except if the request is destroyed early by the
799 * user).
800 * The resulting thumbnail size can either be:
801 * - Hardcoded by providing both width & height. In which case, the image will
802 * be stretched to match the provided aspect ratio, or cropped if crop is true.
803 * - Derived from the media aspect ratio if only width or height is provided and
804 * the other one is set to 0.
805 *
806 * \param inst LibVLC instance to generate the thumbnail with
807 * \param md media descriptor object
808 * \param pos The position at which the thumbnail should be generated
809 * \param speed The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
810 * \param width The thumbnail width
811 * \param height the thumbnail height
812 * \param crop Should the picture be cropped to preserve source aspect ratio
813 * \param picture_type The thumbnail picture type \sa{libvlc_picture_type_t}
814 * \param timeout A timeout value in ms, or 0 to disable timeout
815 *
816 * \return A valid opaque request object, or NULL in case of failure.
817 * It must be released by libvlc_media_thumbnail_request_destroy().
818 *
819 * \version libvlc 4.0 or later
820 *
821 * \see libvlc_picture_t
822 * \see libvlc_picture_type_t
823 */
826 libvlc_media_t *md, double pos,
828 unsigned int width, unsigned int height,
829 bool crop, libvlc_picture_type_t picture_type,
830 libvlc_time_t timeout );
831
832/**
833 * @brief libvlc_media_thumbnail_destroy destroys a thumbnail request
834 * @param p_req An opaque thumbnail request object.
835 *
836 * This will also cancel the thumbnail request, no events will be emitted after
837 * this call.
838 */
839LIBVLC_API void
841
842/**
843 * Add a slave to the current media.
844 *
845 * A slave is an external input source that may contains an additional subtitle
846 * track (like a .srt) or an additional audio track (like a .ac3).
847 *
848 * \note This function must be called before the media is parsed (via
849 * libvlc_media_parse_request()) or before the media is played (via
850 * libvlc_media_player_play())
851 *
852 * \version LibVLC 3.0.0 and later.
853 *
854 * \param p_md media descriptor object
855 * \param i_type subtitle or audio
856 * \param i_priority from 0 (low priority) to 4 (high priority)
857 * \param psz_uri Uri of the slave (should contain a valid scheme).
858 *
859 * \return 0 on success, -1 on error.
860 */
864 unsigned int i_priority,
865 const char *psz_uri );
866
867/**
868 * Clear all slaves previously added by libvlc_media_slaves_add() or
869 * internally.
870 *
871 * \version LibVLC 3.0.0 and later.
872 *
873 * \param p_md media descriptor object
874 */
877
878/**
879 * Get a media descriptor's slave list
880 *
881 * The list will contain slaves parsed by VLC or previously added by
882 * libvlc_media_slaves_add(). The typical use case of this function is to save
883 * a list of slave in a database for a later use.
884 *
885 * \version LibVLC 3.0.0 and later.
886 *
887 * \see libvlc_media_slaves_add
888 *
889 * \param p_md media descriptor object
890 * \param ppp_slaves address to store an allocated array of slaves (must be
891 * freed with libvlc_media_slaves_release()) [OUT]
892 *
893 * \return the number of slaves (zero on error)
894 */
897 libvlc_media_slave_t ***ppp_slaves );
898
899/**
900 * Release a media descriptor's slave list
901 *
902 * \version LibVLC 3.0.0 and later.
903 *
904 * \param pp_slaves slave array to release
905 * \param i_count number of elements in the array
906 */
909 unsigned int i_count );
910
911/** @}*/
912
913# ifdef __cplusplus
914}
915# endif
916
917#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:747
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:272
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:750
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:551
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:236
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:253
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:195
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:264
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:752
@ libvlc_media_thumbnail_seek_precise
Definition libvlc_media.h:751
@ 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_option_trusted
Definition libvlc_media.h:99
@ libvlc_media_option_unique
Definition libvlc_media.h:100
@ libvlc_media_parsed_status_done
Definition libvlc_media.h:188
@ libvlc_media_parsed_status_failed
Definition libvlc_media.h:185
@ libvlc_media_parsed_status_timeout
Definition libvlc_media.h:186
@ libvlc_media_parsed_status_cancelled
Definition libvlc_media.h:187
@ 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:198
@ libvlc_media_slave_type_generic
Definition libvlc_media.h:197
@ libvlc_media_slave_type_subtitle
Definition libvlc_media.h:196
@ 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
#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:206
unsigned int i_priority
Definition libvlc_media.h:209
libvlc_media_slave_type_t i_type
Definition libvlc_media.h:208
char * psz_uri
Definition libvlc_media.h:207
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