| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/base/decrypt_context_impl.h" | 5 #include "chromecast/media/base/decrypt_context_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 return key_system_; | 31 return key_system_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool DecryptContextImpl::Decrypt(CastDecoderBuffer* buffer, | 34 bool DecryptContextImpl::Decrypt(CastDecoderBuffer* buffer, |
| 35 uint8_t* output, | 35 uint8_t* output, |
| 36 size_t data_offset) { | 36 size_t data_offset) { |
| 37 bool called = false; | 37 bool called = false; |
| 38 bool success = false; | 38 bool success = false; |
| 39 DecryptAsync(buffer, output, data_offset, | 39 DecryptAsync(buffer, output, data_offset, |
| 40 base::Bind(&BufferDecryptCB, &called, &success)); | 40 base::Bind(&BufferDecryptCB, &called, &success)); |
| 41 CHECK(called) << "Sync Decrypt isn't supported"; | 41 // Sync Decrypt isn't supported |
| 42 CHECK(called); |
| 42 | 43 |
| 43 return success; | 44 return success; |
| 44 } | 45 } |
| 45 | 46 |
| 46 void DecryptContextImpl::DecryptAsync(CastDecoderBuffer* buffer, | 47 void DecryptContextImpl::DecryptAsync(CastDecoderBuffer* buffer, |
| 47 uint8_t* output, | 48 uint8_t* output, |
| 48 size_t data_offset, | 49 size_t data_offset, |
| 49 const DecryptCB& decrypt_cb) { | 50 const DecryptCB& decrypt_cb) { |
| 50 decrypt_cb.Run(false); | 51 decrypt_cb.Run(false); |
| 51 } | 52 } |
| 52 | 53 |
| 53 bool DecryptContextImpl::CanDecryptToBuffer() const { | 54 bool DecryptContextImpl::CanDecryptToBuffer() const { |
| 54 return false; | 55 return false; |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace media | 58 } // namespace media |
| 58 } // namespace chromecast | 59 } // namespace chromecast |
| OLD | NEW |