VLC 4.0.0-dev
Loading...
Searching...
No Matches
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.
 
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, int 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.
 
void vlc_media_tree_Release (vlc_media_tree_t *tree)
 Decrease the media tree reference count.
 
void vlc_media_tree_Lock (vlc_media_tree_t *tree)
 Lock the media tree (non-recursive).
 
void vlc_media_tree_Unlock (vlc_media_tree_t *tree)
 Unlock the media tree.
 
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.
 
void vlc_media_tree_RemoveListener (vlc_media_tree_t *tree, vlc_media_tree_listener_id *listener)
 Remove a listener.
 
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.
 
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).
 
bool vlc_media_tree_Remove (vlc_media_tree_t *tree, input_item_t *media)
 Remove an item from the media tree.
 
vlc_preparser_req_id vlc_media_tree_Preparse (vlc_media_tree_t *tree, vlc_preparser_t *parser, input_item_t *media)
 Preparse a media, and expand it in the media tree on subitems added.
 

Variables

static const input_item_parser_cbs_t 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_foreach(listener, tree) \
vlc_media_tree_NotifyListener(tree, listener, event, ##__VA_ARGS__); \
} while (0)
Definition media_tree.c:37

◆ 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,
int  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()

static void vlc_media_tree_AddSubtree ( input_item_node_t to,
input_item_node_t from 
)
static

◆ 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 input_item_parser_cbs_t preparser_callbacks
static
Initial value:
= {
.on_subtree_added = media_subtree_changed,
}
static void media_subtree_changed(input_item_t *media, input_item_node_t *node, void *userdata)
Definition media_tree.c:150
static void media_subtree_preparse_ended(input_item_t *media, int status, void *user_data)
Definition media_tree.c:173

Referenced by vlc_media_tree_Preparse().