VLC  3.0.0-git
Modules | Files | Data Structures | Macros | Typedefs | Functions
VLC playlist internals
Collaboration diagram for VLC playlist internals:

Modules

 Playlist_NodeDeleteExplicit_flags
 Flags for playlist_NodeDeleteExplicit.
 

Files

file  playlist_internal.h
 VLC playlist internal interface.
 

Data Structures

struct  playlist_private_t
 

Macros

#define pl_priv(pl)   container_of(pl, playlist_private_t, public_data)
 
#define PLAYLIST_DEBUG   1
 
#define PL_DEBUG(...)   msg_Dbg( p_playlist, __VA_ARGS__ )
 
#define PL_DEBUG2(msg, ...)   {}
 
#define PLI_NAME(p)   p && p->p_input ? p->p_input->psz_name : "null"
 
#define PL_LOCK_IF(cond)   pl_lock_if( p_playlist, cond )
 
#define PL_UNLOCK_IF(cond)   pl_unlock_if( p_playlist, cond )
 

Typedefs

typedef struct vlc_sd_internal_t vlc_sd_internal_t
 
typedef struct playlist_private_t playlist_private_t
 

Functions

void playlist_ServicesDiscoveryKillAll (playlist_t *p_playlist)
 
playlist_tplaylist_Create (vlc_object_t *)
 Create playlist. More...
 
void playlist_Destroy (playlist_t *)
 Destroy playlist. More...
 
void playlist_Activate (playlist_t *)
 Creates the main playlist thread. More...
 
playlist_item_tplaylist_ItemNewFromInput (playlist_t *p_playlist, input_item_t *p_input)
 
playlist_item_tget_current_status_item (playlist_t *p_playlist)
 Accessor for status item and status nodes. More...
 
playlist_item_tget_current_status_node (playlist_t *p_playlist)
 
void set_current_status_item (playlist_t *, playlist_item_t *)
 
void set_current_status_node (playlist_t *, playlist_item_t *)
 
int playlist_MLLoad (playlist_t *p_playlist)
 
int playlist_MLDump (playlist_t *p_playlist)
 
void playlist_SendAddNotify (playlist_t *p_playlist, playlist_item_t *item)
 Send a notification that an item has been added to a node. More...
 
int playlist_InsertInputItemTree (playlist_t *, playlist_item_t *, input_item_node_t *, int, bool)
 Insert a tree of input items into a given playlist node. More...
 
int playlist_NodeInsert (playlist_item_t *, playlist_item_t *, int)
 
void playlist_NodeDeleteExplicit (playlist_t *, playlist_item_t *, int flags)
 Delete a node with explicit semantics. More...
 
void playlist_ItemRelease (playlist_t *, playlist_item_t *)
 Release an item. More...
 
void ResetCurrentlyPlaying (playlist_t *p_playlist, playlist_item_t *p_cur)
 Reset the currently playing playlist. More...
 
void ResyncCurrentIndex (playlist_t *p_playlist, playlist_item_t *p_cur)
 Synchronise the current index of the playlist to match the index of the current item. More...
 
playlist_item_tplaylist_GetNextLeaf (playlist_t *, playlist_item_t *p_root, playlist_item_t *p_item, bool b_ena, bool b_unplayed)
 Finds the next item to play. More...
 
static void pl_lock_if (playlist_t *p_playlist, bool cond)
 
static void pl_unlock_if (playlist_t *p_playlist, bool cond)
 

Detailed Description

Macro Definition Documentation

◆ PL_DEBUG

#define PL_DEBUG (   ...)    msg_Dbg( p_playlist, __VA_ARGS__ )

◆ PL_DEBUG2

#define PL_DEBUG2 (   msg,
  ... 
)    {}

◆ PL_LOCK_IF

#define PL_LOCK_IF (   cond)    pl_lock_if( p_playlist, cond )

◆ pl_priv

#define pl_priv (   pl)    container_of(pl, playlist_private_t, public_data)

◆ PL_UNLOCK_IF

#define PL_UNLOCK_IF (   cond)    pl_unlock_if( p_playlist, cond )

◆ PLAYLIST_DEBUG

#define PLAYLIST_DEBUG   1

◆ PLI_NAME

#define PLI_NAME (   p)    p && p->p_input ? p->p_input->psz_name : "null"

Typedef Documentation

◆ playlist_private_t

◆ vlc_sd_internal_t

Function Documentation

◆ get_current_status_item()

playlist_item_t* get_current_status_item ( playlist_t p_playlist)

Accessor for status item and status nodes.

References PL_ASSERT_LOCKED, and pl_priv.

Referenced by input_item_add_subitem_tree(), NextItem(), playlist_NodeDeleteExplicit(), and playlist_vaControl().

◆ get_current_status_node()

playlist_item_t* get_current_status_node ( playlist_t p_playlist)

References PL_ASSERT_LOCKED, and pl_priv.

Referenced by NextItem(), and playlist_vaControl().

◆ pl_lock_if()

static void pl_lock_if ( playlist_t p_playlist,
bool  cond 
)
inlinestatic

◆ pl_unlock_if()

static void pl_unlock_if ( playlist_t p_playlist,
bool  cond 
)
inlinestatic

◆ playlist_Activate()

void playlist_Activate ( playlist_t )

Creates the main playlist thread.

References msg_Err, pl_priv, Thread(), playlist_private_t::thread, vlc_clone(), and VLC_THREAD_PRIORITY_LOW.

Referenced by playlist_Create().

◆ playlist_Create()

playlist_t* playlist_Create ( vlc_object_t p_parent)

◆ playlist_Destroy()

void playlist_Destroy ( playlist_t p_playlist)

◆ playlist_GetNextLeaf()

