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

Side by Side Diff: media/cast/sender/frame_sender.h

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Speculative workaround fix for win8_chromium_ng compile error. Created 4 years, 11 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
« no previous file with comments | « media/cast/sender/fake_software_video_encoder.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This is the base class for an object that send frames to a receiver. 5 // This is the base class for an object that send frames to a receiver.
6 // TODO(hclam): Refactor such that there is no separate AudioSender vs. 6 // TODO(hclam): Refactor such that there is no separate AudioSender vs.
7 // VideoSender, and the functionality of both is rolled into this class. 7 // VideoSender, and the functionality of both is rolled into this class.
8 8
9 #ifndef MEDIA_CAST_SENDER_FRAME_SENDER_H_ 9 #ifndef MEDIA_CAST_SENDER_FRAME_SENDER_H_
10 #define MEDIA_CAST_SENDER_FRAME_SENDER_H_ 10 #define MEDIA_CAST_SENDER_FRAME_SENDER_H_
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Returns true if too many frames would be in-flight by encoding and sending 94 // Returns true if too many frames would be in-flight by encoding and sending
95 // the next frame having the given |frame_duration|. 95 // the next frame having the given |frame_duration|.
96 bool ShouldDropNextFrame(base::TimeDelta frame_duration) const; 96 bool ShouldDropNextFrame(base::TimeDelta frame_duration) const;
97 97
98 // Record or retrieve a recent history of each frame's timestamps. 98 // Record or retrieve a recent history of each frame's timestamps.
99 // Warning: If a frame ID too far in the past is requested, the getters will 99 // Warning: If a frame ID too far in the past is requested, the getters will
100 // silently succeed but return incorrect values. Be sure to respect 100 // silently succeed but return incorrect values. Be sure to respect
101 // media::cast::kMaxUnackedFrames. 101 // media::cast::kMaxUnackedFrames.
102 void RecordLatestFrameTimestamps(uint32_t frame_id, 102 void RecordLatestFrameTimestamps(uint32_t frame_id,
103 base::TimeTicks reference_time, 103 base::TimeTicks reference_time,
104 RtpTimestamp rtp_timestamp); 104 RtpTimeTicks rtp_timestamp);
105 base::TimeTicks GetRecordedReferenceTime(uint32_t frame_id) const; 105 base::TimeTicks GetRecordedReferenceTime(uint32_t frame_id) const;
106 RtpTimestamp GetRecordedRtpTimestamp(uint32_t frame_id) const; 106 RtpTimeTicks GetRecordedRtpTimestamp(uint32_t frame_id) const;
107 107
108 // Returns the number of frames that were sent but not yet acknowledged. 108 // Returns the number of frames that were sent but not yet acknowledged.
109 int GetUnacknowledgedFrameCount() const; 109 int GetUnacknowledgedFrameCount() const;
110 110
111 // Playout delay represents total amount of time between a frame's 111 // Playout delay represents total amount of time between a frame's
112 // capture/recording on the sender and its playback on the receiver 112 // capture/recording on the sender and its playback on the receiver
113 // (i.e., shown to a user). This should be a value large enough to 113 // (i.e., shown to a user). This should be a value large enough to
114 // give the system sufficient time to encode, transmit/retransmit, 114 // give the system sufficient time to encode, transmit/retransmit,
115 // receive, decode, and render; given its run-time environment 115 // receive, decode, and render; given its run-time environment
116 // (sender/receiver hardware performance, network conditions,etc.). 116 // (sender/receiver hardware performance, network conditions,etc.).
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // RTP timestamp increment representing one second. 173 // RTP timestamp increment representing one second.
174 const int rtp_timebase_; 174 const int rtp_timebase_;
175 175
176 const bool is_audio_; 176 const bool is_audio_;
177 177
178 // Ring buffers to keep track of recent frame timestamps (both in terms of 178 // Ring buffers to keep track of recent frame timestamps (both in terms of
179 // local reference time and RTP media time). These should only be accessed 179 // local reference time and RTP media time). These should only be accessed
180 // through the Record/GetXXX() methods. 180 // through the Record/GetXXX() methods.
181 base::TimeTicks frame_reference_times_[256]; 181 base::TimeTicks frame_reference_times_[256];
182 RtpTimestamp frame_rtp_timestamps_[256]; 182 RtpTimeTicks frame_rtp_timestamps_[256];
183 183
184 // NOTE: Weak pointers must be invalidated before all other member variables. 184 // NOTE: Weak pointers must be invalidated before all other member variables.
185 base::WeakPtrFactory<FrameSender> weak_factory_; 185 base::WeakPtrFactory<FrameSender> weak_factory_;
186 186
187 DISALLOW_COPY_AND_ASSIGN(FrameSender); 187 DISALLOW_COPY_AND_ASSIGN(FrameSender);
188 }; 188 };
189 189
190 } // namespace cast 190 } // namespace cast
191 } // namespace media 191 } // namespace media
192 192
193 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_ 193 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_
OLDNEW
« no previous file with comments | « media/cast/sender/fake_software_video_encoder.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698