LCOV - code coverage report
Current view: top level - media/client/main/include - MediaKeysCapabilities.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 2 2
Test Date: 2025-02-18 13:13:53 Functions: 100.0 % 2 2

            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_CLIENT_MEDIA_KEYS_CAPABILITIES_H_
      21              : #define FIREBOLT_RIALTO_CLIENT_MEDIA_KEYS_CAPABILITIES_H_
      22              : 
      23              : #include "IMediaKeysCapabilities.h"
      24              : #include "IMediaKeysCapabilitiesIpcFactory.h"
      25              : #include <memory>
      26              : #include <mutex>
      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              :     /**
      42              :      * @brief Weak pointer to the singleton object.
      43              :      */
      44              :     static std::weak_ptr<IMediaKeysCapabilities> m_mediaKeysCapabilities;
      45              : 
      46              :     /**
      47              :      * @brief Mutex protection for creation of the MediaKeysCapabilities object.
      48              :      */
      49              :     static std::mutex m_creationMutex;
      50              : 
      51              :     std::shared_ptr<IMediaKeysCapabilities> getMediaKeysCapabilities() const override;
      52              : };
      53              : 
      54              : }; // namespace firebolt::rialto
      55              : 
      56              : namespace firebolt::rialto::client
      57              : {
      58              : /**
      59              :  * @brief The definition of the MediaKeysCapabilities.
      60              :  */
      61              : class MediaKeysCapabilities : public IMediaKeysCapabilities
      62              : {
      63              : public:
      64              :     /**
      65              :      * @brief The constructor.
      66              :      *
      67              :      * @param[in] mediaKeysCapabilitiesIpcFactory : The media keys capabilities ipc factory.
      68              :      */
      69              :     explicit MediaKeysCapabilities(const std::shared_ptr<IMediaKeysCapabilitiesIpcFactory> &MediaKeysCapabilitiesIpcFactory);
      70              : 
      71              :     /**
      72              :      * @brief Virtual destructor.
      73              :      */
      74              :     virtual ~MediaKeysCapabilities();
      75              : 
      76              :     std::vector<std::string> getSupportedKeySystems() override;
      77              : 
      78              :     bool supportsKeySystem(const std::string &keySystem) override;
      79              : 
      80              :     bool getSupportedKeySystemVersion(const std::string &keySystem, std::string &version) override;
      81              : 
      82              :     bool isServerCertificateSupported(const std::string &keySystem) override;
      83              : 
      84              : private:
      85              :     /**
      86              :      * @brief The media keys capabilities ipc object.
      87              :      */
      88              :     std::shared_ptr<IMediaKeysCapabilities> m_mediaKeysCapabilitiesIpc;
      89              : };
      90              : 
      91              : }; // namespace firebolt::rialto::client
      92              : 
      93              : #endif // FIREBOLT_RIALTO_CLIENT_MEDIA_KEYS_CAPABILITIES_H_
        

Generated by: LCOV version 2.0-1