playlist_item_t* playlist_GetNextLeaf ( playlist_t p_playlist,
playlist_item_t p_root,
playlist_item_t p_item,
bool  b_ena,
bool  b_unplayed 
)

Finds the next item to play.

Parameters
p_playlistthe playlist
p_rootthe root node
p_itemthe previous item (NULL if none )
Returns
the next item to play, or NULL if none found

References GetNextItem(), playlist_item_t::i_children, playlist_item_t::i_flags, playlist_item_t::i_nb_played, PL_ASSERT_LOCKED, PL_DEBUG2, PLAYLIST_DBL_FLAG, and PLI_NAME.

Referenced by NextItem(), and ResetCurrentlyPlaying().

◆ playlist_InsertInputItemTree()

int playlist_InsertInputItemTree ( playlist_t p_playlist,
playlist_item_t p_parent,
input_item_node_t p_node,
int  i_pos,
bool  b_flat 
)

Insert a tree of input items into a given playlist node.

Parameters
p_playlistthe playlist to insert into
p_parentthe receiving playlist node (can be an item)
p_nodethe root of input item tree, only it's contents will be inserted
i_posthe position in the playlist where to insert. If this is PLAYLIST_END the items will be added at the end of the playlist regardless of its size
b_flatTRUE if the new tree contents should be flattened into a list
Returns
the first new leaf inserted (in playing order)

References RecursiveAddIntoParent().

Referenced by input_item_add_subitem_tree(), and input_item_subitem_tree_added().

◆ playlist_ItemNewFromInput()

playlist_item_t* playlist_ItemNewFromInput ( playlist_t p_playlist,
input_item_t p_input 
)

◆ playlist_ItemRelease()

void playlist_ItemRelease ( playlist_t p_playlist,
playlist_item_t p_item 
)

◆ playlist_MLDump()

int playlist_MLDump ( playlist_t p_playlist)

< Unspecified error

< Unspecified error

< Unspecified error

< No error

< Unspecified error

< No error

References asprintf(), config_CreateDir(), config_GetUserDir(), DIR_SEP, getpid(), msg_Err, playlist_Export(), VLC_DATA_DIR, VLC_EGENERIC, vlc_rename(), vlc_strerror_c(), VLC_SUCCESS, and vlc_unlink().

Referenced by playlist_Destroy().

◆ playlist_MLLoad()

int playlist_MLLoad ( playlist_t p_playlist)

◆ playlist_NodeDeleteExplicit()

void playlist_NodeDeleteExplicit ( playlist_t ,
playlist_item_t ,
int  flags 
)

Delete a node with explicit semantics.

This function acts like playlist_NodeDelete with the advantage of the caller being able control some of the semantics of the function.

p_playlist the playlist where the node is to be deleted p_node the node to delete flags a bitfield consisting of Playlist_NodeDeleteExplicit_flags

< delete node even if read-only

< delete node even if read-only

< stop playlist playback if node is currently the one played

References ARRAY_BSEARCH, ARRAY_REMOVE, playlist_t::current, get_current_status_item(), playlist_item_t::i_children, playlist_item_t::i_flags, playlist_item_t::i_id, playlist_item_array_t::i_size, playlist_t::items, playlist_item_array_t::p_elems, playlist_item_t::p_input, playlist_item_t::p_parent, PL_ASSERT_LOCKED, PL_DEBUG, pl_Locked, pl_priv, playlist_Control(), PLAYLIST_DELETE_FORCE, PLAYLIST_DELETE_STOP_IF_CURRENT, playlist_ItemRelease(), PLAYLIST_RO_FLAG, PLAYLIST_STOP, playlist_item_t::pp_children, input_item_t::psz_name, set_current_status_item(), TAB_REMOVE, and var_SetAddress.

Referenced by input_item_add_subitem_tree(), playlist_Destroy(), playlist_NodeDelete(), playlist_sd_item_removed(), and playlist_ServicesDiscoveryInternalRemove().

◆ playlist_NodeInsert()

int playlist_NodeInsert ( playlist_item_t ,
playlist_item_t ,
int   
)

◆ playlist_SendAddNotify()

void playlist_SendAddNotify ( playlist_t p_playlist,
playlist_item_t item 
)

Send a notification that an item has been added to a node.

Parameters
p_playlistthe playlist object
i_item_idid of the item added
i_node_idid of the node in which the item was added
Returns
nothing

References playlist_private_t::b_reset_currently_playing, PL_ASSERT_LOCKED, pl_priv, playlist_private_t::signal, var_SetAddress, and vlc_cond_signal().

Referenced by playlist_NodeAddInput(), and playlist_NodeCreate().

◆ playlist_ServicesDiscoveryKillAll()

void playlist_ServicesDiscoveryKillAll ( playlist_t p_playlist)

◆ ResetCurrentlyPlaying()

void ResetCurrentlyPlaying ( playlist_t p_playlist,
playlist_item_t p_cur 
)

◆ ResyncCurrentIndex()

void ResyncCurrentIndex ( playlist_t p_playlist,
playlist_item_t p_cur 
)

Synchronise the current index of the playlist to match the index of the current item.

Parameters
p_playlistthe playlist structure
p_curthe current playlist item
Returns
nothing

References ARRAY_VAL, playlist_t::current, playlist_t::i_current_index, playlist_item_array_t::i_size, PL_ASSERT_LOCKED, PL_DEBUG, and PLI_NAME.

Referenced by Next(), NextItem(), and RandomCallback().

◆ set_current_status_item()

void set_current_status_item ( playlist_t ,
playlist_item_t  
)

◆ set_current_status_node()

void set_current_status_node ( playlist_t ,
playlist_item_t  
)

References PL_ASSERT_LOCKED, and pl_priv.

Referenced by NextItem(), and playlist_Destroy().