LCOV - code coverage report
Current view: top level - media/server/gstplayer/source/tasks/generic - EnoughData.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 13 13
Test Date: 2025-02-18 13:13:53 Functions: 100.0 % 3 3

            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              : #include "tasks/generic/EnoughData.h"
      21              : #include "GenericPlayerContext.h"
      22              : #include "RialtoServerLogging.h"
      23              : #include "TypeConverters.h"
      24              : 
      25              : namespace firebolt::rialto::server::tasks::generic
      26              : {
      27            3 : EnoughData::EnoughData(GenericPlayerContext &context, GstAppSrc *src) : m_context{context}, m_src{src}
      28              : {
      29            3 :     RIALTO_SERVER_LOG_DEBUG("Constructing EnoughData");
      30              : }
      31              : 
      32            4 : EnoughData::~EnoughData()
      33              : {
      34            3 :     RIALTO_SERVER_LOG_DEBUG("EnoughData finished");
      35            4 : }
      36              : 
      37            2 : void EnoughData::execute() const
      38              : {
      39            2 :     RIALTO_SERVER_LOG_DEBUG("Executing EnoughData");
      40            3 :     for (auto &elem : m_context.streamInfo)
      41              :     {
      42            3 :         firebolt::rialto::MediaSourceType sourceType = elem.first;
      43            3 :         if (elem.second.appSrc == GST_ELEMENT(m_src))
      44              :         {
      45            2 :             RIALTO_SERVER_LOG_DEBUG("%s source has enough data", common::convertMediaSourceType(sourceType));
      46            2 :             elem.second.isDataNeeded = false;
      47            2 :             break;
      48              :         }
      49              :     }
      50              : }
      51              : } // namespace firebolt::rialto::server::tasks::generic
        

Generated by: LCOV version 2.0-1