/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef VTS_VNDK_HIDL_BUFFERPOOL_V1_0_ALLOCATOR_H #define VTS_VNDK_HIDL_BUFFERPOOL_V1_0_ALLOCATOR_H #include using android::hardware::media::bufferpool::V1_0::ResultStatus; using android::hardware::media::bufferpool::V1_0::implementation:: BufferPoolAllocation; using android::hardware::media::bufferpool::V1_0::implementation:: BufferPoolAllocator; // buffer allocator for the tests class VtsBufferPoolAllocator : public BufferPoolAllocator { public: VtsBufferPoolAllocator(const std::shared_ptr &allocator) : mAllocator(allocator) {} ~VtsBufferPoolAllocator() override {} ResultStatus allocate(const std::vector ¶ms, std::shared_ptr *alloc, size_t *allocSize) override; bool compatible(const std::vector &newParams, const std::vector &oldParams) override; private: const std::shared_ptr mAllocator; }; // retrieve buffer allocator paramters void getVtsAllocatorParams(std::vector *params); #endif // VTS_VNDK_HIDL_BUFFERPOOL_V1_0_ALLOCATOR_H