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 "webkit/media/crypto/ppapi_decryptor.h" | 5 #include "webkit/media/crypto/ppapi_decryptor.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/decoder_buffer.h" | 8 #include "media/base/decoder_buffer.h" |
9 #include "media/base/decryptor_client.h" | 9 #include "media/base/decryptor_client.h" |
10 #include "webkit/media/crypto/key_systems.h" | 10 #include "webkit/media/crypto/key_systems.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const DecryptCB& decrypt_cb) { | 60 const DecryptCB& decrypt_cb) { |
61 DCHECK(cdm_plugin_); | 61 DCHECK(cdm_plugin_); |
62 // TODO(xhwang): Enable the following once we have updated PluginInstance. | 62 // TODO(xhwang): Enable the following once we have updated PluginInstance. |
63 // TODO(xhwang): Need to figure out thread safety about PPP calls. | 63 // TODO(xhwang): Need to figure out thread safety about PPP calls. |
64 // if (!cdm_plugin_->Decrypt( | 64 // if (!cdm_plugin_->Decrypt( |
65 // encrypted, base::Bind(&PpapiDecryptor::DataReady, this, decrypt_cb))) { | 65 // encrypted, base::Bind(&PpapiDecryptor::DataReady, this, decrypt_cb))) { |
66 // decrypt_cb.Run(kError, NULL); | 66 // decrypt_cb.Run(kError, NULL); |
67 // } | 67 // } |
68 } | 68 } |
69 | 69 |
| 70 void PpapiDecryptor::Stop() { |
| 71 } |
| 72 |
70 void PpapiDecryptor::DataReady(const DecryptCB& decrypt_cb, | 73 void PpapiDecryptor::DataReady(const DecryptCB& decrypt_cb, |
71 const uint8* data, int data_size ) { | 74 const uint8* data, int data_size ) { |
72 DCHECK(!decrypt_cb.is_null()); | 75 DCHECK(!decrypt_cb.is_null()); |
73 scoped_refptr<media::DecoderBuffer> decrypted_data = | 76 scoped_refptr<media::DecoderBuffer> decrypted_data = |
74 media::DecoderBuffer::CopyFrom(data, data_size); | 77 media::DecoderBuffer::CopyFrom(data, data_size); |
75 decrypt_cb.Run(kSuccess, decrypted_data); | 78 decrypt_cb.Run(kSuccess, decrypted_data); |
76 } | 79 } |
77 | 80 |
78 } // namespace webkit_media | 81 } // namespace webkit_media |
OLD | NEW |