Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
deadbeef84 committed Oct 14, 2024
2 parents f20f499 + 20a78f6 commit 8aa7084
Show file tree
Hide file tree
Showing 94 changed files with 3,448 additions and 3,228 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.diff]
trim_trailing_whitespace = false

[*.patch]
trim_trailing_whitespace = false

[debian/rules]
indent_style = tab
23 changes: 13 additions & 10 deletions .github/workflows/linux-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04

runs-on: ${{ matrix.os }}

Expand All @@ -22,27 +22,30 @@ jobs:

- name: Setup environment
run: |
sudo apt-get update
sudo ./tools/linux/install-dependencies
sudo apt-get update
sudo ./tools/linux/install-dependencies
sudo apt-get install -y libboost-all-dev \
sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:casparcg/ppa
sudo apt-get -y install libboost-all-dev \
libavcodec-dev \
libavformat-dev \
libavdevice-dev \
libavutil-dev \
libavfilter-dev \
libswscale-dev \
libpostproc-dev \
libswresample-dev
libswresample-dev \
casparcg-cef-117-dev
- name: Run build
run: |
mkdir build
cd build
mkdir build
cd build
cmake ../src -DUSE_STATIC_BOOST=OFF -DUSE_SYSTEM_FFMPEG=ON
make -j2
cmake ../src -DUSE_STATIC_BOOST=OFF -DUSE_SYSTEM_FFMPEG=ON -DUSE_SYSTEM_CEF=ON
make -j2
env:
CI: 1
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
- name: Copy single file to remote
uses: garygrossgarten/[email protected]
if: ${{ steps.rename-build.outputs.uploadname }}
timeout-minutes: 5
with:
local: "${{ steps.rename-build.outputs.uploadname }}"
remote: "${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.rename-build.outputs.uploadname }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- name: Copy single file to remote
uses: garygrossgarten/[email protected]
if: ${{ steps.rename-build.outputs.uploadname }}
timeout-minutes: 5
with:
local: "${{ steps.rename-build.outputs.uploadname }}"
remote: "${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.rename-build.outputs.uploadname }}"
Expand Down
16 changes: 16 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ You can figure out which files you need by looking at each of the `ExternalProje

# Windows

## Building distributable

1. Install Visual Studio 2022.

2. Install CMake (http://www.cmake.org/download/).

3. Install 7-zip (https://www.7-zip.org/).

4. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`

5. `cd casparcg-server-master`

6. `.\tools\windows\build.bat`

7. Copy the `dist\casparcg_server.zip` file for distribution

## Development using Visual Studio

1. Install Visual Studio 2022.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ System Requirements

- A graphics card (GPU) capable of OpenGL 4.5 is required.
- An Nvidia GPU is recommended, but other GPU's will likely work fine.
- Only Intel CPU's have been tested and are known to work
- Intel and AMD CPU's have been tested and are known to work
- PCIE bandwidth is important between your GPU and CPU, as well as Decklink and CPU. Avoid chipset lanes when possible.

### Windows

- Only Windows 10 is supported

### Linux

- Ubuntu 22.04 is recommended
- Ubuntu 22.04 or 24.04 are recommended
- Other distributions and releases will work but have not been tested

Getting Started
Expand Down
69 changes: 36 additions & 33 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmake_minimum_required (VERSION 3.16)
cmake_minimum_required(VERSION 3.16)

# Project settings
PROJECT ("CasparCG Server")
SET (CONFIG_VERSION_MAJOR 2)
SET (CONFIG_VERSION_MINOR 5)
SET (CONFIG_VERSION_BUG 0)
SET (CONFIG_VERSION_TAG "Dev")
project("CasparCG Server")
set(CONFIG_VERSION_MAJOR 2)
set(CONFIG_VERSION_MINOR 5)
set(CONFIG_VERSION_BUG 0)
set(CONFIG_VERSION_TAG "Dev")

