LCOV - code coverage report
Current view: top level - media/server/main/interface - IMediaKeysServerInternal.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 2 2
Test Date: 2025-11-17 09:18:47 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_SERVER_I_MEDIA_KEYS_SERVER_INTERNAL_H_
      21              : #define FIREBOLT_RIALTO_SERVER_I_MEDIA_KEYS_SERVER_INTERNAL_H_
      22              : 
      23              : /**
      24              :  * @file IMediaKeysServerInternal.h
      25              :  *
      26              :  * The definition of the IMediaKeys interface.
      27              :  *
      28              :  * This interface defines the server internal API of Rialto for EME decryption of AV content.
      29              :  */
      30              : 
      31              : #include "IHeartbeatHandler.h"
      32              : #include "IMediaKeys.h"
      33              : #include "MediaCommon.h"
      34              : #include <cstdint>
      35              : #include <gst/gst.h>
      36              : #include <memory>
      37              : #include <string>
      38              : #include <vector>
      39              : 
      40              : namespace firebolt::rialto::server
      41              : {
      42              : class IMediaKeysServerInternal;
      43              : /**
      44              :  * @brief IMediaKeysServerInternal factory class, returns a concrete implementation of IMediaKeysServerInternal
      45              :  */
      46              : class IMediaKeysServerInternalFactory : public IMediaKeysFactory
      47              : {
      48              : public:
      49           98 :     IMediaKeysServerInternalFactory() = default;
      50           98 :     ~IMediaKeysServerInternalFactory() override = default;
      51              : 
      52              :     /**
      53              :      * @brief Create a IMediaKeysServerInternalFactory instance.
      54              :      *
      55              :      * @retval the factory instance or null on error.
      56              :      */
      57              :     static std::shared_ptr<IMediaKeysServerInternalFactory> createFactory();
      58              : 
      59              :     /**
      60              :      * @brief IMediaKeysServerInternal factory method, returns a concrete implementation of IMediaKeysServerInternal
      61              :      *
      62              :      * @param[in] keySystem : The key system for which to create a Media Keys instance
      63              :      *
      64              :      * @retval the new media keys instance or null on error.
      65              :      */
      66              :     virtual std::unique_ptr<IMediaKeysServerInternal> createMediaKeysServerInternal(const std::string &keySystem) const = 0;
      67              : };
      68              : 
      69              : /**
      70              :  * @brief The definition of the IMediaKeysServerInternal interface.
      71              :  *
      72              :  * This interface defines the public API of Rialto for EME decryption of AV content
      73              :  * which should be implemented by Rialto Server.
      74              :  */
      75              : class IMediaKeysServerInternal : public IMediaKeys
      76              : {
      77              : public:
      78              :     /**
      79              :      * @brief Decrypts the buffer.
      80              :      *
      81              :      * Encryption metadata shall be attached to the encrypted buffer as protection meta prior to this call.
      82              :      *
      83              :      * @param[in] keySessionId    : The session id for the session.
      84              :      * @param[in] encrypted       : Gstreamer buffer containing encrypted data and related meta data. If applicable,
      85              :      *                              decrypted data will be stored here after this call returns.
      86              :      * @param[in] caps            : The gst caps of buffer.
      87              :      *
      88              :      * @retval an error status.
      89              :      */
      90              :     virtual MediaKeyErrorStatus decrypt(int32_t keySessionId, GstBuffer *encrypted, GstCaps *caps) = 0;
      91              : 
      92              :     /**
      93              :      * @brief Checks, if key system of media key session is Netflix Playready.
      94              :      *
      95              :      * @retval true if key system is Playready
      96              :      */
      97              :     virtual bool isNetflixPlayreadyKeySystem() const = 0;
      98              : 
      99              :     /**
     100              :      * @brief Checks, if MediaKeys main thread is not deadlocked
     101              :      *
     102              :      * @param[in] heartbeatHandler    : The heartbeat handler instance.
     103              :      *
     104              :      */
     105              :     virtual void ping(std::unique_ptr<IHeartbeatHandler> &&heartbeatHandler) = 0;
     106              : };
     107              : } // namespace firebolt::rialto::server
     108              : 
     109              : #endif // FIREBOLT_RIALTO_SERVER_I_MEDIA_KEYS_SERVER_INTERNAL_H_
        

Generated by: LCOV version 2.0-1