| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
#ifndef _LIBVLC_INTERNAL_H |
|---|
| 26 |
#define _LIBVLC_INTERNAL_H 1 |
|---|
| 27 |
|
|---|
| 28 |
#ifdef HAVE_CONFIG_H |
|---|
| 29 |
# include "config.h" |
|---|
| 30 |
#endif |
|---|
| 31 |
|
|---|
| 32 |
#include <vlc/vlc.h> |
|---|
| 33 |
#include <vlc/libvlc_structures.h> |
|---|
| 34 |
|
|---|
| 35 |
#include <vlc_common.h> |
|---|
| 36 |
#include <vlc_arrays.h> |
|---|
| 37 |
#include <vlc_input.h> |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) ); |
|---|
| 43 |
VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) ); |
|---|
| 44 |
VLC_EXPORT (int, libvlc_InternalCleanup, ( libvlc_int_t * ) ); |
|---|
| 45 |
VLC_EXPORT (int, libvlc_InternalDestroy, ( libvlc_int_t * ) ); |
|---|
| 46 |
|
|---|
| 47 |
VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) ); |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
typedef int * libvlc_media_list_path_t; |
|---|
| 54 |
|
|---|
| 55 |
typedef enum libvlc_lock_state_t |
|---|
| 56 |
{ |
|---|
| 57 |
libvlc_Locked, |
|---|
| 58 |
libvlc_UnLocked |
|---|
| 59 |
} libvlc_lock_state_t; |
|---|
| 60 |
|
|---|
| 61 |
struct libvlc_instance_t |
|---|
| 62 |
{ |
|---|
| 63 |
libvlc_int_t *p_libvlc_int; |
|---|
| 64 |
vlm_t *p_vlm; |
|---|
| 65 |
int b_playlist_locked; |
|---|
| 66 |
unsigned ref_count; |
|---|
| 67 |
vlc_mutex_t instance_lock; |
|---|
| 68 |
vlc_mutex_t event_callback_lock; |
|---|
| 69 |
struct libvlc_callback_entry_list_t *p_callback_list; |
|---|
| 70 |
}; |
|---|
| 71 |
|
|---|
| 72 |
struct libvlc_media_t |
|---|
| 73 |
{ |
|---|
| 74 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 75 |
int b_preparsed; |
|---|
| 76 |
input_item_t *p_input_item; |
|---|
| 77 |
int i_refcount; |
|---|
| 78 |
libvlc_instance_t *p_libvlc_instance; |
|---|
| 79 |
libvlc_state_t state; |
|---|
| 80 |
struct libvlc_media_list_t *p_subitems; |
|---|
| 81 |
* Sub item */ |
|---|
| 82 |
void *p_user_data; |
|---|
| 83 |
}; |
|---|
| 84 |
|
|---|
| 85 |
struct libvlc_media_list_t |
|---|
| 86 |
{ |
|---|
| 87 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 88 |
libvlc_instance_t * p_libvlc_instance; |
|---|
| 89 |
int i_refcount; |
|---|
| 90 |
vlc_mutex_t object_lock; |
|---|
| 91 |
libvlc_media_t * p_md; |
|---|
| 92 |
|
|---|
| 93 |
vlc_array_t items; |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
libvlc_media_list_t * p_flat_mlist; |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
bool b_read_only; |
|---|
| 102 |
}; |
|---|
| 103 |
|
|---|
| 104 |
typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ; |
|---|
| 105 |
typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ; |
|---|
| 106 |
|
|---|
| 107 |
typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv, |
|---|
| 108 |
libvlc_exception_t * ) ; |
|---|
| 109 |
|
|---|
| 110 |
typedef libvlc_media_t * |
|---|
| 111 |
(*libvlc_media_list_view_item_at_index_func_t)( |
|---|
| 112 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 113 |
int index, |
|---|
| 114 |
libvlc_exception_t * ) ; |
|---|
| 115 |
|
|---|
| 116 |
typedef libvlc_media_list_view_t * |
|---|
| 117 |
(*libvlc_media_list_view_children_at_index_func_t)( |
|---|
| 118 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 119 |
int index, |
|---|
| 120 |
libvlc_exception_t * ) ; |
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
struct libvlc_media_list_view_t |
|---|
| 124 |
{ |
|---|
| 125 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 126 |
libvlc_instance_t * p_libvlc_instance; |
|---|
| 127 |
int i_refcount; |
|---|
| 128 |
vlc_mutex_t object_lock; |
|---|
| 129 |
|
|---|
| 130 |
libvlc_media_list_t * p_mlist; |
|---|
| 131 |
|
|---|
| 132 |
struct libvlc_media_list_view_private_t * p_this_view_data; |
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
libvlc_media_list_view_count_func_t pf_count; |
|---|
| 136 |
libvlc_media_list_view_item_at_index_func_t pf_item_at_index; |
|---|
| 137 |
libvlc_media_list_view_children_at_index_func_t pf_children_at_index; |
|---|
| 138 |
|
|---|
| 139 |
libvlc_media_list_view_constructor_func_t pf_constructor; |
|---|
| 140 |
libvlc_media_list_view_release_func_t pf_release; |
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
void (*pf_ml_item_added)(const libvlc_event_t *, libvlc_media_list_view_t *); |
|---|
| 144 |
void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *); |
|---|
| 145 |
}; |
|---|
| 146 |
|
|---|
| 147 |
struct libvlc_media_player_t |
|---|
| 148 |
{ |
|---|
| 149 |
int i_refcount; |
|---|
| 150 |
vlc_mutex_t object_lock; |
|---|
| 151 |
input_thread_t * p_input_thread; |
|---|
| 152 |
struct libvlc_instance_t * p_libvlc_instance; |
|---|
| 153 |
libvlc_media_t * p_md; |
|---|
| 154 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 155 |
libvlc_drawable_t drawable; |
|---|
| 156 |
|
|---|
| 157 |
bool b_own_its_input_thread; |
|---|
| 158 |
}; |
|---|
| 159 |
|
|---|
| 160 |
struct libvlc_media_list_player_t |
|---|
| 161 |
{ |
|---|
| 162 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 163 |
libvlc_instance_t * p_libvlc_instance; |
|---|
| 164 |
int i_refcount; |
|---|
| 165 |
vlc_mutex_t object_lock; |
|---|
| 166 |
libvlc_media_list_path_t current_playing_item_path; |
|---|
| 167 |
libvlc_media_t * p_current_playing_item; |
|---|
| 168 |
libvlc_media_list_t * p_mlist; |
|---|
| 169 |
libvlc_media_player_t * p_mi; |
|---|
| 170 |
}; |
|---|
| 171 |
|
|---|
| 172 |
struct libvlc_media_library_t |
|---|
| 173 |
{ |
|---|
| 174 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 175 |
libvlc_instance_t * p_libvlc_instance; |
|---|
| 176 |
int i_refcount; |
|---|
| 177 |
libvlc_media_list_t * p_mlist; |
|---|
| 178 |
}; |
|---|
| 179 |
|
|---|
| 180 |
struct libvlc_media_discoverer_t |
|---|
| 181 |
{ |
|---|
| 182 |
libvlc_event_manager_t * p_event_manager; |
|---|
| 183 |
libvlc_instance_t * p_libvlc_instance; |
|---|
| 184 |
services_discovery_t * p_sd; |
|---|
| 185 |
libvlc_media_list_t * p_mlist; |
|---|
| 186 |
bool running; |
|---|
| 187 |
vlc_dictionary_t catname_to_submedialist; |
|---|
| 188 |
}; |
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
|
|---|
| 229 |
typedef struct libvlc_event_listener_t |
|---|
| 230 |
{ |
|---|
| 231 |
libvlc_event_type_t event_type; |
|---|
| 232 |
void * p_user_data; |
|---|
| 233 |
libvlc_callback_t pf_callback; |
|---|
| 234 |
} libvlc_event_listener_t; |
|---|
| 235 |
|
|---|
| 236 |
typedef struct libvlc_event_listeners_group_t |
|---|
| 237 |
{ |
|---|
| 238 |
libvlc_event_type_t event_type; |
|---|
| 239 |
vlc_array_t listeners; |
|---|
| 240 |
bool b_sublistener_removed; |
|---|
| 241 |
} libvlc_event_listeners_group_t; |
|---|
| 242 |
|
|---|
| 243 |
typedef struct libvlc_event_manager_t |
|---|
| 244 |
{ |
|---|
| 245 |
void * p_obj; |
|---|
| 246 |
struct libvlc_instance_t * p_libvlc_instance; |
|---|
| 247 |
vlc_array_t listeners_groups; |
|---|
| 248 |
vlc_mutex_t object_lock; |
|---|
| 249 |
vlc_mutex_t event_sending_lock; |
|---|
| 250 |
} libvlc_event_sender_t; |
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 |
input_thread_t *libvlc_get_input_thread( |
|---|
| 257 |
libvlc_media_player_t *, |
|---|
| 258 |
libvlc_exception_t * ); |
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
libvlc_media_player_t * |
|---|
| 262 |
libvlc_media_player_new_from_input_thread( libvlc_instance_t *, |
|---|
| 263 |
input_thread_t *, |
|---|
| 264 |
libvlc_exception_t * ); |
|---|
| 265 |
|
|---|
| 266 |
void libvlc_media_player_destroy( |
|---|
| 267 |
libvlc_media_player_t * ); |
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 |
libvlc_media_t * libvlc_media_new_from_input_item( |
|---|
| 271 |
libvlc_instance_t *, input_item_t *, |
|---|
| 272 |
libvlc_exception_t * ); |
|---|
| 273 |
|
|---|
| 274 |
void libvlc_media_set_state( |
|---|
| 275 |
libvlc_media_t *, libvlc_state_t, |
|---|
| 276 |
libvlc_exception_t * ); |
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 |
void _libvlc_media_list_add_media( |
|---|
| 280 |
libvlc_media_list_t * p_mlist, |
|---|
| 281 |
libvlc_media_t * p_md, |
|---|
| 282 |
libvlc_exception_t * p_e ); |
|---|
| 283 |
|
|---|
| 284 |
void _libvlc_media_list_insert_media( |
|---|
| 285 |
libvlc_media_list_t * p_mlist, |
|---|
| 286 |
libvlc_media_t * p_md, int index, |
|---|
| 287 |
libvlc_exception_t * p_e ); |
|---|
| 288 |
|
|---|
| 289 |
void _libvlc_media_list_remove_index( |
|---|
| 290 |
libvlc_media_list_t * p_mlist, int index, |
|---|
| 291 |
libvlc_exception_t * p_e ); |
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
libvlc_media_list_view_t * libvlc_media_list_view_new( |
|---|
| 295 |
libvlc_media_list_t * p_mlist, |
|---|
| 296 |
libvlc_media_list_view_count_func_t pf_count, |
|---|
| 297 |
libvlc_media_list_view_item_at_index_func_t pf_item_at_index, |
|---|
| 298 |
libvlc_media_list_view_children_at_index_func_t pf_children_at_index, |
|---|
| 299 |
libvlc_media_list_view_constructor_func_t pf_constructor, |
|---|
| 300 |
libvlc_media_list_view_release_func_t pf_release, |
|---|
| 301 |
void * this_view_data, |
|---|
| 302 |
libvlc_exception_t * p_e ); |
|---|
| 303 |
|
|---|
| 304 |
void libvlc_media_list_view_set_ml_notification_callback( |
|---|
| 305 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 306 |
void (*item_added)(const libvlc_event_t *, libvlc_media_list_view_t *), |
|---|
| 307 |
void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) ); |
|---|
| 308 |
|
|---|
| 309 |
void libvlc_media_list_view_will_delete_item( |
|---|
| 310 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 311 |
libvlc_media_t * p_item, int index ); |
|---|
| 312 |
|
|---|
| 313 |
void libvlc_media_list_view_item_deleted( |
|---|
| 314 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 315 |
libvlc_media_t * p_item, int index ); |
|---|
| 316 |
|
|---|
| 317 |
void libvlc_media_list_view_will_add_item ( |
|---|
| 318 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 319 |
libvlc_media_t * p_item, int index ); |
|---|
| 320 |
|
|---|
| 321 |
void libvlc_media_list_view_item_added( |
|---|
| 322 |
libvlc_media_list_view_t * p_mlv, |
|---|
| 323 |
libvlc_media_t * p_item, int index ); |
|---|
| 324 |
|
|---|
| 325 |
|
|---|
| 326 |
libvlc_event_manager_t * libvlc_event_manager_new( |
|---|
| 327 |
void * p_obj, libvlc_instance_t * p_libvlc_inst, |
|---|
| 328 |
libvlc_exception_t *p_e ); |
|---|
| 329 |
|
|---|
| 330 |
void libvlc_event_manager_release( |
|---|
| 331 |
libvlc_event_manager_t * p_em ); |
|---|
| 332 |
|
|---|
| 333 |
void libvlc_event_manager_register_event_type( |
|---|
| 334 |
libvlc_event_manager_t * p_em, |
|---|
| 335 |
libvlc_event_type_t event_type, |
|---|
| 336 |
libvlc_exception_t * p_e ); |
|---|
| 337 |
|
|---|
| 338 |
void libvlc_event_send( |
|---|
| 339 |
libvlc_event_manager_t * p_em, |
|---|
| 340 |
libvlc_event_t * p_event ); |
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
#define RAISENULL( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ |
|---|
| 346 |
return NULL; } |
|---|
| 347 |
#define RAISEVOID( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ |
|---|
| 348 |
return; } |
|---|
| 349 |
#define RAISEZERO( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ |
|---|
| 350 |
return 0; } |
|---|
| 351 |
|
|---|
| 352 |
#endif |
|---|