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 |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 // The capture timestamp of this frame. | 31 // The capture timestamp of this frame. |
32 virtual uint32_t Timestamp() const = 0; | 32 virtual uint32_t Timestamp() const = 0; |
33 | 33 |
34 // When this frame was received. | 34 // When this frame was received. |
35 virtual int64_t ReceivedTime() const = 0; | 35 virtual int64_t ReceivedTime() const = 0; |
36 | 36 |
37 // When this frame should be rendered. | 37 // When this frame should be rendered. |
38 virtual int64_t RenderTime() const = 0; | 38 virtual int64_t RenderTime() const = 0; |
39 | 39 |
40 // This is a RtpFrameObject specific function that is needed by the current | |
41 // timing calculation class. | |
42 // TODO(philipel): Remove this function when new a new timing class has | |
stefan-webrtc
2017/01/24 13:03:14
when a new
philipel
2017/01/25 15:04:17
Done.
| |
43 // been implemented. | |
44 virtual int times_nacked() const { return 0; } | |
stefan-webrtc
2017/01/24 13:03:14
Should we call it "delayed_by_retransmission()" in
philipel
2017/01/25 15:04:16
Done.
| |
45 | |
40 size_t size() { return _length; } | 46 size_t size() { return _length; } |
41 | 47 |
42 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame | 48 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame |
43 // object. For codec types that don't necessarily have picture ids they | 49 // object. For codec types that don't necessarily have picture ids they |
44 // have to be constructed from the header data relevant to that codec. | 50 // have to be constructed from the header data relevant to that codec. |
45 uint16_t picture_id; | 51 uint16_t picture_id; |
46 uint8_t spatial_layer; | 52 uint8_t spatial_layer; |
47 uint32_t timestamp; | 53 uint32_t timestamp; |
48 | 54 |
49 size_t num_references; | 55 size_t num_references; |
50 uint16_t references[kMaxFrameReferences]; | 56 uint16_t references[kMaxFrameReferences]; |
51 bool inter_layer_predicted; | 57 bool inter_layer_predicted; |
52 }; | 58 }; |
53 | 59 |
54 class PacketBuffer; | 60 class PacketBuffer; |
55 | 61 |
56 class RtpFrameObject : public FrameObject { | 62 class RtpFrameObject : public FrameObject { |
57 public: | 63 public: |
58 RtpFrameObject(PacketBuffer* packet_buffer, | 64 RtpFrameObject(PacketBuffer* packet_buffer, |
59 uint16_t first_seq_num, | 65 uint16_t first_seq_num, |
60 uint16_t last_seq_num, | 66 uint16_t last_seq_num, |
61 size_t frame_size, | 67 size_t frame_size, |
62 int times_nacked, | 68 int times_nacked, |
63 int64_t received_time); | 69 int64_t received_time); |
64 | 70 |
65 ~RtpFrameObject(); | 71 ~RtpFrameObject(); |
66 uint16_t first_seq_num() const; | 72 uint16_t first_seq_num() const; |
67 uint16_t last_seq_num() const; | 73 uint16_t last_seq_num() const; |
68 int times_nacked() const; | 74 int times_nacked() const override; |
69 enum FrameType frame_type() const; | 75 enum FrameType frame_type() const; |
70 VideoCodecType codec_type() const; | 76 VideoCodecType codec_type() const; |
71 bool GetBitstream(uint8_t* destination) const override; | 77 bool GetBitstream(uint8_t* destination) const override; |
72 uint32_t Timestamp() const override; | 78 uint32_t Timestamp() const override; |
73 int64_t ReceivedTime() const override; | 79 int64_t ReceivedTime() const override; |
74 int64_t RenderTime() const override; | 80 int64_t RenderTime() const override; |
75 rtc::Optional<RTPVideoTypeHeader> GetCodecHeader() const; | 81 rtc::Optional<RTPVideoTypeHeader> GetCodecHeader() const; |
76 | 82 |
77 private: | 83 private: |
78 rtc::scoped_refptr<PacketBuffer> packet_buffer_; | 84 rtc::scoped_refptr<PacketBuffer> packet_buffer_; |
79 enum FrameType frame_type_; | 85 enum FrameType frame_type_; |
80 VideoCodecType codec_type_; | 86 VideoCodecType codec_type_; |
81 uint16_t first_seq_num_; | 87 uint16_t first_seq_num_; |
82 uint16_t last_seq_num_; | 88 uint16_t last_seq_num_; |
83 uint32_t timestamp_; | 89 uint32_t timestamp_; |
84 int64_t received_time_; | 90 int64_t received_time_; |
85 | 91 |
86 // Equal to times nacked of the packet with the highet times nacked | 92 // Equal to times nacked of the packet with the highet times nacked |
87 // belonging to this frame. | 93 // belonging to this frame. |
88 int times_nacked_; | 94 int times_nacked_; |
89 }; | 95 }; |
90 | 96 |
91 } // namespace video_coding | 97 } // namespace video_coding |
92 } // namespace webrtc | 98 } // namespace webrtc |
93 | 99 |
94 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ | 100 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
OLD | NEW |