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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 demuxer_->Initialize(this); | 68 demuxer_->Initialize(this); |
69 interpolator_.SetUpperBound(base::TimeDelta()); | 69 interpolator_.SetUpperBound(base::TimeDelta()); |
70 weak_this_ = weak_factory_.GetWeakPtr(); | 70 weak_this_ = weak_factory_.GetWeakPtr(); |
71 } | 71 } |
72 | 72 |
73 MediaSourcePlayer::~MediaSourcePlayer() { | 73 MediaSourcePlayer::~MediaSourcePlayer() { |
74 Release(); | 74 Release(); |
75 DCHECK_EQ(!cdm_, !cdm_registration_id_); | 75 DCHECK_EQ(!cdm_, !cdm_registration_id_); |
76 if (cdm_) { | 76 if (cdm_) { |
| 77 // Cancel previously registered callback (if any). |
| 78 static_cast<MediaDrmBridge*>(cdm_.get()) |
| 79 ->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB()); |
| 80 |
77 static_cast<MediaDrmBridge*>(cdm_.get()) | 81 static_cast<MediaDrmBridge*>(cdm_.get()) |
78 ->UnregisterPlayer(cdm_registration_id_); | 82 ->UnregisterPlayer(cdm_registration_id_); |
79 cdm_registration_id_ = 0; | 83 cdm_registration_id_ = 0; |
80 } | 84 } |
81 } | 85 } |
82 | 86 |
83 void MediaSourcePlayer::SetVideoSurface(gfx::ScopedJavaSurface surface) { | 87 void MediaSourcePlayer::SetVideoSurface(gfx::ScopedJavaSurface surface) { |
84 DVLOG(1) << __FUNCTION__; | 88 DVLOG(1) << __FUNCTION__; |
85 if (!video_decoder_job_->SetVideoSurface(std::move(surface))) | 89 if (!video_decoder_job_->SetVideoSurface(std::move(surface))) |
86 return; | 90 return; |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 is_waiting_for_key_ = false; | 852 is_waiting_for_key_ = false; |
849 key_added_while_decode_pending_ = false; | 853 key_added_while_decode_pending_ = false; |
850 | 854 |
851 // StartInternal() will trigger a prefetch, where in most cases we'll just | 855 // StartInternal() will trigger a prefetch, where in most cases we'll just |
852 // use previously received data. | 856 // use previously received data. |
853 if (playing_) | 857 if (playing_) |
854 StartInternal(); | 858 StartInternal(); |
855 } | 859 } |
856 | 860 |
857 } // namespace media | 861 } // namespace media |
OLD | NEW |