1 /* 2 * Copyright (C) 2019 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 #ifndef ANDROID_GUI_BUFFERITEM_H 18 #define ANDROID_GUI_BUFFERITEM_H 19 20 #include <system/graphics.h> 21 #include <ui/Fence.h> 22 #include <ui/Rect.h> 23 #include <utils/StrongPointer.h> 24 25 namespace android { 26 27 class Fence; 28 29 class GraphicBuffer; 30 31 // The only thing we need here for layoutlib is mGraphicBuffer. The rest of the fields are added 32 // just to satisfy the calls from the android_media_ImageReader.h 33 34 class BufferItem { 35 public: 36 enum { INVALID_BUFFER_SLOT = -1 }; 37 BufferItem()38 BufferItem() : mGraphicBuffer(nullptr), mFence(Fence::NO_FENCE) {} 39 ~BufferItem()40 ~BufferItem() {} 41 42 sp<GraphicBuffer> mGraphicBuffer; 43 44 sp<Fence> mFence; 45 46 Rect mCrop; 47 48 uint32_t mTransform; 49 50 uint32_t mScalingMode; 51 52 int64_t mTimestamp; 53 54 android_dataspace mDataSpace; 55 56 uint64_t mFrameNumber; 57 58 int mSlot; 59 60 bool mTransformToDisplayInverse; 61 }; 62 63 } // namespace android 64 65 #endif // ANDROID_GUI_BUFFERITEM_H 66