Serenity Operating System
1/*
2 * Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/ByteBuffer.h>
10#include <AK/Time.h>
11#include <LibVideo/Color/CodingIndependentCodePoints.h>
12
13namespace Video {
14
15class Sample {
16public:
17 virtual ~Sample() = default;
18
19 virtual bool is_video_sample() const { return false; }
20};
21
22class VideoSample : public Sample {
23public:
24 VideoSample(ReadonlyBytes data, CodingIndependentCodePoints container_cicp, Time timestamp)
25 : m_data(data)
26 , m_container_cicp(container_cicp)
27 , m_timestamp(timestamp)
28 {
29 }
30
31 bool is_video_sample() const override { return true; }
32 ReadonlyBytes const& data() const { return m_data; }
33 CodingIndependentCodePoints container_cicp() const { return m_container_cicp; }
34 Time timestamp() const { return m_timestamp; }
35
36private:
37 ReadonlyBytes m_data;
38 CodingIndependentCodePoints m_container_cicp;
39 Time m_timestamp;
40};
41
42// FIXME: Add samples for audio, subtitles, etc.
43
44}