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

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

Issue 1414693006: Add DecodedImageCallback::Decoded() function with custom decode time value. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: addressed comments. Created 5 years, 1 month 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/main/source/generic_decoder.cc
diff --git a/webrtc/modules/video_coding/main/source/generic_decoder.cc b/webrtc/modules/video_coding/main/source/generic_decoder.cc
index 8b2d3974de486f90f423709ec45665f0ea88e109..4f4a09b0581f66250b8fa0d6bcd9f5cf1826ecf6 100644
--- a/webrtc/modules/video_coding/main/source/generic_decoder.cc
+++ b/webrtc/modules/video_coding/main/source/generic_decoder.cc
@@ -47,6 +47,11 @@ VCMReceiveCallback* VCMDecodedFrameCallback::UserReceiveCallback()
}
int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
+ return Decoded(decodedImage, -1);
+}
+
+int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
+ int64_t decode_time_ms) {
// TODO(holmer): We should improve this so that we can handle multiple
// callbacks from one call to Decode().
VCMFrameInformation* frameInfo;
@@ -63,10 +68,15 @@ int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
return WEBRTC_VIDEO_CODEC_OK;
}
+ const int64_t now_ms = _clock->TimeInMilliseconds();
+ if (decode_time_ms < 0) {
+ decode_time_ms =
+ static_cast<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
+ }
_timing.StopDecodeTimer(
decodedImage.timestamp(),
- frameInfo->decodeStartTimeMs,
- _clock->TimeInMilliseconds(),
+ decode_time_ms,
+ now_ms,
frameInfo->renderTimeMs);
if (callback != NULL)
« no previous file with comments | « webrtc/modules/video_coding/main/source/generic_decoder.h ('k') | webrtc/modules/video_coding/main/source/timing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698