blob: d913d5786bdec825d38d078742ce234af549ec20 [file] [log] [blame]
Roman Stratiienko946126c2020-10-02 19:01:10 +03001/*
Roman Stratiienkob2e9fe22020-10-03 10:52:36 +03002 * Copyright (C) 2020 The Android Open Source Project
Roman Stratiienko946126c2020-10-02 19:01:10 +03003 *
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 Stratiienkobde95662022-12-10 20:27:58 +020017#pragma once
Roman Stratiienko946126c2020-10-02 19:01:10 +030018
19#include <hardware/gralloc.h>
20
Roman Stratiienkob2e9fe22020-10-03 10:52:36 +030021#include "bufferinfo/BufferInfoGetter.h"
Roman Stratiienko946126c2020-10-02 19:01:10 +030022
23namespace android {
24
Roman Stratiienkob2e9fe22020-10-03 10:52:36 +030025class BufferInfoLibdrm : public LegacyBufferInfoGetter {
Roman Stratiienko946126c2020-10-02 19:01:10 +030026 public:
Roman Stratiienkob2e9fe22020-10-03 10:52:36 +030027 using LegacyBufferInfoGetter::LegacyBufferInfoGetter;
Roman Stratiienkoe9fbd8d2022-02-21 13:03:29 +020028 auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override;
Roman Stratiienko39d8f7e2021-11-30 17:06:44 +020029 int ValidateGralloc() override;
Roman Stratiienko946126c2020-10-02 19:01:10 +030030
31 private:
Roman Stratiienko1cbaaf92022-02-21 10:52:18 +020032 bool GetYuvPlaneInfo(uint32_t hal_format, int num_fds, buffer_handle_t handle,
33 BufferInfo *bo);
Roman Stratiienko946126c2020-10-02 19:01:10 +030034};
35
36} // namespace android