| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Cancel previously registered callback (if any). | 79 // Cancel previously registered callback (if any). |
| 80 static_cast<MediaDrmBridge*>(cdm_.get()) | 80 static_cast<MediaDrmBridge*>(cdm_.get()) |
| 81 ->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB()); | 81 ->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB()); |
| 82 | 82 |
| 83 static_cast<MediaDrmBridge*>(cdm_.get()) | 83 static_cast<MediaDrmBridge*>(cdm_.get()) |
| 84 ->UnregisterPlayer(cdm_registration_id_); | 84 ->UnregisterPlayer(cdm_registration_id_); |
| 85 cdm_registration_id_ = 0; | 85 cdm_registration_id_ = 0; |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 void MediaSourcePlayer::SetVideoSurface(gfx::ScopedJavaSurface surface) { | 89 void MediaSourcePlayer::SetVideoSurface(gl::ScopedJavaSurface surface) { |
| 90 DVLOG(1) << __FUNCTION__; | 90 DVLOG(1) << __FUNCTION__; |
| 91 if (!video_decoder_job_->SetVideoSurface(std::move(surface))) | 91 if (!video_decoder_job_->SetVideoSurface(std::move(surface))) |
| 92 return; | 92 return; |
| 93 // Retry video decoder creation. | 93 // Retry video decoder creation. |
| 94 RetryDecoderCreation(false, true); | 94 RetryDecoderCreation(false, true); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void MediaSourcePlayer::ScheduleSeekEventAndStopDecoding( | 97 void MediaSourcePlayer::ScheduleSeekEventAndStopDecoding( |
| 98 base::TimeDelta seek_time) { | 98 base::TimeDelta seek_time) { |
| 99 DVLOG(1) << __FUNCTION__ << "(" << seek_time.InSecondsF() << ")"; | 99 DVLOG(1) << __FUNCTION__ << "(" << seek_time.InSecondsF() << ")"; |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 is_waiting_for_key_ = false; | 854 is_waiting_for_key_ = false; |
| 855 key_added_while_decode_pending_ = false; | 855 key_added_while_decode_pending_ = false; |
| 856 | 856 |
| 857 // StartInternal() will trigger a prefetch, where in most cases we'll just | 857 // StartInternal() will trigger a prefetch, where in most cases we'll just |
| 858 // use previously received data. | 858 // use previously received data. |
| 859 if (playing_) | 859 if (playing_) |
| 860 StartInternal(); | 860 StartInternal(); |
| 861 } | 861 } |
| 862 | 862 |
| 863 } // namespace media | 863 } // namespace media |
| OLD | NEW |