1 /*****************************************************************************
2 * libvlc_internal.h : Definition of opaque structures for libvlc exported API
3 * Also contains some internal utility functions
4 *****************************************************************************
5 * Copyright (C) 2005-2009 the VideoLAN team
8 * Authors: Clément Stenac <zorglub@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _LIBVLC_INTERNAL_H
26 #define _LIBVLC_INTERNAL_H 1
32 #include <vlc/libvlc_structures.h>
33 #include <vlc/libvlc.h>
34 #include <vlc/libvlc_media.h>
35 #include <vlc/libvlc_events.h>
37 #include <vlc_common.h>
39 /***************************************************************************
40 * Internal creation and destruction functions
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 (void, libvlc_InternalCleanup, ( libvlc_int_t * ) );
45 VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) );
47 VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) );
48 VLC_EXPORT (void, libvlc_InternalWait, ( libvlc_int_t * ) );
50 /***************************************************************************
51 * Opaque structures for libvlc API
52 ***************************************************************************/
54 typedef enum libvlc_lock_state_t
58 } libvlc_lock_state_t;
60 struct libvlc_instance_t
62 libvlc_int_t *p_libvlc_int;
64 libvlc_event_manager_t *p_event_manager;
65 int b_playlist_locked;
68 vlc_mutex_t instance_lock;
69 vlc_mutex_t event_callback_lock;
70 struct libvlc_callback_entry_list_t *p_callback_list;
74 /***************************************************************************
75 * Other internal functions
76 ***************************************************************************/
79 libvlc_event_manager_t * libvlc_event_manager_new(
80 void * p_obj, libvlc_instance_t * p_libvlc_inst,
81 libvlc_exception_t *p_e );
83 void libvlc_event_manager_release(
84 libvlc_event_manager_t * p_em );
86 void libvlc_event_manager_register_event_type(
87 libvlc_event_manager_t * p_em,
88 libvlc_event_type_t event_type,
89 libvlc_exception_t * p_e );
91 void libvlc_event_send(
92 libvlc_event_manager_t * p_em,
93 libvlc_event_t * p_event );
95 void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager,
96 libvlc_event_type_t event_type,
97 libvlc_callback_t pf_callback,
99 libvlc_exception_t *p_e );
101 /* Exception shorcuts */
103 #define RAISENULL( ... ) { libvlc_exception_raise( p_e, __VA_ARGS__ ); \
105 #define RAISEVOID( ... ) { libvlc_exception_raise( p_e, __VA_ARGS__ ); \
107 #define RAISEZERO( ... ) { libvlc_exception_raise( p_e, __VA_ARGS__ ); \