Skip to content

Commit

Permalink
Updated and fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki committed Sep 6, 2024
2 parents e8cd37d + 9c7206f commit f26a087
Show file tree
Hide file tree
Showing 97 changed files with 3,885 additions and 2,045 deletions.
10 changes: 3 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ configuration:
- Debug

image:
- Visual Studio 2022
- Visual Studio 2019
- Visual Studio 2015
- Visual Studio 2013

platform:
- x64
Expand All @@ -14,12 +14,8 @@ platform:
build_script:
- ps: $VSIMG = $Env:APPVEYOR_BUILD_WORKER_IMAGE; $CNFG = $Env:CONFIGURATION
# use a few differing arguments depending on VS version to exercise different options during builds
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON }
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Debug") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON }
- ps: if ($VSIMG -match '2015' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON}
- ps: if ($VSIMG -match '2015' -and $CNFG -eq "Debug") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS OFF }
- ps: if ($VSIMG -match '2013' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -CXX11 OFF -BUILD_APPS ON }
- ps: if ($VSIMG -match '2013' -and $CNFG -eq "Debug") { Exit-AppveyorBuild } # just skip 2013 debug build for speed
- ps: if ($CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON}
- ps: if ($CNFG -eq "Debug") { if ($VSIMG -match '2015') { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS OFF } else {.\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON }}

test_script:
- ps: if ( $Env:RUN_UNIT_TESTS ) { cd ./_build; ctest -E "TestIPv6.v6_calls_v4" --extra-verbose -C $Env:CONFIGURATION; cd ../ }
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/abi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: ABI checks

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
SRT_BASE: v1.5.0

jobs:
build:
name: ABI checks
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
path: pull_request
- name: configure
run: |
cd pull_request
mkdir _build && cd _build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UNITTESTS=ON ../
- name: build
run: |
sudo apt install -y abi-dumper
cd pull_request/_build && cmake --build ./
make install DESTDIR=./installdir
SRT_TAG_VERSION=$(cat version.h |grep SRT_VERSION_MINOR |head -n1 |awk {'print $3'})
abi-dumper libsrt.so -o libsrt-pr.dump -public-headers installdir/usr/local/include/srt/ -lver 0
SRT_BASE="v1.$SRT_TAG_VERSION.0"
echo "SRT_BASE=$SRT_BASE" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
with:
path: tag
ref: ${{ env.SRT_BASE }}
- name: configure_tag
run: |
echo $SRT_TAG_VERSION
cd tag
mkdir _build && cd _build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UNITTESTS=ON ../
- name: build_tag
run: |
cd tag
cd _build && cmake --build ./
make install DESTDIR=./installdir
abi-dumper libsrt.so -o libsrt-tag.dump -public-headers installdir/usr/local/include/srt/ -lver 1
- name: abi-check
run: |
git clone https://github.com/lvc/abi-compliance-checker.git
cd abi-compliance-checker && sudo make install && cd ../
abi-compliance-checker -l libsrt -old tag/_build/libsrt-tag.dump -new pull_request/_build/libsrt-pr.dump
RES=$?
if (( $RES != 0 ))
then
echo "ABI/API Compatibility check failed with value $?"
exit $RES
fi
25 changes: 20 additions & 5 deletions .github/workflows/cxx11-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,34 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]

types: [opened, synchronize, reopened]
jobs:
build:
name: ubuntu
runs-on: ubuntu-20.04

