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 "webrtc/common_types.h" | 14 #include "webrtc/common_types.h" |
15 #include "webrtc/modules/include/module_common_types.h" | 15 #include "webrtc/modules/include/module_common_types.h" |
16 #include "webrtc/modules/video_coding/encoded_frame.h" | 16 #include "webrtc/modules/video_coding/encoded_frame.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 namespace video_coding { | 19 namespace video_coding { |
20 | 20 |
21 class FrameObject : public webrtc::VCMEncodedFrame { | 21 class FrameObject : public webrtc::VCMEncodedFrame { |
22 public: | 22 public: |
23 static const uint8_t kMaxFrameReferences = 5; | 23 static const uint8_t kMaxFrameReferences = 5; |
24 | 24 |
25 FrameObject(); | 25 FrameObject(); |
26 | 26 |
27 virtual bool GetBitstream(uint8_t* destination) const = 0; | 27 virtual bool GetBitstream(uint8_t* destination) const = 0; |
28 virtual uint32_t Timestamp() const = 0; | |
terelius
2016/07/07 16:12:30
Which timestamp is this? From the RTP header? Plea
philipel
2016/07/08 09:41:19
Done.
| |
29 virtual int64_t ReceivedTimestamp() const = 0; | |
30 virtual int64_t RenderTimestamp() const = 0; | |
stefan-webrtc
2016/07/08 10:33:39
I'd prefer if we don't overuse the word timestamp
philipel
2016/07/08 11:10:50
Done.
| |
28 virtual ~FrameObject() {} | 31 virtual ~FrameObject() {} |
29 | 32 |
30 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame | 33 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame |
31 // object. For codec types that don't necessarily have picture ids they | 34 // object. For codec types that don't necessarily have picture ids they |
32 // have to be constructed from the header data relevant to that codec. | 35 // have to be constructed from the header data relevant to that codec. |
33 uint16_t picture_id; | 36 uint16_t picture_id; |
34 uint8_t spatial_layer; | 37 uint8_t spatial_layer; |
35 uint32_t timestamp; | 38 uint32_t timestamp; |
36 | 39 |
37 size_t num_references; | 40 size_t num_references; |
38 uint16_t references[kMaxFrameReferences]; | 41 uint16_t references[kMaxFrameReferences]; |
39 bool inter_layer_predicted; | 42 bool inter_layer_predicted; |
40 | 43 |
41 size_t size; | 44 size_t size; |
42 }; | 45 }; |
43 | 46 |
44 class PacketBuffer; | 47 class PacketBuffer; |
45 | 48 |
46 class RtpFrameObject : public FrameObject { | 49 class RtpFrameObject : public FrameObject { |
47 public: | 50 public: |
48 RtpFrameObject(PacketBuffer* packet_buffer, | 51 RtpFrameObject(PacketBuffer* packet_buffer, |
49 uint16_t first_seq_num, | 52 uint16_t first_seq_num, |
50 uint16_t last_seq_num, | 53 uint16_t last_seq_num, |
51 size_t frame_size, | 54 size_t frame_size, |
52 int times_nacked); | 55 int times_nacked, |
56 int64_t frame_completed_timestamp); | |
terelius
2016/07/07 16:12:30
Different name in the implementation.
philipel
2016/07/08 09:41:19
Fixed.
| |
53 | 57 |
54 ~RtpFrameObject(); | 58 ~RtpFrameObject(); |
55 uint16_t first_seq_num() const; | 59 uint16_t first_seq_num() const; |
56 uint16_t last_seq_num() const; | 60 uint16_t last_seq_num() const; |
57 int times_nacked() const; | 61 int times_nacked() const; |
58 enum FrameType frame_type() const; | 62 enum FrameType frame_type() const; |
59 VideoCodecType codec_type() const; | 63 VideoCodecType codec_type() const; |
60 bool GetBitstream(uint8_t* destination) const override; | 64 bool GetBitstream(uint8_t* destination) const override; |
65 uint32_t Timestamp() const override; | |
66 int64_t ReceivedTimestamp() const override; | |
67 int64_t RenderTimestamp() const override; | |
61 RTPVideoTypeHeader* GetCodecHeader() const; | 68 RTPVideoTypeHeader* GetCodecHeader() const; |
62 | 69 |
63 private: | 70 private: |
64 PacketBuffer* packet_buffer_; | 71 PacketBuffer* packet_buffer_; |
65 enum FrameType frame_type_; | 72 enum FrameType frame_type_; |
66 VideoCodecType codec_type_; | 73 VideoCodecType codec_type_; |
67 uint16_t first_seq_num_; | 74 uint16_t first_seq_num_; |
68 uint16_t last_seq_num_; | 75 uint16_t last_seq_num_; |
76 uint32_t timestamp_; | |
77 int64_t received_timestamp_; | |
69 | 78 |
70 // Equal to times nacked of the packet with the highet times nacked | 79 // Equal to times nacked of the packet with the highet times nacked |
71 // belonging to this frame. | 80 // belonging to this frame. |
72 int times_nacked_; | 81 int times_nacked_; |
73 }; | 82 }; |
74 | 83 |
75 } // namespace video_coding | 84 } // namespace video_coding |
76 } // namespace webrtc | 85 } // namespace webrtc |
77 | 86 |
78 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ | 87 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
OLD | NEW |