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

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

Issue 1601743007: media: Cancel MediaCryptoReadyCB during player destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « media/base/android/media_codec_player.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
OLDNEW
« no previous file with comments | « media/base/android/media_codec_player.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698