vlc_objects.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_objects.h: vlc_object_t definition and manipulation methods
00003  *****************************************************************************
00004  * Copyright (C) 2002-2008 the VideoLAN team
00005  * $Id: 3232dfcecd76b057debe2c8f4e737043ec40a6bb $
00006  *
00007  * Authors: Samuel Hocevar <sam@zoy.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /**
00025  * \file
00026  * This file defines the vlc_object_t structure and object types.
00027  */
00028 
00029 /**
00030  * \defgroup vlc_object Objects
00031  * @{
00032  */
00033 
00034 /* Object types */
00035 #define VLC_OBJECT_INPUT       (-7)
00036 #define VLC_OBJECT_DECODER     (-8)
00037 #define VLC_OBJECT_VOUT        (-9)
00038 #define VLC_OBJECT_AOUT        (-10)
00039 /* Please add new object types below -34 */
00040 /* Please do not add new object types anyway */
00041 #define VLC_OBJECT_GENERIC     (-666)
00042 
00043 /* Object search mode */
00044 #define FIND_PARENT         0x0001
00045 #define FIND_CHILD          0x0002
00046 #define FIND_ANYWHERE       0x0003
00047 
00048 #define FIND_STRICT         0x0010
00049 
00050 /* Object flags */
00051 #define OBJECT_FLAGS_NODBG       0x0001
00052 #define OBJECT_FLAGS_QUIET       0x0002
00053 #define OBJECT_FLAGS_NOINTERACT  0x0004
00054 
00055 /* Types */
00056 typedef void (*vlc_destructor_t)(struct vlc_object_t *);
00057 
00058 /*****************************************************************************
00059  * The vlc_object_t type. Yes, it's that simple :-)
00060  *****************************************************************************/
00061 /** The main vlc_object_t structure */
00062 struct vlc_object_t
00063 {
00064     VLC_COMMON_MEMBERS
00065 };
00066 
00067 /*****************************************************************************
00068  * Prototypes
00069  *****************************************************************************/
00070 VLC_EXPORT( void *, __vlc_object_create, ( vlc_object_t *, int ) ) LIBVLC_MALLOC LIBVLC_USED;
00071 VLC_EXPORT( void, __vlc_object_set_destructor, ( vlc_object_t *, vlc_destructor_t ) );
00072 VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
00073 VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) );
00074 #if defined (__GNUC__) && !defined __cplusplus
00075 __attribute__((deprecated))
00076 #endif
00077 VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) ) LIBVLC_USED;
00078 #if defined (__GNUC__) && !defined __cplusplus
00079 __attribute__((deprecated))
00080 #endif
00081 VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) ) LIBVLC_USED;
00082 VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) );
00083 VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
00084 VLC_EXPORT( vlc_list_t *, __vlc_list_children, ( vlc_object_t * ) ) LIBVLC_USED;
00085 VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
00086 VLC_EXPORT( char *, vlc_object_get_name, ( const vlc_object_t * ) ) LIBVLC_USED;
00087 #define vlc_object_get_name(o) vlc_object_get_name(VLC_OBJECT(o))
00088 
00089 /*}@*/
00090 
00091 #define vlc_object_create(a,b) \
00092     __vlc_object_create( VLC_OBJECT(a), b )
00093 
00094 #define vlc_object_set_destructor(a,b) \
00095     __vlc_object_set_destructor( VLC_OBJECT(a), b )
00096 
00097 #define vlc_object_detach(a) \
00098     __vlc_object_detach( VLC_OBJECT(a) )
00099 
00100 #define vlc_object_attach(a,b) \
00101     __vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
00102 
00103 #define vlc_object_find(a,b,c) \
00104     __vlc_object_find( VLC_OBJECT(a),b,c)
00105 
00106 #define vlc_object_find_name(a,b,c) \
00107     vlc_object_find_name( VLC_OBJECT(a),b,c)
00108 
00109 #define vlc_object_hold(a) \
00110     __vlc_object_hold( VLC_OBJECT(a) )
00111 
00112 #define vlc_object_release(a) \
00113     __vlc_object_release( VLC_OBJECT(a) )
00114 
00115 #define vlc_list_children(a) \
00116     __vlc_list_children( VLC_OBJECT(a) )
00117 
00118 /* Objects and threading */
00119 VLC_EXPORT( void, __vlc_object_kill, ( vlc_object_t * ) );
00120 #define vlc_object_kill(a) \
00121     __vlc_object_kill( VLC_OBJECT(a) )
00122 
00123 LIBVLC_USED
00124 static inline bool vlc_object_alive (const vlc_object_t *obj)
00125 {
00126     barrier ();
00127     return !obj->b_die;
00128 }
00129 
00130 #define vlc_object_alive(a) vlc_object_alive( VLC_OBJECT(a) )

Generated on Sun Nov 22 08:05:13 2009 for VLC by  doxygen 1.5.6