# support for language servers (eg, clangd or ccls)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CASPARCG_DOWNLOAD_MIRROR https://github.com/CasparCG/dependencies/releases/download/ CACHE STRING "Source/mirror to use for external dependencies")
set(CASPARCG_DOWNLOAD_CACHE ${CMAKE_CURRENT_BINARY_DIR}/external CACHE STRING "Download cache directory for cmake ExternalProjects")
Expand All @@ -21,41 +24,41 @@ set(DIAG_FONT_PATH "LiberationMono-Regular.ttf" CACHE STRING
add_compile_definitions("DIAG_FONT_PATH=\"${DIAG_FONT_PATH}\"")

# Add custom cmake modules path
SET (CASPARCG_PATCH_DIR ${CMAKE_SOURCE_DIR}/CMakeModules/patches)
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
set(CASPARCG_PATCH_DIR ${CMAKE_SOURCE_DIR}/CMakeModules/patches)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)

# Determine the git hash
FIND_PACKAGE (Git)
SET (CONFIG_VERSION_GIT_HASH "N/A")
IF (DEFINED ENV{GIT_HASH} AND NOT $ENV{GIT_HASH} STREQUAL "")
SET (CONFIG_VERSION_GIT_HASH "$ENV{GIT_HASH}")
ELSEIF (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git")
EXEC_PROGRAM ("${GIT_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/../" ARGS rev-parse --verify --short HEAD OUTPUT_VARIABLE CONFIG_VERSION_GIT_HASH)
ENDIF ()
find_package(Git)
set(CONFIG_VERSION_GIT_HASH "N/A")
if(DEFINED ENV{GIT_HASH} AND NOT $ENV{GIT_HASH} STREQUAL "")
set(CONFIG_VERSION_GIT_HASH "$ENV{GIT_HASH}")
elseif(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git")
exec_program("${GIT_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/../" ARGS rev-parse --verify --short HEAD OUTPUT_VARIABLE CONFIG_VERSION_GIT_HASH)
endif()

cmake_host_system_information(RESULT CONFIG_CPU_COUNT QUERY NUMBER_OF_PHYSICAL_CORES)

INCLUDE (CasparCG_Util)
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/version.tmpl" "${CMAKE_BINARY_DIR}/generated/version.h")
include(CasparCG_Util)
configure_file("${PROJECT_SOURCE_DIR}/version.tmpl" "${CMAKE_BINARY_DIR}/generated/version.h")

if (MSVC)
INCLUDE (Bootstrap_Windows)
if(MSVC)
include(Bootstrap_Windows)
else ()
INCLUDE (Bootstrap_Linux)
include(Bootstrap_Linux)

# Output build settings
MESSAGE (STATUS "Target architecture: ${CMAKE_SYSTEM_PROCESSOR}")
MESSAGE (STATUS "CPU Count: ${CONFIG_CPU_COUNT}")
MESSAGE (STATUS "Target build type: ${CMAKE_BUILD_TYPE}")
MESSAGE (STATUS "Build Version: ${CONFIG_VERSION_MAJOR}.${CONFIG_VERSION_MINOR}.${CONFIG_VERSION_BUG} ${CONFIG_VERSION_TAG} (Revision: ${CONFIG_VERSION_GIT_HASH})")
# Output build settings
message(STATUS "Target architecture: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CPU Count: ${CONFIG_CPU_COUNT}")
message(STATUS "Target build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build Version: ${CONFIG_VERSION_MAJOR}.${CONFIG_VERSION_MINOR}.${CONFIG_VERSION_BUG} ${CONFIG_VERSION_TAG} (Revision: ${CONFIG_VERSION_GIT_HASH})")
endif ()

INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/generated")
include_directories("${CMAKE_BINARY_DIR}/generated")

ADD_SUBDIRECTORY (tools)
ADD_SUBDIRECTORY (accelerator)
ADD_SUBDIRECTORY (common)
ADD_SUBDIRECTORY (core)
ADD_SUBDIRECTORY (modules)
ADD_SUBDIRECTORY (protocol)
ADD_SUBDIRECTORY (shell)
add_subdirectory(tools)
add_subdirectory(accelerator)
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(modules)
add_subdirectory(protocol)
add_subdirectory(shell)
15 changes: 7 additions & 8 deletions src/CMakeModules/Bootstrap_Linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ cmake_minimum_required (VERSION 3.16)
include(ExternalProject)
include(FetchContent)

if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

set(ENABLE_HTML ON CACHE BOOL "Enable CEF and HTML producer")
set(USE_STATIC_BOOST ON CACHE BOOL "Use shared library version of Boost")
set(USE_SYSTEM_FFMPEG OFF CACHE BOOL "Use the version of ffmpeg from your OS")
Expand All @@ -20,19 +24,18 @@ MARK_AS_ADVANCED (CMAKE_INSTALL_PREFIX)
if (USE_STATIC_BOOST)
SET (Boost_USE_STATIC_LIBS ON)
endif()
FIND_PACKAGE (Boost 1.74.0 COMPONENTS system thread chrono filesystem log locale regex date_time coroutine REQUIRED)
FIND_PACKAGE (Boost 1.74.0 COMPONENTS system thread chrono filesystem log_setup log locale regex date_time coroutine REQUIRED)

if (NOT USE_SYSTEM_FFMPEG)
FetchContent_Declare(
ffmpeg-lib
URL ${CASPARCG_DOWNLOAD_MIRROR}/ffmpeg/ffmpeg-n5.1.3_jammy.tar.gz
URL_HASH SHA1=344336816c214d52f63c197acbe9cce7d4a718ef
URL ${CASPARCG_DOWNLOAD_MIRROR}/ffmpeg/ffmpeg-n7.0.2_jammy.tar.gz
URL_HASH MD5=b25c102df1793764fa8fb509b0ce7461
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)

FetchContent_MakeAvailable(ffmpeg-lib)


SET (FFMPEG_ROOT_PATH "${ffmpeg-lib_SOURCE_DIR}/ffmpeg/lib/pkgconfig")
SET (ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${FFMPEG_ROOT_PATH}")

Expand Down Expand Up @@ -137,7 +140,3 @@ ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "ADDING: -DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION}")
add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION})
ENDIF ()

