LCOV - code coverage report
Current view: top level - media/client/ipc/interface - IMediaPipelineIpcClient.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 2 2
Test Date: 2026-12-04 20:46:59 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_I_MEDIA_PIPELINE_IPC_CLIENT_H_
      21              : #define FIREBOLT_RIALTO_CLIENT_I_MEDIA_PIPELINE_IPC_CLIENT_H_
      22              : 
      23              : #include <MediaCommon.h>
      24              : #include <memory>
      25              : #include <stdint.h>
      26              : #include <string>
      27              : 
      28              : /**
      29              :  * @file IMediaPipelineIpcClient.h
      30              :  *
      31              :  * The definition of the IMediaPipelineIpcClient interface.
      32              :  */
      33              : 
      34              : namespace firebolt::rialto::client
      35              : {
      36              : /**
      37              :  * @brief The Rialto media player client ipc interface.
      38              :  */
      39              : class IMediaPipelineIpcClient
      40              : {
      41              : public:
      42          334 :     IMediaPipelineIpcClient() = default;
      43          334 :     virtual ~IMediaPipelineIpcClient() = default;
      44              : 
      45              :     IMediaPipelineIpcClient(const IMediaPipelineIpcClient &) = delete;
      46              :     IMediaPipelineIpcClient &operator=(const IMediaPipelineIpcClient &) = delete;
      47              :     IMediaPipelineIpcClient(IMediaPipelineIpcClient &&) = delete;
      48              :     IMediaPipelineIpcClient &operator=(IMediaPipelineIpcClient &&) = delete;
      49              : 
      50              :     /**
      51              :      * @brief Notifies the rialto client of the playback state.
      52              :      *
      53              :      * @param[in] state : The new playback state.
      54              :      */
      55              :     virtual void notifyPlaybackState(PlaybackState state) = 0;
      56              : 
      57              :     /**
      58              :      * @brief Handler for a playback position update from the server.
      59              :      *
      60              :      * @param[in] event : The playback position changed event structure.
      61              :      */
      62              :     virtual void notifyPosition(int64_t position) = 0;
      63              : 
      64              :     /**
      65              :      * @brief Notifies the rialto client of the network state.
      66              :      *
      67              :      * @param[in] state : The new network state.
      68              :      */
      69              :     virtual void notifyNetworkState(NetworkState state) = 0;
      70              : 
      71              :     /**
      72              :      * @brief Notifies the rialto client of a need data request.
      73              :      *
      74              :      * @param[in] sourceId      : The source to read data from.
      75              :      * @param[in] frameCount    : The number of frames to read.
      76              :      * @param[in] requestId     : Need data request id.
      77              :      * @param[in] shmInfo       : Information for populating the shared memory (null if not applicable to the client).
      78              :      */
      79              :     virtual void notifyNeedMediaData(int32_t sourceId, size_t frameCount, uint32_t requestId,
      80              :                                      const std::shared_ptr<MediaPlayerShmInfo> &shmInfo) = 0;
      81              : 
      82              :     /**
      83              :      * @brief Notifies the rialto client of a Quality Of Service update.
      84              :      *
      85              :      * @param[in] sourceId  : The id of the source that produced the Qos.
      86              :      * @param[in] qosInfo   : The information provided in the update.
      87              :      */
      88              :     virtual void notifyQos(int32_t sourceId, const QosInfo &qosInfo) = 0;
      89              : 
      90              :     /**
      91              :      * @brief Notifies the rialto client of a playback metric event.
      92              :      *
      93              :      * @param[in] metric   : The metric event, with optional fields left as std::nullopt when absent.
      94              :      */
      95              :     virtual void notifyMetric(const MetricEvent &metric) = 0;
      96              : 
      97              :     /**
      98              :      * @brief Notifies the client that buffer underflow occurred.
      99              :      *
     100              :      * Notification shall be sent whenever a video/audio buffer underflow occurs
     101              :      *
     102              :      * @param[in] sourceId  : The id of the source that produced the buffer underflow
     103              :      */
     104              :     virtual void notifyBufferUnderflow(int32_t sourceId) = 0;
     105              : 
     106              :     /**
     107              :      * @brief Notifies the client that the first frame has been received.
     108              :      *
     109              :      * Notification shall be sent whenever a video/audio first frame is received
     110              :      *
     111              :      * @param[in] sourceId  : The id of the source that received the first frame
     112              :      */
     113              :     virtual void notifyFirstFrameReceived(int32_t sourceId) = 0;
     114              : 
     115              :     /**
     116              :      * @brief Notifies the client that a non-fatal error has occurred in the player.
     117              :      *
     118              :      * PlaybackState remains unchanged when an error occurs.
     119              :      *
     120              :      * @param[in] sourceId  : The id of the source that produced the error.
     121              :      * @param[in] error     : The type of error that occurred.
     122              :      */
     123              :     virtual void notifyPlaybackError(int32_t sourceId, PlaybackError error) = 0;
     124              : 
     125              :     /**
     126              :      * @brief Notifies the client whether video data is available.
     127              :      *
     128              :      * @param[in] hasData : true if video data is available.
     129              :      */
     130              :     virtual void notifyVideoData(bool hasData) = 0;
     131              : 
     132              :     /**
     133              :      * @brief Notifies the client whether audio data is available.
     134              :      *
     135              :      * @param[in] hasData : true if audio data is available.
     136              :      */
     137              :     virtual void notifyAudioData(bool hasData) = 0;
     138              : 
     139              :     /**
     140              :      * @brief Notifies the client that the source has been flushed.
     141              :      *
     142              :      * Notification shall be sent whenever a flush procedure is finished.
     143              :      *
     144              :      * @param[in] sourceId  : The id of the source that has been flushed.
     145              :      */
     146              :     virtual void notifySourceFlushed(int32_t sourceId) = 0;
     147              : 
     148              :     /**
     149              :      * @brief Notifies the client about the current playback state
     150              :      *
     151              :      * Notification shall be sent every 32ms after reaching the PLAYING state.
     152              :      *
     153              :      * @param[in] playbackInfo : The current playback information.
     154              :      */
     155              :     virtual void notifyPlaybackInfo(const PlaybackInfo &playbackInfo) = 0;
     156              : };
     157              : 
     158              : }; // namespace firebolt::rialto::client
     159              : 
     160              : #endif // FIREBOLT_RIALTO_CLIENT_I_MEDIA_PIPELINE_IPC_CLIENT_H_
        

Generated by: LCOV version 2.0-1