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

Side by Side Diff: media/base/android/media_source_player.cc

Issue 545993002: Provide fine grained media playback time thru interpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 6 years, 3 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 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_source_player.h" 5 #include "media/base/android/media_source_player.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 manager()->OnSeekComplete(player_id(), current_time); 351 manager()->OnSeekComplete(player_id(), current_time);
352 352
353 ProcessPendingEvents(); 353 ProcessPendingEvents();
354 } 354 }
355 355
356 void MediaSourcePlayer::UpdateTimestamps( 356 void MediaSourcePlayer::UpdateTimestamps(
357 base::TimeDelta current_presentation_timestamp, 357 base::TimeDelta current_presentation_timestamp,
358 base::TimeDelta max_presentation_timestamp) { 358 base::TimeDelta max_presentation_timestamp) {
359 interpolator_.SetBounds(current_presentation_timestamp, 359 interpolator_.SetBounds(current_presentation_timestamp,
360 max_presentation_timestamp); 360 max_presentation_timestamp);
361 manager()->OnTimeUpdate(player_id(), GetCurrentTime()); 361 manager()->OnTimeUpdate(player_id(),
362 GetCurrentTime(),
363 base::TimeTicks::Now());
362 } 364 }
363 365
364 void MediaSourcePlayer::ProcessPendingEvents() { 366 void MediaSourcePlayer::ProcessPendingEvents() {
365 DVLOG(1) << __FUNCTION__ << " : 0x" << std::hex << pending_event_; 367 DVLOG(1) << __FUNCTION__ << " : 0x" << std::hex << pending_event_;
366 // Wait for all the decoding jobs to finish before processing pending tasks. 368 // Wait for all the decoding jobs to finish before processing pending tasks.
367 if (video_decoder_job_->is_decoding()) { 369 if (video_decoder_job_->is_decoding()) {
368 DVLOG(1) << __FUNCTION__ << " : A video job is still decoding."; 370 DVLOG(1) << __FUNCTION__ << " : A video job is still decoding.";
369 return; 371 return;
370 } 372 }
371 373
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // release MediaDrm when the video is paused, or when the device goes to 754 // release MediaDrm when the video is paused, or when the device goes to
753 // sleep (see http://crbug.com/272421). 755 // sleep (see http://crbug.com/272421).
754 NOTREACHED() << "CDM detachment not supported."; 756 NOTREACHED() << "CDM detachment not supported.";
755 DCHECK(drm_bridge_); 757 DCHECK(drm_bridge_);
756 audio_decoder_job_->SetDrmBridge(NULL); 758 audio_decoder_job_->SetDrmBridge(NULL);
757 video_decoder_job_->SetDrmBridge(NULL); 759 video_decoder_job_->SetDrmBridge(NULL);
758 drm_bridge_ = NULL; 760 drm_bridge_ = NULL;
759 } 761 }
760 762
761 } // namespace media 763 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_player_manager.h ('k') | media/base/android/media_source_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698