3 * @brief Unmanaged LibVLC APIs
6 * @defgroup Internals LibVLC internals
7 * This covers internal marshalling functions to use the native LibVLC.
8 * Only VLC developpers should need to read this section.
11 /**********************************************************************
12 * Copyright (C) 2007-2009 RĂ©mi Denis-Courmont. *
13 * This program is free software; you can redistribute and/or modify *
14 * it under the terms of the GNU General Public License as published *
15 * by the Free Software Foundation; version 2 of the license, or (at *
16 * your option) any later version. *
18 * This program is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
21 * See the GNU General Public License for more details. *
23 * You should have received a copy of the GNU General Public License *
24 * along with this program; if not, you can get it from: *
25 * http://www.gnu.org/copyleft/gpl.html *
26 **********************************************************************/
29 using System.Runtime.InteropServices;
31 namespace VideoLAN.LibVLC
34 * @brief Native: unmanaged LibVLC APIs
37 internal static class LibVLC
40 [DllImport ("libvlc.dll", EntryPoint="libvlc_get_version")]
41 public static extern IntPtr GetVersion ();
43 [DllImport ("libvlc.dll", EntryPoint="libvlc_get_compiler")]
44 public static extern IntPtr GetCompiler ();
46 [DllImport ("libvlc.dll", EntryPoint="libvlc_get_changeset")]
47 public static extern IntPtr GetChangeset ();
49 [DllImport ("libvlc.dll", EntryPoint="libvlc_new")]
51 InstanceHandle Create (int argc, U8String[] argv, NativeException ex);
53 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_retain")]
55 void Retain (InstanceHandle h, NativeException ex);*/
57 [DllImport ("libvlc.dll", EntryPoint="libvlc_release")]
59 void Release (IntPtr h, NativeException ex);
61 [DllImport ("libvlc.dll", EntryPoint="libvlc_add_intf")]
63 void AddIntf (InstanceHandle h, U8String name, NativeException ex);
65 [DllImport ("libvlc.dll", EntryPoint="libvlc_wait")]
67 void Wait (InstanceHandle h);
69 [DllImport ("libvlc.dll", EntryPoint="libvlc_get_vlc_instance")]
71 SafeHandle GetVLCInstance (InstanceHandle h);
74 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_new")]
76 MediaHandle MediaCreate (InstanceHandle inst, U8String mrl,
79 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_new_as_node")]
81 MediaHandle MediaCreateAsNode (InstanceHandle inst, U8String name,
84 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_add_option")]
86 void MediaAddOption (MediaHandle media, U8String options,
89 [DllImport ("libvlc.dll",
90 EntryPoint="libvlc_media_add_option_untrusted")]
92 void MediaAddUntrustedOption (MediaHandle media, U8String options,
95 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_release")]
97 void MediaRelease (IntPtr ptr);
99 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_mrl")]
101 StringHandle MediaGetMRL (MediaHandle media, NativeException ex);
103 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_duplicate")]
105 MediaHandle MediaDuplicate (MediaHandle media);
107 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_read_meta")]
109 MediaHandle MediaDuplicate (MediaHandle media, int type,
110 NativeException ex);*/
112 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_state")]
114 int MediaGetState (MediaHandle media, NativeException ex);*/
116 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_subitems")]
118 MediaListHandle MediaSubItems (MediaHandle media, NativeException ex);*/
120 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_event_manager")]
122 EventManagerHandle MediaGetEventManager (MediaHandle media,
123 NativeException ex);*/
125 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_duration")]
127 long MediaGetDuration (MediaHandle media, NativeException ex);
129 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_is_preparsed")]
131 int MediaIsPreparsed (MediaHandle media, NativeException ex);
133 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_set_user_data")]
135 void MediaIsPreparsed (MediaHandle media, IntPtr data,
136 NativeException ex);*/
138 /*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_user_data")]
140 IntPtr MediaIsPreparsed (MediaHandle media, NativeException ex);*/
143 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_player_new")]
145 PlayerHandle PlayerCreate (InstanceHandle inst, NativeException ex);
147 [DllImport ("libvlc.dll",
148 EntryPoint="libvlc_media_player_new_from_media")]
150 PlayerHandle PlayerCreateFromMedia (MediaHandle media,
153 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_player_release")]
155 void PlayerRelease (IntPtr ptr);
159 [DllImport ("libvlc.dll",
160 EntryPoint="libvlc_media_player_set_media")]
162 void PlayerSetMedia (PlayerHandle player, MediaHandle media,
165 /*[DllImport ("libvlc.dll",
166 EntryPoint="libvlc_media_player_get_media")]
168 MediaHandle PlayerGetMedia (PlayerHandle player,
169 NativeException ex);*/
171 /*[DllImport ("libvlc.dll",
172 EntryPoint="libvlc_media_player_event_manager")]
174 EventManagerHandle PlayerGetEventManager (PlayerHandle media,
175 NativeException ex);*/
176 [DllImport ("libvlc.dll",
177 EntryPoint="libvlc_media_player_is_playing")]
179 int PlayerIsPlaying (PlayerHandle player, NativeException ex);
181 [DllImport ("libvlc.dll",
182 EntryPoint="libvlc_media_player_play")]
184 void PlayerPlay (PlayerHandle player, NativeException ex);
186 [DllImport ("libvlc.dll",
187 EntryPoint="libvlc_media_player_pause")]
189 void PlayerPause (PlayerHandle player, NativeException ex);
191 [DllImport ("libvlc.dll",
192 EntryPoint="libvlc_media_player_stop")]
194 void PlayerStop (PlayerHandle player, NativeException ex);
196 [DllImport ("libvlc.dll",
197 EntryPoint="libvlc_media_player_set_xwindow")]
199 void PlayerSetXWindow (PlayerHandle player, int xid,
202 [DllImport ("libvlc.dll",
203 EntryPoint="libvlc_media_player_get_xwindow")]
205 int PlayerGetXWindow (PlayerHandle player);
207 [DllImport ("libvlc.dll",
208 EntryPoint="libvlc_media_player_set_hwnd")]
210 void PlayerSetHWND (PlayerHandle player, SafeHandle hwnd,
213 [DllImport ("libvlc.dll",
214 EntryPoint="libvlc_media_player_get_hwnd")]
216 SafeHandle PlayerGetHWND (PlayerHandle player);
218 [DllImport ("libvlc.dll",
219 EntryPoint="libvlc_media_player_get_length")]
221 long PlayerGetLength (PlayerHandle player, NativeException ex);
223 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_player_get_time")]
225 long PlayerGetTime (PlayerHandle player, NativeException ex);
227 [DllImport ("libvlc.dll", EntryPoint="libvlc_media_player_set_time")]
229 void PlayerSetTime (PlayerHandle player, long time,
232 [DllImport ("libvlc.dll",
233 EntryPoint="libvlc_media_player_get_position")]
235 float PlayerGetPosition (PlayerHandle player, NativeException ex);
237 [DllImport ("libvlc.dll",
238 EntryPoint="libvlc_media_player_set_position")]
240 void PlayerSetPosition (PlayerHandle player, float position,
243 [DllImport ("libvlc.dll",
244 EntryPoint="libvlc_media_player_get_chapter")]
246 int PlayerGetChapter (PlayerHandle player, NativeException ex);
248 [DllImport ("libvlc.dll",
249 EntryPoint="libvlc_media_player_set_chapter")]
251 void PlayerSetChapter (PlayerHandle player, int chapter,
254 [DllImport ("libvlc.dll",
255 EntryPoint="libvlc_media_player_get_chapter_count")]
257 int PlayerGetChapterCount (PlayerHandle player, NativeException ex);
261 [DllImport ("libvlc.dll",
262 EntryPoint="libvlc_media_player_get_chapter_count_for_title")]
264 int PlayerGetChapterCountForTitle (PlayerHandle player, int title,
267 [DllImport ("libvlc.dll",
268 EntryPoint="libvlc_media_player_get_title")]
270 int PlayerGetTitle (PlayerHandle player, NativeException ex);
272 [DllImport ("libvlc.dll",
273 EntryPoint="libvlc_media_player_set_title")]
275 void PlayerSetTitle (PlayerHandle player, int chapter,
278 [DllImport ("libvlc.dll",
279 EntryPoint="libvlc_media_player_get_title_count")]
281 int PlayerGetTitleCount (PlayerHandle player, NativeException ex);
283 [DllImport ("libvlc.dll",
284 EntryPoint="libvlc_media_player_next_chapter")]
286 void PlayerNextChapter (PlayerHandle player, NativeException ex);
288 [DllImport ("libvlc.dll",
289 EntryPoint="libvlc_media_player_previous_chapter")]
291 void PlayerPreviousChapter (PlayerHandle player, NativeException ex);
293 [DllImport ("libvlc.dll",
294 EntryPoint="libvlc_media_player_get_rate")]
296 float PlayerGetRate (PlayerHandle player, NativeException ex);
298 [DllImport ("libvlc.dll",
299 EntryPoint="libvlc_media_player_set_rate")]
301 void PlayerSetRate (PlayerHandle player, float rate,
304 /*[DllImport ("libvlc.dll",
305 EntryPoint="libvlc_media_player_get_state")]
307 void PlayerSetState (PlayerHandle player, float rate,
308 NativeException ex); */
310 [DllImport ("libvlc.dll",
311 EntryPoint="libvlc_media_player_get_fps")]
313 float PlayerGetFPS (PlayerHandle player, NativeException ex);
315 [DllImport ("libvlc.dll",
316 EntryPoint="libvlc_media_player_has_vout")]
318 int PlayerHasVout (PlayerHandle player, NativeException ex);
320 [DllImport ("libvlc.dll",
321 EntryPoint="libvlc_media_player_is_seekable")]
323 int PlayerIsSeekable (PlayerHandle player, NativeException ex);
325 [DllImport ("libvlc.dll",
326 EntryPoint="libvlc_media_player_can_pause")]
328 int PlayerCanPause (PlayerHandle player, NativeException ex);