IF (POLICY CMP0045)
CMAKE_POLICY (SET CMP0045 OLD)
ENDIF ()
44 changes: 22 additions & 22 deletions src/CMakeModules/Bootstrap_Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required (VERSION 3.16)

include(ExternalProject)

if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

set(BOOST_USE_PRECOMPILED ON CACHE BOOL "Use precompiled boost")

set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE "" CACHE INTERNAL "")
Expand Down Expand Up @@ -32,21 +36,21 @@ casparcg_add_runtime_dependency("${PROJECT_SOURCE_DIR}/shell/casparcg.config")
casparcg_add_external_project(boost)
if (BOOST_USE_PRECOMPILED)
ExternalProject_Add(boost
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_67_0-win32-x64-debug-release.zip
URL_HASH MD5=a10a3c92c79cde3aa4ab6e60137b54d5
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_74_0-win32-x64-debug-release.zip
URL_HASH MD5=8d379b0da9a5ae50a3980d2fc1a24d34
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(boost SOURCE_DIR)
set(BOOST_INCLUDE_PATH "${SOURCE_DIR}/include/boost-1_67")
set(BOOST_INCLUDE_PATH "${SOURCE_DIR}/include/boost-1_74")
link_directories("${SOURCE_DIR}/lib")
else ()
set(BOOST_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost-install)
ExternalProject_Add(boost
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_67_0.zip
URL_HASH MD5=6da1ba65f8d33b1d306616e5acd87f67
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_74_0.zip
URL_HASH MD5=df1456965493f05952b7c06205688ae9
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./bootstrap.bat
Expand All @@ -60,7 +64,7 @@ else ()
BUILD_COMMAND ./b2 install debug release --prefix=${BOOST_INSTALL_DIR} link=static threading=multi runtime-link=shared -j ${CONFIG_CPU_COUNT}
INSTALL_COMMAND ""
)
set(BOOST_INCLUDE_PATH "${BOOST_INSTALL_DIR}/include/boost-1_67")
set(BOOST_INCLUDE_PATH "${BOOST_INSTALL_DIR}/include/boost-1_74")
link_directories("${BOOST_INSTALL_DIR}/lib")
endif ()
add_definitions( -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE )
Expand All @@ -70,8 +74,8 @@ add_definitions( -DBOOST_LOCALE_HIDE_AUTO_PTR )
# FFMPEG
casparcg_add_external_project(ffmpeg-lib)
ExternalProject_Add(ffmpeg-lib
URL ${CASPARCG_DOWNLOAD_MIRROR}/ffmpeg/ffmpeg-5.1.2-full_build-shared.zip
URL_HASH MD5=bcb1efb68701a4b71e8a7efd9b817965
URL ${CASPARCG_DOWNLOAD_MIRROR}/ffmpeg/ffmpeg-7.0.2-full_build-shared.7z
URL_HASH MD5=c5127aeed36a9a86dd3b84346be182f8
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand All @@ -81,14 +85,14 @@ ExternalProject_Get_Property(ffmpeg-lib SOURCE_DIR)
set(FFMPEG_INCLUDE_PATH "${SOURCE_DIR}/include")
set(FFMPEG_BIN_PATH "${SOURCE_DIR}/bin")
link_directories("${SOURCE_DIR}/lib")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avcodec-59.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avdevice-59.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avfilter-8.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avformat-59.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avutil-57.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-56.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-4.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-6.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avcodec-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avdevice-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avfilter-10.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avformat-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avutil-59.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-58.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-5.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-8.dll")
# for scanner:
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/ffmpeg.exe")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/ffprobe.exe")
Expand Down Expand Up @@ -155,8 +159,8 @@ casparcg_add_runtime_dependency("${SFML_BIN_PATH}/sfml-system-2.dll" "Release")
# FREEIMAGE
casparcg_add_external_project(freeimage)
ExternalProject_Add(freeimage
URL ${CASPARCG_DOWNLOAD_MIRROR}/freeimage/FreeImage3180Win32Win64.zip
URL_HASH MD5=393d3df75b14cbcb4887da1c395596e2
URL ${CASPARCG_DOWNLOAD_MIRROR}/freeimage/FreeImage319-r1909.zip
URL_HASH MD5=c19087de6b42c7e17f71c6c8d4ad158d
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down Expand Up @@ -265,7 +269,3 @@ add_definitions(-D_WIN32_WINNT=0x601)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa /Zi /W4 /WX /MP /fp:fast /Zm192 /FIcommon/compiler/vs/disable_silly_warnings.h")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D TBB_USE_ASSERT=1 /D TBB_USE_DEBUG /bigobj")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /Ot /Gy /bigobj")

if (POLICY CMP0045)
cmake_policy(SET CMP0045 OLD)
endif ()
2 changes: 1 addition & 1 deletion src/CMakeModules/CasparCG_Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ FUNCTION (casparcg_add_library PROJECT)
# Setup the library and some default config
ADD_LIBRARY (${PROJECT} ${PARSED_ARGS_SOURCES})
target_compile_features (${PROJECT} PRIVATE cxx_std_17)
target_include_directories(${PROJECT} PRIVATE
target_include_directories(${PROJECT} SYSTEM PRIVATE
${BOOST_INCLUDE_PATH}
${TBB_INCLUDE_PATH}
)
Expand Down
23 changes: 23 additions & 0 deletions src/CMakeModules/patches/cef117.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,26 @@

# Project name.
# TODO: Change this line to match your project name when you copy this file.
@@ -234,22 +231,3 @@

# Display configuration settings.
PRINT_CEF_CONFIG()
-
-
-#
-# Define the API documentation target.
-#
-
-find_package(Doxygen)
-if(DOXYGEN_FOUND)
- add_custom_target(apidocs ALL
- # Generate documentation in the docs/html directory.
- COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
- # Write a docs/index.html file.
- COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
- WORKING_DIRECTORY "${CEF_ROOT}"
- COMMENT "Generating API documentation with Doxygen..."
- VERBATIM )
-else()
- message(WARNING "Doxygen must be installed to generate API documentation.")
-endif()
1 change: 0 additions & 1 deletion src/accelerator/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <common/assert.h>
#include <common/env.h>
#include <common/except.h>
#include <common/forward.h>
#include <common/future.h>
#include <common/gl/gl_check.h>
#include <common/memory.h>
Expand Down
Loading

0 comments on commit 8aa7084

Please sign in to comment.