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

Side by Side Diff: media/base/android/media_codec_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 | « no previous file | media/base/android/media_source_player.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_codec_player.h" 5 #include "media/base/android/media_codec_player.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // watching the demuxer, which is destroyed as one of the member variables. 95 // watching the demuxer, which is destroyed as one of the member variables.
96 // Release the codecs here, before any member variable is destroyed to make 96 // Release the codecs here, before any member variable is destroyed to make
97 // the unit tests happy. 97 // the unit tests happy.
98 98
99 if (video_decoder_) 99 if (video_decoder_)
100 video_decoder_->ReleaseDecoderResources(); 100 video_decoder_->ReleaseDecoderResources();
101 if (audio_decoder_) 101 if (audio_decoder_)
102 audio_decoder_->ReleaseDecoderResources(); 102 audio_decoder_->ReleaseDecoderResources();
103 103
104 if (cdm_) { 104 if (cdm_) {
105 // Cancel previously registered callback (if any).
106 static_cast<MediaDrmBridge*>(cdm_.get())
107 ->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB());
108
105 DCHECK(cdm_registration_id_); 109 DCHECK(cdm_registration_id_);
106 static_cast<MediaDrmBridge*>(cdm_.get()) 110 static_cast<MediaDrmBridge*>(cdm_.get())
107 ->UnregisterPlayer(cdm_registration_id_); 111 ->UnregisterPlayer(cdm_registration_id_);
108 } 112 }
109 } 113 }
110 114
111 void MediaCodecPlayer::Initialize() { 115 void MediaCodecPlayer::Initialize() {
112 DVLOG(1) << __FUNCTION__; 116 DVLOG(1) << __FUNCTION__;
113 DCHECK(GetMediaTaskRunner()->BelongsToCurrentThread()); 117 DCHECK(GetMediaTaskRunner()->BelongsToCurrentThread());
114 118
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 RETURN_STRING(kStateWaitingForMediaCrypto); 1419 RETURN_STRING(kStateWaitingForMediaCrypto);
1416 RETURN_STRING(kStateWaitingForSeek); 1420 RETURN_STRING(kStateWaitingForSeek);
1417 RETURN_STRING(kStateError); 1421 RETURN_STRING(kStateError);
1418 } 1422 }
1419 return nullptr; // crash early 1423 return nullptr; // crash early
1420 } 1424 }
1421 1425
1422 #undef RETURN_STRING 1426 #undef RETURN_STRING
1423 1427
1424 } // namespace media 1428 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/android/media_source_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698