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

Unified Diff: webrtc/modules/video_coding/generic_decoder.cc

Issue 2649133005: Add QP sum stats for received streams. (Closed)
Patch Set: Fix error. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/generic_decoder.cc
diff --git a/webrtc/modules/video_coding/generic_decoder.cc b/webrtc/modules/video_coding/generic_decoder.cc
index b95571b8f73793718d318eedc82fff249e9a9f17..7acacbb40947716528ba7eaa1a45dcc61c50488e 100644
--- a/webrtc/modules/video_coding/generic_decoder.cc
+++ b/webrtc/modules/video_coding/generic_decoder.cc
@@ -48,6 +48,15 @@ int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
int64_t decode_time_ms) {
+ return Decoded(decodedImage,
+ decode_time_ms >= 0 ? rtc::Optional<int32_t>(decode_time_ms)
+ : rtc::Optional<int32_t>(),
+ rtc::Optional<uint8_t>());
+}
+
+int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
+ rtc::Optional<int32_t> decode_time_ms,
+ rtc::Optional<uint8_t> qp) {
TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded",
"timestamp", decodedImage.timestamp());
// TODO(holmer): We should improve this so that we can handle multiple
@@ -67,11 +76,11 @@ int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
}
const int64_t now_ms = _clock->TimeInMilliseconds();
- if (decode_time_ms < 0) {
+ if (!decode_time_ms) {
decode_time_ms =
- static_cast<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
+ rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
}
- _timing->StopDecodeTimer(decodedImage.timestamp(), decode_time_ms, now_ms,
+ _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms,
frameInfo->renderTimeMs);
decodedImage.set_render_time_ms(frameInfo->renderTimeMs);
@@ -79,7 +88,7 @@ int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
// TODO(sakal): Investigate why callback is NULL sometimes and replace if
// statement with a DCHECK.
if (callback) {
- callback->FrameToRender(decodedImage);
+ callback->FrameToRender(decodedImage, qp);
} else {
LOG(LS_WARNING) << "No callback, dropping frame.";
}

Powered by Google App Engine
This is Rietveld 408576698