1 /* 2 * Copyright (C) 2020 Google LLC. All rights reserved. 3 * 4 * Copyright (C) 2008 The Android Open Source Project 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef GRALLOC_VENDOR_INTERFACE_H 20 #define GRALLOC_VENDOR_INTERFACE_H 21 22 #include <cutils/native_handle.h> 23 #include <sys/types.h> 24 #include <cstdint> 25 #include <system/graphics-base-v1.0.h> 26 27 28 namespace android::hardware::graphics::allocator::priv { 29 30 struct Descriptor; 31 Descriptor *createDescriptor(); 32 void deleteDescriptor(Descriptor *descriptor); 33 34 void setProducerUsage(Descriptor &descriptor, uint64_t usage); 35 void setConsumerUsage(Descriptor &descriptor, uint64_t usage); 36 void setPlaneCount(Descriptor &descriptor, int count); 37 void setPlane(Descriptor &descriptor, int index, int fd, size_t size, off_t offset, int stride_byte); 38 void setWidth(Descriptor &descriptor, int width); 39 void setHeight(Descriptor &descriptor, int height); 40 void setStridePixel(Descriptor &descriptor, int stride_pixel); 41 void setFormat(Descriptor &descriptor, int format); 42 43 buffer_handle_t createNativeHandle(const Descriptor &descriptor); 44 45 } // namespace android::hardware::graphics::allocator::priv 46 47 #endif 48