OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include "webrtc/common_types.h" |
15 #include <stdint.h> | 15 #include "webrtc/modules/include/module_common_types.h" |
16 | |
17 #include <array> | |
18 | 16 |
19 namespace webrtc { | 17 namespace webrtc { |
20 namespace video_coding { | 18 namespace video_coding { |
21 | 19 |
22 class FrameObject { | 20 class FrameObject { |
23 public: | 21 public: |
24 static const uint8_t kMaxFrameReferences = 5; | 22 static const uint8_t kMaxFrameReferences = 5; |
25 | 23 |
26 FrameObject(); | 24 FrameObject(); |
27 | 25 |
28 virtual bool GetBitstream(uint8_t* destination) const = 0; | 26 virtual bool GetBitstream(uint8_t* destination) const = 0; |
29 virtual ~FrameObject() {} | 27 virtual ~FrameObject() {} |
30 | 28 |
31 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame | 29 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame |
32 // object. For codec types that don't necessarily have picture ids they | 30 // object. For codec types that don't necessarily have picture ids they |
33 // have to be constructed from the header data relevant to that codec. | 31 // have to be constructed from the header data relevant to that codec. |
34 uint16_t picture_id; | 32 uint16_t picture_id; |
35 uint8_t spatial_layer; | 33 uint8_t spatial_layer; |
36 | 34 |
37 size_t num_references; | 35 size_t num_references; |
38 uint16_t references[kMaxFrameReferences]; | 36 uint16_t references[kMaxFrameReferences]; |
39 bool inter_layer_predicted; | 37 bool inter_layer_predicted; |
40 }; | 38 }; |
41 | 39 |
42 class PacketBuffer; | 40 class PacketBuffer; |
43 | 41 |
44 class RtpFrameObject : public FrameObject { | 42 class RtpFrameObject : public FrameObject { |
45 public: | 43 public: |
46 RtpFrameObject(PacketBuffer* packet_buffer, | 44 RtpFrameObject(PacketBuffer* packet_buffer, |
47 uint16_t first_packet, | 45 uint16_t first_seq_num, |
48 uint16_t last_packet); | 46 uint16_t last_seq_num); |
49 | 47 |
50 ~RtpFrameObject(); | 48 ~RtpFrameObject(); |
51 uint16_t first_seq_num() const; | 49 uint16_t first_seq_num() const; |
52 uint16_t last_seq_num() const; | 50 uint16_t last_seq_num() const; |
| 51 FrameType frame_type() const; |
| 52 VideoCodecType codec_type() const; |
53 bool GetBitstream(uint8_t* destination) const override; | 53 bool GetBitstream(uint8_t* destination) const override; |
| 54 RTPVideoTypeHeader* GetCodecHeader() const; |
54 | 55 |
55 private: | 56 private: |
56 PacketBuffer* packet_buffer_; | 57 PacketBuffer* packet_buffer_; |
57 uint16_t first_packet_; | 58 FrameType frame_type_; |
58 uint16_t last_packet_; | 59 VideoCodecType codec_type_; |
| 60 uint16_t first_seq_num_; |
| 61 uint16_t last_seq_num_; |
59 }; | 62 }; |
60 | 63 |
61 } // namespace video_coding | 64 } // namespace video_coding |
62 } // namespace webrtc | 65 } // namespace webrtc |
63 | 66 |
64 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ | 67 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
OLD | NEW |