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

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

Issue 2649133005: Add QP sum stats for received streams. (Closed)
Patch Set: Changes according to hbos's comments. #1 Created 3 years, 10 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) 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 30 matching lines...) Expand all
41 CriticalSectionScoped cs(_critSect); 41 CriticalSectionScoped cs(_critSect);
42 return _receiveCallback; 42 return _receiveCallback;
43 } 43 }
44 44
45 int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) { 45 int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
46 return Decoded(decodedImage, -1); 46 return Decoded(decodedImage, -1);
47 } 47 }
48 48
49 int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, 49 int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
50 int64_t decode_time_ms) { 50 int64_t decode_time_ms) {
51 return Decoded(decodedImage, decode_time_ms, -1);
52 }
53
54 int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
55 int64_t decode_time_ms,
56 int qp) {
51 TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded", 57 TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded",
52 "timestamp", decodedImage.timestamp()); 58 "timestamp", decodedImage.timestamp());
53 // TODO(holmer): We should improve this so that we can handle multiple 59 // TODO(holmer): We should improve this so that we can handle multiple
54 // callbacks from one call to Decode(). 60 // callbacks from one call to Decode().
55 VCMFrameInformation* frameInfo; 61 VCMFrameInformation* frameInfo;
56 VCMReceiveCallback* callback; 62 VCMReceiveCallback* callback;
57 { 63 {
58 CriticalSectionScoped cs(_critSect); 64 CriticalSectionScoped cs(_critSect);
59 frameInfo = _timestampMap.Pop(decodedImage.timestamp()); 65 frameInfo = _timestampMap.Pop(decodedImage.timestamp());
60 callback = _receiveCallback; 66 callback = _receiveCallback;
(...skipping 11 matching lines...) Expand all
72 static_cast<int32_t>(now_ms - frameInfo->decodeStartTimeMs); 78 static_cast<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
73 } 79 }
74 _timing->StopDecodeTimer(decodedImage.timestamp(), decode_time_ms, now_ms, 80 _timing->StopDecodeTimer(decodedImage.timestamp(), decode_time_ms, now_ms,
75 frameInfo->renderTimeMs); 81 frameInfo->renderTimeMs);
76 82
77 decodedImage.set_render_time_ms(frameInfo->renderTimeMs); 83 decodedImage.set_render_time_ms(frameInfo->renderTimeMs);
78 decodedImage.set_rotation(frameInfo->rotation); 84 decodedImage.set_rotation(frameInfo->rotation);
79 // TODO(sakal): Investigate why callback is NULL sometimes and replace if 85 // TODO(sakal): Investigate why callback is NULL sometimes and replace if
80 // statement with a DCHECK. 86 // statement with a DCHECK.
81 if (callback) { 87 if (callback) {
82 callback->FrameToRender(decodedImage); 88 callback->FrameToRender(decodedImage, qp);
83 } else { 89 } else {
84 LOG(LS_WARNING) << "No callback, dropping frame."; 90 LOG(LS_WARNING) << "No callback, dropping frame.";
85 } 91 }
86 return WEBRTC_VIDEO_CODEC_OK; 92 return WEBRTC_VIDEO_CODEC_OK;
87 } 93 }
88 94
89 int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame( 95 int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame(
90 const uint64_t pictureId) { 96 const uint64_t pictureId) {
91 CriticalSectionScoped cs(_critSect); 97 CriticalSectionScoped cs(_critSect);
92 if (_receiveCallback != NULL) { 98 if (_receiveCallback != NULL) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 191
186 bool VCMGenericDecoder::External() const { 192 bool VCMGenericDecoder::External() const {
187 return _isExternal; 193 return _isExternal;
188 } 194 }
189 195
190 bool VCMGenericDecoder::PrefersLateDecoding() const { 196 bool VCMGenericDecoder::PrefersLateDecoding() const {
191 return _decoder->PrefersLateDecoding(); 197 return _decoder->PrefersLateDecoding();
192 } 198 }
193 199
194 } // namespace webrtc 200 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698