Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 1 | /* |
Roman Stratiienko | b2e9fe2 | 2020-10-03 10:52:36 +0300 | [diff] [blame] | 2 | * Copyright (C) 2020 The Android Open Source Project |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 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 | |
Roman Stratiienko | bde9566 | 2022-12-10 20:27:58 +0200 | [diff] [blame^] | 17 | #pragma once |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 18 | |
| 19 | #include <hardware/gralloc.h> |
| 20 | |
Roman Stratiienko | b2e9fe2 | 2020-10-03 10:52:36 +0300 | [diff] [blame] | 21 | #include "bufferinfo/BufferInfoGetter.h" |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 22 | |
| 23 | namespace android { |
| 24 | |
Roman Stratiienko | b2e9fe2 | 2020-10-03 10:52:36 +0300 | [diff] [blame] | 25 | class BufferInfoLibdrm : public LegacyBufferInfoGetter { |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 26 | public: |
Roman Stratiienko | b2e9fe2 | 2020-10-03 10:52:36 +0300 | [diff] [blame] | 27 | using LegacyBufferInfoGetter::LegacyBufferInfoGetter; |
Roman Stratiienko | e9fbd8d | 2022-02-21 13:03:29 +0200 | [diff] [blame] | 28 | auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override; |
Roman Stratiienko | 39d8f7e | 2021-11-30 17:06:44 +0200 | [diff] [blame] | 29 | int ValidateGralloc() override; |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 30 | |
| 31 | private: |
Roman Stratiienko | 1cbaaf9 | 2022-02-21 10:52:18 +0200 | [diff] [blame] | 32 | bool GetYuvPlaneInfo(uint32_t hal_format, int num_fds, buffer_handle_t handle, |
| 33 | BufferInfo *bo); |
Roman Stratiienko | 946126c | 2020-10-02 19:01:10 +0300 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | } // namespace android |