Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __LIBVLC_PLAYLIST_INTERNAL_H
00026 # define __LIBVLC_PLAYLIST_INTERNAL_H 1
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "input/input_interface.h"
00038 #include <assert.h>
00039
00040 #include "art.h"
00041 #include "fetcher.h"
00042 #include "preparser.h"
00043
00044 typedef struct vlc_sd_internal_t vlc_sd_internal_t;
00045
00046 typedef struct playlist_private_t
00047 {
00048 playlist_t public_data;
00049 playlist_preparser_t *p_preparser;
00050 playlist_fetcher_t *p_fetcher;
00051
00052 playlist_item_array_t items_to_delete;
00053
00054
00055 vlc_sd_internal_t **pp_sds;
00056 int i_sds;
00057 input_thread_t * p_input;
00058
00059 input_resource_t * p_input_resource;
00060 struct {
00061
00062
00063 playlist_status_t i_status;
00064 playlist_item_t * p_item;
00065 playlist_item_t * p_node;
00066 } status;
00067
00068 struct {
00069
00070 playlist_status_t i_status;
00071 playlist_item_t * p_node;
00072 playlist_item_t * p_item;
00073
00074 int i_skip;
00075
00076 bool b_request;
00077
00078
00079 vlc_mutex_t lock;
00080 } request;
00081
00082 vlc_thread_t thread;
00083 vlc_mutex_t lock;
00084 vlc_cond_t signal;
00085
00086 int i_last_playlist_id;
00087 bool b_reset_currently_playing;
00088
00089 bool b_tree;
00090 bool b_doing_ml;
00091 bool b_auto_preparse;
00092 mtime_t last_rebuild_date;
00093
00094 } playlist_private_t;
00095
00096 #define pl_priv( pl ) ((playlist_private_t *)(pl))
00097
00098
00099
00100
00101
00102
00103 playlist_t *playlist_Create( vlc_object_t * );
00104 void playlist_Destroy( playlist_t * );
00105
00106
00107 void playlist_Activate( playlist_t * );
00108 void playlist_Deactivate( playlist_t * );
00109 void pl_Deactivate (libvlc_int_t *);
00110
00111
00112 playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
00113 input_item_t *p_input );
00114
00115
00116 playlist_item_t * get_current_status_item( playlist_t * p_playlist);
00117 playlist_item_t * get_current_status_node( playlist_t * p_playlist );
00118 void set_current_status_item( playlist_t *, playlist_item_t * );
00119 void set_current_status_node( playlist_t *, playlist_item_t * );
00120
00121
00122 int playlist_MLLoad( playlist_t *p_playlist );
00123 int playlist_MLDump( playlist_t *p_playlist );
00124
00125
00126
00127
00128
00129 void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
00130 int i_node_id, bool b_signal );
00131
00132 playlist_item_t * playlist_NodeAddInput( playlist_t *, input_item_t *,
00133 playlist_item_t *,int , int, bool );
00134
00135 int playlist_InsertInputItemTree ( playlist_t *,
00136 playlist_item_t *, input_item_node_t *, int, bool );
00137
00138
00139 playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
00140 input_item_t *p_input, playlist_item_t *p_root,
00141 bool );
00142
00143 int playlist_DeleteFromInputInParent( playlist_t *, input_item_t *,
00144 playlist_item_t *, bool );
00145 int playlist_DeleteFromItemId( playlist_t*, int );
00146 int playlist_ItemRelease( playlist_item_t * );
00147
00148 int playlist_NodeEmpty( playlist_t *, playlist_item_t *, bool );
00149 int playlist_DeleteItem( playlist_t * p_playlist, playlist_item_t *, bool);
00150
00151
00152
00153
00154
00155
00156 #define PLAYLIST_DEBUG 1
00157
00158
00159 #ifdef PLAYLIST_DEBUG
00160 #define PL_DEBUG( msg, args... ) msg_Dbg( p_playlist, msg, ## args )
00161 #ifdef PLAYLIST_DEBUG2
00162 #define PL_DEBUG2( msg, args... ) msg_Dbg( p_playlist, msg, ## args )
00163 #else
00164 #define PL_DEBUG2( msg, args... ) {}
00165 #endif
00166 #else
00167 #define PL_DEBUG( msg, args ... ) {}
00168 #define PL_DEBUG2( msg, args... ) {}
00169 #endif
00170
00171 #define PLI_NAME( p ) p && p->p_input ? p->p_input->psz_name : "null"
00172
00173 #define PL_LOCK_IF( cond ) pl_lock_if( p_playlist, cond )
00174 static inline void pl_lock_if( playlist_t * p_playlist, bool cond )
00175 {
00176 if( cond ) PL_LOCK; else PL_ASSERT_LOCKED;
00177 }
00178
00179 #define PL_UNLOCK_IF( cond ) pl_unlock_if( p_playlist, cond )
00180 static inline void pl_unlock_if( playlist_t * p_playlist, bool cond )
00181 {
00182 if( cond ) PL_UNLOCK;
00183 }
00184
00185 #endif