Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: webrtc/modules/video_coding/frame_object.h

Issue 2124943002: Added various timestamps to FrameObject. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename ...Timestamp to ...Time. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 virtual ~FrameObject() {}
26 27
27 virtual bool GetBitstream(uint8_t* destination) const = 0; 28 virtual bool GetBitstream(uint8_t* destination) const = 0;
28 virtual ~FrameObject() {} 29
30 // The capture timestamp of this frame.
31 virtual uint32_t Timestamp() const = 0;
32
33 // When this frame was received.
34 virtual int64_t ReceivedTime() const = 0;
35
36 // When this frame should be rendered.
37 virtual int64_t RenderTime() const = 0;
38
29 39
30 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame 40 // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame
31 // object. For codec types that don't necessarily have picture ids they 41 // 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. 42 // have to be constructed from the header data relevant to that codec.
33 uint16_t picture_id; 43 uint16_t picture_id;
34 uint8_t spatial_layer; 44 uint8_t spatial_layer;
35 uint32_t timestamp; 45 uint32_t timestamp;
36 46
37 size_t num_references; 47 size_t num_references;
38 uint16_t references[kMaxFrameReferences]; 48 uint16_t references[kMaxFrameReferences];
39 bool inter_layer_predicted; 49 bool inter_layer_predicted;
40 50
41 size_t size; 51 size_t size;
42 }; 52 };
43 53
44 class PacketBuffer; 54 class PacketBuffer;
45 55
46 class RtpFrameObject : public FrameObject { 56 class RtpFrameObject : public FrameObject {
47 public: 57 public:
48 RtpFrameObject(PacketBuffer* packet_buffer, 58 RtpFrameObject(PacketBuffer* packet_buffer,
49 uint16_t first_seq_num, 59 uint16_t first_seq_num,
50 uint16_t last_seq_num, 60 uint16_t last_seq_num,
51 size_t frame_size, 61 size_t frame_size,
52 int times_nacked); 62 int times_nacked,
63 int64_t received_timestamp);
53 64
54 ~RtpFrameObject(); 65 ~RtpFrameObject();
55 uint16_t first_seq_num() const; 66 uint16_t first_seq_num() const;
56 uint16_t last_seq_num() const; 67 uint16_t last_seq_num() const;
57 int times_nacked() const; 68 int times_nacked() const;
58 enum FrameType frame_type() const; 69 enum FrameType frame_type() const;
59 VideoCodecType codec_type() const; 70 VideoCodecType codec_type() const;
60 bool GetBitstream(uint8_t* destination) const override; 71 bool GetBitstream(uint8_t* destination) const override;
72 uint32_t Timestamp() const override;
73 int64_t ReceivedTime() const override;
74 int64_t RenderTime() const override;
61 RTPVideoTypeHeader* GetCodecHeader() const; 75 RTPVideoTypeHeader* GetCodecHeader() const;
62 76
63 private: 77 private:
64 PacketBuffer* packet_buffer_; 78 PacketBuffer* packet_buffer_;
65 enum FrameType frame_type_; 79 enum FrameType frame_type_;
66 VideoCodecType codec_type_; 80 VideoCodecType codec_type_;
67 uint16_t first_seq_num_; 81 uint16_t first_seq_num_;
68 uint16_t last_seq_num_; 82 uint16_t last_seq_num_;
83 uint32_t timestamp_;
84 int64_t received_timestamp_;
terelius 2016/07/11 08:44:08 Since you changed ReceivedTimestamp to ReceivedTim
philipel 2016/07/11 11:00:38 Done.
69 85
70 // Equal to times nacked of the packet with the highet times nacked 86 // Equal to times nacked of the packet with the highet times nacked
71 // belonging to this frame. 87 // belonging to this frame.
72 int times_nacked_; 88 int times_nacked_;
73 }; 89 };
74 90
75 } // namespace video_coding 91 } // namespace video_coding
76 } // namespace webrtc 92 } // namespace webrtc
77 93
78 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ 94 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2_unittest.cc ('k') | webrtc/modules/video_coding/frame_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698