|
VLC 4.0.0-dev
|
libvlc_media_t is an abstract representation of a playable media. More...
Files | |
| file | libvlc_media.h |
| LibVLC media item/descriptor external API. | |
Data Structures | |
| struct | libvlc_media_stats_t |
| struct | libvlc_media_slave_t |
| A slave of a libvlc_media_t. More... | |
| struct | libvlc_media_open_cbs |
| struct defining callbacks for libvlc_media_new_callbacks() More... | |
Macros | |
| #define | libvlc_media_filestat_mtime 0 |
| Type of stat that can be requested from libvlc_media_get_filestat(). | |
| #define | libvlc_media_filestat_size 1 |
| #define | VLC_FORWARD_DECLARE_OBJECT(a) |
Typedefs | |
| typedef struct libvlc_media_t | libvlc_media_t |
| typedef enum libvlc_meta_t | libvlc_meta_t |
| Meta data types. | |
| typedef enum libvlc_state_t | libvlc_state_t |
| libvlc media or media_player state | |
| typedef struct libvlc_media_stats_t | libvlc_media_stats_t |
| typedef enum libvlc_media_type_t | libvlc_media_type_t |
| Media type. | |
| typedef enum libvlc_media_slave_type_t | libvlc_media_slave_type_t |
| Type of a media slave: subtitle or audio. | |
| typedef struct libvlc_media_slave_t | libvlc_media_slave_t |
| A slave of a libvlc_media_t. | |
Functions | |
| 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 libvlc_media_t * | libvlc_media_new_path (const char *path) |
| Create a media for a certain file path. | |
| 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_callbacks (const struct libvlc_media_open_cbs *cbs, void *cbs_opaque) |
| Create a media with custom callbacks to read the data from. | |
| 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_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_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 void | libvlc_media_release (libvlc_media_t *p_md) |
| Decrement the reference count of a media descriptor object. | |
| 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 libvlc_media_t * | libvlc_media_duplicate (libvlc_media_t *p_md) |
| Duplicate a media descriptor object. | |
| 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 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 to save the meta). | |
| 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 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 to save the meta). | |
| 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. | |
| LIBVLC_API void | libvlc_media_meta_extra_names_release (char **ppsz_names, unsigned i_count) |
| Release a media meta extra names. | |
| LIBVLC_API int | libvlc_media_save_meta (libvlc_instance_t *inst, libvlc_media_t *p_md) |
| Save the meta previously set. | |
| 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_API struct libvlc_media_list_t * | libvlc_media_subitems (libvlc_media_t *p_md) |
| Get subitems of media descriptor object. | |
| LIBVLC_API libvlc_time_t | libvlc_media_get_duration (libvlc_media_t *p_md) |
| Get duration (in us) of media descriptor object item. | |
| 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 bool | libvlc_media_is_parsed (libvlc_media_t *p_md) |
| Whether the media has been parsed. | |
| 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 void * | libvlc_media_get_user_data (libvlc_media_t *p_md) |
| Get media descriptor's user_data. | |
| 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 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_API libvlc_media_type_t | libvlc_media_get_type (libvlc_media_t *p_md) |
| Get the media type of the 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 void | libvlc_media_slaves_clear (libvlc_media_t *p_md) |
| Clear all slaves previously added by libvlc_media_slaves_add() or internally. | |
| 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 void | libvlc_media_slaves_release (libvlc_media_slave_t **pp_slaves, unsigned int i_count) |
| Release a media descriptor's slave list. | |
libvlc_media_t is an abstract representation of a playable media.
It consists of a media location and various optional meta data.
| #define libvlc_media_filestat_mtime 0 |
Type of stat that can be requested from libvlc_media_get_filestat().
| #define libvlc_media_filestat_size 1 |
| #define VLC_FORWARD_DECLARE_OBJECT | ( | a | ) |
| typedef struct libvlc_media_slave_t libvlc_media_slave_t |
A slave of a libvlc_media_t.
| typedef enum libvlc_media_slave_type_t libvlc_media_slave_type_t |
Type of a media slave: subtitle or audio.
| typedef struct libvlc_media_stats_t libvlc_media_stats_t |
| typedef struct libvlc_media_t libvlc_media_t |
| typedef enum libvlc_media_type_t libvlc_media_type_t |
Media type.
| typedef enum libvlc_meta_t libvlc_meta_t |
Meta data types.
| typedef enum libvlc_state_t libvlc_state_t |
libvlc media or media_player state
| enum libvlc_media_type_t |
Media type.
| Enumerator | |
|---|---|
| libvlc_media_type_unknown | |
| libvlc_media_type_file | |
| libvlc_media_type_directory | |
| libvlc_media_type_disc | |
| libvlc_media_type_stream | |
| libvlc_media_type_playlist | |
| enum libvlc_meta_t |
Meta data types.
| enum libvlc_state_t |
| LIBVLC_API void libvlc_media_add_option | ( | libvlc_media_t * | p_md, |
| const char * | psz_options ) |
Add an option to the media.
This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis.
| p_md | the media descriptor |
| psz_options | the options (as a string) |
References LIBVLC_API.
| 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.
This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis.
The options are detailed in vlc –longhelp, for instance "--sout-all". Note that all options are not usable on medias: specifically, due to architectural issues, video-related options such as text renderer options cannot be set on a single media. They must be set on the whole libvlc instance instead.
| p_md | the media descriptor |
| psz_options | the options (as a string) |
| i_flags | the flags for this option |
References LIBVLC_API.
| LIBVLC_API libvlc_media_t * libvlc_media_duplicate | ( | libvlc_media_t * | p_md | ) |
Duplicate a media descriptor object.
| p_md | a media descriptor object. |
References LIBVLC_API.
| 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.
Note, you need to parse using libvlc_parser_queue() or play the media at least once before calling this function.
| i_type | i_type from libvlc_media_track_t |
| i_codec | i_codec or i_original_fourcc from libvlc_media_track_t |
References i_codec, i_type, LIBVLC_API, and libvlc_media_get_codec_description().
Referenced by libvlc_media_get_codec_description().
| LIBVLC_API libvlc_time_t libvlc_media_get_duration | ( | libvlc_media_t * | p_md | ) |
Get duration (in us) of media descriptor object item.
Note, you need to parse using libvlc_parser_queue() or play the media at least once before calling this function. Not doing this will result in an undefined result.
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_get_duration().
Referenced by libvlc_media_get_duration().
| 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.
| p_md | media descriptor object |
| type | a valid libvlc_media_stat_ define |
| out | field in which the value will be stored |
References libvlc_media_get_filestat().
Referenced by libvlc_media_get_filestat().
| LIBVLC_API char * libvlc_media_get_meta | ( | libvlc_media_t * | p_md, |
| libvlc_meta_t | e_meta ) |
Read the meta of the media.
Note, you need to parse using libvlc_parser_queue() or play the media at least once before calling this function. If the media has not yet been parsed this will return NULL.
| p_md | the media descriptor |
| e_meta | the meta to read |
References LIBVLC_API.
| LIBVLC_API char * libvlc_media_get_meta_extra | ( | libvlc_media_t * | p_md, |
| const char * | psz_name ) |
Read the meta extra of the media.
If the media has not yet been parsed this will return NULL.
| p_md | the media descriptor |
| psz_name | the meta extra to read (nonnullable) |
References LIBVLC_API, and psz_name.
| 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.
| p_md | the media descriptor |
| pppsz_names | the media's meta extra name array you can access the elements using the return value (count) must be released with libvlc_media_meta_extra_names_release() |
References LIBVLC_API.
| LIBVLC_API char * libvlc_media_get_mrl | ( | libvlc_media_t * | p_md | ) |
Get the media resource locator (mrl) from a media descriptor object.
| p_md | a media descriptor object |
References LIBVLC_API.
| 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.
| p_md | media descriptor object |
| p_stats | structure that contain the statistics about the media (this structure must be allocated by the caller) |
| true | statistics are available |
| false | otherwise |
References LIBVLC_API.
| 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.
| p_md | media descriptor object |
| type | type of the track list to request |
References LIBVLC_API, and libvlc_media_get_tracklist().
Referenced by libvlc_media_get_tracklist().
| LIBVLC_API libvlc_media_type_t libvlc_media_get_type | ( | libvlc_media_t * | p_md | ) |
Get the media type of the media descriptor object.
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_get_type().
Referenced by libvlc_media_get_type().
| LIBVLC_API void * libvlc_media_get_user_data | ( | libvlc_media_t * | p_md | ) |
Get media descriptor's user_data.
user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a libvlc_media_t pointer
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_get_user_data().
Referenced by libvlc_media_get_user_data().
| LIBVLC_API bool libvlc_media_is_parsed | ( | libvlc_media_t * | p_md | ) |
Whether the media has been parsed.
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_is_parsed().
Referenced by libvlc_media_is_parsed().
| LIBVLC_API void libvlc_media_meta_extra_names_release | ( | char ** | ppsz_names, |
| unsigned | i_count ) |
Release a media meta extra names.
| ppsz_names | meta extra names array to release |
| i_count | number of elements in the array |
References LIBVLC_API.
| 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.
| psz_name | the name of the node |
References LIBVLC_API, and psz_name.
| LIBVLC_API libvlc_media_t * libvlc_media_new_callbacks | ( | const struct libvlc_media_open_cbs * | cbs, |
| void * | cbs_opaque ) |
Create a media with custom callbacks to read the data from.
| cbs | callback to setup the media (can't be NULL). The pointed struct must be kept alive (and not modified) by the caller until all player instances that were supplied this media item are stopped. |
| cbs_opaque | opaque pointer for the open callback |
| LIBVLC_API libvlc_media_t * libvlc_media_new_fd | ( | int | fd | ) |
Create a media for an already open file descriptor.
The file descriptor shall be open for reading (or reading and writing).
Regular file descriptors, pipe read descriptors and character device descriptors (including TTYs) are supported on all platforms. Block device descriptors are supported where available. Directory descriptors are supported on systems that provide fdopendir(). Sockets are supported on all platforms where they are file descriptors, i.e. all except Windows.
| fd | open file descriptor |
References LIBVLC_API.
| 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.
| psz_mrl | the media location |
References LIBVLC_API.
| LIBVLC_API libvlc_media_t * libvlc_media_new_path | ( | const char * | path | ) |
Create a media for a certain file path.
| path | local filesystem path |
References LIBVLC_API.
| LIBVLC_API void libvlc_media_release | ( | libvlc_media_t * | p_md | ) |
Decrement the reference count of a media descriptor object.
If the reference count is 0, then libvlc_media_release() will release the media descriptor object. If the media descriptor object has been released it should not be used again.
| p_md | the media descriptor |
References LIBVLC_API.
| LIBVLC_API libvlc_media_t * libvlc_media_retain | ( | libvlc_media_t * | p_md | ) |
Retain a reference to a media descriptor object (libvlc_media_t).
Use libvlc_media_release() to decrement the reference count of a media descriptor object.
| p_md | the media descriptor |
References LIBVLC_API.
| LIBVLC_API int libvlc_media_save_meta | ( | libvlc_instance_t * | inst, |
| libvlc_media_t * | p_md ) |
Save the meta previously set.
| inst | LibVLC instance |
| p_md | the media descriptor |
References LIBVLC_API.
| 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 to save the meta).
| p_md | the media descriptor |
| e_meta | the meta to write |
| psz_value | the media's meta |
References LIBVLC_API, and psz_value.
| 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 to save the meta).
| p_md | the media descriptor |
| psz_name | the meta extra to write (nonnullable) |
| psz_value | the media's meta extra (nullable) Removed from meta extra if set to NULL |
References LIBVLC_API, psz_name, and psz_value.
| LIBVLC_API void libvlc_media_set_user_data | ( | libvlc_media_t * | p_md, |
| void * | p_new_user_data ) |
Sets media descriptor's user_data.
user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a libvlc_media_t pointer
| p_md | media descriptor object |
| p_new_user_data | pointer to user data |
References libvlc_media_set_user_data().
Referenced by libvlc_media_set_user_data().
| 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.
A slave is an external input source that may contains an additional subtitle track (like a .srt) or an additional audio track (like a .ac3).
| p_md | media descriptor object |
| i_type | subtitle or audio |
| i_priority | from 0 (low priority) to 4 (high priority) |
| psz_uri | Uri of the slave (should contain a valid scheme). |
References i_type, LIBVLC_API, and libvlc_media_slaves_add().
Referenced by libvlc_media_slaves_add().
| LIBVLC_API void libvlc_media_slaves_clear | ( | libvlc_media_t * | p_md | ) |
Clear all slaves previously added by libvlc_media_slaves_add() or internally.
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_slaves_clear().
Referenced by libvlc_media_slaves_clear().
| 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.
The list will contain slaves parsed by VLC or previously added by libvlc_media_slaves_add(). The typical use case of this function is to save a list of slave in a database for a later use.
| p_md | media descriptor object |
| ppp_slaves | address to store an allocated array of slaves (must be freed with libvlc_media_slaves_release()) [OUT] |
References LIBVLC_API, and libvlc_media_slaves_get().
Referenced by libvlc_media_slaves_get().
| LIBVLC_API void libvlc_media_slaves_release | ( | libvlc_media_slave_t ** | pp_slaves, |
| unsigned int | i_count ) |
Release a media descriptor's slave list.
| pp_slaves | slave array to release |
| i_count | number of elements in the array |
References libvlc_media_slaves_release().
Referenced by libvlc_media_slaves_release().
| LIBVLC_API struct libvlc_media_list_t * libvlc_media_subitems | ( | libvlc_media_t * | p_md | ) |
Get subitems of media descriptor object.
This will increment the reference count of supplied media descriptor object. Use libvlc_media_list_release() to decrement the reference counting.
| p_md | media descriptor object |
References LIBVLC_API, and libvlc_media_subitems().
Referenced by libvlc_media_subitems().