blob: c5cdd6eb1125c2a8ef5fb35c1f441f747c307c4d [file] [log] [blame]
philipelc707ab72016-04-01 02:01:54 -07001/*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
12#define WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
13
philipelf4139332016-04-20 10:26:34 +020014#include <stddef.h>
15#include <stdint.h>
16
17#include <array>
philipelc707ab72016-04-01 02:01:54 -070018
19namespace webrtc {
20namespace video_coding {
21
22class FrameObject {
23 public:
philipelf4139332016-04-20 10:26:34 +020024 static const uint8_t kMaxFrameReferences = 5;
25
philipelc707ab72016-04-01 02:01:54 -070026 virtual bool GetBitstream(uint8_t* destination) const = 0;
27 virtual ~FrameObject() {}
philipelf4139332016-04-20 10:26:34 +020028
29 uint16_t picture_id;
30 size_t num_references;
31 std::array<uint16_t, kMaxFrameReferences> referencesr;
32 uint16_t references[kMaxFrameReferences];
philipelc707ab72016-04-01 02:01:54 -070033};
34
35class PacketBuffer;
36
37class RtpFrameObject : public FrameObject {
38 public:
39 RtpFrameObject(PacketBuffer* packet_buffer,
philipelc707ab72016-04-01 02:01:54 -070040 uint16_t first_packet,
41 uint16_t last_packet);
philipelf4139332016-04-20 10:26:34 +020042
philipelc707ab72016-04-01 02:01:54 -070043 ~RtpFrameObject();
philipelf4139332016-04-20 10:26:34 +020044 uint16_t first_seq_num() const;
45 uint16_t last_seq_num() const;
philipelc707ab72016-04-01 02:01:54 -070046 bool GetBitstream(uint8_t* destination) const override;
47
48 private:
49 PacketBuffer* packet_buffer_;
philipelc707ab72016-04-01 02:01:54 -070050 uint16_t first_packet_;
51 uint16_t last_packet_;
52};
53
54} // namespace video_coding
55} // namespace webrtc
56
57#endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_