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

Side by Side Diff: webrtc/modules/video_coding/video_receiver.cc

Issue 1406903002: Expose codec implementation names in stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix rebase Created 5 years 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/modules/video_coding/include/video_coding_defines.h ('k') | webrtc/test/fake_decoder.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 int64_t nextRenderTimeMs; 280 int64_t nextRenderTimeMs;
281 bool prefer_late_decoding = false; 281 bool prefer_late_decoding = false;
282 { 282 {
283 CriticalSectionScoped cs(_receiveCritSect); 283 CriticalSectionScoped cs(_receiveCritSect);
284 prefer_late_decoding = _codecDataBase.PrefersLateDecoding(); 284 prefer_late_decoding = _codecDataBase.PrefersLateDecoding();
285 } 285 }
286 286
287 VCMEncodedFrame* frame = _receiver.FrameForDecoding( 287 VCMEncodedFrame* frame = _receiver.FrameForDecoding(
288 maxWaitTimeMs, nextRenderTimeMs, prefer_late_decoding); 288 maxWaitTimeMs, nextRenderTimeMs, prefer_late_decoding);
289 289
290 if (frame == NULL) { 290 if (!frame)
291 return VCM_FRAME_NOT_READY; 291 return VCM_FRAME_NOT_READY;
292 } else {
293 CriticalSectionScoped cs(_receiveCritSect);
294 292
295 // If this frame was too late, we should adjust the delay accordingly 293 CriticalSectionScoped cs(_receiveCritSect);
296 _timing.UpdateCurrentDelay(frame->RenderTimeMs(),
297 clock_->TimeInMilliseconds());
298 294
299 if (pre_decode_image_callback_) { 295 // If this frame was too late, we should adjust the delay accordingly
300 EncodedImage encoded_image(frame->EncodedImage()); 296 _timing.UpdateCurrentDelay(frame->RenderTimeMs(),
301 int qp = -1; 297 clock_->TimeInMilliseconds());
302 if (qp_parser_.GetQp(*frame, &qp)) { 298
303 encoded_image.qp_ = qp; 299 if (pre_decode_image_callback_) {
304 } 300 EncodedImage encoded_image(frame->EncodedImage());
305 pre_decode_image_callback_->Encoded( 301 int qp = -1;
306 encoded_image, frame->CodecSpecific(), NULL); 302 if (qp_parser_.GetQp(*frame, &qp)) {
303 encoded_image.qp_ = qp;
307 } 304 }
305 pre_decode_image_callback_->Encoded(encoded_image, frame->CodecSpecific(),
306 NULL);
307 }
308 308
309 #ifdef DEBUG_DECODER_BIT_STREAM 309 #ifdef DEBUG_DECODER_BIT_STREAM
310 if (_bitStreamBeforeDecoder != NULL) { 310 if (_bitStreamBeforeDecoder != NULL) {
311 // Write bit stream to file for debugging purposes 311 // Write bit stream to file for debugging purposes
312 if (fwrite( 312 if (fwrite(frame->Buffer(), 1, frame->Length(), _bitStreamBeforeDecoder) !=
313 frame->Buffer(), 1, frame->Length(), _bitStreamBeforeDecoder) != 313 frame->Length()) {
314 frame->Length()) { 314 return -1;
315 return -1;
316 }
317 }
318 #endif
319 const int32_t ret = Decode(*frame);
320 _receiver.ReleaseFrame(frame);
321 frame = NULL;
322 if (ret != VCM_OK) {
323 return ret;
324 } 315 }
325 } 316 }
326 return VCM_OK; 317 #endif
318 const int32_t ret = Decode(*frame);
319 _receiver.ReleaseFrame(frame);
320 return ret;
327 } 321 }
328 322
329 int32_t VideoReceiver::RequestSliceLossIndication( 323 int32_t VideoReceiver::RequestSliceLossIndication(
330 const uint64_t pictureID) const { 324 const uint64_t pictureID) const {
331 TRACE_EVENT1("webrtc", "RequestSLI", "picture_id", pictureID); 325 TRACE_EVENT1("webrtc", "RequestSLI", "picture_id", pictureID);
332 CriticalSectionScoped cs(process_crit_sect_.get()); 326 CriticalSectionScoped cs(process_crit_sect_.get());
333 if (_frameTypeCallback != NULL) { 327 if (_frameTypeCallback != NULL) {
334 const int32_t ret = 328 const int32_t ret =
335 _frameTypeCallback->SliceLossIndicationRequest(pictureID); 329 _frameTypeCallback->SliceLossIndicationRequest(pictureID);
336 if (ret < 0) { 330 if (ret < 0) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 552 }
559 553
560 void VideoReceiver::RegisterPreDecodeImageCallback( 554 void VideoReceiver::RegisterPreDecodeImageCallback(
561 EncodedImageCallback* observer) { 555 EncodedImageCallback* observer) {
562 CriticalSectionScoped cs(_receiveCritSect); 556 CriticalSectionScoped cs(_receiveCritSect);
563 pre_decode_image_callback_ = observer; 557 pre_decode_image_callback_ = observer;
564 } 558 }
565 559
566 } // namespace vcm 560 } // namespace vcm
567 } // namespace webrtc 561 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/include/video_coding_defines.h ('k') | webrtc/test/fake_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698