Line data Source code
1 : /*
2 : * If not stated otherwise in this file or this component's LICENSE file the
3 : * following copyright and licenses apply:
4 : *
5 : * Copyright 2023 Sky UK
6 : *
7 : * Licensed under the Apache License, Version 2.0 (the "License");
8 : * you may not use this file except in compliance with the License.
9 : * You may obtain a copy of the License at
10 : *
11 : * http://www.apache.org/licenses/LICENSE-2.0
12 : *
13 : * Unless required by applicable law or agreed to in writing, software
14 : * distributed under the License is distributed on an "AS IS" BASIS,
15 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 : * See the License for the specific language governing permissions and
17 : * limitations under the License.
18 : */
19 :
20 : #ifndef I_CDM_BACKEND_H_
21 : #define I_CDM_BACKEND_H_
22 :
23 : #include <ControlCommon.h>
24 : #include <IMediaKeysClient.h>
25 : #include <MediaCommon.h>
26 : #include <cstdint>
27 : #include <memory>
28 : #include <string>
29 : #include <vector>
30 :
31 : class ICdmBackend
32 : {
33 : public:
34 147 : virtual ~ICdmBackend() = default;
35 :
36 : virtual bool initialize(const firebolt::rialto::ApplicationState &initialState) = 0;
37 : virtual bool selectKeyId(int32_t keySessionId, const std::vector<uint8_t> &keyId) = 0;
38 : virtual bool containsKey(int32_t keySessionId, const std::vector<uint8_t> &keyId) = 0;
39 : virtual bool createKeySession(firebolt::rialto::KeySessionType sessionType, bool isLDL, int32_t &keySessionId) = 0;
40 : virtual bool generateRequest(int32_t keySessionId, firebolt::rialto::InitDataType initDataType,
41 : const std::vector<uint8_t> &initData) = 0;
42 : virtual bool loadSession(int32_t keySessionId) = 0;
43 : virtual bool updateSession(int32_t keySessionId, const std::vector<uint8_t> &responseData) = 0;
44 : virtual bool setDrmHeader(int32_t keySessionId, const std::vector<uint8_t> &requestData) = 0;
45 : virtual bool closeKeySession(int32_t keySessionId) = 0;
46 : virtual bool removeKeySession(int32_t keySessionId) = 0;
47 : virtual bool deleteDrmStore() = 0;
48 : virtual bool deleteKeyStore() = 0;
49 : virtual bool getDrmStoreHash(std::vector<unsigned char> &drmStoreHash) = 0;
50 : virtual bool getKeyStoreHash(std::vector<unsigned char> &keyStoreHash) = 0;
51 : virtual bool getLdlSessionsLimit(uint32_t &ldlLimit) = 0;
52 : virtual bool getLastDrmError(int32_t keySessionId, uint32_t &errorCode) = 0;
53 : virtual bool getDrmTime(uint64_t &drmTime) = 0;
54 : virtual bool getCdmKeySessionId(int32_t keySessionId, std::string &cdmKeySessionId) = 0;
55 : virtual bool releaseKeySession(int32_t keySessionId) = 0;
56 : virtual bool getMetricSystemData(std::vector<uint8_t> &buffer) = 0;
57 : };
58 :
59 : #endif // I_CDM_BACKEND_H_
|