OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/decrypting_demuxer_stream.h" | 5 #include "media/filters/decrypting_demuxer_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 false, // Output video is not encrypted. | 184 false, // Output video is not encrypted. |
185 false); | 185 false); |
186 break; | 186 break; |
187 } | 187 } |
188 | 188 |
189 default: | 189 default: |
190 NOTREACHED(); | 190 NOTREACHED(); |
191 return; | 191 return; |
192 } | 192 } |
193 | 193 |
194 decryptor_->RegisterKeyAddedCB( | 194 decryptor_->RegisterNewKeyCB( |
195 GetDecryptorStreamType(), | 195 GetDecryptorStreamType(), |
196 BIND_TO_LOOP(&DecryptingDemuxerStream::OnKeyAdded)); | 196 BIND_TO_LOOP(&DecryptingDemuxerStream::OnKeyAdded)); |
197 | 197 |
198 state_ = kIdle; | 198 state_ = kIdle; |
199 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 199 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
200 } | 200 } |
201 | 201 |
202 void DecryptingDemuxerStream::DecryptBuffer( | 202 void DecryptingDemuxerStream::DecryptBuffer( |
203 DemuxerStream::Status status, | 203 DemuxerStream::Status status, |
204 const scoped_refptr<DecoderBuffer>& buffer) { | 204 const scoped_refptr<DecoderBuffer>& buffer) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 state_ = kIdle; | 342 state_ = kIdle; |
343 base::ResetAndReturn(&reset_cb_).Run(); | 343 base::ResetAndReturn(&reset_cb_).Run(); |
344 } | 344 } |
345 | 345 |
346 Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const { | 346 Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const { |
347 DCHECK(stream_type_ == AUDIO || stream_type_ == VIDEO); | 347 DCHECK(stream_type_ == AUDIO || stream_type_ == VIDEO); |
348 return stream_type_ == AUDIO ? Decryptor::kAudio : Decryptor::kVideo; | 348 return stream_type_ == AUDIO ? Decryptor::kAudio : Decryptor::kVideo; |
349 } | 349 } |
350 | 350 |
351 } // namespace media | 351 } // namespace media |
OLD | NEW |