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: 150e67fd5a8bbae57e6ba7e2a9af0a7aa94b145c $
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 /* Object flags */
00049 #define OBJECT_FLAGS_NODBG       0x0001
00050 #define OBJECT_FLAGS_QUIET       0x0002
00051 #define OBJECT_FLAGS_NOINTERACT  0x0004
00052 
00053 /* Types */
00054 typedef void (*vlc_destructor_t)(struct vlc_object_t *);
00055 
00056 /*****************************************************************************
00057  * The vlc_object_t type. Yes, it's that simple :-)
00058  *****************************************************************************/
00059 /** The main vlc_object_t structure */
00060 struct vlc_object_t
00061 {
00062     VLC_COMMON_MEMBERS
00063 };
00064 
00065 /*****************************************************************************
00066  * Prototypes
00067  *****************************************************************************/
00068 VLC_EXPORT( void *, vlc_object_create, ( vlc_object_t *, size_t ) ) LIBVLC_MALLOC LIBVLC_USED;
00069 VLC_EXPORT( void, vlc_object_set_destructor, ( vlc_object_t *, vlc_destructor_t ) );
00070 VLC_EXPORT( void, vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
00071 #if defined (__GNUC__) && !defined __cplusplus
00072 __attribute__((deprecated))
00073 #endif
00074 VLC_EXPORT( void *, vlc_object_find, ( vlc_object_t *, int, int ) ) LIBVLC_USED;
00075 #if defined (__GNUC__) && !defined __cplusplus
00076 __attribute__((deprecated))
00077 #endif
00078 VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) ) LIBVLC_USED;
00079 VLC_EXPORT( void *, vlc_object_hold, ( vlc_object_t * ) );
00080 VLC_EXPORT( void, vlc_object_release, ( vlc_object_t * ) );
00081 VLC_EXPORT( vlc_list_t *, vlc_list_children, ( vlc_object_t * ) ) LIBVLC_USED;
00082 VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
00083 VLC_EXPORT( char *, vlc_object_get_name, ( const vlc_object_t * ) ) LIBVLC_USED;
00084 #define vlc_object_get_name(o) vlc_object_get_name(VLC_OBJECT(o))
00085 
00086 /**}@*/
00087 
00088 #define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
00089 
00090 #define vlc_object_set_destructor(a,b) \
00091     vlc_object_set_destructor( VLC_OBJECT(a), b )
00092 
00093 #define vlc_object_attach(a,b) \
00094     vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
00095 
00096 #define vlc_object_find(a,b,c) \
00097     vlc_object_find( VLC_OBJECT(a),b,c)
00098 
00099 #define vlc_object_find_name(a,b,c) \
00100     vlc_object_find_name( VLC_OBJECT(a),b,c)
00101 
00102 #define vlc_object_hold(a) \
00103     vlc_object_hold( VLC_OBJECT(a) )
00104 
00105 #define vlc_object_release(a) \
00106     vlc_object_release( VLC_OBJECT(a) )
00107 
00108 #define vlc_list_children(a) \
00109     vlc_list_children( VLC_OBJECT(a) )
00110 
00111 /* Objects and threading */
00112 VLC_EXPORT( void, vlc_object_kill, ( vlc_object_t * ) );
00113 #define vlc_object_kill(a) \
00114     vlc_object_kill( VLC_OBJECT(a) )
00115 
00116 LIBVLC_USED
00117 static inline bool vlc_object_alive (const vlc_object_t *obj)
00118 {
00119     barrier ();
00120     return !obj->b_die;
00121 }
00122 
00123 #define vlc_object_alive(a) vlc_object_alive( VLC_OBJECT(a) )
00124 
00125 /** @} */

Generated on Mon Nov 22 07:55:20 2010 for VLC by  doxygen 1.5.6