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 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_SERVER_MEDIA_KEYS_CAPABILITIES_H_
21 : #define FIREBOLT_RIALTO_SERVER_MEDIA_KEYS_CAPABILITIES_H_
22 :
23 : #include "IMediaKeysCapabilities.h"
24 : #include "IOcdm.h"
25 : #include "IOcdmSystem.h"
26 : #include <memory>
27 : #include <string>
28 : #include <vector>
29 :
30 : namespace firebolt::rialto
31 : {
32 : /**
33 : * @brief IMediaKeysCapabilities factory class definition.
34 : */
35 : class MediaKeysCapabilitiesFactory : public IMediaKeysCapabilitiesFactory
36 : {
37 : public:
38 1 : MediaKeysCapabilitiesFactory() = default;
39 1 : ~MediaKeysCapabilitiesFactory() override = default;
40 :
41 : std::shared_ptr<IMediaKeysCapabilities> getMediaKeysCapabilities() const override;
42 : };
43 :
44 : }; // namespace firebolt::rialto
45 :
46 : namespace firebolt::rialto::server
47 : {
48 : /**
49 : * @brief The definition of the MediaKeys.
50 : */
51 : class MediaKeysCapabilities : public IMediaKeysCapabilities
52 : {
53 : public:
54 : /**
55 : * @brief The constructor.
56 : *
57 : * @param[in] ocdmFactory : The ocdm factory.
58 : * @param[in] ocdmSystemFactory : The ocdmSystem factory.
59 : */
60 : MediaKeysCapabilities(std::shared_ptr<firebolt::rialto::wrappers::IOcdmFactory> ocdmFactory,
61 : std::shared_ptr<firebolt::rialto::wrappers::IOcdmSystemFactory> ocdmSystemFactory);
62 :
63 : /**
64 : * @brief Virtual destructor.
65 : */
66 : virtual ~MediaKeysCapabilities();
67 :
68 : std::vector<std::string> getSupportedKeySystems() override;
69 :
70 : bool supportsKeySystem(const std::string &keySystem) override;
71 :
72 : bool getSupportedKeySystemVersion(const std::string &keySystem, std::string &version) override;
73 :
74 : bool isServerCertificateSupported(const std::string &keySystem) override;
75 :
76 : private:
77 : /**
78 : * @brief The IOcdm instance.
79 : */
80 : std::shared_ptr<firebolt::rialto::wrappers::IOcdm> m_ocdm;
81 :
82 : /**
83 : * @brief The IOcdmSystem factory.
84 : */
85 : std::shared_ptr<firebolt::rialto::wrappers::IOcdmSystemFactory> m_ocdmSystemFactory;
86 : };
87 :
88 : }; // namespace firebolt::rialto::server
89 :
90 : #endif // FIREBOLT_RIALTO_SERVER_MEDIA_KEYS_CAPABILITIES_H_
|