1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/omx-plugin/include/gb/ui/android_native_buffer.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,75 @@ 1.4 +/* 1.5 + * Copyright (C) 2009 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 ANDROID_ANDROID_NATIVES_PRIV_H 1.21 +#define ANDROID_ANDROID_NATIVES_PRIV_H 1.22 + 1.23 +#include <ui/egl/android_natives.h> 1.24 + 1.25 +#ifdef __cplusplus 1.26 +extern "C" { 1.27 +#endif 1.28 + 1.29 +/*****************************************************************************/ 1.30 + 1.31 +typedef struct android_native_buffer_t 1.32 +{ 1.33 +#ifdef __cplusplus 1.34 + android_native_buffer_t() { 1.35 + common.magic = ANDROID_NATIVE_BUFFER_MAGIC; 1.36 + common.version = sizeof(android_native_buffer_t); 1.37 + memset(common.reserved, 0, sizeof(common.reserved)); 1.38 + } 1.39 + 1.40 + // Implement the methods that sp<android_native_buffer_t> expects so that it 1.41 + // can be used to automatically refcount android_native_buffer_t's. 1.42 + void incStrong(const void* id) const { 1.43 + common.incRef(const_cast<android_native_base_t*>(&common)); 1.44 + } 1.45 + void decStrong(const void* id) const { 1.46 + common.decRef(const_cast<android_native_base_t*>(&common)); 1.47 + } 1.48 +#endif 1.49 + 1.50 + struct android_native_base_t common; 1.51 + 1.52 + int width; 1.53 + int height; 1.54 + int stride; 1.55 + int format; 1.56 + int usage; 1.57 + 1.58 + /* transformation as defined in hardware.h */ 1.59 + uint8_t transform; 1.60 + 1.61 + uint8_t reserved_bytes[3]; 1.62 + void* reserved[1]; 1.63 + 1.64 + buffer_handle_t handle; 1.65 + 1.66 + void* reserved_proc[8]; 1.67 +} android_native_buffer_t; 1.68 + 1.69 + 1.70 +/*****************************************************************************/ 1.71 + 1.72 +#ifdef __cplusplus 1.73 +} 1.74 +#endif 1.75 + 1.76 +/*****************************************************************************/ 1.77 + 1.78 +#endif /* ANDROID_ANDROID_NATIVES_PRIV_H */