QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
libvlc.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * libvlc.h: libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2009 VLC authors and VideoLAN
5  * $Id: 485f4ff7198fd86d7935613b254f074f47577dd5 $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  * Jean-Paul Saman <jpsaman@videolan.org>
9  * Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25 
38 #ifndef VLC_LIBVLC_H
39 #define VLC_LIBVLC_H 1
40 
41 #if defined (_WIN32) && defined (DLL_EXPORT)
42 # define LIBVLC_API __declspec(dllexport)
43 #elif defined (__GNUC__) && (__GNUC__ >= 4)
44 # define LIBVLC_API __attribute__((visibility("default")))
45 #else
46 # define LIBVLC_API
47 #endif
48 
49 #ifdef __LIBVLC__
50 /* Avoid unhelpful warnings from libvlc with our deprecated APIs */
51 # define LIBVLC_DEPRECATED
52 #elif defined(__GNUC__) && \
53  (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
54 # define LIBVLC_DEPRECATED __attribute__((deprecated))
55 #else
56 # define LIBVLC_DEPRECATED
57 #endif
58 
59 #include <stdio.h>
60 #include <stdarg.h>
61 
62 # ifdef __cplusplus
63 extern "C" {
64 # endif
65 
66 #include <vlc/libvlc_structures.h>
67 
92 LIBVLC_API const char *libvlc_errmsg (void);
93 
99 LIBVLC_API void libvlc_clearerr (void);
100 
108 LIBVLC_API const char *libvlc_vprinterr (const char *fmt, va_list ap);
109 
117 LIBVLC_API const char *libvlc_printerr (const char *fmt, ...);
118 
143 LIBVLC_API libvlc_instance_t *
144 libvlc_new( int argc , const char *const *argv );
145 
152 LIBVLC_API void libvlc_release( libvlc_instance_t *p_instance );
153 
160 LIBVLC_API void libvlc_retain( libvlc_instance_t *p_instance );
161 
169 LIBVLC_API
170 int libvlc_add_intf( libvlc_instance_t *p_instance, const char *name );
171 
189 LIBVLC_API
191  void (*cb) (void *), void *opaque );
192 
201 LIBVLC_DEPRECATED LIBVLC_API
202 void libvlc_wait( libvlc_instance_t *p_instance );
203 
213 LIBVLC_API
214 void libvlc_set_user_agent( libvlc_instance_t *p_instance,
215  const char *name, const char *http );
216 
227 LIBVLC_API
228 void libvlc_set_app_id( libvlc_instance_t *p_instance, const char *id,
229  const char *version, const char *icon );
230 
238 LIBVLC_API const char * libvlc_get_version(void);
239 
247 LIBVLC_API const char * libvlc_get_compiler(void);
248 
256 LIBVLC_API const char * libvlc_get_changeset(void);
257 
265 LIBVLC_API void libvlc_free( void *ptr );
266 
283 
285 
289 typedef int libvlc_event_type_t;
290 
295 typedef void ( *libvlc_callback_t )( const struct libvlc_event_t *, void * );
296 
308 LIBVLC_API int libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
309  libvlc_event_type_t i_event_type,
310  libvlc_callback_t f_callback,
311  void *user_data );
312 
321 LIBVLC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
322  libvlc_event_type_t i_event_type,
323  libvlc_callback_t f_callback,
324  void *p_user_data );
325 
331 LIBVLC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
332 
346 {
351 };
352 
353 typedef struct vlc_log_t libvlc_log_t;
354 
371 LIBVLC_API void libvlc_log_get_context(const libvlc_log_t *ctx,
372  const char **module, const char **file, unsigned *line);
373 
395 LIBVLC_API void libvlc_log_get_object(const libvlc_log_t *ctx,
396  const char **name, const char **header, uintptr_t *id);
397 
409 typedef void (*libvlc_log_cb)(void *data, int level, const libvlc_log_t *ctx,
410  const char *fmt, va_list args);
411 
421 LIBVLC_API void libvlc_log_unset( libvlc_instance_t * );
422 
439 LIBVLC_API void libvlc_log_set( libvlc_instance_t *,
440  libvlc_log_cb cb, void *data );
441 
442 
450 LIBVLC_API void libvlc_log_set_file( libvlc_instance_t *, FILE *stream );
451 
459 LIBVLC_DEPRECATED LIBVLC_API
460 unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance );
461 
469 LIBVLC_DEPRECATED LIBVLC_API
470 void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level );
471 
479 LIBVLC_DEPRECATED LIBVLC_API
481 
487 LIBVLC_DEPRECATED LIBVLC_API
488 void libvlc_log_close( libvlc_log_t *p_log );
489 
497 LIBVLC_DEPRECATED LIBVLC_API
498 unsigned libvlc_log_count( const libvlc_log_t *p_log );
499 
506 LIBVLC_DEPRECATED LIBVLC_API
507 void libvlc_log_clear( libvlc_log_t *p_log );
508 
516 LIBVLC_DEPRECATED LIBVLC_API
518 
524 LIBVLC_DEPRECATED LIBVLC_API
526 
534 LIBVLC_DEPRECATED LIBVLC_API
536 
545 LIBVLC_DEPRECATED LIBVLC_API
547  libvlc_log_message_t *p_buf );
548 
555 {
556  char *psz_name;
557  char *psz_shortname;
558  char *psz_longname;
559  char *psz_help;
560  struct libvlc_module_description_t *p_next;
562 
568 LIBVLC_API
570 
582 LIBVLC_API
584 
596 LIBVLC_API
598 
614 LIBVLC_API
615 int64_t libvlc_clock(void);
616 
623 static inline int64_t libvlc_delay(int64_t pts)
624 {
625  return pts - libvlc_clock();
626 }
627 
630 # ifdef __cplusplus
631 }
632 # endif
633 
634 #endif /* <vlc/libvlc.h> */
LIBVLC_DEPRECATED LIBVLC_API libvlc_log_message_t * libvlc_log_iterator_next(libvlc_log_iterator_t *p_iter, libvlc_log_message_t *p_buf)
LIBVLC_API void libvlc_clearerr(void)
LIBVLC_API void libvlc_set_exit_handler(libvlc_instance_t *p_instance, void(*cb)(void *), void *opaque)
LIBVLC_API int libvlc_add_intf(libvlc_instance_t *p_instance, const char *name)
struct libvlc_event_manager_t libvlc_event_manager_t
Definition: libvlc.h:282
Definition: libvlc_structures.h:58
LIBVLC_DEPRECATED LIBVLC_API void libvlc_log_close(libvlc_log_t *p_log)
LIBVLC_DEPRECATED LIBVLC_API unsigned libvlc_log_count(const libvlc_log_t *p_log)
void(* libvlc_log_cb)(void *data, int level, const libvlc_log_t *ctx, const char *fmt, va_list args)
Definition: libvlc.h:409
Definition: libvlc.h:554
struct libvlc_log_iterator_t libvlc_log_iterator_t
Definition: libvlc_structures.h:56
LIBVLC_DEPRECATED LIBVLC_API void libvlc_log_clear(libvlc_log_t *p_log)
LIBVLC_DEPRECATED LIBVLC_API unsigned libvlc_get_log_verbosity(const libvlc_instance_t *p_instance)
LIBVLC_API void libvlc_set_user_agent(libvlc_instance_t *p_instance, const char *name, const char *http)
LIBVLC_API const char * libvlc_get_compiler(void)
LIBVLC_API const char * libvlc_vprinterr(const char *fmt, va_list ap)
LIBVLC_DEPRECATED LIBVLC_API void libvlc_set_log_verbosity(libvlc_instance_t *p_instance, unsigned level)
LIBVLC_API int libvlc_event_attach(libvlc_event_manager_t *p_event_manager, libvlc_event_type_t i_event_type, libvlc_callback_t f_callback, void *user_data)
struct libvlc_module_description_t libvlc_module_description_t
LIBVLC_DEPRECATED LIBVLC_API libvlc_log_iterator_t * libvlc_log_get_iterator(const libvlc_log_t *p_log)
LIBVLC_API void libvlc_event_detach(libvlc_event_manager_t *p_event_manager, libvlc_event_type_t i_event_type, libvlc_callback_t f_callback, void *p_user_data)
LIBVLC_API void libvlc_log_get_object(const libvlc_log_t *ctx, const char **name, const char **header, uintptr_t *id)
LIBVLC_DEPRECATED LIBVLC_API void libvlc_log_iterator_free(libvlc_log_iterator_t *p_iter)
LIBVLC_API const char * libvlc_event_type_name(libvlc_event_type_t event_type)
LIBVLC_DEPRECATED LIBVLC_API void libvlc_wait(libvlc_instance_t *p_instance)
LIBVLC_API void libvlc_set_app_id(libvlc_instance_t *p_instance, const char *id, const char *version, const char *icon)
void(* libvlc_callback_t)(const struct libvlc_event_t *, void *)
Definition: libvlc.h:295
libvlc_log_level
Definition: libvlc.h:345
LIBVLC_API void libvlc_log_set(libvlc_instance_t *, libvlc_log_cb cb, void *data)
LIBVLC_DEPRECATED LIBVLC_API libvlc_log_t * libvlc_log_open(libvlc_instance_t *p_instance)
LIBVLC_API int64_t libvlc_clock(void)
LIBVLC_API libvlc_module_description_t * libvlc_audio_filter_list_get(libvlc_instance_t *p_instance)
LIBVLC_API void libvlc_retain(libvlc_instance_t *p_instance)
LIBVLC_API void libvlc_log_get_context(const libvlc_log_t *ctx, const char **module, const char **file, unsigned *line)
struct libvlc_instance_t libvlc_instance_t
Definition: libvlc_structures.h:44
Definition: libvlc_events.h:110
LIBVLC_API libvlc_instance_t * libvlc_new(int argc, const char *const *argv)
Definition: libvlc.h:347
LIBVLC_API const char * libvlc_printerr(const char *fmt,...)
LIBVLC_API void libvlc_module_description_list_release(libvlc_module_description_t *p_list)
Definition: libvlc.h:349
LIBVLC_API void libvlc_log_set_file(libvlc_instance_t *, FILE *stream)
Definition: vlc_messages.h:57
Definition: libvlc.h:350
LIBVLC_API void libvlc_log_unset(libvlc_instance_t *)
LIBVLC_API const char * libvlc_get_version(void)
LIBVLC_API void libvlc_free(void *ptr)
LIBVLC_API const char * libvlc_errmsg(void)
LIBVLC_DEPRECATED LIBVLC_API int libvlc_log_iterator_has_next(const libvlc_log_iterator_t *p_iter)
LIBVLC_API void libvlc_release(libvlc_instance_t *p_instance)
int libvlc_event_type_t
Definition: libvlc.h:284
LIBVLC_API libvlc_module_description_t * libvlc_video_filter_list_get(libvlc_instance_t *p_instance)
Definition: libvlc.h:348
LIBVLC_API const char * libvlc_get_changeset(void)