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

Unified Diff: talk/app/webrtc/java/jni/androidmediadecoder_jni.cc

Issue 1665373003: Log Android HW decoder delay time statistics. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
index 17f379d12b5e913ad37753f498922257e6c0fe7e..5b9f28258ae9d79b48810c894aa02a6cf8a7f29d 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
@@ -145,7 +145,8 @@ class MediaCodecVideoDecoder : public webrtc::VideoDecoder,
int current_frames_; // Number of frames in the current statistics interval.
int current_bytes_; // Encoded bytes in the current statistics interval.
int current_decoding_time_ms_; // Overall decoding time in the current second
- uint32_t max_pending_frames_; // Maximum number of pending input frames
+ int current_delay_time_ms_; // Overall delay time in the current second.
+ uint32_t max_pending_frames_; // Maximum number of pending input frames.
// State that is constant for the lifetime of this object once the ctor
// returns.
@@ -390,6 +391,7 @@ int32_t MediaCodecVideoDecoder::InitDecodeOnCodecThread() {
current_frames_ = 0;
current_bytes_ = 0;
current_decoding_time_ms_ = 0;
+ current_delay_time_ms_ = 0;
jobjectArray input_buffers = (jobjectArray)GetObjectField(
jni, *j_media_codec_video_decoder_, j_input_buffers_field_);
@@ -797,22 +799,25 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs(
frames_decoded_++;
current_frames_++;
current_decoding_time_ms_ += decode_time_ms;
+ current_delay_time_ms_ += frame_delayed_ms;
int statistic_time_ms = GetCurrentTimeMs() - start_time_ms_;
if (statistic_time_ms >= kMediaCodecStatisticsIntervalMs &&
current_frames_ > 0) {
int current_bitrate = current_bytes_ * 8 / statistic_time_ms;
int current_fps =
(current_frames_ * 1000 + statistic_time_ms / 2) / statistic_time_ms;
- ALOGD << "Decoded frames: " << frames_decoded_ <<
- ". Received frames: " << frames_received_ <<
+ ALOGD << "Frames decoded: " << frames_decoded_ <<
+ ". Received: " << frames_received_ <<
". Bitrate: " << current_bitrate << " kbps" <<
". Fps: " << current_fps <<
". DecTime: " << (current_decoding_time_ms_ / current_frames_) <<
+ ". DelayTime: " << (current_delay_time_ms_ / current_frames_) <<
" for last " << statistic_time_ms << " ms.";
start_time_ms_ = GetCurrentTimeMs();
current_frames_ = 0;
current_bytes_ = 0;
current_decoding_time_ms_ = 0;
+ current_delay_time_ms_ = 0;
}
// |.IsZeroSize())| returns true when a frame has been dropped.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698