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

Unified Diff: media/base/android/media_source_player.cc

Issue 1458783002: Fix UMA metrics for MediaSourcePlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | media/base/android/media_statistics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player.cc
diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
index fd52bba4662fc47d321d82835ee0cffb8d295f65..b826bfc8f97712551ad64616ce64227ce26eacc0 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -90,6 +90,9 @@ void MediaSourcePlayer::ScheduleSeekEventAndStopDecoding(
DVLOG(1) << __FUNCTION__ << "(" << seek_time.InSecondsF() << ")";
DCHECK(!IsEventPending(SEEK_EVENT_PENDING));
+ // Need to stop here to prevent false reports while seek and drag.
qinmin 2015/11/18 18:12:27 Do we need this? We should have captured this situ
Tima Vaisburd 2015/11/18 18:31:13 I think we do. During the seek-and-drag II did not
qinmin 2015/11/18 19:11:43 Start() will automatically kick off the MediaDecod
Tima Vaisburd 2015/11/18 20:02:12 Yes, you are right, sorry I misled you. The bug wa
+ media_stat_->StopAndReport(GetCurrentTime());
+
pending_seek_ = false;
interpolator_.SetBounds(seek_time, seek_time);
@@ -182,6 +185,8 @@ base::TimeDelta MediaSourcePlayer::GetDuration() {
void MediaSourcePlayer::Release() {
DVLOG(1) << __FUNCTION__;
+ media_stat_->StopAndReport(GetCurrentTime());
+
audio_decoder_job_->ReleaseDecoderResources();
video_decoder_job_->ReleaseDecoderResources();
@@ -479,7 +484,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
DVLOG(1) << __FUNCTION__ << " : decode error";
Release();
manager()->OnError(player_id(), MEDIA_ERROR_DECODE);
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -499,7 +505,9 @@ void MediaSourcePlayer::MediaDecoderCallback(
// any other pending events only after handling EOS detection.
if (IsEventPending(SEEK_EVENT_PENDING)) {
ProcessPendingEvents();
- media_stat_->StopAndReport(GetCurrentTime());
+ // In case of Seek GetCurrentTime() already tells the time to seek to.
+ if (is_clock_manager)
+ media_stat_->StopAndReport(current_presentation_timestamp);
return;
}
@@ -521,7 +529,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
}
if (status == MEDIA_CODEC_OUTPUT_END_OF_STREAM) {
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -529,7 +538,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
if (is_clock_manager)
interpolator_.StopInterpolating();
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -540,7 +550,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
} else {
is_waiting_for_key_ = true;
manager()->OnWaitingForDecryptionKey(player_id());
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
}
return;
}
@@ -559,7 +570,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
// in the middle of a seek or stop event and needs to wait for the IPCs to
// come.
if (status == MEDIA_CODEC_ABORT) {
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
« no previous file with comments | « no previous file | media/base/android/media_statistics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698