My Project
/home/jvcleave/Desktop/RASPBERRY_PI/userland/interface/mmal/core/mmal_component_private.h
00001 /*
00002 Copyright (c) 2012, Broadcom Europe Ltd
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of the copyright holder nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00028 #ifndef MMAL_COMPONENT_PRIVATE_H
00029 #define MMAL_COMPONENT_PRIVATE_H
00030 
00031 #define MMAL_VIDEO_DECODE  "video_decode"
00032 #define MMAL_VIDEO_ENCODE  "video_encode"
00033 #define MMAL_VIDEO_RENDER  "video_render"
00034 #define MMAL_AUDIO_DECODE  "audio_decode"
00035 #define MMAL_AUDIO_ENCODE  "audio_encode"
00036 #define MMAL_AUDIO_RENDER  "audio_render"
00037 #define MMAL_CAMERA        "camera"
00038 
00039 #if defined(__GNUC__) && (__GNUC__ > 2)
00040 # define MMAL_CONSTRUCTOR(func) void __attribute__((constructor,used)) func(void)
00041 # define MMAL_DESTRUCTOR(func) void __attribute__((destructor,used)) func(void)
00042 #else
00043 # define MMAL_CONSTRUCTOR(func) void func(void)
00044 # define MMAL_DESTRUCTOR(func) void func(void)
00045 #endif
00046 
00047 #include "mmal.h"
00048 #include "mmal_component.h"
00049 
00051 struct MMAL_COMPONENT_PRIVATE_T
00052 {
00054    struct MMAL_COMPONENT_MODULE_T *module;
00055 
00056    MMAL_STATUS_T (*pf_enable)(MMAL_COMPONENT_T *component);
00057    MMAL_STATUS_T (*pf_disable)(MMAL_COMPONENT_T *component);
00058    MMAL_STATUS_T (*pf_destroy)(MMAL_COMPONENT_T *component);
00059 
00061    MMAL_POOL_T *event_pool;
00062 
00064    int refcount;
00067    int refcount_ports;
00068 
00071    int priority;
00072 };
00073 
00080 MMAL_STATUS_T mmal_component_parameter_set(MMAL_PORT_T *control_port,
00081                                            const MMAL_PARAMETER_HEADER_T *param);
00082 
00089 MMAL_STATUS_T mmal_component_parameter_get(MMAL_PORT_T *control_port,
00090                                            MMAL_PARAMETER_HEADER_T *param);
00091 
00101 MMAL_STATUS_T mmal_component_action_register(MMAL_COMPONENT_T *component,
00102                                              void (*pf_action)(MMAL_COMPONENT_T *));
00103 
00109 MMAL_STATUS_T mmal_component_action_deregister(MMAL_COMPONENT_T *component);
00110 
00117 MMAL_STATUS_T mmal_component_action_trigger(MMAL_COMPONENT_T *component);
00118 
00125 MMAL_STATUS_T mmal_component_action_lock(MMAL_COMPONENT_T *component);
00126 
00132 MMAL_STATUS_T mmal_component_action_unlock(MMAL_COMPONENT_T *component);
00133 
00135 typedef MMAL_STATUS_T (*MMAL_COMPONENT_SUPPLIER_FUNCTION_T)(const char *name,
00136                                                             MMAL_COMPONENT_T *component);
00137 
00148 MMAL_STATUS_T mmal_component_create_with_constructor(const char *name,
00149    MMAL_STATUS_T (*constructor)(const char *name, MMAL_COMPONENT_T *),
00150    struct MMAL_COMPONENT_MODULE_T *constructor_private,
00151    MMAL_COMPONENT_T **component);
00152 
00158 void mmal_component_supplier_register(const char *prefix,
00159                                       MMAL_COMPONENT_SUPPLIER_FUNCTION_T create_fn);
00160 
00161 #endif /* MMAL_COMPONENT_PRIVATE_H */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines