1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/omx-plugin/include/ics/system/graphics.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,123 @@ 1.4 +/* 1.5 + * Copyright (C) 2011 The Android Open Source Project 1.6 + * 1.7 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.8 + * you may not use this file except in compliance with the License. 1.9 + * You may obtain a copy of the License at 1.10 + * 1.11 + * http://www.apache.org/licenses/LICENSE-2.0 1.12 + * 1.13 + * Unless required by applicable law or agreed to in writing, software 1.14 + * distributed under the License is distributed on an "AS IS" BASIS, 1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.16 + * See the License for the specific language governing permissions and 1.17 + * limitations under the License. 1.18 + */ 1.19 + 1.20 +#ifndef SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H 1.21 +#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H 1.22 + 1.23 +#ifdef __cplusplus 1.24 +extern "C" { 1.25 +#endif 1.26 + 1.27 +/* 1.28 + * If the HAL needs to create service threads to handle graphics related 1.29 + * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority 1.30 + * if they can block the main rendering thread in any way. 1.31 + * 1.32 + * the priority of the current thread can be set with: 1.33 + * 1.34 + * #include <sys/resource.h> 1.35 + * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); 1.36 + * 1.37 + */ 1.38 + 1.39 +#define HAL_PRIORITY_URGENT_DISPLAY (-8) 1.40 + 1.41 +/** 1.42 + * pixel format definitions 1.43 + */ 1.44 + 1.45 +enum { 1.46 + HAL_PIXEL_FORMAT_RGBA_8888 = 1, 1.47 + HAL_PIXEL_FORMAT_RGBX_8888 = 2, 1.48 + HAL_PIXEL_FORMAT_RGB_888 = 3, 1.49 + HAL_PIXEL_FORMAT_RGB_565 = 4, 1.50 + HAL_PIXEL_FORMAT_BGRA_8888 = 5, 1.51 + HAL_PIXEL_FORMAT_RGBA_5551 = 6, 1.52 + HAL_PIXEL_FORMAT_RGBA_4444 = 7, 1.53 + 1.54 + /* 0x8 - 0xFF range unavailable */ 1.55 + 1.56 + /* 1.57 + * 0x100 - 0x1FF 1.58 + * 1.59 + * This range is reserved for pixel formats that are specific to the HAL 1.60 + * implementation. Implementations can use any value in this range to 1.61 + * communicate video pixel formats between their HAL modules. These formats 1.62 + * must not have an alpha channel. Additionally, an EGLimage created from a 1.63 + * gralloc buffer of one of these formats must be supported for use with the 1.64 + * GL_OES_EGL_image_external OpenGL ES extension. 1.65 + */ 1.66 + 1.67 + /* 1.68 + * Android YUV format: 1.69 + * 1.70 + * This format is exposed outside of the HAL to software decoders and 1.71 + * applications. EGLImageKHR must support it in conjunction with the 1.72 + * OES_EGL_image_external extension. 1.73 + * 1.74 + * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed 1.75 + * by (W/2) x (H/2) Cr and Cb planes. 1.76 + * 1.77 + * This format assumes 1.78 + * - an even width 1.79 + * - an even height 1.80 + * - a horizontal stride multiple of 16 pixels 1.81 + * - a vertical stride equal to the height 1.82 + * 1.83 + * y_size = stride * height 1.84 + * c_size = ALIGN(stride/2, 16) * height/2 1.85 + * size = y_size + c_size * 2 1.86 + * cr_offset = y_size 1.87 + * cb_offset = y_size + c_size 1.88 + * 1.89 + */ 1.90 + HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar 1.91 + 1.92 + 1.93 + 1.94 + /* Legacy formats (deprecated), used by ImageFormat.java */ 1.95 + HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 1.96 + HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 1.97 + HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 1.98 +}; 1.99 + 1.100 + 1.101 +/** 1.102 + * Transformation definitions 1.103 + * 1.104 + * IMPORTANT NOTE: 1.105 + * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. 1.106 + * 1.107 + */ 1.108 + 1.109 +enum { 1.110 + /* flip source image horizontally (around the vertical axis) */ 1.111 + HAL_TRANSFORM_FLIP_H = 0x01, 1.112 + /* flip source image vertically (around the horizontal axis)*/ 1.113 + HAL_TRANSFORM_FLIP_V = 0x02, 1.114 + /* rotate source image 90 degrees clockwise */ 1.115 + HAL_TRANSFORM_ROT_90 = 0x04, 1.116 + /* rotate source image 180 degrees */ 1.117 + HAL_TRANSFORM_ROT_180 = 0x03, 1.118 + /* rotate source image 270 degrees clockwise */ 1.119 + HAL_TRANSFORM_ROT_270 = 0x07, 1.120 +}; 1.121 + 1.122 +#ifdef __cplusplus 1.123 +} 1.124 +#endif 1.125 + 1.126 +#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */