]> git.sesse.net Git - vlc/blob - bindings/java/org/videolan/jvlc/internal/LibVlc.java
JNA jvlc initial implementation
[vlc] / bindings / java / org / videolan / jvlc / internal / LibVlc.java
1 /*****************************************************************************
2  * LibVlc.java: VLC Java Bindings JNA Glue
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  *
6  * Authors: Filippo Carone <filippo@carone.org>
7  *
8  *
9  * $Id $
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 package org.videolan.jvlc.internal;
27
28 import com.sun.jna.Callback;
29 import com.sun.jna.Library;
30 import com.sun.jna.Native;
31 import com.sun.jna.Pointer;
32 import com.sun.jna.PointerType;
33 import com.sun.jna.Structure;
34
35
36 public interface LibVlc extends Library
37 {
38
39     LibVlc INSTANCE = (LibVlc) Native.loadLibrary("libvlc-control", LibVlc.class);
40
41     public static class libvlc_exception_t extends Structure
42     {
43
44         public int raised;
45
46         public int code;
47
48         public String message;
49     }
50
51     public class LibVlcInstance extends PointerType
52     {
53     }
54
55     public class LibVlcMediaDescriptor extends PointerType
56     {
57     }
58
59     public class LibVlcMediaInstance extends PointerType
60     {
61     }
62
63     public class LibVlcMediaList extends PointerType
64     {
65     }
66
67     public class LibVlcMediaListPlayer extends PointerType
68     {
69     }
70
71     public class LibVlcEventManager extends PointerType
72     {
73     }
74
75     // exception handling
76     void libvlc_exception_init(libvlc_exception_t exception);
77
78     int libvlc_exception_raised(final libvlc_exception_t exception);
79
80     void libvlc_exception_raise(libvlc_exception_t exception, String format, Object... args);
81
82     void libvlc_exception_clear(libvlc_exception_t exception);
83
84     String libvlc_exception_get_message(libvlc_exception_t exception);
85
86     // core
87     LibVlcInstance libvlc_new(int argc, String[] argv, libvlc_exception_t exception);
88
89     void libvlc_release(LibVlcInstance libvlc_instance_t);
90
91     // video
92
93     void libvlc_video_set_parent(LibVlcInstance libvlc_instance, long drawable, libvlc_exception_t exception);
94
95     void libvlc_toggle_fullscreen(LibVlcMediaInstance libvlc_instance);
96
97     void libvlc_set_fullscreen(LibVlcMediaInstance instance, int fullscreen, libvlc_exception_t exception);
98
99     int libvlc_get_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
100
101     int libvlc_video_get_height(LibVlcMediaInstance instance, libvlc_exception_t exception);
102
103     int libvlc_video_get_width(LibVlcMediaInstance instance, libvlc_exception_t exception);
104
105     String libvlc_video_get_aspect_ration(LibVlcMediaInstance instance, libvlc_exception_t exception);
106
107     void libvlc_video_set_aspect_ration(LibVlcMediaInstance instance, String ratio, libvlc_exception_t exception);
108
109     int libvlc_video_get_spu(LibVlcMediaInstance instance, libvlc_exception_t exception);
110
111     int libvlc_video_set_spu(LibVlcMediaInstance instance, int spu, libvlc_exception_t exception);
112
113     String libvlc_video_get_crop_geometry(LibVlcMediaInstance instance, libvlc_exception_t exception);
114
115     void libvlc_video_set_crop_geometry(LibVlcMediaInstance instance, String geometry, libvlc_exception_t exception);
116
117     void libvlc_video_take_snapshot(LibVlcMediaInstance instance, String filename, int width, int height,
118         libvlc_exception_t exception);
119
120     void libvlc_video_destroy(LibVlcMediaInstance instance, libvlc_exception_t exception);
121
122     void libvlc_video_resize(LibVlcMediaInstance instance, int width, int height, libvlc_exception_t exception);
123
124     void libvlc_video_reparent(LibVlcMediaInstance instance, long drawable, libvlc_exception_t exception);
125
126     void libvlc_video_set_size(LibVlcInstance instance, int width, int height, libvlc_exception_t exception);
127
128     // audio
129
130     void libvlc_audio_toggle_mute(LibVlcInstance instance, libvlc_exception_t exception);
131
132     void libvlc_audio_set_mute(LibVlcInstance instance, int mute, libvlc_exception_t exception);
133
134     int libvlc_audio_get_mute(LibVlcInstance instance, libvlc_exception_t exception);
135
136     int libvlc_audio_get_volume(LibVlcInstance instance, libvlc_exception_t exception);
137
138     int libvlc_audio_set_volume(LibVlcInstance instance, int volume, libvlc_exception_t exception);
139
140     // media descriptor
141
142     LibVlcMediaDescriptor libvlc_media_descriptor_new(LibVlcInstance libvlc_instance, String mrl,
143         libvlc_exception_t exception);
144
145     void libvlc_media_descriptor_add_option(LibVlcMediaDescriptor media_descriptor, String option,
146         libvlc_exception_t exception);
147
148     String libvlc_media_descriptor_get_mrl(LibVlcMediaDescriptor media_descriptor);
149
150     void libvlc_media_descriptor_release(LibVlcMediaDescriptor media_descriptor);
151
152     LibVlcEventManager libvlc_media_descriptor_event_manager(LibVlcMediaDescriptor media_descriptor,
153         libvlc_exception_t exception);
154
155     // media instance
156
157     LibVlcMediaInstance libvlc_media_instance_new(LibVlcInstance instance, libvlc_exception_t exception);
158
159     LibVlcMediaInstance libvlc_media_instance_new_from_media_descriptor(LibVlcMediaDescriptor media_descriptor,
160         libvlc_exception_t exception);
161
162     void libvlc_media_instance_play(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
163
164     void libvlc_media_instance_pause(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
165
166     void libvlc_media_instance_stop(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
167
168     void libvlc_media_instance_set_drawable(LibVlcMediaInstance libvlc_media_instance, long drawable,
169         libvlc_exception_t exception);
170
171     long libvlc_media_instance_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
172
173     long libvlc_media_instance_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
174
175     void libvlc_media_instance_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
176
177     float libvlc_media_instance_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
178     
179     void libvlc_media_instance_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
180
181     int libvlc_media_instance_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
182
183     void libvlc_media_instance_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
184
185     float libvlc_media_instance_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
186
187     int libvlc_media_instance_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
188
189     float libvlc_media_instance_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
190
191     void libvlc_media_instance_release(LibVlcMediaInstance instance);
192     
193     LibVlcEventManager libvlc_media_instance_event_manager(LibVlcMediaInstance media_instance,
194         libvlc_exception_t exception);
195
196     // media list
197
198     LibVlcMediaList libvlc_media_list_new(LibVlcInstance libvlc_instance, libvlc_exception_t exception);
199
200     void libvlc_media_list_release(LibVlcMediaList libVlcMediaList);
201
202     void libvlc_media_list_add_file_content(LibVlcMediaList libvlc_media_list, String fileName,
203         libvlc_exception_t exception);
204
205     void libvlc_media_list_set_media_descriptor(LibVlcMediaList libvlc_media_list,
206         LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
207
208     LibVlcMediaDescriptor libvlc_media_list_media_descriptor(LibVlcMediaList libvlc_media_list,
209         libvlc_exception_t exception);
210
211     void libvlc_media_list_add_media_descriptor(LibVlcMediaList libvlc_media_list,
212         LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
213
214     void libvlc_media_list_insert_media_descriptor(LibVlcMediaList libvlc_media_list,
215         LibVlcMediaDescriptor libvlc_media_descriptor, int position, libvlc_exception_t exception);
216
217     void libvlc_media_list_remove_index(LibVlcMediaList libvlc_media_list, int position, libvlc_exception_t exception);
218
219     int libvlc_media_list_count(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
220
221     LibVlcMediaDescriptor libvlc_media_list_item_at_index(LibVlcMediaList libvlc_media_list, int position,
222         libvlc_exception_t exception);
223
224     int libvlc_media_list_index_of_item(LibVlcMediaList libvlc_media_list,
225         LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
226
227     int libvlc_media_list_is_readonly(LibVlcMediaList libvlc_media_list);
228
229     LibVlcEventManager libvlc_media_list_event_manager(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
230
231     // libvlc_media_list_player
232
233     LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_instance,
234         libvlc_exception_t exception);
235
236     void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
237
238     void libvlc_media_list_player_set_media_instance(LibVlcMediaListPlayer libvlc_media_list_player,
239         LibVlcMediaInstance libvlc_media_instance, libvlc_exception_t exception);
240
241     void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer libvlc_media_list_player,
242         LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
243
244     void libvlc_media_list_player_play(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
245
246     void libvlc_media_list_player_pause(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
247
248     int libvlc_media_list_player_is_playing(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
249
250     int libvlc_media_list_player_get_state(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
251
252     void libvlc_media_list_player_play_item_at_index(LibVlcMediaListPlayer libvlc_media_list_player, int position,
253         libvlc_exception_t exception);
254
255     void libvlc_media_list_player_play_item(LibVlcMediaListPlayer libvlc_media_list_player,
256         LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
257
258     void libvlc_media_list_player_stop(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
259
260     void libvlc_media_list_player_next(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
261
262     // event manager
263
264     public static interface LibVlcCallback extends Callback
265     {
266
267         void callback(int libvlc_event_t, Pointer userData);
268     }
269
270     void libvlc_event_attach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
271         Pointer userData, libvlc_exception_t exception);
272
273     void libvlc_event_detach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
274         Pointer userData, libvlc_exception_t excecption);
275
276 }