media/omx-plugin/include/froyo/hardware/hardware.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 * Copyright (C) 2008 The Android Open Source Project
michael@0 3 *
michael@0 4 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 5 * you may not use this file except in compliance with the License.
michael@0 6 * You may obtain a copy of the License at
michael@0 7 *
michael@0 8 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 9 *
michael@0 10 * Unless required by applicable law or agreed to in writing, software
michael@0 11 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 13 * See the License for the specific language governing permissions and
michael@0 14 * limitations under the License.
michael@0 15 */
michael@0 16
michael@0 17 #ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H
michael@0 18 #define ANDROID_INCLUDE_HARDWARE_HARDWARE_H
michael@0 19
michael@0 20 #include <stdint.h>
michael@0 21 #include <sys/cdefs.h>
michael@0 22
michael@0 23 #include <cutils/native_handle.h>
michael@0 24
michael@0 25 __BEGIN_DECLS
michael@0 26
michael@0 27 /*
michael@0 28 * Value for the hw_module_t.tag field
michael@0 29 */
michael@0 30
michael@0 31 #define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
michael@0 32
michael@0 33 #define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')
michael@0 34 #define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')
michael@0 35
michael@0 36 struct hw_module_t;
michael@0 37 struct hw_module_methods_t;
michael@0 38 struct hw_device_t;
michael@0 39
michael@0 40 /**
michael@0 41 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
michael@0 42 * and the fields of this data structure must begin with hw_module_t
michael@0 43 * followed by module specific information.
michael@0 44 */
michael@0 45 typedef struct hw_module_t {
michael@0 46 /** tag must be initialized to HARDWARE_MODULE_TAG */
michael@0 47 uint32_t tag;
michael@0 48
michael@0 49 /** major version number for the module */
michael@0 50 uint16_t version_major;
michael@0 51
michael@0 52 /** minor version number of the module */
michael@0 53 uint16_t version_minor;
michael@0 54
michael@0 55 /** Identifier of module */
michael@0 56 const char *id;
michael@0 57
michael@0 58 /** Name of this module */
michael@0 59 const char *name;
michael@0 60
michael@0 61 /** Author/owner/implementor of the module */
michael@0 62 const char *author;
michael@0 63
michael@0 64 /** Modules methods */
michael@0 65 struct hw_module_methods_t* methods;
michael@0 66
michael@0 67 /** module's dso */
michael@0 68 void* dso;
michael@0 69
michael@0 70 /** padding to 128 bytes, reserved for future use */
michael@0 71 uint32_t reserved[32-7];
michael@0 72
michael@0 73 } hw_module_t;
michael@0 74
michael@0 75 typedef struct hw_module_methods_t {
michael@0 76 /** Open a specific device */
michael@0 77 int (*open)(const struct hw_module_t* module, const char* id,
michael@0 78 struct hw_device_t** device);
michael@0 79
michael@0 80 } hw_module_methods_t;
michael@0 81
michael@0 82 /**
michael@0 83 * Every device data structure must begin with hw_device_t
michael@0 84 * followed by module specific public methods and attributes.
michael@0 85 */
michael@0 86 typedef struct hw_device_t {
michael@0 87 /** tag must be initialized to HARDWARE_DEVICE_TAG */
michael@0 88 uint32_t tag;
michael@0 89
michael@0 90 /** version number for hw_device_t */
michael@0 91 uint32_t version;
michael@0 92
michael@0 93 /** reference to the module this device belongs to */
michael@0 94 struct hw_module_t* module;
michael@0 95
michael@0 96 /** padding reserved for future use */
michael@0 97 uint32_t reserved[12];
michael@0 98
michael@0 99 /** Close this device */
michael@0 100 int (*close)(struct hw_device_t* device);
michael@0 101
michael@0 102 } hw_device_t;
michael@0 103
michael@0 104 /**
michael@0 105 * Name of the hal_module_info
michael@0 106 */
michael@0 107 #define HAL_MODULE_INFO_SYM HMI
michael@0 108
michael@0 109 /**
michael@0 110 * Name of the hal_module_info as a string
michael@0 111 */
michael@0 112 #define HAL_MODULE_INFO_SYM_AS_STR "HMI"
michael@0 113
michael@0 114 /**
michael@0 115 * Get the module info associated with a module by id.
michael@0 116 * @return: 0 == success, <0 == error and *pHmi == NULL
michael@0 117 */
michael@0 118 int hw_get_module(const char *id, const struct hw_module_t **module);
michael@0 119
michael@0 120
michael@0 121 /**
michael@0 122 * pixel format definitions
michael@0 123 */
michael@0 124
michael@0 125 enum {
michael@0 126 HAL_PIXEL_FORMAT_RGBA_8888 = 1,
michael@0 127 HAL_PIXEL_FORMAT_RGBX_8888 = 2,
michael@0 128 HAL_PIXEL_FORMAT_RGB_888 = 3,
michael@0 129 HAL_PIXEL_FORMAT_RGB_565 = 4,
michael@0 130 HAL_PIXEL_FORMAT_BGRA_8888 = 5,
michael@0 131 HAL_PIXEL_FORMAT_RGBA_5551 = 6,
michael@0 132 HAL_PIXEL_FORMAT_RGBA_4444 = 7,
michael@0 133 HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10,
michael@0 134 HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11,
michael@0 135 HAL_PIXEL_FORMAT_YCbCr_422_P = 0x12,
michael@0 136 HAL_PIXEL_FORMAT_YCbCr_420_P = 0x13,
michael@0 137 HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14,
michael@0 138 HAL_PIXEL_FORMAT_YCbCr_420_I = 0x15,
michael@0 139 HAL_PIXEL_FORMAT_CbYCrY_422_I = 0x16,
michael@0 140 HAL_PIXEL_FORMAT_CbYCrY_420_I = 0x17,
michael@0 141 HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED = 0x20,
michael@0 142 HAL_PIXEL_FORMAT_YCbCr_420_SP = 0x21,
michael@0 143 HAL_PIXEL_FORMAT_YCrCb_420_SP_TILED = 0x22,
michael@0 144 HAL_PIXEL_FORMAT_YCrCb_422_SP = 0x23,
michael@0 145 };
michael@0 146
michael@0 147
michael@0 148 /**
michael@0 149 * Transformation definitions
michael@0 150 */
michael@0 151
michael@0 152 enum {
michael@0 153 /* flip source image horizontally */
michael@0 154 HAL_TRANSFORM_FLIP_H = 0x01,
michael@0 155 /* flip source image vertically */
michael@0 156 HAL_TRANSFORM_FLIP_V = 0x02,
michael@0 157 /* rotate source image 90 degrees */
michael@0 158 HAL_TRANSFORM_ROT_90 = 0x04,
michael@0 159 /* rotate source image 180 degrees */
michael@0 160 HAL_TRANSFORM_ROT_180 = 0x03,
michael@0 161 /* rotate source image 270 degrees */
michael@0 162 HAL_TRANSFORM_ROT_270 = 0x07,
michael@0 163 };
michael@0 164
michael@0 165 __END_DECLS
michael@0 166
michael@0 167 #endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */

mercurial