| OLD | NEW |
| 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 #ifndef MEDIA_CDM_CDM_ADAPTER_H_ | 5 #ifndef MEDIA_CDM_CDM_ADAPTER_H_ |
| 6 #define MEDIA_CDM_CDM_ADAPTER_H_ | 6 #define MEDIA_CDM_CDM_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // operations. Returns NULL if a FileIO object cannot be obtained. Once a | 40 // operations. Returns NULL if a FileIO object cannot be obtained. Once a |
| 41 // valid FileIO object is returned, |client| must be valid until | 41 // valid FileIO object is returned, |client| must be valid until |
| 42 // FileIO::Close() is called. The CDM can call this method multiple times | 42 // FileIO::Close() is called. The CDM can call this method multiple times |
| 43 // to operate on different files. | 43 // to operate on different files. |
| 44 using CreateCdmFileIOCB = | 44 using CreateCdmFileIOCB = |
| 45 base::Callback<std::unique_ptr<CdmFileIO>(cdm::FileIOClient* client)>; | 45 base::Callback<std::unique_ptr<CdmFileIO>(cdm::FileIOClient* client)>; |
| 46 | 46 |
| 47 class MEDIA_EXPORT CdmAdapter : public MediaKeys, | 47 class MEDIA_EXPORT CdmAdapter : public MediaKeys, |
| 48 public CdmContext, | 48 public CdmContext, |
| 49 public Decryptor, | 49 public Decryptor, |
| 50 NON_EXPORTED_BASE(public cdm::Host_7), | |
| 51 NON_EXPORTED_BASE(public cdm::Host_8) { | 50 NON_EXPORTED_BASE(public cdm::Host_8) { |
| 52 public: | 51 public: |
| 53 // Create the CDM using |cdm_path| and initialize it using |key_system| and | 52 // Create the CDM using |cdm_path| and initialize it using |key_system| and |
| 54 // |cdm_config|. |allocator| is to be used whenever the CDM needs memory | 53 // |cdm_config|. |allocator| is to be used whenever the CDM needs memory |
| 55 // and to create VideoFrames. |file_io_provider| is to be used whenever the | 54 // and to create VideoFrames. |file_io_provider| is to be used whenever the |
| 56 // CDM needs access to the file system. Callbacks will be used for events | 55 // CDM needs access to the file system. Callbacks will be used for events |
| 57 // generated by the CDM. |cdm_created_cb| will be called when the CDM is | 56 // generated by the CDM. |cdm_created_cb| will be called when the CDM is |
| 58 // loaded and initialized. | 57 // loaded and initialized. |
| 59 static void Create( | 58 static void Create( |
| 60 const std::string& key_system, | 59 const std::string& key_system, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const DecoderInitCB& init_cb) final; | 102 const DecoderInitCB& init_cb) final; |
| 104 void InitializeVideoDecoder(const VideoDecoderConfig& config, | 103 void InitializeVideoDecoder(const VideoDecoderConfig& config, |
| 105 const DecoderInitCB& init_cb) final; | 104 const DecoderInitCB& init_cb) final; |
| 106 void DecryptAndDecodeAudio(const scoped_refptr<DecoderBuffer>& encrypted, | 105 void DecryptAndDecodeAudio(const scoped_refptr<DecoderBuffer>& encrypted, |
| 107 const AudioDecodeCB& audio_decode_cb) final; | 106 const AudioDecodeCB& audio_decode_cb) final; |
| 108 void DecryptAndDecodeVideo(const scoped_refptr<DecoderBuffer>& encrypted, | 107 void DecryptAndDecodeVideo(const scoped_refptr<DecoderBuffer>& encrypted, |
| 109 const VideoDecodeCB& video_decode_cb) final; | 108 const VideoDecodeCB& video_decode_cb) final; |
| 110 void ResetDecoder(StreamType stream_type) final; | 109 void ResetDecoder(StreamType stream_type) final; |
| 111 void DeinitializeDecoder(StreamType stream_type) final; | 110 void DeinitializeDecoder(StreamType stream_type) final; |
| 112 | 111 |
| 113 // cdm::Host_7 and cdm::Host_8 implementation. | 112 // cdm::Host_8 implementation. |
| 114 cdm::Buffer* Allocate(uint32_t capacity) override; | 113 cdm::Buffer* Allocate(uint32_t capacity) override; |
| 115 void SetTimer(int64_t delay_ms, void* context) override; | 114 void SetTimer(int64_t delay_ms, void* context) override; |
| 116 cdm::Time GetCurrentWallTime() override; | 115 cdm::Time GetCurrentWallTime() override; |
| 117 void OnResolveNewSessionPromise(uint32_t promise_id, | 116 void OnResolveNewSessionPromise(uint32_t promise_id, |
| 118 const char* session_id, | 117 const char* session_id, |
| 119 uint32_t session_id_size) override; | 118 uint32_t session_id_size) override; |
| 120 void OnResolvePromise(uint32_t promise_id) override; | 119 void OnResolvePromise(uint32_t promise_id) override; |
| 121 void OnRejectPromise(uint32_t promise_id, | 120 void OnRejectPromise(uint32_t promise_id, |
| 122 cdm::Error error, | 121 cdm::Error error, |
| 123 uint32_t system_code, | 122 uint32_t system_code, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 226 |
| 228 // NOTE: Weak pointers must be invalidated before all other member variables. | 227 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 229 base::WeakPtrFactory<CdmAdapter> weak_factory_; | 228 base::WeakPtrFactory<CdmAdapter> weak_factory_; |
| 230 | 229 |
| 231 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); | 230 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); |
| 232 }; | 231 }; |
| 233 | 232 |
| 234 } // namespace media | 233 } // namespace media |
| 235 | 234 |
| 236 #endif // MEDIA_CDM_CDM_ADAPTER_H_ | 235 #endif // MEDIA_CDM_CDM_ADAPTER_H_ |
| OLD | NEW |