Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.hardware.media@1.0;
     18 
     19 import android.hardware.graphics.common@1.0::PixelFormat;
     20 
     21 /**
     22  * Aliases
     23  */
     24 typedef handle FileDescriptor; // This must have no more than one fd.
     25 typedef FileDescriptor Fence;
     26 typedef vec<uint8_t> Bytes;
     27 
     28 /**
     29  * Ref: frameworks/native/include/ui/GraphicBuffer.h
     30  * Ref: system/core/include/system/window.h: ANativeWindowBuffer
     31  */
     32 
     33 /**
     34  * This struct contains attributes for a gralloc buffer that can be put into a
     35  * union.
     36  */
     37 struct AnwBufferAttributes {
     38     uint32_t width;
     39     uint32_t height;
     40     uint32_t stride;
     41     PixelFormat format;
     42     uint32_t usage; // TODO: convert to an enum
     43     uint32_t generationNumber;
     44     uint64_t layerCount;
     45     uint64_t id;
     46 };
     47 
     48 /**
     49  * An AnwBuffer is simply AnwBufferAttributes plus a native handle.
     50  */
     51 struct AnwBuffer {
     52     handle nativeHandle;
     53     AnwBufferAttributes attr;
     54 };
     55 
     56 /**
     57  * Ref: frameworks/native/include/android/rect.h
     58  * Ref: frameworks/native/include/ui/Rect.h
     59  */
     60 struct Rect {
     61     int32_t left;
     62     int32_t top;
     63     int32_t right;
     64     int32_t bottom;
     65 };
     66 
     67 /**
     68  * Ref: frameworks/native/include/ui/Region.h
     69  */
     70 typedef vec<Rect> Region;
     71 
     72