15 #ifndef SHAKA_EMBEDDED_EME_CLEARKEY_FACTORY_H_ 16 #define SHAKA_EMBEDDED_EME_CLEARKEY_FACTORY_H_ 21 #include <unordered_map> 28 #define AES_BLOCK_SIZE 16u 33 class DecoderIntegration;
34 class DecoderDecryptIntegration;
44 bool GetExpiration(
const std::string& session_id,
45 int64_t* expiration)
const override;
47 bool GetKeyStatuses(
const std::string& session_id,
48 std::vector<KeyStatusInfo>* statuses)
const override;
52 void CreateSessionAndGenerateRequest(
54 std::function<
void(
const std::string&)> set_session_id,
58 void Load(
const std::string& session_id,
EmePromise promise)
override;
60 void Update(
const std::string& session_id,
EmePromise promise,
63 void Close(
const std::string& session_id,
EmePromise promise)
override;
65 void Remove(
const std::string& session_id,
EmePromise promise)
override;
68 size_t data_size, uint8_t*
dest)
const override;
73 Key(std::vector<uint8_t> key_id, std::vector<uint8_t> key);
78 std::vector<uint8_t>
key;
85 Session(
const Session&) =
delete;
86 Session& operator=(Session&&);
87 Session& operator=(
const Session&) =
delete;
90 bool callable =
false;
93 friend class ClearKeyImplementationTest;
94 friend class media::DecoderIntegration;
95 friend class media::DecoderDecryptIntegration;
98 const uint8_t* data,
size_t data_size,
99 size_t block_offset, uint8_t* dest,
102 void LoadKeyForTesting(std::vector<uint8_t> key_id, std::vector<uint8_t> key);
104 mutable std::mutex mutex_;
105 std::unordered_map<std::string, Session> sessions_;
107 uint32_t cur_session_id_;
113 #endif // SHAKA_EMBEDDED_EME_CLEARKEY_FACTORY_H_
std::vector< uint8_t > key_id
std::vector< uint8_t > key