Update NEWS with new supported codecs.
[vlc/solaris.git] / lib / libvlc_internal.h
blobc3a081d358f157fb5120bd375320492d0a7c7cb0
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
6 * $Id$
8 * Authors: Clément Stenac <zorglub@videolan.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _LIBVLC_INTERNAL_H
26 #define _LIBVLC_INTERNAL_H 1
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
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 /* Note well: this header is included from LibVLC core.
40 * Therefore, static inline functions MUST NOT call LibVLC functions here
41 * (this can cause linkage failure on some platforms). */
43 /***************************************************************************
44 * Internal creation and destruction functions
45 ***************************************************************************/
46 VLC_API libvlc_int_t *libvlc_InternalCreate( void );
47 VLC_API int libvlc_InternalInit( libvlc_int_t *, int, const char *ppsz_argv[] );
48 VLC_API void libvlc_InternalCleanup( libvlc_int_t * );
49 VLC_API void libvlc_InternalDestroy( libvlc_int_t * );
51 VLC_API int libvlc_InternalAddIntf( libvlc_int_t *, const char * );
52 VLC_API void libvlc_InternalWait( libvlc_int_t * );
53 VLC_API void libvlc_SetExitHandler( libvlc_int_t *, void (*) (void *), void * );
55 typedef void (*libvlc_vlm_release_func_t)( libvlc_instance_t * ) ;
57 /***************************************************************************
58 * Opaque structures for libvlc API
59 ***************************************************************************/
61 typedef struct libvlc_vlm_t
63 vlm_t *p_vlm;
64 libvlc_event_manager_t *p_event_manager;
65 libvlc_vlm_release_func_t pf_release;
66 } libvlc_vlm_t;
68 struct libvlc_instance_t
70 libvlc_int_t *p_libvlc_int;
71 libvlc_vlm_t libvlc_vlm;
72 unsigned ref_count;
73 vlc_mutex_t instance_lock;
74 struct libvlc_callback_entry_list_t *p_callback_list;
78 /***************************************************************************
79 * Other internal functions
80 ***************************************************************************/
82 /* Thread context */
83 void libvlc_init_threads (void);
84 void libvlc_deinit_threads (void);
86 /* Events */
87 libvlc_event_manager_t * libvlc_event_manager_new(
88 void * p_obj, libvlc_instance_t * p_libvlc_inst );
90 void libvlc_event_manager_release(
91 libvlc_event_manager_t * p_em );
93 void libvlc_event_manager_register_event_type(
94 libvlc_event_manager_t * p_em,
95 libvlc_event_type_t event_type );
97 void libvlc_event_send(
98 libvlc_event_manager_t * p_em,
99 libvlc_event_t * p_event );
101 void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager,
102 libvlc_event_type_t event_type,
103 libvlc_callback_t pf_callback,
104 void *p_user_data );
106 static inline libvlc_time_t from_mtime(mtime_t time)
108 return (time + 500ULL)/ 1000ULL;
111 static inline mtime_t to_mtime(libvlc_time_t time)
113 return time * 1000ULL;
116 #endif