X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Flibvlc_internal.h;h=c079f8dba9f7fe5787d477ed12752259c32f4cc0;hb=HEAD;hp=2813682fa5e14db75a1f52a1f658f23301563698;hpb=85ff1461a28b5ec29f881aaaa960a242750704fb;p=vlc diff --git a/src/control/libvlc_internal.h b/src/control/libvlc_internal.h index 2813682fa5..c079f8dba9 100644 --- a/src/control/libvlc_internal.h +++ b/src/control/libvlc_internal.h @@ -2,8 +2,8 @@ * libvlc_internal.h : Definition of opaque structures for libvlc exported API * Also contains some internal utility functions ***************************************************************************** - * Copyright (C) 2005 the VideoLAN team - * $Id: control_structures.h 13752 2005-12-15 10:14:42Z oaubert $ + * Copyright (C) 2005-2009 the VideoLAN team + * $Id$ * * Authors: Clément Stenac * @@ -25,51 +25,93 @@ #ifndef _LIBVLC_INTERNAL_H #define _LIBVLC_INTERNAL_H 1 -# ifdef __cplusplus -extern "C" { -# endif +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#include -#include +/* Note well: this header is included from LibVLC core. + * Therefore, static inline functions MUST NOT call LibVLC functions here + * (this can cause linkage failure on some platforms). */ /*************************************************************************** * Internal creation and destruction functions ***************************************************************************/ VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) ); -VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, char *ppsz_argv[] ) ); -VLC_EXPORT (int, libvlc_InternalCleanup, ( libvlc_int_t * ) ); -VLC_EXPORT (int, libvlc_InternalDestroy, ( libvlc_int_t *, vlc_bool_t ) ); +VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) ); +VLC_EXPORT (void, libvlc_InternalCleanup, ( libvlc_int_t * ) ); +VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) ); -VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char *, vlc_bool_t, - vlc_bool_t, int, const char *const * ) ); +VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) ); +VLC_EXPORT (void, libvlc_InternalWait, ( libvlc_int_t * ) ); +VLC_EXPORT (void, libvlc_SetExitHandler, ( libvlc_int_t *, void (*) (void *), void * ) ); + +typedef void (*libvlc_vlm_release_func_t)( libvlc_instance_t * ) ; /*************************************************************************** * Opaque structures for libvlc API ***************************************************************************/ +typedef struct libvlc_vlm_t +{ + vlm_t *p_vlm; + libvlc_event_manager_t *p_event_manager; + libvlc_vlm_release_func_t pf_release; +} libvlc_vlm_t; + struct libvlc_instance_t { libvlc_int_t *p_libvlc_int; - vlm_t *p_vlm; - int b_playlist_locked; + libvlc_vlm_t libvlc_vlm; + unsigned ref_count; + int verbosity; vlc_mutex_t instance_lock; + struct libvlc_callback_entry_list_t *p_callback_list; }; -struct libvlc_input_t -{ - int i_input_id; ///< Input object id. We don't use a pointer to - /// avoid any crash - struct libvlc_instance_t *p_instance; ///< Parent instance -}; -#define RAISENULL( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ - return NULL; } -#define RAISEVOID( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ - return; } -#define RAISEZERO( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \ - return 0; } +/*************************************************************************** + * Other internal functions + ***************************************************************************/ + +/* Thread context */ +void libvlc_init_threads (void); +void libvlc_deinit_threads (void); + +/* Events */ +libvlc_event_manager_t * libvlc_event_manager_new( + void * p_obj, libvlc_instance_t * p_libvlc_inst ); + +void libvlc_event_manager_release( + libvlc_event_manager_t * p_em ); + +void libvlc_event_manager_register_event_type( + libvlc_event_manager_t * p_em, + libvlc_event_type_t event_type ); + +void libvlc_event_send( + libvlc_event_manager_t * p_em, + libvlc_event_t * p_event ); -# ifdef __cplusplus +void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager, + libvlc_event_type_t event_type, + libvlc_callback_t pf_callback, + void *p_user_data ); + +static inline libvlc_time_t from_mtime(mtime_t time) +{ + return (time + 500ULL)/ 1000ULL; +} + +static inline mtime_t to_mtime(libvlc_time_t time) +{ + return time * 1000ULL; } -# endif #endif