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

Side by Side Diff: webrtc/video/vie_encoder.cc

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 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 | « webrtc/video/vie_encoder.h ('k') | webrtc/video_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 void ViEEncoder::SendKeyFrame() { 187 void ViEEncoder::SendKeyFrame() {
188 video_sender_.IntraFrameRequest(0); 188 video_sender_.IntraFrameRequest(0);
189 } 189 }
190 190
191 int64_t ViEEncoder::time_of_last_frame_activity_ms() { 191 int64_t ViEEncoder::time_of_last_frame_activity_ms() {
192 rtc::CritScope lock(&data_cs_); 192 rtc::CritScope lock(&data_cs_);
193 return time_of_last_frame_activity_ms_; 193 return time_of_last_frame_activity_ms_;
194 } 194 }
195 195
196 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, 196 EncodedImageCallback::Result ViEEncoder::OnEncodedImage(
197 const CodecSpecificInfo* codec_specific_info, 197 const EncodedImage& encoded_image,
198 const RTPFragmentationHeader* fragmentation) { 198 const CodecSpecificInfo* codec_specific_info,
199 const RTPFragmentationHeader* fragmentation) {
199 { 200 {
200 rtc::CritScope lock(&data_cs_); 201 rtc::CritScope lock(&data_cs_);
201 time_of_last_frame_activity_ms_ = rtc::TimeMillis(); 202 time_of_last_frame_activity_ms_ = rtc::TimeMillis();
202 } 203 }
203 if (stats_proxy_) { 204 if (stats_proxy_) {
204 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info); 205 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info);
205 } 206 }
206 207
207 int success = 208 EncodedImageCallback::Result result =
208 sink_->Encoded(encoded_image, codec_specific_info, fragmentation); 209 sink_->OnEncodedImage(encoded_image, codec_specific_info, fragmentation);
209 210
210 overuse_detector_->FrameSent(encoded_image._timeStamp); 211 overuse_detector_->FrameSent(encoded_image._timeStamp);
211 return success; 212 return result;
212 } 213 }
213 214
214 void ViEEncoder::SendStatistics(uint32_t bit_rate, 215 void ViEEncoder::SendStatistics(uint32_t bit_rate,
215 uint32_t frame_rate, 216 uint32_t frame_rate,
216 const std::string& encoder_name) { 217 const std::string& encoder_name) {
217 if (stats_proxy_) 218 if (stats_proxy_)
218 stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate, encoder_name); 219 stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate, encoder_name);
219 } 220 }
220 221
221 void ViEEncoder::OnReceivedSLI(uint8_t picture_id) { 222 void ViEEncoder::OnReceivedSLI(uint8_t picture_id) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 265 }
265 266
266 if (stats_proxy_ && video_suspension_changed) { 267 if (stats_proxy_ && video_suspension_changed) {
267 LOG(LS_INFO) << "Video suspend state changed to: " 268 LOG(LS_INFO) << "Video suspend state changed to: "
268 << (video_is_suspended ? "suspended" : "not suspended"); 269 << (video_is_suspended ? "suspended" : "not suspended");
269 stats_proxy_->OnSuspendChange(video_is_suspended); 270 stats_proxy_->OnSuspendChange(video_is_suspended);
270 } 271 }
271 } 272 }
272 273
273 } // namespace webrtc 274 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | webrtc/video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698