aboutsummaryrefslogtreecommitdiff
path: root/components/include/v4l2_codec2/components/BitstreamBuffer.h
blob: d61e4f975b0416ac0ba5ba22079e06c93664a55a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ANDROID_V4L2_CODEC2_COMPONENTS_BITSTREAMBUFFER_H
#define ANDROID_V4L2_CODEC2_COMPONENTS_BITSTREAMBUFFER_H

#include <stdint.h>

namespace android {

// The BitstreamBuffer class can be used to store encoded video data.
// Note: The BitstreamBuffer does not take ownership of the data. The file descriptor is not
//       duplicated and the caller is responsible for keeping the data alive.
struct BitstreamBuffer {
    BitstreamBuffer(const int32_t id, int dmabuf_fd, const size_t offset, const size_t size)
          : id(id), dmabuf_fd(dmabuf_fd), offset(offset), size(size) {}
    ~BitstreamBuffer() = default;

    const int32_t id;
    int dmabuf_fd;
    const size_t offset;
    const size_t size;
};

}  // namespace android

#endif  // ANDROID_V4L2_CODEC2_COMPONENTS_BITSTREAMBUFFER_H