env:
BUILD_WRAPPER_OUT_DIR: sonar-output # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v3
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON -DENABLE_CODE_COVERAGE=ON
- name: build
run: cd _build && cmake --build ./
run: cd _build && build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build .
- name: test
run: cd _build && ctest --extra-verbose
run: |
cd _build && ctest --extra-verbose
- name: codecov
run: |
source ./scripts/collect-gcov.sh
bash <(curl -s https://codecov.io/bash)
- name: Run SonarCloud Scan for C and C++
if: ${{ !github.event.pull_request.head.repo.fork }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options.
run: sonar-scanner --define sonar.cfamily.build-wrapper-output=_build/"${{ env.BUILD_WRAPPER_OUT_DIR }}"
41 changes: 41 additions & 0 deletions .github/workflows/s390x-focal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: QEMU to run s390x-focal

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
Tests:
runs-on: ubuntu-latest
steps:
- name: Setup multiarch/qemu-user-static
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: ubuntu-core:s390x-focal
uses: docker://multiarch/ubuntu-core:s390x-focal
with:
args: >
bash -c
"uname -a &&
lscpu | grep Endian
"
- name: Checkout
uses: actions/checkout@v3
- name: configure
uses: docker://multiarch/ubuntu-core:s390x-focal
with:
args: >
bash -c
"apt-get -y update &&
export DEBIAN_FRONTEND=noninteractive &&
export TZ=Etc/UTC &&
apt-get -y install tzdata &&
uname -a &&
lscpu | grep Endian &&
apt-get -y install cmake g++ libssl-dev git &&
mkdir _build && cd _build &&
cmake ../ -DENABLE_ENCRYPTION=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON &&
cmake --build ./ &&
./test-srt -disable-ipv6"
28 changes: 2 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ addons:
- build-essential
- libmbedtls-dev
- gdb
sonarcloud:
organization: "haivision"
token:
secure: "wJZC0kyyjuf4SZyonZ6p/5Ga9asEqSnKWF9NpRbu6S6ceERO7vbebuSJF5qX3A6ivPuw0TTk5WASOdnvIyfA28FU/D0MWRdH8K7T3w77wdE9EgAEYTUXzdrbzJY18+9pxjljHwWXWALPSGf3MClg4irWrdk1e6uHK+68R39+ZvBGBFpWeeZy/+at9+xwhtAGKBlSHe8zc+3wPxuYdvviLVJ25qbpNmnzkUR0X89G+UBl90raCPSN32EHFdImHZ5DxfEQQJgZFRjzQUY4EW/iYwaMel7jufAq0ClgV4psKujl9Lz8cPqx3WgqRfJyiIthOMTsac7G4zAw8LK2CI0VsssBp0JalLXaumi6vG7o6c3rIwKckzSKccq3pHa7h45praIVVn9s3nq+Q/JGA11FMkKQxdQtmwgFsLhbi6ZxabgsUi5KtWoWY2z6MgpJuROuAjNxZi9XJzUoJs7zSTUtRRW7V8Q2lRiOnknYh25N6TCA5bpyy1EZmRdJErm071YNI9P01gbFz5137FWJFiJzro9TGF0KoHSGiCIdUt3WlMzwr/i/wFLxFBQOZQ2rjTXvhs4hxONxMZV3gzxA1NdLaf9i5Mh6jxVMV+ujaRSV7JmPGzxqiAlpT9cJUhTCYuar9diLLeDrpe7RawEZR8V1xVDQ7yT8ruDNQ78VbSn/sC0="
homebrew:
update: false
packages:
Expand All @@ -25,9 +21,7 @@ matrix:
- os: linux
env:
- BUILD_TYPE=Debug
- BUILD_OPTS='-DENABLE_CODE_COVERAGE=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- RUN_SONARCUBE=1
- RUN_CODECOV=1
- BUILD_OPTS='-DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
- env:
- BUILD_TYPE=Debug
- BUILD_OPTS='-DENABLE_LOGGING=OFF -DUSE_ENCLIB=mbedtls -DENABLE_MONOTONIC_CLOCK=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
Expand Down Expand Up @@ -81,29 +75,11 @@ script:
export PKG_CONFIG_PATH=$(brew --prefix openssl)"/lib/pkgconfig";
cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_OPTS -DENABLE_UNITTESTS="ON";
fi
- echo "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG"
- echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
- if [[ "$TRAVIS_REPO_SLUG" != "Haivision/srt" || "$TRAVIS_PULL_REQUEST" -gt 0 ]]; then
export RUN_SONARCUBE=0;
fi
- echo "RUN_SONARCUBE=$RUN_SONARCUBE"
- if (( "$RUN_SONARCUBE" )); then
build-wrapper-linux-x86-64 --out-dir bw-output make;
else
make -j$(nproc);
fi
- make -j$(nproc);
- if [ "$TRAVIS_COMPILER" != "x86_64-w64-mingw32-g++" ]; then
ulimit -c unlimited;
./test-srt -disable-ipv6;
SUCCESS=$?;
if [ -f core ]; then gdb -batch ./test-srt -c core -ex bt -ex "info thread" -ex quit; else echo "NO CORE - NO CRY!"; fi;
test $SUCCESS == 0;
fi
after_success:
- if (( "$RUN_CODECOV" )); then
source ./scripts/collect-gcov.sh;
bash <(curl -s https://codecov.io/bash);
fi
- if (( "$RUN_SONARCUBE" )); then
sonar-scanner -D"sonar.cfamily.gcov.reportPath=.";
fi
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#

cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (SRT_VERSION 1.5.3)
set (SRT_VERSION 1.5.4)

set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
include(haiUtil) # needed for set_version_variables
Expand Down Expand Up @@ -38,7 +38,8 @@ string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSNAME_LC)
set_if(DARWIN (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
OR (${CMAKE_SYSTEM_NAME} MATCHES "iOS")
OR (${CMAKE_SYSTEM_NAME} MATCHES "tvOS")
OR (${CMAKE_SYSTEM_NAME} MATCHES "watchOS"))
OR (${CMAKE_SYSTEM_NAME} MATCHES "watchOS")
OR (${CMAKE_SYSTEM_NAME} MATCHES "visionOS"))
set_if(LINUX ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set_if(BSD ${SYSNAME_LC} MATCHES "bsd$")
set_if(MICROSOFT WIN32 AND (NOT MINGW AND NOT CYGWIN))
Expand Down Expand Up @@ -73,7 +74,12 @@ if (NOT MICROSOFT)
# that ENABLE_DEBUG is set as it should.
if (ENABLE_DEBUG EQUAL 2)
set (CMAKE_BUILD_TYPE "RelWithDebInfo")
add_definitions(-DNDEBUG)
if (ENABLE_ASSERT)
# Add _DEBUG macro if explicitly requested, to enable SRT_ASSERT().
add_definitions(-D_DEBUG)
else()
add_definitions(-DNDEBUG)
endif()
elseif (ENABLE_DEBUG) # 1, ON, YES, TRUE, Y, or any other non-zero number
set (CMAKE_BUILD_TYPE "Debug")

Expand Down Expand Up @@ -232,12 +238,12 @@ if (NOT USE_ENCLIB)
message("NOTE: USE_GNUTLS is deprecated. Use -DUSE_ENCLIB=gnutls instead.")
set (USE_ENCLIB gnutls)
else()
set (USE_ENCLIB openssl)
set (USE_ENCLIB openssl-evp)
endif()
endif()

set(USE_ENCLIB "${USE_ENCLIB}" CACHE STRING "The crypto library that SRT uses")
set_property(CACHE USE_ENCLIB PROPERTY STRINGS "openssl" "gnutls" "mbedtls" "botan")
set_property(CACHE USE_ENCLIB PROPERTY STRINGS "openssl" "openssl-evp" "gnutls" "mbedtls" "botan")

# Make sure DLLs and executabes go to the same path regardles of subdirectory
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down Expand Up @@ -360,11 +366,11 @@ if (ENABLE_ENCRYPTION)
set (SSL_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set (SSL_LIBRARIES ${MBEDTLS_LIBRARIES})
endif()
if (WIN32)
set (SSL_LIBRARIES ${SSL_LIBRARIES} bcrypt)
endif()
if ("${SSL_LIBRARIES}" STREQUAL "")
set (SSL_LIBRARIES mbedtls mbedcrypto)
if (WIN32)
set (SSL_LIBRARIES ${SSL_LIBRARIES} bcrypt)
endif()
endif()
message(STATUS "SSL enforced mbedtls: -I ${SSL_INCLUDE_DIRS} -l;${SSL_LIBRARIES}")

Expand Down Expand Up @@ -1377,7 +1383,6 @@ if (ENABLE_APPS)
# srt-multiplex temporarily blocked
#srt_add_application(srt-multiplex ${VIRTUAL_srtsupport})
srt_add_application(srt-tunnel ${VIRTUAL_srtsupport})
target_compile_definitions(srt-tunnel PUBLIC -DSRT_ENABLE_VERBOSE_LOCK)
endif()

if (ENABLE_TESTING)
Expand Down Expand Up @@ -1415,7 +1420,6 @@ if (ENABLE_APPS)

srt_add_testprogram(srt-test-relay)
srt_make_application(srt-test-relay)
target_compile_definitions(srt-test-relay PUBLIC -DSRT_ENABLE_VERBOSE_LOCK)

srt_add_testprogram(srt-test-multiplex)
srt_make_application(srt-test-multiplex)
Expand Down Expand Up @@ -1522,15 +1526,11 @@ if (ENABLE_UNITTESTS AND ENABLE_CXX11)
)
#set_tests_properties(test-srt PROPERTIES RUN_SERIAL TRUE)
else()
gtest_add_tests(
TEST_LIST tests_srt
TARGET test-srt
)
set_tests_properties(${tests_srt} PROPERTIES RUN_SERIAL TRUE)
gtest_discover_tests(test-srt)
endif()

enable_testing()

endif()


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

[![License: MPLv2.0][license-badge]](./LICENSE)
[![Latest release][release-badge]][github releases]
[![Quality Gate Status][sonarcloud-badge]][sonarcloud-project]
[![codecov][codecov-badge]][codecov-project]
[![Build Status Linux and macOS][travis-badge]][travis]
[![Build Status Windows][appveyor-badge]][appveyor]
Expand Down Expand Up @@ -225,6 +226,9 @@ By contributing code to the SRT project, you agree to license your contribution
[ConanCenter-package]: https://repology.org/project/srt/versions
[ConanCenter-badge]: https://repology.org/badge/version-for-repo/conancenter/srt.svg

[sonarcloud-project]: https://sonarcloud.io/project/overview?id=srt
[sonarcloud-badge]: https://sonarcloud.io/api/project_badges/measure?project=srt&metric=alert_status

[codecov-project]: https://codecov.io/gh/haivision/srt
[codecov-badge]: https://codecov.io/gh/haivision/srt/branch/master/graph/badge.svg

Expand Down
2 changes: 1 addition & 1 deletion apps/srt-live-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <thread>
#include <list>


#include "srt_compat.h"
#include "apputil.hpp" // CreateAddr
#include "uriparser.hpp" // UriParser
#include "socketoptions.hpp"
Expand Down
1 change: 1 addition & 0 deletions apps/srt-tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mutex>
#include <condition_variable>

#include "srt_compat.h"
#include "apputil.hpp" // CreateAddr
#include "uriparser.hpp" // UriParser
#include "socketoptions.hpp"
Expand Down
Loading

0 comments on commit f26a087

Please sign in to comment.