Android-cuttlefish cvd tool
cvd_abgr_video_frame_buffer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 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#pragma once
18
19#include <stdint.h>
20
21#include <vector>
22
24
25namespace cuttlefish {
26
28 public:
29 CvdAbgrVideoFrameBuffer(int width, int height, uint32_t format, int stride,
30 const uint8_t* data);
31 ~CvdAbgrVideoFrameBuffer() override = default;
32
33 int width() const override { return width_; }
34 int height() const override { return height_; }
35
36 uint8_t* Data() const override { return const_cast<uint8_t*>(data_.data()); }
37 int Stride() const override { return stride_; }
38 std::size_t DataSize() const override { return data_.size(); }
39 uint32_t PixelFormat() const override { return format_; }
40
41 std::unique_ptr<VideoFrameBuffer> Clone() const override;
42
43 private:
44 int width_;
46 uint32_t format_;
48 std::vector<uint8_t> data_;
49};
50
51} // namespace cuttlefish
Definition: cvd_abgr_video_frame_buffer.h:27
uint32_t format_
Definition: cvd_abgr_video_frame_buffer.h:46
std::unique_ptr< VideoFrameBuffer > Clone() const override
Definition: cvd_abgr_video_frame_buffer.cpp:32
uint8_t * Data() const override
Definition: cvd_abgr_video_frame_buffer.h:36
int height() const override
Definition: cvd_abgr_video_frame_buffer.h:34
int width_
Definition: cvd_abgr_video_frame_buffer.h:44
int width() const override
Definition: cvd_abgr_video_frame_buffer.h:33
std::vector< uint8_t > data_
Definition: cvd_abgr_video_frame_buffer.h:48
~CvdAbgrVideoFrameBuffer() override=default
uint32_t PixelFormat() const override
Definition: cvd_abgr_video_frame_buffer.h:39
int Stride() const override
Definition: cvd_abgr_video_frame_buffer.h:37
int height_
Definition: cvd_abgr_video_frame_buffer.h:45
std::size_t DataSize() const override
Definition: cvd_abgr_video_frame_buffer.h:38
CvdAbgrVideoFrameBuffer(int width, int height, uint32_t format, int stride, const uint8_t *data)
Definition: cvd_abgr_video_frame_buffer.cpp:23
int stride_
Definition: cvd_abgr_video_frame_buffer.h:47
Definition: video_frame_buffer.h:42
#define data
Definition: dict.c:56
EventFormat format
Definition: kernel_log_server.cc:60
Definition: alloc_driver.h:20