ClearKeySession.h (1506B)
1 /* 2 * Copyright 2015, Mozilla Foundation and contributors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __ClearKeySession_h__ 18 #define __ClearKeySession_h__ 19 20 // This include is required in order for content_decryption_module to work 21 // on Unix systems. 22 23 #include <string> 24 #include <vector> 25 26 #include "ClearKeyUtils.h" 27 #include "content_decryption_module.h" 28 29 class ClearKeySession { 30 public: 31 explicit ClearKeySession(const std::string& aSessionId, 32 cdm::SessionType aSessionType); 33 34 ~ClearKeySession(); 35 36 const std::vector<KeyId>& GetKeyIds() const { return mKeyIds; } 37 38 bool Init(cdm::InitDataType aInitDataType, const uint8_t* aInitData, 39 uint32_t aInitDataSize); 40 41 cdm::SessionType Type() const; 42 43 void AddKeyId(const KeyId& aKeyId); 44 45 const std::string& Id() const { return mSessionId; } 46 47 private: 48 const std::string mSessionId; 49 std::vector<KeyId> mKeyIds; 50 51 const cdm::SessionType mSessionType; 52 }; 53 54 #endif // __ClearKeySession_h__