LCOV - code coverage report
Current view: top level - media/client/main/include - MediaPipelineProxy.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 96.9 % 64 62
Test Date: 2026-03-04 13:20:25 Functions: 97.6 % 42 41

            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 2024 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_PIPELINE_PROXY_H_
      21              : #define FIREBOLT_RIALTO_CLIENT_MEDIA_PIPELINE_PROXY_H_
      22              : 
      23              : #include <stdint.h>
      24              : 
      25              : #include <memory>
      26              : #include <string>
      27              : 
      28              : #include "MediaPipeline.h"
      29              : 
      30              : namespace firebolt::rialto::client
      31              : {
      32              : class MediaPipelineProxy : public IMediaPipelineAndIControlClient
      33              : {
      34              : public:
      35              :     MediaPipelineProxy(const std::shared_ptr<IMediaPipelineAndIControlClient> &mediaPipeline,
      36              :                        client::IClientController &clientController);
      37              :     virtual ~MediaPipelineProxy();
      38              : 
      39            1 :     std::weak_ptr<IMediaPipelineClient> getClient() override { return m_mediaPipeline->getClient(); }
      40              : 
      41            1 :     bool load(MediaType type, const std::string &mimeType, const std::string &url) override
      42              :     {
      43            1 :         return m_mediaPipeline->load(type, mimeType, url);
      44              :     }
      45              : 
      46            1 :     bool attachSource(const std::unique_ptr<MediaSource> &source) override
      47              :     {
      48            1 :         return m_mediaPipeline->attachSource(source);
      49              :     }
      50              : 
      51            1 :     bool removeSource(int32_t id) override { return m_mediaPipeline->removeSource(id); }
      52              : 
      53            1 :     bool allSourcesAttached() override { return m_mediaPipeline->allSourcesAttached(); }
      54              : 
      55            1 :     bool play(bool &async) override { return m_mediaPipeline->play(async); }
      56              : 
      57            1 :     bool pause() override { return m_mediaPipeline->pause(); }
      58              : 
      59            1 :     bool stop() override { return m_mediaPipeline->stop(); }
      60              : 
      61            1 :     bool setPlaybackRate(double rate) override { return m_mediaPipeline->setPlaybackRate(rate); }
      62              : 
      63            1 :     bool setPosition(int64_t position) override { return m_mediaPipeline->setPosition(position); }
      64              : 
      65            1 :     bool getPosition(int64_t &position) override { return m_mediaPipeline->getPosition(position); }
      66              : 
      67            1 :     bool setImmediateOutput(int32_t sourceId, bool immediateOutput)
      68              :     {
      69            1 :         return m_mediaPipeline->setImmediateOutput(sourceId, immediateOutput);
      70              :     }
      71            1 :     bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors)
      72              :     {
      73            1 :         return m_mediaPipeline->setReportDecodeErrors(sourceId, reportDecodeErrors);
      74              :     }
      75            1 :     bool getQueuedFrames(int32_t sourceId, uint32_t &queuedFrames)
      76              :     {
      77            1 :         return m_mediaPipeline->getQueuedFrames(sourceId, queuedFrames);
      78              :     }
      79            1 :     bool getImmediateOutput(int32_t sourceId, bool &immediateOutput)
      80              :     {
      81            1 :         return m_mediaPipeline->getImmediateOutput(sourceId, immediateOutput);
      82              :     }
      83              : 
      84            1 :     bool getStats(int32_t sourceId, uint64_t &renderedFrames, uint64_t &droppedFrames)
      85              :     {
      86            1 :         return m_mediaPipeline->getStats(sourceId, renderedFrames, droppedFrames);
      87              :     }
      88              : 
      89            1 :     bool setVideoWindow(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override
      90              :     {
      91            1 :         return m_mediaPipeline->setVideoWindow(x, y, width, height);
      92              :     }
      93              : 
      94            1 :     bool haveData(MediaSourceStatus status, uint32_t needDataRequestId) override
      95              :     {
      96            1 :         return m_mediaPipeline->haveData(status, needDataRequestId);
      97              :     }
      98              : 
      99            1 :     AddSegmentStatus addSegment(uint32_t needDataRequestId, const std::unique_ptr<MediaSegment> &mediaSegment) override
     100              :     {
     101            1 :         return m_mediaPipeline->addSegment(needDataRequestId, mediaSegment);
     102              :     }
     103              : 
     104            1 :     bool renderFrame() override { return m_mediaPipeline->renderFrame(); }
     105              : 
     106            1 :     bool setVolume(double targetVolume, uint32_t volumeDuration, EaseType easeType) override
     107              :     {
     108            1 :         return m_mediaPipeline->setVolume(targetVolume, volumeDuration, easeType);
     109              :     }
     110              : 
     111            1 :     bool getVolume(double &currentVolume) override { return m_mediaPipeline->getVolume(currentVolume); }
     112              : 
     113            1 :     bool setMute(int32_t sourceId, bool mute) override { return m_mediaPipeline->setMute(sourceId, mute); }
     114              : 
     115            1 :     bool getMute(int32_t sourceId, bool &mute) override { return m_mediaPipeline->getMute(sourceId, mute); }
     116              : 
     117            1 :     bool setTextTrackIdentifier(const std::string &textTrackIdentifier) override
     118              :     {
     119            1 :         return m_mediaPipeline->setTextTrackIdentifier(textTrackIdentifier);
     120              :     }
     121              : 
     122            1 :     bool getTextTrackIdentifier(std::string &textTrackIdentifier) override
     123              :     {
     124            1 :         return m_mediaPipeline->getTextTrackIdentifier(textTrackIdentifier);
     125              :     }
     126              : 
     127            1 :     bool setLowLatency(bool lowLatency) override { return m_mediaPipeline->setLowLatency(lowLatency); }
     128              : 
     129            1 :     bool setSync(bool sync) override { return m_mediaPipeline->setSync(sync); }
     130              : 
     131            1 :     bool getSync(bool &sync) override { return m_mediaPipeline->getSync(sync); }
     132              : 
     133            1 :     bool setSyncOff(bool syncOff) override { return m_mediaPipeline->setSyncOff(syncOff); }
     134              : 
     135            1 :     bool setStreamSyncMode(int32_t sourceId, int32_t streamSyncMode) override
     136              :     {
     137            1 :         return m_mediaPipeline->setStreamSyncMode(sourceId, streamSyncMode);
     138              :     }
     139              : 
     140            1 :     bool getStreamSyncMode(int32_t &streamSyncMode) override
     141              :     {
     142            1 :         return m_mediaPipeline->getStreamSyncMode(streamSyncMode);
     143              :     }
     144              : 
     145            1 :     bool flush(int32_t sourceId, bool resetTime, bool &async) override
     146              :     {
     147            1 :         return m_mediaPipeline->flush(sourceId, resetTime, async);
     148              :     }
     149              : 
     150            1 :     bool setSourcePosition(int32_t sourceId, int64_t position, bool resetTime, double appliedRate,
     151              :                            uint64_t stopPosition) override
     152              :     {
     153            1 :         return m_mediaPipeline->setSourcePosition(sourceId, position, resetTime, appliedRate, stopPosition);
     154              :     }
     155              : 
     156            0 :     bool setSubtitleOffset(int32_t sourceId, int64_t position) override
     157              :     {
     158            0 :         return m_mediaPipeline->setSubtitleOffset(sourceId, position);
     159              :     }
     160              : 
     161            1 :     bool processAudioGap(int64_t position, uint32_t duration, int64_t discontinuityGap, bool audioAac) override
     162              :     {
     163            1 :         return m_mediaPipeline->processAudioGap(position, duration, discontinuityGap, audioAac);
     164              :     }
     165              : 
     166            1 :     bool setBufferingLimit(uint32_t limitBufferingMs) override
     167              :     {
     168            1 :         return m_mediaPipeline->setBufferingLimit(limitBufferingMs);
     169              :     }
     170              : 
     171            1 :     bool getBufferingLimit(uint32_t &limitBufferingMs) override
     172              :     {
     173            1 :         return m_mediaPipeline->getBufferingLimit(limitBufferingMs);
     174              :     }
     175              : 
     176            1 :     bool setUseBuffering(bool useBuffering) override { return m_mediaPipeline->setUseBuffering(useBuffering); }
     177              : 
     178            1 :     bool getUseBuffering(bool &useBuffering) override { return m_mediaPipeline->getUseBuffering(useBuffering); }
     179              : 
     180            1 :     bool switchSource(const std::unique_ptr<MediaSource> &source) override
     181              :     {
     182            1 :         return m_mediaPipeline->switchSource(source);
     183              :     }
     184              : 
     185            1 :     void notifyApplicationState(ApplicationState state) override { m_mediaPipeline->notifyApplicationState(state); }
     186              : 
     187              : private:
     188              :     std::shared_ptr<IMediaPipelineAndIControlClient> m_mediaPipeline;
     189              :     client::IClientController &m_clientController;
     190              : };
     191              : 
     192              : }; // namespace firebolt::rialto::client
     193              : 
     194              : #endif // FIREBOLT_RIALTO_CLIENT_MEDIA_PIPELINE_PROXY_H_
        

Generated by: LCOV version 2.0-1