VLC 4.0.0-dev
Loading...
Searching...
No Matches
LibVLC media list

A LibVLC media list holds multiple libvlc_media_t media descriptors. More...

Collaboration diagram for LibVLC media list:

Files

file  libvlc_media_list.h
 LibVLC media list (playlist) external API.
 

Typedefs

typedef struct libvlc_media_list_t libvlc_media_list_t
 

Functions

LIBVLC_API libvlc_media_list_tlibvlc_media_list_new (void)
 Create an empty media list.
 
LIBVLC_API void libvlc_media_list_release (libvlc_media_list_t *p_ml)
 Release media list created with libvlc_media_list_new().
 
LIBVLC_API libvlc_media_list_tlibvlc_media_list_retain (libvlc_media_list_t *p_ml)
 Retain reference to a media list.
 
LIBVLC_API void libvlc_media_list_set_media (libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
 Associate media instance with this media list instance.
 
LIBVLC_API libvlc_media_tlibvlc_media_list_media (libvlc_media_list_t *p_ml)
 Get media instance from this media list instance.
 
LIBVLC_API int libvlc_media_list_add_media (libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
 Add media instance to media list The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API int libvlc_media_list_insert_media (libvlc_media_list_t *p_ml, libvlc_media_t *p_md, int i_pos)
 Insert media instance in media list on a position The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API int libvlc_media_list_remove_index (libvlc_media_list_t *p_ml, int i_pos)
 Remove media instance from media list on a position The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API int libvlc_media_list_count (libvlc_media_list_t *p_ml)
 Get count on media list items The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API libvlc_media_tlibvlc_media_list_item_at_index (libvlc_media_list_t *p_ml, int i_pos)
 List media instance in media list at a position The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API int libvlc_media_list_index_of_item (libvlc_media_list_t *p_ml, libvlc_media_t *p_md)
 Find index position of List media instance in media list.
 
LIBVLC_API bool libvlc_media_list_is_readonly (libvlc_media_list_t *p_ml)
 This indicates if this media list is read-only from a user point of view.
 
LIBVLC_API void libvlc_media_list_lock (libvlc_media_list_t *p_ml)
 Get lock on media list items.
 
LIBVLC_API void libvlc_media_list_unlock (libvlc_media_list_t *p_ml)
 Release lock on media list items The libvlc_media_list_lock should be held upon entering this function.
 
LIBVLC_API libvlc_event_manager_tlibvlc_media_list_event_manager (libvlc_media_list_t *p_ml)
 Get libvlc_event_manager from this media list instance.
 

Detailed Description

A LibVLC media list holds multiple libvlc_media_t media descriptors.

Typedef Documentation

◆ libvlc_media_list_t

Function Documentation

◆ libvlc_media_list_add_media()

LIBVLC_API int libvlc_media_list_add_media ( libvlc_media_list_t p_ml,
libvlc_media_t p_md 
)

Add media instance to media list The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
p_mda media instance
Returns
0 on success, -1 if the media list is read-only

◆ libvlc_media_list_count()

LIBVLC_API int libvlc_media_list_count ( libvlc_media_list_t p_ml)

Get count on media list items The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
Returns
number of items in media list

◆ libvlc_media_list_event_manager()

LIBVLC_API libvlc_event_manager_t * libvlc_media_list_event_manager ( libvlc_media_list_t p_ml)

Get libvlc_event_manager from this media list instance.

The p_event_manager is immutable, so you don't have to hold the lock

Parameters
p_mla media list instance
Returns
libvlc_event_manager

◆ libvlc_media_list_index_of_item()

LIBVLC_API int libvlc_media_list_index_of_item ( libvlc_media_list_t p_ml,
libvlc_media_t p_md 
)

Find index position of List media instance in media list.

Warning: the function will return the first matched position. The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
p_mdmedia instance
Returns
position of media instance or -1 if media not found

◆ libvlc_media_list_insert_media()

LIBVLC_API int libvlc_media_list_insert_media ( libvlc_media_list_t p_ml,
libvlc_media_t p_md,
int  i_pos 
)

Insert media instance in media list on a position The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
p_mda media instance
i_posposition in array where to insert
Returns
0 on success, -1 if the media list is read-only

◆ libvlc_media_list_is_readonly()

LIBVLC_API bool libvlc_media_list_is_readonly ( libvlc_media_list_t p_ml)

This indicates if this media list is read-only from a user point of view.

Parameters
p_mlmedia list instance
Return values
trueread-only
falseread/write

◆ libvlc_media_list_item_at_index()

LIBVLC_API libvlc_media_t * libvlc_media_list_item_at_index ( libvlc_media_list_t p_ml,
int  i_pos 
)

List media instance in media list at a position The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
i_posposition in array where to insert
Returns
media instance at position i_pos, or NULL if not found. In case of success, libvlc_media_retain() is called to increase the refcount on the media.

◆ libvlc_media_list_lock()

LIBVLC_API void libvlc_media_list_lock ( libvlc_media_list_t p_ml)

Get lock on media list items.

Parameters
p_mla media list instance

◆ libvlc_media_list_media()

LIBVLC_API libvlc_media_t * libvlc_media_list_media ( libvlc_media_list_t p_ml)

Get media instance from this media list instance.

This action will increase the refcount on the media instance. The libvlc_media_list_lock should NOT be held upon entering this function.

Parameters
p_mla media list instance
Returns
media instance

◆ libvlc_media_list_new()

LIBVLC_API libvlc_media_list_t * libvlc_media_list_new ( void  )

Create an empty media list.

Returns
empty media list, or NULL on error

◆ libvlc_media_list_release()

LIBVLC_API void libvlc_media_list_release ( libvlc_media_list_t p_ml)

Release media list created with libvlc_media_list_new().

Parameters
p_mla media list created with libvlc_media_list_new()

◆ libvlc_media_list_remove_index()

LIBVLC_API int libvlc_media_list_remove_index ( libvlc_media_list_t p_ml,
int  i_pos 
)

Remove media instance from media list on a position The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance
i_posposition in array where to insert
Returns
0 on success, -1 if the list is read-only or the item was not found

◆ libvlc_media_list_retain()

LIBVLC_API libvlc_media_list_t * libvlc_media_list_retain ( libvlc_media_list_t p_ml)

Retain reference to a media list.

Parameters
p_mla media list created with libvlc_media_list_new()
Returns
the same object

◆ libvlc_media_list_set_media()

LIBVLC_API void libvlc_media_list_set_media ( libvlc_media_list_t p_ml,
libvlc_media_t p_md 
)

Associate media instance with this media list instance.

If another media instance was present it will be released. The libvlc_media_list_lock should NOT be held upon entering this function.

Parameters
p_mla media list instance
p_mdmedia instance to add

◆ libvlc_media_list_unlock()

LIBVLC_API void libvlc_media_list_unlock ( libvlc_media_list_t p_ml)

Release lock on media list items The libvlc_media_list_lock should be held upon entering this function.

Parameters
p_mla media list instance