| OLD | NEW |
| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // MediaDecoderCallback() is called. | 143 // MediaDecoderCallback() is called. |
| 144 playing_ = false; | 144 playing_ = false; |
| 145 start_time_ticks_ = base::TimeTicks(); | 145 start_time_ticks_ = base::TimeTicks(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool MediaSourcePlayer::IsPlaying() { | 148 bool MediaSourcePlayer::IsPlaying() { |
| 149 return playing_; | 149 return playing_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 int MediaSourcePlayer::GetVideoWidth() { | 152 int MediaSourcePlayer::GetVideoWidth() { |
| 153 return video_decoder_job_->width(); | 153 return video_decoder_job_->output_width(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 int MediaSourcePlayer::GetVideoHeight() { | 156 int MediaSourcePlayer::GetVideoHeight() { |
| 157 return video_decoder_job_->height(); | 157 return video_decoder_job_->output_height(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void MediaSourcePlayer::SeekTo(base::TimeDelta timestamp) { | 160 void MediaSourcePlayer::SeekTo(base::TimeDelta timestamp) { |
| 161 DVLOG(1) << __FUNCTION__ << "(" << timestamp.InSecondsF() << ")"; | 161 DVLOG(1) << __FUNCTION__ << "(" << timestamp.InSecondsF() << ")"; |
| 162 | 162 |
| 163 if (IsEventPending(SEEK_EVENT_PENDING)) { | 163 if (IsEventPending(SEEK_EVENT_PENDING)) { |
| 164 DCHECK(doing_browser_seek_) << "SeekTo while SeekTo in progress"; | 164 DCHECK(doing_browser_seek_) << "SeekTo while SeekTo in progress"; |
| 165 DCHECK(!pending_seek_) << "SeekTo while SeekTo pending browser seek"; | 165 DCHECK(!pending_seek_) << "SeekTo while SeekTo pending browser seek"; |
| 166 | 166 |
| 167 // There is a browser seek currently in progress to obtain I-frame to feed | 167 // There is a browser seek currently in progress to obtain I-frame to feed |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 773 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
| 774 // MediaDrm when the video is paused, or when the device goes to sleep (see | 774 // MediaDrm when the video is paused, or when the device goes to sleep (see |
| 775 // http://crbug.com/272421). | 775 // http://crbug.com/272421). |
| 776 audio_decoder_job_->SetDrmBridge(NULL); | 776 audio_decoder_job_->SetDrmBridge(NULL); |
| 777 video_decoder_job_->SetDrmBridge(NULL); | 777 video_decoder_job_->SetDrmBridge(NULL); |
| 778 cdm_registration_id_ = 0; | 778 cdm_registration_id_ = 0; |
| 779 drm_bridge_ = NULL; | 779 drm_bridge_ = NULL; |
| 780 } | 780 } |
| 781 | 781 |
| 782 } // namespace media | 782 } // namespace media |
| OLD | NEW |