Rialto 0.1
Rialto media pipeline API
Loading...
Searching...
No Matches
IMediaKeys.h
Go to the documentation of this file.
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 2022 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 FIREBOLT_RIALTO_I_MEDIA_KEYS_H_
21#define FIREBOLT_RIALTO_I_MEDIA_KEYS_H_
22
31#include <memory>
32#include <string>
33#include <vector>
34
35#include "IMediaKeysClient.h"
36#include "MediaCommon.h"
37
38namespace firebolt::rialto
39{
40class IMediaKeys;
41
46{
47public:
48 IMediaKeysFactory() = default;
49 virtual ~IMediaKeysFactory() = default;
50
56 static std::shared_ptr<IMediaKeysFactory> createFactory();
57
65 virtual std::unique_ptr<IMediaKeys> createMediaKeys(const std::string &keySystem) const = 0;
66};
67
75{
76public:
77 IMediaKeys() = default;
78 virtual ~IMediaKeys() = default;
79
80 IMediaKeys(const IMediaKeys &) = delete;
81 IMediaKeys &operator=(const IMediaKeys &) = delete;
82 IMediaKeys(IMediaKeys &&) = delete;
83 IMediaKeys &operator=(IMediaKeys &&) = delete;
84
93 virtual MediaKeyErrorStatus selectKeyId(int32_t keySessionId, const std::vector<uint8_t> &keyId) = 0;
94
103 virtual bool containsKey(int32_t keySessionId, const std::vector<uint8_t> &keyId) = 0;
104
118 virtual MediaKeyErrorStatus createKeySession(KeySessionType sessionType, std::weak_ptr<IMediaKeysClient> client,
119 bool isLDL, int32_t &keySessionId) = 0;
120
136 virtual MediaKeyErrorStatus generateRequest(int32_t keySessionId, InitDataType initDataType,
137 const std::vector<uint8_t> &initData) = 0;
138
153 virtual MediaKeyErrorStatus loadSession(int32_t keySessionId) = 0;
154
168 virtual MediaKeyErrorStatus updateSession(int32_t keySessionId, const std::vector<uint8_t> &responseData) = 0;
169
183 virtual MediaKeyErrorStatus setDrmHeader(int32_t keySessionId, const std::vector<uint8_t> &requestData) = 0;
184
196 virtual MediaKeyErrorStatus closeKeySession(int32_t keySessionId) = 0;
197
209 virtual MediaKeyErrorStatus removeKeySession(int32_t keySessionId) = 0;
210
217
224
232 virtual MediaKeyErrorStatus getDrmStoreHash(std::vector<unsigned char> &drmStoreHash) = 0;
233
241 virtual MediaKeyErrorStatus getKeyStoreHash(std::vector<unsigned char> &keyStoreHash) = 0;
242
250 virtual MediaKeyErrorStatus getLdlSessionsLimit(uint32_t &ldlLimit) = 0;
251
260 virtual MediaKeyErrorStatus getLastDrmError(int32_t keySessionId, uint32_t &errorCode) = 0;
261
269 virtual MediaKeyErrorStatus getDrmTime(uint64_t &drmTime) = 0;
270
279 virtual MediaKeyErrorStatus getCdmKeySessionId(int32_t keySessionId, std::string &cdmKeySessionId) = 0;
280
292 virtual MediaKeyErrorStatus releaseKeySession(int32_t keySessionId) = 0;
293
301 virtual MediaKeyErrorStatus getMetricSystemData(std::vector<uint8_t> &buffer) = 0;
302};
303
304}; // namespace firebolt::rialto
305
306#endif // FIREBOLT_RIALTO_I_MEDIA_KEYS_H_
KeySessionType
The media key session type.
Definition MediaCommon.h:302
MediaKeyErrorStatus
The error return status for session management methods.
Definition MediaCommon.h:288
InitDataType
The init data type.
Definition MediaCommon.h:313
IMediaKeys factory class, returns a concrete implementation of IMediaKeys.
Definition IMediaKeys.h:46
virtual std::unique_ptr< IMediaKeys > createMediaKeys(const std::string &keySystem) const =0
IMediaKeys factory method, returns a concrete implementation of IMediaKeys.
static std::shared_ptr< IMediaKeysFactory > createFactory()
Create a IMediaKeysFactory instance.
The definition of the IMediaKeys interface.
Definition IMediaKeys.h:75
virtual bool containsKey(int32_t keySessionId, const std::vector< uint8_t > &keyId)=0
Returns true if the Key Session object contains the specified key.
virtual MediaKeyErrorStatus createKeySession(KeySessionType sessionType, std::weak_ptr< IMediaKeysClient > client, bool isLDL, int32_t &keySessionId)=0
Creates a session and returns the session id.
virtual MediaKeyErrorStatus getDrmTime(uint64_t &drmTime)=0
Get the DRM system time for the object's key system.
virtual MediaKeyErrorStatus setDrmHeader(int32_t keySessionId, const std::vector< uint8_t > &requestData)=0
Set DRM Header for a key session.
virtual MediaKeyErrorStatus getCdmKeySessionId(int32_t keySessionId, std::string &cdmKeySessionId)=0
Get the internal CDM key session ID.
virtual MediaKeyErrorStatus getMetricSystemData(std::vector< uint8_t > &buffer)=0
Get metrics for a DRM system.
virtual MediaKeyErrorStatus generateRequest(int32_t keySessionId, InitDataType initDataType, const std::vector< uint8_t > &initData)=0
Generates a licence request.
virtual MediaKeyErrorStatus removeKeySession(int32_t keySessionId)=0
Removes a key session.
virtual MediaKeyErrorStatus closeKeySession(int32_t keySessionId)=0
Closes a key session.
virtual MediaKeyErrorStatus deleteKeyStore()=0
Delete the key store for the object's key system.
virtual MediaKeyErrorStatus loadSession(int32_t keySessionId)=0
Loads an existing key session.
virtual MediaKeyErrorStatus getKeyStoreHash(std::vector< unsigned char > &keyStoreHash)=0
Gets a hash of the Key store for the object's key system.
virtual MediaKeyErrorStatus releaseKeySession(int32_t keySessionId)=0
Releases a key session.
virtual MediaKeyErrorStatus getDrmStoreHash(std::vector< unsigned char > &drmStoreHash)=0
Gets a hash of the DRM store for the object's key system.
virtual MediaKeyErrorStatus getLastDrmError(int32_t keySessionId, uint32_t &errorCode)=0
Get the last cdm specific DRM error code.
virtual MediaKeyErrorStatus getLdlSessionsLimit(uint32_t &ldlLimit)=0
Get the limit on the number of ldl key sessions for the object's key system.
virtual MediaKeyErrorStatus selectKeyId(int32_t keySessionId, const std::vector< uint8_t > &keyId)=0
Selects the specified keyId for the key session. Netflix specific API.
virtual MediaKeyErrorStatus deleteDrmStore()=0
Delete the DRM store for the object's key system.
virtual MediaKeyErrorStatus updateSession(int32_t keySessionId, const std::vector< uint8_t > &responseData)=0
Updates a key session's state.