Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy_gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
doxygen

- name: Download Coverage Report
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
workflow: build_ut.yml
workflow_conclusion: success
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ jobs:

# Download current master coverage statistics. Should be triggered only for PRs to master
- name: Download Master Coverage Statistics
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
if: ${{ success() && github.event_name == 'pull_request' && github.base_ref == 'master' }}
with:
workflow_conclusion: success
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/client_component_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ jobs:
# Run the check_coverage_stats script
- name: Process Coverage Statistics
if: ${{ success() && github.event_name == 'pull_request' && github.base_ref == 'master' }}
run: python scripts/coverage/check_coverage_stats.py build/coverage_statistics_public_apis.txt 98
run: python scripts/coverage/check_coverage_stats.py build/coverage_statistics_public_apis.txt 97
2 changes: 1 addition & 1 deletion .github/workflows/valgrind_server_component_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-24.04

# Timeout after
timeout-minutes: 10
timeout-minutes: 20

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/cmake/ocdm-config.cmake
*__pycache__
/.vscode/*
/CMakeUserPresets.json
/CMakeLists.txt.user*

# These files are fetched by cmake during building rialto for the native platform
/stubs/opencdm/third-party/*
Expand Down
26 changes: 15 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ add_compile_definitions(PROJECT_VER_PATCH="${PROJECT_VERSION_PATCH}")
set(CMAKE_CXX_STANDARD 17)

if ( COVERAGE_ENABLED )
add_compile_options(-coverage -fprofile-update=atomic)
add_compile_options(--coverage -fprofile-update=atomic)
add_link_options(--coverage)
endif()

add_compile_options(-Wall -Werror)
Expand All @@ -55,7 +56,7 @@ else()
option(RIALTO_LOG_DEBUG_ENABLED "Enable debug logging for RialtoServer" OFF)
endif()

if (NOT RIALTO_LOG_FATAL_ENABLED OR
if (NOT RIALTO_LOG_FATAL_ENABLED OR
NOT RIALTO_LOG_ERROR_ENABLED OR
NOT RIALTO_LOG_WARN_ENABLED OR
NOT RIALTO_LOG_MIL_ENABLED OR
Expand All @@ -66,7 +67,7 @@ if (NOT RIALTO_LOG_FATAL_ENABLED OR
add_compile_options(-Wno-error=unused-function -Wno-error=unused-variable)

endif()

if ( RIALTO_LOG_FATAL_ENABLED )
message("RIALTO_LOG_FATAL IS ENABLED")
add_compile_definitions( RIALTO_LOG_FATAL_ENABLED )
Expand Down Expand Up @@ -104,13 +105,13 @@ if (TEXT_TRACK_INCLUDE_DIR)
add_compile_definitions(RIALTO_ENABLE_TEXT_TRACK)
endif()

# Retrieve the commit ID
# Retrieve the commit ID
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE SRCREV
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE SRCREV
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(RESULT)
Expand All @@ -120,15 +121,15 @@ endif()
# Retrieve release tag
execute_process(
COMMAND bash -c "git tag --points-at ${SRCREV} | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$'"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE TAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ", " TAGS "${TAGS}")

if(NOT TAGS STREQUAL "")
set(TAGS ${TAGS})
endif()
endif()

# Preprocesser Variable
add_compile_definitions(SRCREV="${SRCREV}")
Expand Down Expand Up @@ -213,6 +214,9 @@ if( NATIVE_BUILD )
add_subdirectory( stubs/wpeframework-core )
add_subdirectory( stubs/wpeframework-com )

add_compile_options(-DFREE_MEM_BEFORE_EXIT)
add_compile_options(-ggdb)

include( GNUInstallDirs )
configure_file( pkg-config/RialtoClient.in.pc ${CMAKE_BINARY_DIR}/RialtoClient.pc @ONLY )
install (
Expand Down
5 changes: 3 additions & 2 deletions build_ct.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# Entry script for running rialto componenttests

import argparse
import os
from scripts.gtest.build_and_run_tests import getGenericArguments, buildAndRunGTests
from scripts.gtest.utils import getSuitesToRun, getOutputFile
from scripts.gtest.generate_coverage import generateCoverageReport, generateSpecificCoverageStats
Expand Down Expand Up @@ -50,8 +51,8 @@

# Generate coverage
if args['coverage'] == True:
generateCoverageReport(args['output'], outputFile, suitesToRun)
generateCoverageReport(os.getcwd(), args['output'], outputFile)

# Also generate coverage stats for public interfaces source
files = ["*/main/source/*"]
generateSpecificCoverageStats(args['output'], outputFile, files, "coverage_statistics_public_apis")
generateSpecificCoverageStats(os.getcwd(), args['output'], outputFile, files, "coverage_statistics_public_apis")
3 changes: 2 additions & 1 deletion build_ut.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# Entry script for running rialto unittests

import argparse
import os
from scripts.gtest.build_and_run_tests import getGenericArguments, buildAndRunGTests
from scripts.gtest.utils import getSuitesToRun, getOutputFile
from scripts.gtest.generate_coverage import generateCoverageReport
Expand Down Expand Up @@ -58,4 +59,4 @@
buildAndRunGTests(args, outputFile, buildDefines, suitesToRun)

if args['coverage'] == True:
generateCoverageReport(args['output'], outputFile, suitesToRun)
generateCoverageReport(os.getcwd(), args['output'], outputFile)
43 changes: 43 additions & 0 deletions cmake/FindEthanLog.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2025 Sky UK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

find_path(EthanLog_INCLUDE_DIR
NAMES ethanlog.h
)

find_library(EthanLog_LIBRARY
NAMES ethanlog
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EthanLog DEFAULT_MSG EthanLog_INCLUDE_DIR EthanLog_LIBRARY)

mark_as_advanced(EthanLog_INCLUDE_DIR EthanLog_LIBRARY)

if (ETHANLOG_FOUND OR EthanLog_FOUND)
set(EthanLog_INCLUDE_DIRS "${EthanLog_INCLUDE_DIR}")
set(EthanLog_LIBRARIES "${EthanLog_LIBRARY}")
set(EthanLog_FOUND TRUE)
endif()

if (EthanLog_FOUND AND NOT TARGET EthanLog::EthanLog)
add_library(EthanLog::EthanLog INTERFACE IMPORTED)
set_property(TARGET EthanLog::EthanLog PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${EthanLog_INCLUDE_DIR}")
set_property(TARGET EthanLog::EthanLog PROPERTY INTERFACE_LINK_LIBRARIES "${EthanLog_LIBRARY}")
endif()
8 changes: 0 additions & 8 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,3 @@ target_link_libraries (
PRIVATE
RialtoLogging
)

if ( COVERAGE_ENABLED )
target_link_libraries(
RialtoCommon
PRIVATE
gcov
)
endif()
55 changes: 31 additions & 24 deletions logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2022 Sky UK
# Copyright 2025 Sky UK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,30 +17,37 @@
# limitations under the License.
#

set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 17)
set(RialtoLogging_HEADERS
include/RialtoLogging.h
)

set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_POSITION_INDEPENDENT_CODE ON )
include( CheckCCompilerFlag )
include( CheckCXXCompilerFlag )
set(RialtoLogging_SOURCES
source/EnvVariableParser.cpp
source/EnvVariableParser.h
source/LogFileHandle.cpp
source/LogFileHandle.h
source/RialtoLogging.cpp
)

set(LIB_RIALTO_LOGGING_SOURCES
source/EnvVariableParser.cpp
source/LogFileHandle.cpp
source/RialtoLogging.cpp
)
set(RialtoLogging_INCLUDES
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)

set(LIB_RIALTO_LOGGING_PUBLIC_HEADERS
include/RialtoLogging.h
)
add_library(RialtoLogging STATIC ${RialtoLogging_HEADERS} ${RialtoLogging_SOURCES})
target_include_directories(RialtoLogging PUBLIC "$<BUILD_INTERFACE:${RialtoLogging_INCLUDES}>")
set_target_properties(RialtoLogging PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF)
set_target_properties(RialtoLogging PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_library(RialtoLogging STATIC ${LIB_RIALTO_LOGGING_SOURCES})

target_include_directories(
RialtoLogging

PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/rialto>
)
find_package(EthanLog)
if (EthanLog_FOUND AND RIALTO_ENABLE_ETHAN_LOG)
message(STATUS "EthanLog is enabled")
add_library(RialtoEthanLog STATIC ${RialtoLogging_HEADERS} ${RialtoLogging_SOURCES})
target_include_directories(RialtoEthanLog PUBLIC "$<BUILD_INTERFACE:${RialtoLogging_INCLUDES}>")
target_compile_definitions(RialtoEthanLog PRIVATE USE_ETHANLOG)
target_link_libraries(RialtoEthanLog PUBLIC EthanLog::EthanLog)
set_target_properties(RialtoEthanLog PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF)
set_target_properties(RialtoEthanLog PROPERTIES POSITION_INDEPENDENT_CODE ON)
else ()
message(STATUS "EthanLog is disabled")
add_library(RialtoEthanLog ALIAS RialtoLogging)
endif ()
41 changes: 33 additions & 8 deletions logging/source/RialtoLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,38 @@
#include <mutex>
#include <sys/syscall.h>
#include <sys/uio.h>
#include <syslog.h>
#include <unistd.h>

#include "EnvVariableParser.h"
#include "LogFileHandle.h"
#include "RialtoLogging.h"

#ifdef USE_ETHANLOG

#include <ethanlog.h>

#define SYSTEM_LOG_FATAL(filename, function, line, ...) ethanlog(ETHAN_LOG_FATAL, filename, function, line, __VA_ARGS__)
#define SYSTEM_LOG_ERROR(filename, function, line, ...) ethanlog(ETHAN_LOG_ERROR, filename, function, line, __VA_ARGS__)
#define SYSTEM_LOG_WARN(filename, function, line, ...) \
ethanlog(ETHAN_LOG_WARNING, filename, function, line, __VA_ARGS__)
#define SYSTEM_LOG_MIL(filename, function, line, ...) \
ethanlog(ETHAN_LOG_MILESTONE, filename, function, line, __VA_ARGS__)
#define SYSTEM_LOG_INFO(filename, function, line, ...) ethanlog(ETHAN_LOG_INFO, filename, function, line, __VA_ARGS__)
#define SYSTEM_LOG_DEBUG(filename, function, line, ...) ethanlog(ETHAN_LOG_DEBUG, filename, function, line, __VA_ARGS__)

#else

#include <syslog.h>

#define SYSTEM_LOG_FATAL(filename, function, line, ...) syslog(LOG_CRIT, __VA_ARGS__)
#define SYSTEM_LOG_ERROR(filename, function, line, ...) syslog(LOG_ERR, __VA_ARGS__)
#define SYSTEM_LOG_WARN(filename, function, line, ...) syslog(LOG_WARNING, __VA_ARGS__)
#define SYSTEM_LOG_MIL(filename, function, line, ...) syslog(LOG_NOTICE, __VA_ARGS__)
#define SYSTEM_LOG_INFO(filename, function, line, ...) syslog(LOG_INFO, __VA_ARGS__)
#define SYSTEM_LOG_DEBUG(filename, function, line, ...) syslog(LOG_DEBUG, __VA_ARGS__)

#endif

namespace
{
/**
Expand Down Expand Up @@ -203,25 +228,25 @@ void journaldLogHandler(RIALTO_COMPONENT component, RIALTO_DEBUG_LEVEL level, co
switch (level)
{
case RIALTO_DEBUG_LEVEL_FATAL:
syslog(LOG_CRIT, "%s %s", fbuf, message);
SYSTEM_LOG_FATAL(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_ERROR:
syslog(LOG_ERR, "%s %s", fbuf, message);
SYSTEM_LOG_ERROR(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_WARNING:
syslog(LOG_WARNING, "%s %s", fbuf, message);
SYSTEM_LOG_WARN(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_MILESTONE:
syslog(LOG_NOTICE, "%s %s", fbuf, message);
SYSTEM_LOG_MIL(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_INFO:
syslog(LOG_INFO, "%s %s", fbuf, message);
SYSTEM_LOG_INFO(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_DEBUG:
syslog(LOG_DEBUG, "%s %s", fbuf, message);
SYSTEM_LOG_DEBUG(file, function, line, "%s %s", fbuf, message);
break;
case RIALTO_DEBUG_LEVEL_EXTERNAL:
syslog(LOG_INFO, "%s %s", fbuf, message);
SYSTEM_LOG_INFO(file, function, line, "%s %s", fbuf, message);
break;
default:
break;
Expand Down
3 changes: 1 addition & 2 deletions media/client/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ target_include_directories (
$<TARGET_PROPERTY:RialtoClientCommon,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:RialtoCommon,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:RialtoPlayerCommon,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:RialtoLogging,INTERFACE_INCLUDE_DIRECTORIES>
)

target_link_libraries (
Expand All @@ -66,6 +65,6 @@ target_link_libraries (
RialtoIpcCommon
RialtoCommon
RialtoPlayerCommon
RialtoLogging
RialtoEthanLog
RialtoProtobuf
)
9 changes: 9 additions & 0 deletions media/client/ipc/include/MediaPipelineCapabilitiesIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ class MediaPipelineCapabilitiesIpc : public IMediaPipelineCapabilities, public I
std::vector<std::string> getSupportedProperties(MediaSourceType mediaType,
const std::vector<std::string> &propertyNames) override;

/**
* @brief Checks if the platform is video master.
*
* @param[out] isVideoMaster : The output value. True if video is master otherwise false.
*
* @retval true on success false otherwise
*/
bool isVideoMaster(bool &isVideoMaster) override;

private:
/**
* @brief The ipc protobuf media Pipeline capabilities stub.
Expand Down
Loading