libvlc_internal.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_internal.h : Definition of opaque structures for libvlc exported API
00003  * Also contains some internal utility functions
00004  *****************************************************************************
00005  * Copyright (C) 2005-2009 the VideoLAN team
00006  * $Id: 7e784cd70909f882b71646a833db951c3e5543ae $
00007  *
00008  * Authors: Clément Stenac <zorglub@videolan.org>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef _LIBVLC_INTERNAL_H
00026 #define _LIBVLC_INTERNAL_H 1
00027 
00028 #ifdef HAVE_CONFIG_H
00029 # include "config.h"
00030 #endif
00031 
00032 #include <vlc/libvlc_structures.h>
00033 #include <vlc/libvlc.h>
00034 #include <vlc/libvlc_media.h>
00035 #include <vlc/libvlc_events.h>
00036 
00037 #include <vlc_common.h>
00038 
00039 /***************************************************************************
00040  * Internal creation and destruction functions
00041  ***************************************************************************/
00042 VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) );
00043 VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) );
00044 VLC_EXPORT (void, libvlc_InternalCleanup, ( libvlc_int_t * ) );
00045 VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) );
00046 
00047 VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) );
00048 VLC_EXPORT (void, libvlc_InternalWait, ( libvlc_int_t * ) );
00049 
00050 typedef void (*libvlc_vlm_release_func_t)( libvlc_instance_t * ) ;
00051 
00052 /***************************************************************************
00053  * Opaque structures for libvlc API
00054  ***************************************************************************/
00055 
00056 typedef struct libvlc_vlm_t
00057 {
00058     vlm_t                  *p_vlm;
00059     libvlc_event_manager_t *p_event_manager;
00060     libvlc_vlm_release_func_t pf_release;
00061 } libvlc_vlm_t;
00062 
00063 struct libvlc_instance_t
00064 {
00065     libvlc_int_t *p_libvlc_int;
00066     libvlc_vlm_t  libvlc_vlm;
00067     unsigned      ref_count;
00068     int           verbosity;
00069     vlc_mutex_t   instance_lock;
00070     struct libvlc_callback_entry_list_t *p_callback_list;
00071 };
00072 
00073 
00074 /***************************************************************************
00075  * Other internal functions
00076  ***************************************************************************/
00077 
00078 /* Thread context */
00079 void libvlc_init_threads (void);
00080 void libvlc_deinit_threads (void);
00081 
00082 /* Events */
00083 libvlc_event_manager_t * libvlc_event_manager_new(
00084         void * p_obj, libvlc_instance_t * p_libvlc_inst,
00085         libvlc_exception_t *p_e );
00086 
00087 void libvlc_event_manager_release(
00088         libvlc_event_manager_t * p_em );
00089 
00090 void libvlc_event_manager_register_event_type(
00091         libvlc_event_manager_t * p_em,
00092         libvlc_event_type_t event_type,
00093         libvlc_exception_t * p_e );
00094 
00095 void libvlc_event_send(
00096         libvlc_event_manager_t * p_em,
00097         libvlc_event_t * p_event );
00098 
00099 void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager,
00100                                libvlc_event_type_t event_type,
00101                                libvlc_callback_t pf_callback,
00102                                void *p_user_data,
00103                                libvlc_exception_t *p_e );
00104 
00105 /* Exception shorcuts */
00106 
00107 #define RAISENULL( ... ) { libvlc_printerr(__VA_ARGS__); \
00108                            libvlc_exception_raise( p_e ); \
00109                            return NULL; }
00110 #define RAISEZERO( ... ) { libvlc_printerr(__VA_ARGS__); \
00111                            libvlc_exception_raise( p_e ); \
00112                            return 0; }
00113 
00114 #endif

Generated on Sat Nov 21 08:05:24 2009 for VLC by  doxygen 1.5.6