1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CLEARPLAY_SESSION_H
17 #define CLEARPLAY_SESSION_H
18 
19 #include <hdf_base.h>
20 #include <hdi_base.h>
21 #include <vector>
22 #include "v1_0/media_key_system_types.h"
23 
24 namespace OHOS {
25 namespace HDI {
26 namespace Drm {
27 namespace V1_0 {
28 class Session : public RefBase {
29 public:
Session()30     explicit Session() {}
~Session()31     virtual ~Session() {}
32     int32_t getKeyRequest(const std::vector<uint8_t> &indexInfo, const std::string &mimeType, MediaKeyType keyType,
33         std::map<std::string, std::string> optionalData, std::vector<uint8_t> *keyRequest);
34     int32_t setKeyIdAndKeyValue(const std::vector<uint8_t> &keyId, const std::vector<uint8_t> &keyValue);
35     int32_t getKeyValueByKeyId(const std::vector<uint8_t> &keyId, std::vector<uint8_t> &keyValue);
36     std::vector<std::pair<std::vector<uint8_t>, std::vector<uint8_t>>> keyIdAndKeyValue_;
37     std::map<std::vector<uint8_t>, OfflineMediaKeyStatus> keyIdStatusMap;
38 };
39 } // V1_0
40 } // Drm
41 } // HDI
42 } // OHOS
43 #endif // CLEARPLAY_SESSION_H