Update Changelogs
[vlc.git] / lib / libvlc_internal.h
blob154780895f9ada93a909760c918b79a1a8439de6
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 VLC authors and VideoLAN
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _LIBVLC_INTERNAL_H
25 #define _LIBVLC_INTERNAL_H 1
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc/libvlc.h>
32 #include <vlc/libvlc_dialog.h>
33 #include <vlc/libvlc_picture.h>
34 #include <vlc/libvlc_media.h>
35 #include <vlc/libvlc_events.h>
36 #include <vlc_atomic.h>
38 #include <vlc_common.h>
40 /* Note well: this header is included from LibVLC core.
41 * Therefore, static inline functions MUST NOT call LibVLC functions here
42 * (this can cause linkage failure on some platforms). */
44 /***************************************************************************
45 * Internal creation and destruction functions
46 ***************************************************************************/
47 VLC_API libvlc_int_t *libvlc_InternalCreate( void );
48 VLC_API int libvlc_InternalInit( libvlc_int_t *, int, const char *ppsz_argv[] );
49 VLC_API void libvlc_InternalCleanup( libvlc_int_t * );
50 VLC_API void libvlc_InternalDestroy( libvlc_int_t * );
52 VLC_API int libvlc_InternalAddIntf( libvlc_int_t *, const char * );
53 VLC_API void libvlc_InternalPlay( libvlc_int_t * );
54 VLC_API void libvlc_InternalWait( libvlc_int_t * );
55 VLC_API void libvlc_SetExitHandler( libvlc_int_t *, void (*) (void *), void * );
57 /***************************************************************************
58 * Opaque structures for libvlc API
59 ***************************************************************************/
61 struct libvlc_instance_t
63 libvlc_int_t *p_libvlc_int;
64 vlc_atomic_rc_t ref_count;
65 struct libvlc_callback_entry_list_t *p_callback_list;
66 struct
68 void (*cb) (void *, int, const libvlc_log_t *, const char *, va_list);
69 void *data;
70 } log;
71 struct
73 libvlc_dialog_cbs cbs;
74 void *data;
75 } dialog;
78 struct libvlc_event_manager_t
80 void * p_obj;
81 vlc_array_t listeners;
82 vlc_mutex_t lock;
85 /***************************************************************************
86 * Other internal functions
87 ***************************************************************************/
89 /* Thread context */
90 void libvlc_threads_init (void);
91 void libvlc_threads_deinit (void);
93 /* Events */
94 void libvlc_event_manager_init(libvlc_event_manager_t *, void *);
95 void libvlc_event_manager_destroy(libvlc_event_manager_t *);
97 void libvlc_event_send(
98 libvlc_event_manager_t * p_em,
99 libvlc_event_t * p_event );
101 static inline libvlc_time_t from_mtime(vlc_tick_t time)
103 return (time + 500ULL)/ 1000ULL;
106 static inline vlc_tick_t to_mtime(libvlc_time_t time)
108 return VLC_TICK_FROM_MS(time);
111 #endif