]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
libvlc_video_get_handle function added
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
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 General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 /**
26  * \defgroup libvlc Libvlc
27  * This is libvlc, the base library of the VLC program.
28  *
29  * @{
30  */
31
32
33 #ifndef _LIBVLC_H
34 #define _LIBVLC_H 1
35
36 #include <vlc/vlc.h>
37
38 # ifdef __cplusplus
39 extern "C" {
40 # endif
41
42 /*****************************************************************************
43  * Exception handling
44  *****************************************************************************/
45 /** defgroup libvlc_exception Exceptions
46  * \ingroup libvlc
47  * LibVLC Exceptions handling
48  * @{
49  */
50
51 typedef struct
52 {
53     int b_raised;
54     int i_code;
55     char *psz_message;
56 } libvlc_exception_t;
57
58 /**
59  * Initialize an exception structure. This can be called several times to reuse
60  * an exception structure.
61  * \param p_exception the exception to initialize
62  */
63 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
64
65 /**
66  * Has an exception been raised ?
67  * \param p_exception the exception to query
68  * \return 0 if no exception raised, 1 else
69  */
70 VLC_PUBLIC_API int libvlc_exception_raised( libvlc_exception_t *p_exception );
71
72 /**
73  * Raise an exception
74  * \param p_exception the exception to raise
75  * \param psz_message the exception message
76  */
77 VLC_PUBLIC_API void libvlc_exception_raise( libvlc_exception_t *p_exception, const char *psz_format, ... );
78
79 /**
80  * Clear an exception object so it can be reused.
81  * The exception object must be initialized
82  * \param p_exception the exception to clear
83  */
84 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
85
86 /**
87  * Get exception message
88  * \param p_exception the exception to query
89  * \return the exception message or NULL if not applicable (exception not raised
90  * for example)
91  */
92 VLC_PUBLIC_API char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
93
94 /**@} */
95
96 /*****************************************************************************
97  * Core handling
98  *****************************************************************************/
99
100 /** defgroup libvlc_core Core
101  * \ingroup libvlc
102  * LibVLC Core
103  * @{
104  */
105
106 /** This structure is opaque. It represents a libvlc instance */
107 typedef struct libvlc_instance_t libvlc_instance_t;
108
109 /**
110  * Create an initialized libvlc instance
111  * \param argc the number of arguments
112  * \param argv command-line-type arguments
113  * \param exception an initialized exception pointer
114  */
115 VLC_PUBLIC_API libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
116
117 /**
118  * Returns a libvlc instance identifier for legacy APIs. Use of this
119  * function is discouraged, you should convert your program to use the
120  * new API.
121  * \param p_instance the instance
122  */
123 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
124
125 /**
126  * Destroy a libvlc instance.
127  * \param p_instance the instance to destroy
128  */
129 VLC_PUBLIC_API void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
130
131 /** @}*/
132
133 /*****************************************************************************
134  * Playlist
135  *****************************************************************************/
136 /** defgroup libvlc_playlist Playlist
137  * \ingroup libvlc
138  * LibVLC Playlist handling
139  * @{
140  */
141
142 typedef struct {
143     int i_id;
144     char * psz_uri;
145     char * psz_name;
146
147 } libvlc_playlist_item_t;
148
149 /**
150  * Set loop variable
151  */
152 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
153                                           libvlc_exception_t * );
154
155 /**
156  * Start playing. You can give some additionnal playlist item options
157  * that will be added to the item before playing it.
158  * \param p_instance the instance
159  * \param i_id the item to play. If this is a negative number, the next
160  * item will be selected. Else, the item with the given ID will be played
161  * \param i_options the number of options to add to the item
162  * \param ppsz_options the options to add to the item
163  * \param p_exception an initialized exception
164  */
165 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
166                                           libvlc_exception_t * );
167
168 /**
169  * Pause a running playlist, resume if it was stopped
170  * \param p_instance the instance to pause
171  * \param p_exception an initialized exception
172  */
173 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
174
175 /**
176  * Checks if the playlist is running
177  * \param p_instance the instance
178  * \param p_exception an initialized exception
179  * \return 0 if the playlist is stopped or paused, 1 if it is running
180  */
181 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
182
183 /**
184  * Get the number of items in the playlist
185  * \param p_instance the instance
186  * \param p_exception an initialized exception
187  * \return the number of items
188  */
189 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
190
191 /**
192  * Stop playing
193  * \param p_instance the instance to stop
194  * \param p_exception an initialized exception
195  */
196 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
197
198 /**
199  * Go to next playlist item (starts playback if it was stopped)
200  * \param p_instance the instance to use
201  * \param p_exception an initialized exception
202  */
203 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
204
205 /**
206  * Go to previous playlist item (starts playback if it was stopped)
207  * \param p_instance the instance to use
208  * \param p_exception an initialized exception
209  */
210 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
211
212 /**
213  * Remove all playlist items
214  * \param p_instance the instance
215  * \param p_exception an initialized exception
216  */
217 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
218
219 /**
220  * Add an item at the end of the playlist
221  * If you need more advanced options, \see libvlc_playlist_add_extended
222  * \param p_instance the instance
223  * \param psz_uri the URI to open, using VLC format
224  * \param psz_name a name that you might want to give or NULL
225  * \return the identifier of the new item
226  */
227 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
228                                         libvlc_exception_t * );
229
230 /**
231  * Add an item at the end of the playlist, with additional input options
232  * \param p_instance the instance
233  * \param psz_uri the URI to open, using VLC format
234  * \param psz_name a name that you might want to give or NULL
235  * \param i_options the number of options to add
236  * \param ppsz_options strings representing the options to add
237  * \param p_exception an initialized exception
238  * \return the identifier of the new item
239  */
240 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
241                                                  const char *, int, const char **,
242                                                  libvlc_exception_t * );
243
244 /**
245  * Delete the playlist item with the given ID.
246  * \param p_instance the instance
247  * \param i_id the id to remove
248  * \param p_exception an initialized exception
249  * \return
250  */
251 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
252                                                 libvlc_exception_t * );
253
254 typedef struct libvlc_input_t libvlc_input_t;
255
256 /* Get the input that is currently being played by the playlist
257  * \param p_instance the instance to use
258  * \param p_exception an initialized excecption
259  * \return an input object
260  */
261 VLC_PUBLIC_API libvlc_input_t *libvlc_playlist_get_input( libvlc_instance_t *,
262                                                           libvlc_exception_t * );
263
264 /** @}*/
265
266 /*****************************************************************************
267  * Input
268  *****************************************************************************/
269 /** defgroup libvlc_input Input
270  * \ingroup libvlc
271  * LibVLC Input handling
272  * @{
273  */
274
275 /** Free an input object
276  * \param p_input the input to free
277  */
278 VLC_PUBLIC_API void libvlc_input_free( libvlc_input_t * );
279
280 /// \bug This might go away ... to be replaced by a broader system
281 VLC_PUBLIC_API vlc_int64_t libvlc_input_get_length     ( libvlc_input_t *, libvlc_exception_t *);
282 VLC_PUBLIC_API vlc_int64_t libvlc_input_get_time       ( libvlc_input_t *, libvlc_exception_t *);
283 VLC_PUBLIC_API void        libvlc_input_set_time       ( libvlc_input_t *, vlc_int64_t, libvlc_exception_t *);
284 VLC_PUBLIC_API float       libvlc_input_get_position   ( libvlc_input_t *, libvlc_exception_t *);
285 VLC_PUBLIC_API void        libvlc_input_set_position   ( libvlc_input_t *, float, libvlc_exception_t *);
286 VLC_PUBLIC_API vlc_bool_t  libvlc_input_will_play      ( libvlc_input_t *, libvlc_exception_t *);
287 VLC_PUBLIC_API float       libvlc_input_get_rate       ( libvlc_input_t *, libvlc_exception_t *);
288 VLC_PUBLIC_API void        libvlc_input_set_rate       ( libvlc_input_t *, float, libvlc_exception_t *);
289 VLC_PUBLIC_API int         libvlc_input_get_state      ( libvlc_input_t *, libvlc_exception_t *);
290
291 /** @} */
292
293 /** defgroup libvlc_video Video
294  * \ingroup libvlc
295  * LibVLC Video handling
296  * @{
297  */
298
299 /**
300 * Downcast to this general type as placeholder for a platform specific one, such as:
301 *  Drawable on X11,
302 *  CGrafPort on MacOSX,
303 *  HWND on win32
304 */
305 typedef int libvlc_drawable_t;
306
307 /**
308 * Rectangle type for video geometry
309 */
310 typedef struct
311 {
312     int top, left;
313     int bottom, right;
314 }
315 libvlc_rectangle_t;
316
317 /**
318  * Does this input have a video output ?
319  * \param p_input the input
320  * \param p_exception an initialized exception
321  */
322 VLC_PUBLIC_API vlc_bool_t  libvlc_input_has_vout( libvlc_input_t *, libvlc_exception_t *);
323 VLC_PUBLIC_API float       libvlc_input_get_fps( libvlc_input_t *, libvlc_exception_t *);
324
325 /**
326  * Toggle fullscreen status on video output
327  * \param p_input the input
328  * \param p_exception an initialized exception
329  */
330 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_input_t *, libvlc_exception_t * );
331
332 /**
333  * Enable or disable fullscreen on a video output
334  * \param p_input the input
335  * \param b_fullscreen boolean for fullscreen status
336  * \param p_exception an initialized exception
337  */
338 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * );
339
340 /**
341  * Get current fullscreen status
342  * \param p_input the input
343  * \param p_exception an initialized exception
344  * \return the fullscreen status (boolean)
345  */
346 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
347
348 /**
349  * Get current video height
350  * \param p_input the input
351  * \param p_exception an initialized exception
352  * \return the video height
353  */
354 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * );
355
356 /**
357  * Get current video width
358  * \param p_input the input
359  * \param p_exception an initialized exception
360  * \return the video width
361  */
362 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * );
363
364 /**
365  * Get current video aspect ratio
366  * \param p_input the input
367  * \param p_exception an initialized exception
368  * \return the video aspect ratio
369  */
370 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_input_t *, libvlc_exception_t * );
371
372 /**
373  * Set new video aspect ratio
374  * \param p_input the input
375  * \param psz_aspect new video aspect-ratio
376  * \param p_exception an initialized exception
377  */
378 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_input_t *, char *, libvlc_exception_t * );
379
380 /**
381  * Get current crop filter geometry
382  * \param p_input the input
383  * \param p_exception an initialized exception
384  * \return the crop filter geometry
385  */
386 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_input_t *, libvlc_exception_t * );
387
388 /**
389  * Set new crop filter geometry
390  * \param p_input the input
391  * \param psz_geometry new crop filter geometry
392  * \param p_exception an initialized exception
393  */
394 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_input_t *, char *, libvlc_exception_t * );
395
396 /**
397  * Take a snapshot of the current video window
398  * \param p_input the input
399  * \param psz_filepath the path where to save the screenshot to
400  * \param p_exception an initialized exception
401  */
402 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
403
404 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_input_t *, libvlc_exception_t *);
405
406 /**
407  * Resize the current video output window
408  * \param p_instance libvlc instance
409  * \param width new width for video output window
410  * \param height new height for video output window
411  * \param p_exception an initialized exception
412  * \return the success status (boolean)
413  */
414 VLC_PUBLIC_API void libvlc_video_resize( libvlc_input_t *, int, int, libvlc_exception_t *);
415
416 /**
417  * change the parent for the current the video output
418  * \param p_instance libvlc instance
419  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
420  * \param p_exception an initialized exception
421  * \return the success status (boolean)
422  */
423 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_input_t *, libvlc_drawable_t, libvlc_exception_t * );
424
425 /**
426  * Set the default video output parent
427  *  this settings will be used as default for all video outputs
428  * \param p_instance libvlc instance
429  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
430  * \param p_exception an initialized exception
431  */
432 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
433
434 /**
435  * Set the default video output parent
436  *  this settings will be used as default for all video outputs
437  * \param p_instance libvlc instance
438  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
439  * \param p_exception an initialized exception
440  */
441 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_handle( libvlc_instance_t *, libvlc_exception_t * );
442
443 /**
444  * Set the default video output size
445  *  this settings will be used as default for all video outputs
446  * \param p_instance libvlc instance
447  * \param width new width for video drawable
448  * \param height new height for video drawable
449  * \param p_exception an initialized exception
450  */
451 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
452
453 /**
454  * Set the default video output viewport for a windowless video output (MacOS X only)
455  *  this settings will be used as default for all video outputs
456  * \param p_instance libvlc instance
457  * \param view coordinates within video drawable
458  * \param clip coordinates within video drawable
459  * \param p_exception an initialized exception
460  */
461 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
462
463
464 /** @} */
465
466 /**
467  * defgroup libvlc_vlm VLM
468  * \ingroup libvlc
469  * LibVLC VLM handling
470  * @{
471  */
472
473 /** defgroup libvlc_audio Audio
474  * \ingroup libvlc
475  * LibVLC Audio handling
476  * @{
477  */
478
479 /**
480  * Toggle mute status
481  * \param p_instance libvlc instance
482  * \param p_exception an initialized exception
483  * \return void
484  */
485 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
486
487 /**
488  * Get current mute status
489  * \param p_instance libvlc instance
490  * \param p_exception an initialized exception
491  * \return the mute status (boolean)
492  */
493 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
494
495 /**
496  * Set mute status
497  * \param p_instance libvlc instance
498  * \param status If status is VLC_TRUE then mute, otherwise unmute
499  * \param p_exception an initialized exception
500  * \return void
501  */
502 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
503
504 /**
505  * Get current audio level
506  * \param p_instance libvlc instance
507  * \param p_exception an initialized exception
508  * \return the audio level (int)
509  */
510 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
511
512 /**
513  * Set current audio level
514  * \param p_instance libvlc instance
515  * \param i_volume the volume (int)
516  * \param p_exception an initialized exception
517  */
518 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
519
520 /**
521 +  * Get current audio track
522 +  * \param p_input input instance
523 +  * \param p_exception an initialized exception
524 +  * \return the audio track (int)
525 +  */
526 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_input_t *, libvlc_exception_t * );
527
528 /**
529  * Set current audio track
530  * \param p_input input instance
531  * \param i_track the track (int)
532  * \param p_exception an initialized exception
533  */
534 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_input_t *, int, libvlc_exception_t * );
535
536 /**
537  * Get current audio channel
538  * \param p_instance input instance
539  * \param p_exception an initialized exception
540  * \return the audio channel (int)
541  */
542 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
543
544 /**
545  * Set current audio channel
546  * \param p_instance input instance
547  * \param i_channel the audio channel (int)
548  * \param p_exception an initialized exception
549  */
550 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
551
552 /** @} */
553
554
555 /**
556  * Add a broadcast, with one input
557  * \param p_instance the instance
558  * \param psz_name the name of the new broadcast
559  * \param psz_input the input MRL
560  * \param psz_output the output MRL (the parameter to the "sout" variable)
561  * \param i_options number of additional options
562  * \param ppsz_options additional options
563  * \param b_enabled boolean for enabling the new broadcast
564  * \param b_loop Should this broadcast be played in loop ?
565  * \param p_exception an initialized exception
566  */
567 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
568                                               int, char **, int, int, libvlc_exception_t * );
569
570 /**
571  * Delete a media (vod or broadcast)
572  * \param p_instance the instance
573  * \param psz_name the media to delete
574  * \param p_exception an initialized exception
575  */
576 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
577
578 /**
579  * Enable or disable a media (vod or broadcast)
580  * \param p_instance the instance
581  * \param psz_name the media to work on
582  * \param b_enabled the new status
583  * \param p_exception an initialized exception
584  */
585 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
586                                             libvlc_exception_t *);
587
588 /**
589  * Set the output for a media
590  * \param p_instance the instance
591  * \param psz_name the media to work on
592  * \param psz_output the output MRL (the parameter to the "sout" variable)
593  * \param p_exception an initialized exception
594  */
595 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
596                                            libvlc_exception_t *);
597
598 /**
599  * Set a media's input MRL. This will delete all existing inputs and
600  * add the specified one.
601  * \param p_instance the instance
602  * \param psz_name the media to work on
603  * \param psz_input the input MRL
604  * \param p_exception an initialized exception
605  */
606 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
607                                           libvlc_exception_t *);
608
609 /**
610  * Set output for a media
611  * \param p_instance the instance
612  * \param psz_name the media to work on
613  * \param b_loop the new status
614  * \param p_exception an initialized exception
615  */
616 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
617                                          libvlc_exception_t *);
618
619 /**
620  * Edit the parameters of a media. This will delete all existing inputs and
621  * add the specified one.
622  * \param p_instance the instance
623  * \param psz_name the name of the new broadcast
624  * \param psz_input the input MRL
625  * \param psz_output the output MRL (the parameter to the "sout" variable)
626  * \param i_options number of additional options
627  * \param ppsz_options additional options
628  * \param b_enabled boolean for enabling the new broadcast
629  * \param b_loop Should this broadcast be played in loop ?
630  * \param p_exception an initialized exception
631  */
632 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
633                                              int, char **, int, int, libvlc_exception_t * );
634
635 /**
636  * Plays the named broadcast.
637  * \param p_instance the instance
638  * \param psz_name the name of the broadcast
639  * \param p_exception an initialized exception
640  */
641 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
642
643 /**
644  * Stops the named broadcast.
645  * \param p_instance the instance
646  * \param psz_name the name of the broadcast
647  * \param p_exception an initialized exception
648  */ 
649 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
650
651 /**
652  * Pauses the named broadcast.
653  * \param p_instance the instance
654  * \param psz_name the name of the broadcast
655  * \param p_exception an initialized exception
656  */ 
657 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
658     
659 /**
660  * Seeks in the named broadcast.
661  * \param p_instance the instance
662  * \param psz_name the name of the broadcast
663  * \param f_percentage the percentage to seek to
664  * \param p_exception an initialized exception
665  */ 
666 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
667                                            float, libvlc_exception_t * );
668    
669 /**
670  * Return information of the named broadcast.
671  * \param p_instance the instance
672  * \param psz_name the name of the broadcast
673  * \param p_exception an initialized exception
674  */ 
675 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
676
677 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
678 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
679                         char *, int , libvlc_exception_t * );
680
681 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
682 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
683 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
684 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
685 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
686 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
687 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
688
689 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
690
691 /** @} */
692 /** @} */
693
694 /*****************************************************************************
695  * Message log handling
696  *****************************************************************************/
697
698 /** defgroup libvlc_log Log
699  * \ingroup libvlc
700  * LibVLC Message Logging
701  * @{
702  */
703
704 /** This structure is opaque. It represents a libvlc log instance */
705 typedef struct libvlc_log_t libvlc_log_t;
706
707 /** This structure is opaque. It represents a libvlc log iterator */
708 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
709
710 typedef struct libvlc_log_message_t
711 {
712     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
713     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
714     const char *psz_type;     /* module type */
715     const char *psz_name;     /* module name */
716     const char *psz_header;   /* optional header */
717     const char *psz_message;  /* message */
718 } libvlc_log_message_t;
719
720 /**
721  * Returns the VLC messaging verbosity level
722  * \param p_instance libvlc instance
723  * \param exception an initialized exception pointer
724  */
725 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
726                                                   libvlc_exception_t *p_e );
727
728 /**
729  * Set the VLC messaging verbosity level
730  * \param p_log libvlc log instance
731  * \param exception an initialized exception pointer
732  */
733 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
734                                               libvlc_exception_t *p_e );
735
736 /**
737  * Open an instance to VLC message log 
738  * \param p_instance libvlc instance
739  * \param exception an initialized exception pointer
740  */
741 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
742
743 /**
744  * Close an instance of VLC message log 
745  * \param p_log libvlc log instance
746  * \param exception an initialized exception pointer
747  */
748 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
749
750 /**
751  * Returns the number of messages in log
752  * \param p_log libvlc log instance
753  * \param exception an initialized exception pointer
754  */
755 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
756
757 /**
758  * Clear all messages in log
759  *  the log should be cleared on a regular basis to avoid clogging
760  * \param p_log libvlc log instance
761  * \param exception an initialized exception pointer
762  */
763 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
764
765 /**
766  * Allocate and returns a new iterator to messages in log
767  * \param p_log libvlc log instance
768  * \param exception an initialized exception pointer
769  */
770 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
771
772 /**
773  * Releases a previoulsy allocated iterator
774  * \param p_log libvlc log iterator 
775  * \param exception an initialized exception pointer
776  */
777 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
778
779 /**
780  * Returns whether log iterator has more messages 
781  * \param p_log libvlc log iterator
782  * \param exception an initialized exception pointer
783  */
784 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
785
786 /**
787  * Returns next log message
788  *   the content of message must not be freed
789  * \param p_log libvlc log iterator
790  * \param exception an initialized exception pointer
791  */
792 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
793                                                                struct libvlc_log_message_t *buffer,
794                                                                libvlc_exception_t *p_e );
795
796 /** @} */
797
798 # ifdef __cplusplus
799 }
800 # endif
801
802 #endif /* <vlc/libvlc.h> */