VLC 4.0.0-dev
media_tree.c File Reference
Include dependency graph for media_tree.c:

Data Structures

struct  vlc_media_tree_listener_id
 
struct  media_tree_private_t
 

Macros

#define mt_priv(mt)   container_of(mt, media_tree_private_t, public_data)
 
#define vlc_media_tree_listener_foreach(listener, tree)    vlc_list_foreach(listener, &mt_priv(tree)->listeners, node)
 
#define vlc_media_tree_NotifyListener(tree, listener, event, ...)
 
#define vlc_media_tree_Notify(tree, event, ...)
 

Functions

vlc_media_tree_tvlc_media_tree_New (void)
 Create an empty media tree. More...
 
static void vlc_media_tree_AssertLocked (vlc_media_tree_t *tree)
 
static bool vlc_media_tree_FindNodeByMedia (input_item_node_t *parent, const input_item_t *media, input_item_node_t **result, input_item_node_t **result_parent)
 
static input_item_node_tvlc_media_tree_AddChild (input_item_node_t *parent, input_item_t *media)
 
static void vlc_media_tree_AddSubtree (input_item_node_t *to, input_item_node_t *from)
 
static void vlc_media_tree_ClearChildren (input_item_node_t *root)
 
static void media_subtree_changed (input_item_t *media, input_item_node_t *node, void *userdata)
 
static void media_subtree_preparse_ended (input_item_t *media, enum input_item_preparse_status status, void *user_data)
 
static void vlc_media_tree_DestroyRootNode (vlc_media_tree_t *tree)
 
static void vlc_media_tree_Delete (vlc_media_tree_t *tree)
 
void vlc_media_tree_Hold (vlc_media_tree_t *tree)
 Increase the media tree reference count. More...
 
void vlc_media_tree_Release (vlc_media_tree_t *tree)
 Decrease the media tree reference count. More...
 
void vlc_media_tree_Lock (vlc_media_tree_t *tree)
 Lock the media tree (non-recursive). More...
 
void vlc_media_tree_Unlock (vlc_media_tree_t *tree)
 Unlock the media tree. More...
 
static void vlc_media_tree_NotifyCurrentState (vlc_media_tree_t *tree, vlc_media_tree_listener_id *listener)
 
vlc_media_tree_listener_idvlc_media_tree_AddListener (vlc_media_tree_t *tree, const struct vlc_media_tree_callbacks *cbs, void *userdata, bool notify_current_state)
 Add a listener. More...
 
void vlc_media_tree_RemoveListener (vlc_media_tree_t *tree, vlc_media_tree_listener_id *listener)
 Remove a listener. More...
 
input_item_node_tvlc_media_tree_Add (vlc_media_tree_t *tree, input_item_node_t *parent, input_item_t *media)
 Add an item to the media tree. More...
 
bool vlc_media_tree_Find (vlc_media_tree_t *tree, const input_item_t *media, input_item_node_t **result, input_item_node_t **result_parent)
 Find the node containing the requested input item (and its parent). More...
 
bool vlc_media_tree_Remove (vlc_media_tree_t *tree, input_item_t *media)
 Remove an item from the media tree. More...
 
void vlc_media_tree_Preparse (vlc_media_tree_t *tree, libvlc_int_t *libvlc, input_item_t *media, void *id)
 Preparse a media, and expand it in the media tree on subitems added. More...
 
void vlc_media_tree_PreparseCancel (libvlc_int_t *libvlc, void *id)
 Cancel a media tree preparse request. More...
 

Variables

static const struct vlc_metadata_cbs preparser_callbacks
 

Macro Definition Documentation

◆ mt_priv

#define mt_priv (   mt)    container_of(mt, media_tree_private_t, public_data)

◆ vlc_media_tree_listener_foreach

#define vlc_media_tree_listener_foreach (   listener,
  tree 
)     vlc_list_foreach(listener, &mt_priv(tree)->listeners, node)

◆ vlc_media_tree_Notify

#define vlc_media_tree_Notify (   tree,
  event,
  ... 
)
Value:
do { \
vlc_media_tree_AssertLocked(tree); \
vlc_media_tree_listener_id *listener; \
vlc_media_tree_listener_foreach(listener, tree) \
vlc_media_tree_NotifyListener(tree, listener, event, ##__VA_ARGS__); \
} while (0)

◆ vlc_media_tree_NotifyListener

#define vlc_media_tree_NotifyListener (   tree,
  listener,
  event,
  ... 
)
Value:
do { \
if (listener->cbs->event) \
listener->cbs->event(tree, ##__VA_ARGS__, listener->userdata); \
} while(0)

Function Documentation

◆ media_subtree_changed()

◆ media_subtree_preparse_ended()

static void media_subtree_preparse_ended ( input_item_t media,
enum input_item_preparse_status  status,
void *  user_data 
)
static

◆ vlc_media_tree_AddChild()

static input_item_node_t * vlc_media_tree_AddChild ( input_item_node_t parent,
input_item_t media 
)
static

◆ vlc_media_tree_AddSubtree()

◆ vlc_media_tree_AssertLocked()

static void vlc_media_tree_AssertLocked ( vlc_media_tree_t tree)
inlinestatic

◆ vlc_media_tree_ClearChildren()

static void vlc_media_tree_ClearChildren ( input_item_node_t root)
static

◆ vlc_media_tree_Delete()

static void vlc_media_tree_Delete ( vlc_media_tree_t tree)
static

◆ vlc_media_tree_DestroyRootNode()

static void vlc_media_tree_DestroyRootNode ( vlc_media_tree_t tree)
inlinestatic

◆ vlc_media_tree_FindNodeByMedia()

◆ vlc_media_tree_NotifyCurrentState()

static void vlc_media_tree_NotifyCurrentState ( vlc_media_tree_t tree,
vlc_media_tree_listener_id listener 
)
static

Variable Documentation

◆ preparser_callbacks

const struct vlc_metadata_cbs preparser_callbacks
static
Initial value:
= {
.on_subtree_added = media_subtree_changed,
.on_preparse_ended = media_subtree_preparse_ended
}
static void media_subtree_changed(input_item_t *media, input_item_node_t *node, void *userdata)
Definition: media_tree.c:149
static void media_subtree_preparse_ended(input_item_t *media, enum input_item_preparse_status status, void *user_data)
Definition: media_tree.c:172

Referenced by vlc_media_tree_Preparse().