/src/vlc/lib/libvlc_internal.h
Line | Count | Source |
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 | | * |
7 | | * Authors: Clément Stenac <zorglub@videolan.org> |
8 | | * |
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. |
13 | | * |
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. |
18 | | * |
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 | | *****************************************************************************/ |
23 | | |
24 | | #ifndef _LIBVLC_INTERNAL_H |
25 | | #define _LIBVLC_INTERNAL_H 1 |
26 | | |
27 | | #include <vlc/libvlc.h> |
28 | | #include <vlc/libvlc_dialog.h> |
29 | | #include <vlc/libvlc_picture.h> |
30 | | #include <vlc/libvlc_media.h> |
31 | | |
32 | | #include <vlc_atomic.h> |
33 | | #include <vlc_common.h> |
34 | | #include <vlc_arrays.h> |
35 | | #include <vlc_threads.h> |
36 | | |
37 | | /* Note well: this header is included from LibVLC core. |
38 | | * Therefore, static inline functions MUST NOT call LibVLC functions here |
39 | | * (this can cause linkage failure on some platforms). */ |
40 | | |
41 | | /*************************************************************************** |
42 | | * Internal creation and destruction functions |
43 | | ***************************************************************************/ |
44 | | VLC_API libvlc_int_t *libvlc_InternalCreate( void ); |
45 | | VLC_API int libvlc_InternalInit( libvlc_int_t *, int, const char *ppsz_argv[] ); |
46 | | VLC_API void libvlc_InternalCleanup( libvlc_int_t * ); |
47 | | VLC_API void libvlc_InternalDestroy( libvlc_int_t * ); |
48 | | |
49 | | /** |
50 | | * Try to start a user interface for the libvlc instance. |
51 | | * |
52 | | * \param libvlcint the internal instance |
53 | | * \param name interface name, or NULL for default |
54 | | * \return 0 on success, -1 on error. |
55 | | */ |
56 | | VLC_API int libvlc_InternalAddIntf( libvlc_int_t *libvlcint, const char *name ); |
57 | | |
58 | | /** |
59 | | * Start playing the main playlist |
60 | | * |
61 | | * The main playlist can only be populated via an interface created by the |
62 | | * libvlc_InternalAddIntf() function. The control and media flow will only be |
63 | | * controlled by the interface previously added. |
64 | | * |
65 | | * One of these 2 functions (libvlc_InternalAddIntf() or libvlc_InternalPlay()) |
66 | | * will trigger the creation of an internal playlist and player. |
67 | | * |
68 | | * \param libvlcint the internal instance |
69 | | */ |
70 | | VLC_API void libvlc_InternalPlay( libvlc_int_t *libvlcint ); |
71 | | VLC_API void libvlc_InternalWait( libvlc_int_t * ); |
72 | | |
73 | | /** |
74 | | * Registers a callback for the LibVLC exit event. This is mostly useful if |
75 | | * the VLC playlist and/or at least one interface are started with |
76 | | * libvlc_InternalPlay() or libvlc_InternalAddIntf () respectively. |
77 | | * Typically, this function will wake up your application main loop (from |
78 | | * another thread). |
79 | | * |
80 | | * \note This function should be called before the playlist or interface are |
81 | | * started. Otherwise, there is a small race condition: the exit event could |
82 | | * be raised before the handler is registered. |
83 | | * |
84 | | * \param libvlcint the internal instance |
85 | | * \param cb callback to invoke when LibVLC wants to exit, |
86 | | * or NULL to disable the exit handler (as by default) |
87 | | * \param opaque data pointer for the callback |
88 | | */ |
89 | | VLC_API void libvlc_SetExitHandler( libvlc_int_t *libvlcint, void (*cb) (void *), |
90 | | void *opaque ); |
91 | | |
92 | | /*************************************************************************** |
93 | | * Opaque structures for libvlc API |
94 | | ***************************************************************************/ |
95 | | |
96 | | struct libvlc_instance_t |
97 | | { |
98 | | libvlc_int_t *p_libvlc_int; |
99 | | vlc_atomic_rc_t ref_count; |
100 | | struct libvlc_callback_entry_list_t *p_callback_list; |
101 | | |
102 | | struct |
103 | | { |
104 | | void (*cb) (void *, int, const libvlc_log_t *, const char *, va_list); |
105 | | void *data; |
106 | | } log; |
107 | | struct |
108 | | { |
109 | | libvlc_dialog_cbs cbs; |
110 | | void *data; |
111 | | } dialog; |
112 | | }; |
113 | | |
114 | | /*************************************************************************** |
115 | | * Other internal functions |
116 | | ***************************************************************************/ |
117 | | |
118 | | /* Not synchronized: set the LibVLC owner before publishing the item. */ |
119 | | VLC_API void *input_item_GetLibvlcOwner(input_item_t *); |
120 | | VLC_API void input_item_SetLibvlcOwner(input_item_t *, void *, |
121 | | void (*release)(void *)); |
122 | | |
123 | | /* Thread context */ |
124 | | void libvlc_threads_init (void); |
125 | | void libvlc_threads_deinit (void); |
126 | | |
127 | | static inline libvlc_time_t libvlc_time_from_vlc_tick(vlc_tick_t time) |
128 | 0 | { |
129 | 0 | return US_FROM_VLC_TICK(time); |
130 | 0 | } Unexecuted instantiation: demux-run.c:libvlc_time_from_vlc_tick Unexecuted instantiation: common.c:libvlc_time_from_vlc_tick Unexecuted instantiation: decoder.c:libvlc_time_from_vlc_tick Unexecuted instantiation: core.c:libvlc_time_from_vlc_tick Unexecuted instantiation: error.c:libvlc_time_from_vlc_tick Unexecuted instantiation: libvlc.c:libvlc_time_from_vlc_tick Unexecuted instantiation: interface.c:libvlc_time_from_vlc_tick Unexecuted instantiation: exit.c:libvlc_time_from_vlc_tick Unexecuted instantiation: specific.c:libvlc_time_from_vlc_tick |
131 | | |
132 | | static inline vlc_tick_t vlc_tick_from_libvlc_time(libvlc_time_t time) |
133 | 0 | { |
134 | 0 | return VLC_TICK_FROM_US(time); |
135 | 0 | } Unexecuted instantiation: demux-run.c:vlc_tick_from_libvlc_time Unexecuted instantiation: common.c:vlc_tick_from_libvlc_time Unexecuted instantiation: decoder.c:vlc_tick_from_libvlc_time Unexecuted instantiation: core.c:vlc_tick_from_libvlc_time Unexecuted instantiation: error.c:vlc_tick_from_libvlc_time Unexecuted instantiation: libvlc.c:vlc_tick_from_libvlc_time Unexecuted instantiation: interface.c:vlc_tick_from_libvlc_time Unexecuted instantiation: exit.c:vlc_tick_from_libvlc_time Unexecuted instantiation: specific.c:vlc_tick_from_libvlc_time |
136 | | |
137 | | #endif |