├── tools ├── linux │ ├── deb │ │ ├── ubuntu-noble │ │ │ └── debian │ │ │ │ ├── patches │ │ │ │ ├── series │ │ │ │ └── README │ │ │ │ ├── source │ │ │ │ └── format │ │ │ │ ├── gbp.conf │ │ │ │ ├── casparcg-server-beta.manpages │ │ │ │ ├── casparcg-server-beta.docs │ │ │ │ ├── .gitignore │ │ │ │ ├── upstream │ │ │ │ └── metadata │ │ │ │ ├── watch │ │ │ │ ├── casparcg.txt2man │ │ │ │ ├── rules │ │ │ │ └── control │ │ └── INSTALLING │ ├── extract-from-docker │ ├── build-in-docker │ ├── run_docker.sh │ ├── install-dependencies │ ├── Dockerfile │ └── start_docker.sh ├── verify-format.sh ├── windows │ ├── package.bat │ └── build.bat └── update-format.sh ├── src ├── shell │ ├── resource.h │ ├── CasparCG.ico │ ├── LiberationSans-Regular.ttf │ ├── liberation-fonts │ │ ├── LiberationMono-Regular.ttf │ │ ├── AUTHORS │ │ ├── TODO │ │ └── ChangeLog │ ├── run.sh │ ├── casparcg_auto_restart.bat │ ├── included_modules.tmpl │ ├── copy_deps.sh │ ├── platform_specific.h │ ├── server.h │ └── linux_specific.cpp ├── common │ ├── os │ │ ├── thread.h │ │ ├── windows │ │ │ ├── windows.h │ │ │ ├── thread.cpp │ │ │ └── filesystem.cpp │ │ ├── linux │ │ │ └── thread.cpp │ │ └── filesystem.h │ ├── bit_depth.h │ ├── future.h │ ├── stdafx.cpp │ ├── base64.h │ ├── utf.h │ ├── prec_timer.h │ ├── utf.cpp │ ├── env.h │ ├── timer.h │ ├── CMakeLists.txt │ ├── filesystem.h │ └── scope_exit.h ├── modules │ ├── screen │ │ ├── consumer │ │ │ ├── screen.vert │ │ │ └── screen_consumer.h │ │ ├── util │ │ │ └── x11_util.h │ │ ├── CMakeLists.txt │ │ ├── screen.h │ │ └── screen.cpp │ ├── CMakeLists.txt │ ├── oal │ │ ├── CMakeLists.txt │ │ ├── oal.h │ │ ├── oal.cpp │ │ └── consumer │ │ │ └── oal_consumer.h │ ├── artnet │ │ ├── CMakeLists.txt │ │ ├── artnet.h │ │ ├── artnet.cpp │ │ └── consumer │ │ │ └── artnet_consumer.h │ ├── ffmpeg │ │ ├── util │ │ │ ├── audio_resampler.h │ │ │ ├── audio_resampler.cpp │ │ │ └── av_util.h │ │ ├── CMakeLists.txt │ │ ├── ffmpeg.h │ │ ├── producer │ │ │ ├── ffmpeg_producer.h │ │ │ ├── av_input.h │ │ │ └── av_producer.h │ │ └── consumer │ │ │ └── ffmpeg_consumer.h │ ├── html │ │ ├── CMakeLists.txt │ │ ├── html.h │ │ ├── util.h │ │ └── producer │ │ │ ├── html_producer.h │ │ │ └── html_cg_proxy.h │ ├── flash │ │ ├── CMakeLists.txt │ │ ├── flash.h │ │ ├── producer │ │ │ └── flash_producer.h │ │ ├── util │ │ │ └── swf.h │ │ └── StdAfx.h │ ├── bluefish │ │ ├── CMakeLists.txt │ │ ├── bluefish.h │ │ ├── producer │ │ │ └── bluefish_producer.h │ │ ├── StdAfx.h │ │ ├── interop │ │ │ └── BlueTypes.h │ │ └── consumer │ │ │ └── bluefish_consumer.h │ ├── image │ │ ├── CMakeLists.txt │ │ ├── image.h │ │ ├── util │ │ │ ├── image_converter.h │ │ │ ├── image_loader.h │ │ │ └── image_algorithms.cpp │ │ ├── producer │ │ │ ├── image_producer.h │ │ │ └── image_scroll_producer.h │ │ ├── image.cpp │ │ └── consumer │ │ │ └── image_consumer.h │ ├── newtek │ │ ├── newtek.h │ │ ├── StdAfx.h │ │ ├── producer │ │ │ └── newtek_ndi_producer.h │ │ ├── CMakeLists.txt │ │ ├── util │ │ │ └── ndi.h │ │ ├── consumer │ │ │ └── newtek_ndi_consumer.h │ │ ├── newtek.cpp │ │ └── interop │ │ │ └── Processing.NDI.compat.h │ └── decklink │ │ ├── decklink.h │ │ ├── consumer │ │ ├── monitor.h │ │ └── decklink_consumer.h │ │ └── producer │ │ └── decklink_producer.h ├── version.tmpl ├── accelerator │ ├── ogl │ │ ├── image │ │ │ ├── shader.vert │ │ │ ├── image_shader.h │ │ │ └── image_shader.cpp │ │ └── util │ │ │ ├── context.h │ │ │ ├── buffer.h │ │ │ ├── matrix.h │ │ │ ├── transforms.h │ │ │ └── texture.h │ ├── accelerator.h │ ├── StdAfx.h │ ├── CMakeLists.txt │ └── accelerator.cpp ├── tools │ ├── CMakeLists.txt │ └── bin2c.cpp ├── protocol │ ├── util │ │ ├── http_request.h │ │ ├── lock_container.h │ │ ├── tokenize.h │ │ ├── ProtocolStrategy.h │ │ ├── ClientInfo.h │ │ └── AsyncEventServer.h │ ├── amcp │ │ ├── AMCPCommandsImpl.h │ │ ├── AMCPProtocolStrategy.h │ │ ├── AMCPCommandQueue.h │ │ ├── amcp_args.h │ │ └── amcp_command_repository.h │ ├── StdAfx.h │ ├── osc │ │ ├── oscpack │ │ │ └── OscTypes.cpp │ │ └── client.h │ └── CMakeLists.txt ├── core │ ├── diagnostics │ │ ├── osd_graph.h │ │ ├── call_context.cpp │ │ └── call_context.h │ ├── producer │ │ ├── separated │ │ │ └── separated_producer.h │ │ ├── route │ │ │ └── route_producer.h │ │ ├── transition │ │ │ ├── sting_producer.h │ │ │ └── transition_producer.h │ │ ├── color │ │ │ └── color_producer.h │ │ └── layer.h │ ├── consumer │ │ └── channel_info.h │ ├── frame │ │ ├── frame_visitor.h │ │ └── frame_factory.h │ ├── fwd.h │ └── mixer │ │ ├── image │ │ └── blend_modes.h │ │ ├── mixer.h │ │ └── audio │ │ ├── audio_mixer.h │ │ └── audio_util.h └── CMakeSettings.json ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yaml │ └── bug_report.yaml └── workflows │ └── linux.yml ├── .dockerignore ├── .gitignore ├── .editorconfig └── _typos.toml /tools/linux/deb/ubuntu-noble/debian/patches/series: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | pristine-tar = True 3 | -------------------------------------------------------------------------------- /src/shell/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasparCG/server/HEAD/src/shell/resource.h -------------------------------------------------------------------------------- /src/shell/CasparCG.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasparCG/server/HEAD/src/shell/CasparCG.ico -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/casparcg-server-beta.manpages: -------------------------------------------------------------------------------- 1 | debian/casparcg-server-beta.1 2 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/casparcg-server-beta.docs: -------------------------------------------------------------------------------- 1 | CHANGELOG.md 2 | LICENSE 3 | README.md 4 | -------------------------------------------------------------------------------- /src/shell/LiberationSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasparCG/server/HEAD/src/shell/LiberationSans-Regular.ttf -------------------------------------------------------------------------------- /src/shell/liberation-fonts/LiberationMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasparCG/server/HEAD/src/shell/liberation-fonts/LiberationMono-Regular.ttf -------------------------------------------------------------------------------- /src/shell/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RET=5 4 | 5 | while [ $RET -eq 5 ] 6 | do 7 | LD_LIBRARY_PATH=lib bin/casparcg "$@" 8 | RET=$? 9 | done 10 | 11 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/.gitignore: -------------------------------------------------------------------------------- 1 | .debhelper 2 | debhelper-build-stamp 3 | /casparcg-server-*/ 4 | *.log 5 | *.substvars 6 | /files 7 | /tmp/ 8 | /changelog -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/patches/README: -------------------------------------------------------------------------------- 1 | 0xxx: Grabbed from upstream development. 2 | 1xxx: Possibly relevant for upstream adoption. 3 | 2xxx: Only relevant for packaging. 4 | -------------------------------------------------------------------------------- /tools/linux/extract-from-docker: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | tempContainer=$(docker create casparcg/server) 3 | docker cp $tempContainer:/opt/casparcg ./casparcg_server 4 | docker rm -v $tempContainer 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Question or need help? 4 | url: https://casparcgforum.org/ 5 | about: Ask the community here. -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | src/packages 2 | src/cmake-build-* 3 | build-scripts 4 | build 5 | resources 6 | .git 7 | .vscode 8 | CMakeFiles 9 | casparcg_server 10 | 11 | dist 12 | build 13 | src/cmake-build-* 14 | -------------------------------------------------------------------------------- /tools/verify-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # override args to diff changes 4 | export CLANG_ARGS=-output-replacements-xml 5 | 6 | SCRIPT_ROOT=$(dirname "${0}")/.. 7 | "${SCRIPT_ROOT}/tools/update-format.sh" 8 | -------------------------------------------------------------------------------- /src/shell/casparcg_auto_restart.bat: -------------------------------------------------------------------------------- 1 | @Echo off 2 | 3 | IF EXIST scanner.exe ( 4 | start scanner.exe 5 | ) 6 | 7 | :Start 8 | SET ERRORLEVEL 0 9 | 10 | casparcg.exe 11 | 12 | if ERRORLEVEL 5 goto :Start 13 | -------------------------------------------------------------------------------- /src/common/os/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace caspar { 6 | 7 | void set_thread_name(const std::wstring& name); 8 | void set_thread_realtime_priority(); 9 | } // namespace caspar 10 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/upstream/metadata: -------------------------------------------------------------------------------- 1 | --- 2 | Bug-Database: https://github.com/CasparCG/server/issues 3 | Bug-Submit: https://github.com/CasparCG/server/issues/new 4 | Repository-Browse: https://github.com/CasparCG/server 5 | -------------------------------------------------------------------------------- /src/modules/screen/consumer/screen.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | in vec4 TexCoordIn; 3 | in vec2 Position; 4 | 5 | out vec4 TexCoord; 6 | 7 | void main() 8 | { 9 | TexCoord = TexCoordIn; 10 | gl_Position = vec4(Position, 0, 1); 11 | } 12 | -------------------------------------------------------------------------------- /src/version.tmpl: -------------------------------------------------------------------------------- 1 | #define CASPAR_GEN ${CONFIG_VERSION_MAJOR} 2 | #define CASPAR_MAJOR ${CONFIG_VERSION_MINOR} 3 | #define CASPAR_MINOR ${CONFIG_VERSION_BUG} 4 | #define CASPAR_TAG "${CONFIG_VERSION_TAG}" 5 | #define CASPAR_HASH "${CONFIG_VERSION_GIT_HASH}" 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dir 2 | *.vcxproj 3 | *.vcxproj.filters 4 | *.tlog 5 | *.sln 6 | .settings 7 | .vscode 8 | .idea 9 | .vs 10 | build 11 | dist 12 | CMakeFiles 13 | casparcg_server 14 | 15 | src/cmake-build-* 16 | src/.idea 17 | 18 | # debian build artifacts 19 | /debian 20 | /obj-* -------------------------------------------------------------------------------- /src/common/bit_depth.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace caspar { namespace common { 6 | 7 | enum class bit_depth : uint8_t 8 | { 9 | bit8 = 0, 10 | bit10, 11 | bit12, 12 | // bit14, 13 | bit16, 14 | }; 15 | 16 | }} // namespace caspar::common -------------------------------------------------------------------------------- /tools/linux/build-in-docker: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | GIT_HASH=$(git rev-parse --verify --short HEAD) 4 | 5 | docker build -t casparcg/server \ 6 | --build-arg CC \ 7 | --build-arg CXX \ 8 | --build-arg PROC_COUNT \ 9 | --build-arg GIT_HASH \ 10 | -f $PWD/tools/linux/Dockerfile $PWD 11 | 12 | -------------------------------------------------------------------------------- /src/shell/liberation-fonts/AUTHORS: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | 3 | Current Contributors (sorted alphabetically): 4 | - Pravin Satpute 5 | Project Owner (Current) 6 | Red Hat, Inc. 7 | 8 | Previous Contributors 9 | 10 | - Steve Matteson 11 | Original Designer 12 | Ascender, Inc. 13 | -------------------------------------------------------------------------------- /tools/linux/run_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$DISPLAY" ]; then 4 | echo "WARNING: DISPLAY is not set" 5 | fi 6 | 7 | if [ ! -d /tmp/.X11-unix ]; then 8 | echo "WARNING: X11 socket not found" 9 | fi 10 | 11 | if [ ! -f /root/.Xauthority ]; then 12 | echo "WARNING: Xauthority not found" 13 | fi 14 | 15 | ./run.sh 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.diff] 12 | trim_trailing_whitespace = false 13 | 14 | [*.patch] 15 | trim_trailing_whitespace = false 16 | 17 | [debian/rules] 18 | indent_style = tab 19 | -------------------------------------------------------------------------------- /src/shell/liberation-fonts/TODO: -------------------------------------------------------------------------------- 1 | Here are todo for next release 2 | 1) Serbian glyph for wikipedia https://bugzilla.redhat.com/show_bug.cgi?id=657849 3 | - Improving shape of S_BE https://bugzilla.redhat.com/show_bug.cgi?id=657849#c96 4 | 2) Liberation Mono not recognizing as Mono in Windows application #861003 5 | - presently it is patch, we have to update zero width characters to fixed width 6 | -------------------------------------------------------------------------------- /src/accelerator/ogl/image/shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | in vec4 TexCoordIn; 3 | in vec2 Position; 4 | 5 | out vec4 TexCoord; 6 | out vec4 TexCoord2; 7 | 8 | void main() 9 | { 10 | TexCoord = TexCoordIn; 11 | vec4 pos = vec4(Position, 0, 1); 12 | TexCoord2 = vec4(pos.xy, 0.0, 0.0); 13 | pos.x = pos.x*2.0 - 1.0; 14 | pos.y = pos.y*2.0 - 1.0; 15 | gl_Position = pos; 16 | } 17 | -------------------------------------------------------------------------------- /_typos.toml: -------------------------------------------------------------------------------- 1 | [default] 2 | # Ignore lines following the commment `// typos: ignore-next 3 | extend-ignore-re = [".*// typos: ignore-next\\n[^\\n]*\\n"] 4 | 5 | [default.extend-words] 6 | # NDI is a common acronym in the context of video and audio over IP 7 | ndi = "ndi" 8 | # it was seeoing NDIfoo as ND-Ifoo and turning it into ANDIfoo 9 | nd = "nd" 10 | # ANC is short for "ancillary" and is used in the bluefish drivers 11 | anc = "anc" 12 | 13 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | opts=\ 3 | searchmode=plain,\ 4 | repack,\ 5 | repacksuffix=+dfsg,\ 6 | dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\ 7 | uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/,\ 8 | filenamemangle=s%.*/v?@ANY_VERSION@%@PACKAGE@-$1.tar.xz%" \ 9 | https://api.github.com/repos/casparcg/server/releases?per_page=50 \ 10 | https://api.github.com/repos/[^/]+/[^/]+/tarball/v?@ANY_VERSION@ 11 | -------------------------------------------------------------------------------- /src/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project("modules") 3 | 4 | add_subdirectory(image) 5 | add_subdirectory(ffmpeg) 6 | add_subdirectory(oal) 7 | add_subdirectory(decklink) 8 | add_subdirectory(screen) 9 | add_subdirectory(newtek) 10 | add_subdirectory(artnet) 11 | 12 | if (ENABLE_HTML) 13 | add_subdirectory(html) 14 | endif () 15 | 16 | if (MSVC) 17 | add_subdirectory(flash) 18 | add_subdirectory(bluefish) 19 | endif() 20 | 21 | -------------------------------------------------------------------------------- /src/common/os/windows/windows.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef _UNICODE 4 | #define _UNICODE 5 | #undef UNICODE 6 | #define UNICODE 7 | 8 | #undef NOMINMAX 9 | #define NOMINMAX 10 | 11 | #undef NOSERVICE 12 | #define NOSERVICE 13 | #undef NOMCX 14 | #define NOMCX 15 | 16 | #ifdef _MSC_VER 17 | #include 18 | #endif 19 | #ifndef _WIN32_WINNT 20 | #define _WIN32_WINNT _WIN32_WINNT_WIN7 21 | #endif 22 | 23 | #undef WIN32_LEAN_AND_MEAN 24 | #define WIN32_LEAN_AND_MEAN 25 | 26 | #include 27 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/casparcg.txt2man: -------------------------------------------------------------------------------- 1 | NAME 2 | casparcg-server-beta - layered real-time video compositor to multiple outputs 3 | SYNOPSIS 4 | casparcg-server-beta [path-to-config] 5 | DESCRIPTION 6 | Play out professional graphics, audio and video to multiple outputs as a 7 | layerbased real-time compositor. 8 | 9 | If no path-to-config is provided, the default path is 'casparcg.config'. 10 | OPTIONS 11 | There are no options. 12 | AUTHOR 13 | Petter Reinholdtsen wrote this manual page. 14 | -------------------------------------------------------------------------------- /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: Build Linux 2 | 3 | on: 4 | push: 5 | # branches: [ "master" ] 6 | pull_request: 7 | branches: ["master"] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | permissions: 14 | packages: write 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - name: Run build 20 | run: | 21 | ./tools/linux/build-in-docker 22 | env: 23 | CI: 1 24 | -------------------------------------------------------------------------------- /tools/windows/package.bat: -------------------------------------------------------------------------------- 1 | if exist "%SERVER_FOLDER%" rmdir "%SERVER_FOLDER%" /s /q 2 | 3 | xcopy shell\Release "%SERVER_FOLDER%" /E /I /Y 4 | xcopy flashtemplatehost-prefix\src\flashtemplatehost "%SERVER_FOLDER%\" /E /I /Y 5 | 6 | copy %1\src\shell\casparcg_auto_restart.bat "%SERVER_FOLDER%\" 7 | 8 | echo Copying documentation... 9 | copy %1\CHANGELOG.md "%SERVER_FOLDER%" 10 | copy %1\LICENSE "%SERVER_FOLDER%" 11 | copy %1\README.md "%SERVER_FOLDER%" 12 | 13 | if exist "%MEDIA_SCANNER_FOLDER%" xcopy "%MEDIA_SCANNER_FOLDER%" "%SERVER_FOLDER%" /E /I /Y -------------------------------------------------------------------------------- /src/accelerator/ogl/util/context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace caspar::accelerator::ogl { 6 | 7 | class device_context final 8 | { 9 | public: 10 | device_context(); 11 | ~device_context(); 12 | 13 | device_context(const device_context&) = delete; 14 | 15 | device_context& operator=(const device_context&) = delete; 16 | 17 | void bind(); 18 | void unbind(); 19 | 20 | struct impl; 21 | 22 | private: 23 | spl::shared_ptr impl_; 24 | }; 25 | 26 | } // namespace caspar::accelerator::ogl 27 | -------------------------------------------------------------------------------- /src/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | 3 | add_executable(bin2c bin2c.cpp) 4 | target_compile_features(bin2c PRIVATE cxx_std_17) 5 | 6 | target_include_directories(bin2c PRIVATE ..) 7 | 8 | function(bin2c source_file dest_file namespace obj_name) 9 | ADD_CUSTOM_COMMAND( 10 | OUTPUT ${dest_file} 11 | COMMAND bin2c ${namespace} ${obj_name} ${CMAKE_CURRENT_SOURCE_DIR}/${source_file} > ${CMAKE_CURRENT_BINARY_DIR}/${dest_file} 12 | DEPENDS bin2c ${CMAKE_CURRENT_SOURCE_DIR}/${source_file} 13 | ) 14 | endfunction() 15 | -------------------------------------------------------------------------------- /src/modules/oal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (oal) 3 | 4 | set(SOURCES 5 | consumer/oal_consumer.cpp 6 | consumer/oal_consumer.h 7 | 8 | oal.cpp 9 | oal.h 10 | ) 11 | 12 | casparcg_add_module_project(oal 13 | SOURCES ${SOURCES} 14 | INIT_FUNCTION "oal::init" 15 | ) 16 | target_include_directories(oal PRIVATE 17 | ${FFMPEG_INCLUDE_PATH} 18 | ) 19 | target_link_libraries(oal PRIVATE OpenAL::OpenAL) 20 | 21 | set_target_properties(oal PROPERTIES FOLDER modules) 22 | source_group(sources\\consumer consumer/*) 23 | source_group(sources ./*) 24 | -------------------------------------------------------------------------------- /src/modules/artnet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (artnet) 3 | 4 | set(SOURCES 5 | consumer/artnet_consumer.cpp 6 | consumer/artnet_consumer.h 7 | 8 | util/fixture_calculation.cpp 9 | util/fixture_calculation.h 10 | 11 | artnet.cpp 12 | artnet.h 13 | ) 14 | 15 | casparcg_add_module_project(artnet 16 | SOURCES ${SOURCES} 17 | INIT_FUNCTION "artnet::init" 18 | ) 19 | 20 | set_target_properties(artnet PROPERTIES FOLDER modules) 21 | source_group(sources\\consumer consumer/*) 22 | source_group(sources\\util util/*) 23 | source_group(sources ./*) 24 | 25 | -------------------------------------------------------------------------------- /src/protocol/util/http_request.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace caspar { namespace http { 7 | 8 | struct HTTPResponse 9 | { 10 | unsigned int status_code; 11 | std::string status_message; 12 | std::map headers; 13 | std::string body; 14 | }; 15 | 16 | HTTPResponse request(const std::string& host, const std::string& port, const std::string& path); 17 | 18 | std::string url_encode(const std::string& str); 19 | 20 | }} // namespace caspar::http 21 | -------------------------------------------------------------------------------- /src/shell/included_modules.tmpl: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated file. 3 | */ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | ${CASPARCG_MODULE_INCLUDE_STATEMENTS} 11 | 12 | namespace caspar { 13 | 14 | static bool intercept_command_line_args(int argc, char** argv) 15 | {${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS} 16 | return false; 17 | } 18 | 19 | static void initialize_modules(const core::module_dependencies& dependencies) 20 | {${CASPARCG_MODULE_INIT_STATEMENTS}} 21 | 22 | static void uninitialize_modules() 23 | { 24 | ${CASPARCG_MODULE_UNINIT_STATEMENTS}} 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/common/os/linux/thread.cpp: -------------------------------------------------------------------------------- 1 | #include "../thread.h" 2 | #include "../../utf.h" 3 | #include 4 | #include 5 | 6 | namespace caspar { 7 | 8 | void set_thread_name(const std::wstring& name) { pthread_setname_np(pthread_self(), u8(name).c_str()); } 9 | 10 | void set_thread_realtime_priority() 11 | { 12 | pthread_t handle = pthread_self(); 13 | int policy; 14 | struct sched_param param; 15 | if (pthread_getschedparam(handle, &policy, ¶m) != 0) 16 | return; 17 | param.sched_priority = 2; 18 | pthread_setschedparam(handle, SCHED_FIFO, ¶m); 19 | } 20 | 21 | } // namespace caspar 22 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/util/audio_resampler.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #pragma once 5 | 6 | extern "C" { 7 | #include 8 | } 9 | 10 | struct SwrContext; 11 | 12 | namespace caspar::ffmpeg { 13 | 14 | class AudioResampler 15 | { 16 | std::shared_ptr ctx; 17 | 18 | public: 19 | AudioResampler(int sample_rate, AVSampleFormat in_sample_fmt); 20 | 21 | AudioResampler(const AudioResampler&) = delete; 22 | AudioResampler& operator=(const AudioResampler&) = delete; 23 | 24 | caspar::array convert(int frames, const void** src); 25 | }; 26 | 27 | }; // namespace caspar::ffmpeg -------------------------------------------------------------------------------- /tools/update-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # args needed to format inline. can be overridden to use script for other purposes 4 | CLANG_ARGS=${CLANG_ARGS:--i} 5 | 6 | SOURCE_FILES=`find ./src/ \( -name \*.cpp -type f -or -name \*.h -type f \) -not -path "./src/packages/*" -not -path "*interop*" -not -path "./src/cmake*"` 7 | BAD_FILES=0 8 | for SOURCE_FILE in $SOURCE_FILES 9 | do 10 | export FORMATTING_ISSUE_COUNT=`clang-format $CLANG_ARGS $SOURCE_FILE | grep offset | wc -l` 11 | if [ "$FORMATTING_ISSUE_COUNT" -gt "0" ]; then 12 | echo "Source file $SOURCE_FILE contains formatting issues." 13 | BAD_FILES=1 14 | fi 15 | done 16 | 17 | if [ $BAD_FILES ]; then 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this project 3 | labels: 4 | - type/enhancement 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Before you post, make sure to check for existing matching feature requests: 11 | https://github.com/CasparCG/server/issues?q=+is%3Aissue+label%3Atype%2Fbug 12 | 13 | - type: textarea 14 | attributes: 15 | label: Description 16 | description: How should the feature/enhancement work? 17 | validations: 18 | required: true 19 | 20 | - type: textarea 21 | attributes: 22 | label: Solution suggestion 23 | description: If you have any suggestions on how the solution should work, add that here. 24 | -------------------------------------------------------------------------------- /src/modules/html/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (html) 3 | 4 | set(SOURCES 5 | producer/html_cg_proxy.cpp 6 | producer/html_cg_proxy.h 7 | producer/html_producer.cpp 8 | producer/html_producer.h 9 | 10 | html.cpp 11 | html.h 12 | util.h 13 | ) 14 | 15 | casparcg_add_module_project(html 16 | SOURCES ${SOURCES} 17 | INIT_FUNCTION "html::init" 18 | UNINIT_FUNCTION "html::uninit" 19 | CLI_INTERCEPTOR "html::intercept_command_line" 20 | ) 21 | target_link_libraries(html PRIVATE ffmpeg CEF::CEF) 22 | 23 | target_include_directories(html PRIVATE 24 | .. 25 | ${FFMPEG_INCLUDE_PATH} 26 | ) 27 | 28 | set_target_properties(html PROPERTIES FOLDER modules) 29 | source_group(sources\\producer producer/*) 30 | source_group(sources ./*) 31 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ --sourcedirectory=src --buildsystem=cmake 4 | 5 | override_dh_auto_configure: 6 | dh_auto_configure -- -DDIAG_FONT_PATH=/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf -DCASPARCG_BINARY_NAME=casparcg-server-beta 7 | 8 | # Generate and install manual page 9 | debian/casparcg-server-beta.1: debian/casparcg.txt2man 10 | txt2man -t CASPARCG -d 2018-12-14 -s 1 debian/casparcg.txt2man > $@ 11 | 12 | override_dh_installman: debian/casparcg-server-beta.1 13 | dh_installman 14 | $(RM) debian/casparcg-server-beta.1 15 | 16 | override_dh_gencontrol: 17 | CASPARCG_CEF_VER=$(dpkg-query -W -f='${Version}' casparcg-cef-142) 18 | sed -i "s/@CASPARCG_CEF_VER@/${CASPARCG_CEF_VER}/" debian/control 19 | dh_gencontrol 20 | -------------------------------------------------------------------------------- /src/protocol/util/lock_container.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "protocol_strategy.h" 6 | 7 | namespace caspar { namespace IO { 8 | 9 | class lock_container 10 | { 11 | public: 12 | lock_container(const std::wstring& lifecycle_key); 13 | ~lock_container(); 14 | 15 | bool check_access(client_connection::ptr conn); 16 | bool try_lock(const std::wstring& lock_phrase, client_connection::ptr conn); 17 | void release_lock(client_connection::ptr conn); 18 | void clear_locks(); 19 | 20 | private: 21 | struct impl; 22 | spl::unique_ptr impl_; 23 | 24 | lock_container(const lock_container&) = delete; 25 | lock_container& operator=(const lock_container&) = delete; 26 | }; 27 | }} // namespace caspar::IO 28 | -------------------------------------------------------------------------------- /src/common/future.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace caspar { 8 | 9 | template 10 | auto flatten(F&& f) 11 | { 12 | return std::async(std::launch::deferred, [f = std::forward(f)]() mutable { return f.get().get(); }); 13 | } 14 | 15 | template 16 | bool is_ready(const F& future) 17 | { 18 | return future.wait_for(std::chrono::seconds(0)) == std::future_status::ready; 19 | } 20 | 21 | template 22 | auto make_ready_future(T&& value) 23 | { 24 | std::promise::type> p; 25 | p.set_value(std::forward(value)); 26 | return p.get_future(); 27 | } 28 | 29 | static std::future make_ready_future() 30 | { 31 | std::promise p; 32 | p.set_value(); 33 | return p.get_future(); 34 | } 35 | 36 | } // namespace caspar -------------------------------------------------------------------------------- /src/shell/liberation-fonts/ChangeLog: -------------------------------------------------------------------------------- 1 | * Thu Oct 04 2012 Pravin Satpute 2 | - Resolved "Glyphs with multiple unicode encodings inhibit subsetting" #851790 3 | - Resolved #851791, #854601 and #851825 4 | - Following GASP table version as per Liberation old version. (Anti-aliasing disabled) 5 | - Added support for Serbian glyphs for wikipedia #657849 6 | - In Monospace fonts, isFixedPitch bit set via script for getting it recognized as Monospace in putty.exe 7 | 8 | * Fri Jul 06 2012 Pravin Satpute 9 | - Initial version of Liberation fonts based on croscore fonts version 1.21.0 10 | - Converted TTF files into SFD files to be open source. 11 | - Update Copyright and License file 12 | - set fsType bit to 0, Installable Embedding is allowed. 13 | - Absolute value in HHeadAscent/Descent values for maintaining Metric compatibility. 14 | 15 | -------------------------------------------------------------------------------- /src/modules/flash/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (flash) 3 | 4 | set(SOURCES 5 | interop/Flash9e_i.c 6 | interop/axflash.h 7 | interop/TimerHelper.h 8 | 9 | producer/FlashAxContainer.cpp 10 | producer/FlashAxContainer.h 11 | producer/flash_producer.cpp 12 | producer/flash_producer.h 13 | 14 | util/swf.cpp 15 | util/swf.h 16 | 17 | flash.cpp 18 | flash.h 19 | StdAfx.h 20 | ) 21 | 22 | casparcg_add_module_project(flash 23 | SOURCES ${SOURCES} 24 | INIT_FUNCTION "flash::init" 25 | ) 26 | target_include_directories(flash PRIVATE 27 | ${ZLIB_INCLUDE_PATH} 28 | ) 29 | target_precompile_headers(flash PRIVATE "StdAfx.h") 30 | 31 | set_target_properties(flash PROPERTIES FOLDER modules) 32 | source_group(sources\\interop interop/*) 33 | source_group(sources\\producer producer/*) 34 | source_group(sources\\util util/*) 35 | source_group(sources ./*) 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/common/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #include "stdafx.h" 23 | -------------------------------------------------------------------------------- /tools/linux/deb/INSTALLING: -------------------------------------------------------------------------------- 1 | Installation from Graphical User Interface 2 | 3 | Double click on the casparcg-cef package. Click the install 4 | button and follow the prompts. This can then be repeated for 5 | the casparcg-server and casparcg-scanner packages if desired. 6 | 7 | Installation from Command Line 8 | 9 | At the command prompt type: 10 | 11 | # sudo dpkg -i casparcg-*.deb 12 | 13 | Then fix up any missing dependencies with: 14 | 15 | # sudo apt-get install -f 16 | 17 | Running 18 | 19 | You will need to run both: 20 | 21 | # casparcg-scanner --caspar.config casparcg.config 22 | 23 | and 24 | 25 | # casparcg-server-beta casparcg.config 26 | 27 | with the same config file and potentially working directory (if the config file uses relative paths). 28 | 29 | The server needs to be run as a normal user inside a running x11 server. The scanner can be run as a system service. 30 | -------------------------------------------------------------------------------- /src/modules/bluefish/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (bluefish) 3 | 4 | set(SOURCES 5 | consumer/bluefish_consumer.cpp 6 | consumer/bluefish_consumer.h 7 | producer/bluefish_producer.cpp 8 | producer/bluefish_producer.h 9 | util/blue_velvet.cpp 10 | util/blue_velvet.h 11 | util/memory.h 12 | bluefish.cpp 13 | bluefish.h 14 | StdAfx.h 15 | ) 16 | 17 | casparcg_add_module_project(bluefish 18 | SOURCES ${SOURCES} 19 | INIT_FUNCTION "bluefish::init" 20 | ) 21 | target_include_directories(bluefish PRIVATE 22 | .. 23 | ${FFMPEG_INCLUDE_PATH} 24 | ) 25 | target_precompile_headers(bluefish PRIVATE "StdAfx.h") 26 | 27 | set_target_properties(bluefish PROPERTIES FOLDER modules) 28 | source_group(sources ./*) 29 | source_group(sources\\consumer consumer/*) 30 | source_group(sources\\producer producer/*) 31 | source_group(sources\\util util/*) 32 | source_group(sources\\interop interop/*) 33 | 34 | target_link_libraries(bluefish PRIVATE ffmpeg) 35 | -------------------------------------------------------------------------------- /src/modules/screen/util/x11_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, git@julusian.co.uk 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | bool window_always_on_top(const sf::Window& window); 27 | -------------------------------------------------------------------------------- /src/modules/screen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (screen) 3 | 4 | set(SOURCES 5 | consumer/screen_consumer.cpp 6 | consumer/screen_consumer.h 7 | 8 | consumer_screen_vertex.h 9 | consumer_screen_fragment.h 10 | 11 | screen.cpp 12 | screen.h 13 | ) 14 | 15 | bin2c("consumer/screen.vert" "consumer_screen_vertex.h" "caspar::screen" "vertex_shader") 16 | bin2c("consumer/screen.frag" "consumer_screen_fragment.h" "caspar::screen" "fragment_shader") 17 | 18 | if (MSVC) 19 | else () 20 | list(APPEND SOURCES 21 | util/x11_util.cpp 22 | util/x11_util.h 23 | ) 24 | endif () 25 | 26 | casparcg_add_module_project(screen 27 | SOURCES ${SOURCES} 28 | INIT_FUNCTION "screen::init" 29 | ) 30 | target_include_directories(screen PRIVATE 31 | ${CMAKE_CURRENT_BINARY_DIR} 32 | ${FFMPEG_INCLUDE_PATH} 33 | ) 34 | target_link_libraries(screen PRIVATE accelerator ffmpeg GLEW::glew sfml-window) 35 | 36 | set_target_properties(screen PROPERTIES FOLDER modules) 37 | source_group(sources\\consumer consumer/*) 38 | source_group(sources ./*) 39 | -------------------------------------------------------------------------------- /tools/linux/install-dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt-get install -yq --no-install-recommends \ 4 | autoconf \ 5 | automake \ 6 | cmake \ 7 | ninja-build \ 8 | curl \ 9 | bzip2 \ 10 | clang \ 11 | g++ \ 12 | gcc \ 13 | git \ 14 | gperf \ 15 | libtool \ 16 | make \ 17 | perl \ 18 | pkg-config \ 19 | python3 \ 20 | zlib1g-dev \ 21 | libexpat1-dev \ 22 | lsb-release \ 23 | libglew-dev \ 24 | libtbb-dev \ 25 | libopenal-dev \ 26 | libxcursor-dev \ 27 | libxinerama-dev \ 28 | libxi-dev \ 29 | libsfml-dev \ 30 | libxrandr-dev \ 31 | libudev-dev \ 32 | libglu1-mesa-dev \ 33 | libgl1-mesa-dev \ 34 | libegl1-mesa-dev \ 35 | libboost-all-dev \ 36 | libnss3-dev \ 37 | libcups2-dev \ 38 | libxdamage-dev \ 39 | libxcomposite-dev \ 40 | libatk1.0-dev \ 41 | libatspi2.0-dev \ 42 | libatk-bridge2.0-dev \ 43 | libavcodec-dev \ 44 | libavformat-dev \ 45 | libavdevice-dev \ 46 | libavutil-dev \ 47 | libavfilter-dev \ 48 | libswscale-dev \ 49 | libpostproc-dev \ 50 | libswresample-dev \ 51 | libsimde-dev 52 | -------------------------------------------------------------------------------- /src/modules/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (image) 3 | 4 | set(SOURCES 5 | consumer/image_consumer.cpp 6 | consumer/image_consumer.h 7 | 8 | producer/image_producer.cpp 9 | producer/image_producer.h 10 | 11 | producer/image_scroll_producer.cpp 12 | producer/image_scroll_producer.h 13 | 14 | util/image_algorithms.cpp 15 | util/image_algorithms.h 16 | util/image_converter.cpp 17 | util/image_converter.h 18 | util/image_loader.cpp 19 | util/image_loader.h 20 | util/image_view.h 21 | 22 | image.cpp 23 | image.h 24 | ) 25 | 26 | casparcg_add_module_project(image 27 | SOURCES ${SOURCES} 28 | INIT_FUNCTION "image::init" 29 | ) 30 | target_include_directories(image PRIVATE 31 | .. 32 | ${FFMPEG_INCLUDE_PATH} 33 | ) 34 | 35 | set_target_properties(image PROPERTIES FOLDER modules) 36 | source_group(sources\\consumer consumer/*) 37 | source_group(sources\\producer producer/*) 38 | source_group(sources\\util util/*) 39 | source_group(sources ./*) 40 | 41 | target_link_libraries(image PRIVATE 42 | ffmpeg 43 | ) 44 | 45 | -------------------------------------------------------------------------------- /src/protocol/util/tokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see .* 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | namespace caspar { namespace IO { 26 | 27 | std::size_t tokenize(const std::wstring& message, std::list& pTokenVector); 28 | 29 | }} // namespace caspar::IO 30 | -------------------------------------------------------------------------------- /src/modules/oal/oal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace oal { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::oal 31 | -------------------------------------------------------------------------------- /src/modules/newtek/newtek.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace newtek { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::newtek -------------------------------------------------------------------------------- /src/modules/flash/flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace flash { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::flash 31 | -------------------------------------------------------------------------------- /src/modules/image/image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace image { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::image 31 | -------------------------------------------------------------------------------- /src/modules/screen/screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace screen { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::screen 31 | -------------------------------------------------------------------------------- /src/modules/artnet/artnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Eliyah Sundström eliyah@sundstroem.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace artnet { 27 | 28 | void init(const core::module_dependencies& dependencies); 29 | 30 | }} // namespace caspar::artnet 31 | -------------------------------------------------------------------------------- /src/accelerator/accelerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace caspar { namespace accelerator { 16 | 17 | class accelerator_device 18 | { 19 | public: 20 | virtual boost::property_tree::wptree info() const = 0; 21 | virtual std::future gc() = 0; 22 | }; 23 | 24 | class accelerator 25 | { 26 | public: 27 | explicit accelerator(const core::video_format_repository format_repository); 28 | accelerator(accelerator&) = delete; 29 | ~accelerator(); 30 | 31 | accelerator& operator=(accelerator&) = delete; 32 | 33 | std::unique_ptr create_image_mixer(int channel_id, common::bit_depth depth); 34 | 35 | std::shared_ptr get_device() const; 36 | 37 | private: 38 | struct impl; 39 | std::unique_ptr impl_; 40 | }; 41 | 42 | }} // namespace caspar::accelerator 43 | -------------------------------------------------------------------------------- /src/core/diagnostics/osd_graph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace caspar { namespace core { namespace diagnostics { namespace osd { 25 | 26 | void register_sink(); 27 | void show_graphs(bool value); 28 | void shutdown(); 29 | 30 | }}}} // namespace caspar::core::diagnostics::osd 31 | -------------------------------------------------------------------------------- /src/shell/copy_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function usage() 4 | { 5 | cat << EOU 6 | Usage: bash $0 7 | EOU 8 | exit 1 9 | } 10 | 11 | #Validate the inputs 12 | [[ $# < 2 ]] && usage 13 | 14 | #Check if the paths are valid 15 | [[ ! -e $1 ]] && echo "Not a valid input $1" && exit 1 16 | [[ -d $2 ]] || echo "No such directory $2 creating..."&& mkdir -p "$2" 17 | 18 | #Get the library dependencies 19 | export LD_LIBRARY_PATH=/opt/boost/lib 20 | echo "Collecting the shared library dependencies for $1..." 21 | deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1\ 22 | ~/^\//{print $1}$3~/^\//{print $3}'\ 23 | | sed 's/,$/\n/') 24 | echo "Copying the dependencies to $2" 25 | 26 | #Copy the deps 27 | for dep in $deps 28 | do 29 | if [[ $dep = *"ld-linux-x86-64.so"* ]] || [[ $dep = *"libc.so"* ]] || [[ $dep = *"libstdc++.so"* ]]; then 30 | echo "Skipping $dep" 31 | else 32 | echo "Copying $dep to $2" 33 | cp "$dep" "$2" 34 | fi 35 | done 36 | 37 | # Dynamic deps 38 | cp "/usr/lib/x86_64-linux-gnu/nss/libsoftokn3.so" "$2" 39 | cp "/usr/lib/x86_64-linux-gnu/nss/libnssckbi.so" "$2" 40 | 41 | echo "Done!" 42 | -------------------------------------------------------------------------------- /src/common/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | namespace caspar { 28 | 29 | std::string to_base64(const char* data, size_t length); 30 | std::vector from_base64(const std::string& data); 31 | 32 | } // namespace caspar -------------------------------------------------------------------------------- /src/modules/bluefish/bluefish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace bluefish { 27 | 28 | std::wstring get_version(); 29 | void init(const core::module_dependencies& dependencies); 30 | 31 | }} // namespace caspar::bluefish 32 | -------------------------------------------------------------------------------- /src/modules/decklink/decklink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace decklink { 27 | 28 | std::wstring get_version(); 29 | void init(const core::module_dependencies& dependencies); 30 | 31 | }} // namespace caspar::decklink 32 | -------------------------------------------------------------------------------- /src/common/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { 27 | 28 | std::wstring u16(const std::string& str); 29 | std::wstring u16(const std::wstring& str); 30 | std::string u8(const std::wstring& str); 31 | std::string u8(const std::string& str); 32 | 33 | } // namespace caspar -------------------------------------------------------------------------------- /src/common/os/windows/thread.cpp: -------------------------------------------------------------------------------- 1 | #include "../thread.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include "../../utf.h" 8 | 9 | namespace caspar { 10 | 11 | typedef struct tagTHREADNAME_INFO 12 | { 13 | DWORD dwType; // must be 0x1000 14 | LPCSTR szName; // pointer to name (in user addr space) 15 | DWORD dwThreadID; // thread ID (-1=caller thread) 16 | DWORD dwFlags; // reserved for future use, must be zero 17 | } THREADNAME_INFO; 18 | 19 | inline void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) 20 | { 21 | THREADNAME_INFO info; 22 | { 23 | info.dwType = 0x1000; 24 | info.szName = szThreadName; 25 | info.dwThreadID = dwThreadID; 26 | info.dwFlags = 0; 27 | } 28 | __try { 29 | RaiseException(0x406D1388, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); 30 | } __except (EXCEPTION_CONTINUE_EXECUTION) { 31 | } 32 | } 33 | 34 | void set_thread_name(const std::wstring& name) { SetThreadName(GetCurrentThreadId(), u8(name).c_str()); } 35 | 36 | void set_thread_realtime_priority() { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); } 37 | 38 | } // namespace caspar 39 | -------------------------------------------------------------------------------- /tools/linux/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.io/buildpack-deps:noble AS build-casparcg 2 | ADD tools/linux/install-dependencies / 3 | 4 | RUN apt-get update && /install-dependencies 5 | 6 | RUN mkdir /source && mkdir /build && mkdir /install 7 | 8 | COPY ./src /source 9 | 10 | WORKDIR /build 11 | 12 | ARG CC 13 | ARG CXX 14 | ARG GIT_HASH 15 | 16 | RUN cmake -GNinja /source -DUSE_STATIC_BOOST=ON -DUSE_SYSTEM_CEF=OFF 17 | 18 | RUN cmake --build . 19 | 20 | RUN cmake --install . --prefix staging 21 | 22 | # Find a better way to copy deps 23 | RUN ln -s /build/staging /staging && \ 24 | /source/shell/copy_deps.sh /build/shell/casparcg /staging/lib 25 | 26 | FROM docker.io/ubuntu:noble 27 | COPY --from=build-casparcg /staging /opt/casparcg 28 | 29 | RUN set -ex; \ 30 | apt-get update; \ 31 | DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ 32 | tzdata \ 33 | libc++1 \ 34 | libnss3 \ 35 | fontconfig \ 36 | libglvnd0 \ 37 | libgl1 \ 38 | libglx0 \ 39 | libegl1 \ 40 | libgles2 \ 41 | ; \ 42 | rm -rf /var/lib/apt/lists/* 43 | 44 | WORKDIR /opt/casparcg 45 | RUN chmod 755 run.sh 46 | ADD tools/linux/run_docker.sh ./ 47 | CMD ["./run_docker.sh"] 48 | -------------------------------------------------------------------------------- /src/protocol/amcp/AMCPCommandsImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "amcp_command_context.h" 25 | #include "amcp_command_repository_wrapper.h" 26 | 27 | namespace caspar { namespace protocol { namespace amcp { 28 | 29 | void register_commands(std::shared_ptr& repo); 30 | 31 | }}} // namespace caspar::protocol::amcp 32 | -------------------------------------------------------------------------------- /src/modules/decklink/consumer/monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@superfly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "config.h" 25 | 26 | #include 27 | 28 | namespace caspar { namespace decklink { 29 | 30 | core::monitor::state get_state_for_config(const configuration& config, const core::video_format_desc& channel_format); 31 | 32 | }} // namespace caspar::decklink -------------------------------------------------------------------------------- /src/modules/ffmpeg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (ffmpeg) 3 | 4 | set(SOURCES 5 | producer/av_producer.cpp 6 | producer/av_producer.h 7 | producer/av_input.cpp 8 | producer/av_input.h 9 | producer/ffmpeg_producer.cpp 10 | producer/ffmpeg_producer.h 11 | consumer/ffmpeg_consumer.cpp 12 | consumer/ffmpeg_consumer.h 13 | 14 | util/av_util.cpp 15 | util/av_util.h 16 | util/audio_resampler.cpp 17 | util/audio_resampler.h 18 | util/av_assert.h 19 | 20 | ffmpeg.cpp 21 | ffmpeg.h 22 | StdAfx.h 23 | ) 24 | 25 | casparcg_add_module_project(ffmpeg 26 | SOURCES ${SOURCES} 27 | INIT_FUNCTION "ffmpeg::init" 28 | UNINIT_FUNCTION "ffmpeg::uninit" 29 | ) 30 | 31 | target_include_directories(ffmpeg PRIVATE 32 | ${FFMPEG_INCLUDE_PATH} 33 | ) 34 | target_precompile_headers(ffmpeg PRIVATE "StdAfx.h") 35 | 36 | set_target_properties(ffmpeg PROPERTIES FOLDER modules) 37 | source_group(sources ./*) 38 | source_group(sources\\consumer ./consumer/.*) 39 | source_group(sources\\producer ./producer/.*) 40 | source_group(sources\\util ./util/.*) 41 | 42 | if (MSVC) 43 | # target_link_libraries(ffmpeg 44 | # ) 45 | else() 46 | target_link_libraries(ffmpeg PRIVATE 47 | ${FFMPEG_LIBRARIES} 48 | ) 49 | endif() 50 | -------------------------------------------------------------------------------- /src/modules/html/html.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | namespace caspar::html { 31 | 32 | bool intercept_command_line(int argc, char** argv); 33 | void init(const core::module_dependencies& dependencies); 34 | void uninit(); 35 | 36 | } // namespace caspar::html 37 | -------------------------------------------------------------------------------- /src/common/os/filesystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | namespace caspar { 28 | 29 | std::optional find_case_insensitive(const std::wstring& case_insensitive); 30 | 31 | std::wstring clean_path(std::wstring path); 32 | 33 | std::wstring ensure_trailing_slash(std::wstring folder); 34 | 35 | } // namespace caspar 36 | -------------------------------------------------------------------------------- /src/modules/image/util/image_converter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@superfly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace caspar::image { 29 | 30 | bool is_frame_compatible_with_mixer(const std::shared_ptr& src); 31 | 32 | std::shared_ptr convert_image_frame(const std::shared_ptr& src, AVPixelFormat pixFmt); 33 | 34 | } // namespace caspar::image -------------------------------------------------------------------------------- /src/core/producer/separated/separated_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace core { 27 | 28 | spl::shared_ptr create_separated_producer(const spl::shared_ptr& fill, 29 | const spl::shared_ptr& key); 30 | 31 | }} // namespace caspar::core -------------------------------------------------------------------------------- /src/tools/bin2c.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char** argv) 7 | { 8 | if (argc != 4) { 9 | fprintf(stderr, "Usage: %s \"namespace\" \"constant_name\" \"input_filename\"\n", argv[0]); 10 | return -1; 11 | } 12 | char* fn = argv[3]; 13 | FILE* f = fopen(fn, "rb"); 14 | 15 | if (f == nullptr) { 16 | fprintf(stderr, "Error opening file: %s\n", strerror(errno)); 17 | return -1; 18 | } 19 | 20 | int count = 0; 21 | char* pch = strtok(argv[1], "::"); 22 | while (pch != nullptr) { 23 | printf("namespace %s {\n", pch); 24 | pch = strtok(nullptr, "::"); 25 | count++; 26 | } 27 | 28 | printf("const char %s[] = {\n", argv[2]); 29 | unsigned long n = 0; 30 | while (!feof(f)) { 31 | unsigned char c; 32 | if (fread(&c, 1, 1, f) == 0) 33 | break; 34 | if ('\r' == c) // ignore carriage return 35 | continue; 36 | printf("0x%.2X,", (int)c); 37 | ++n; 38 | if (n % 10 == 0) 39 | printf("\n"); 40 | } 41 | fclose(f); 42 | printf("0x00\n};\n"); 43 | 44 | for (int i = 0; i < count; i++) 45 | printf("}\n"); 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/ffmpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace caspar { namespace ffmpeg { 25 | 26 | void init(const core::module_dependencies& dependencies); 27 | void uninit(); 28 | std::shared_ptr temporary_enable_quiet_logging_for_thread(bool enable); 29 | void enable_quiet_logging_for_thread(); 30 | bool is_logging_quiet_for_thread(); 31 | 32 | }} // namespace caspar::ffmpeg 33 | -------------------------------------------------------------------------------- /src/modules/newtek/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #ifdef _DEBUG 23 | #include 24 | #endif 25 | 26 | #define NOMINMAX 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | #include 41 | #include 42 | 43 | #include 44 | -------------------------------------------------------------------------------- /tools/linux/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CMD="docker run --rm -it" 4 | 5 | # bind AMCP Ports 6 | CMD="$CMD -p 5250:5250" 7 | 8 | # passthrough config 9 | CMD="$CMD -v $PWD/casparcg.config:/opt/casparcg/casparcg.config:ro" 10 | 11 | # passthrough media folder 12 | CMD="$CMD -v $PWD/media:/opt/casparcg/media" 13 | 14 | ## DO NOT EDIT BELOW THIS LINE 15 | 16 | HAS_NVIDIA_RUNTIME=$(docker info | grep -i nvidia) 17 | if [ ! -z "$HAS_NVIDIA_RUNTIME" ]; then 18 | CMD="$CMD --runtime=nvidia" 19 | else 20 | # assume intel, so setup for that 21 | CMD="$CMD --device /dev/dri" 22 | fi 23 | 24 | DECKLINK_API_SO="/usr/lib/libDeckLinkAPI.so" 25 | if [ -f "$DECKLINK_API_SO" ]; then 26 | CMD="$CMD -v $DECKLINK_API_SO:$DECKLINK_API_SO:ro" 27 | 28 | for dev in /dev/blackmagic/*; do 29 | if [ -f "$dev" ]; then 30 | CMD="$CMD --device $dev" 31 | fi 32 | done 33 | fi 34 | 35 | if [ ! -z "$XAUTHORITY" ]; then 36 | CMD="$CMD -v $XAUTHORITY:/root/.Xauthority:ro" 37 | elif [ -f "$HOME/.Xauthority" ]; then 38 | CMD="$CMD -v $HOME/.Xauthority:/root/.Xauthority:ro" 39 | else 40 | echo "Failed to find Xauthority file" 41 | exit 9 42 | fi 43 | 44 | CMD="$CMD -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro" 45 | 46 | CMD="$CMD casparcg/server" 47 | 48 | echo "Executing command: $CMD" 49 | 50 | # Run it! 51 | $CMD 52 | -------------------------------------------------------------------------------- /src/modules/html/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@supergly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar::html { 29 | 30 | const std::string REMOVE_MESSAGE_NAME = "CasparCGRemove"; 31 | const std::string LOG_MESSAGE_NAME = "CasparCGLog"; 32 | 33 | void invoke(const std::function& func); 34 | std::future begin_invoke(const std::function& func); 35 | 36 | } // namespace caspar::html 37 | -------------------------------------------------------------------------------- /src/shell/platform_specific.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { 27 | 28 | void setup_prerequisites(); 29 | void setup_console_window(); 30 | void increase_process_priority(); 31 | void wait_for_keypress(); 32 | std::shared_ptr setup_debugging_environment(); 33 | void wait_for_remote_debugging(); 34 | 35 | } // namespace caspar 36 | -------------------------------------------------------------------------------- /src/modules/decklink/producer/decklink_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { namespace decklink { 30 | 31 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 32 | const std::vector& params); 33 | 34 | }} // namespace caspar::decklink 35 | -------------------------------------------------------------------------------- /src/modules/image/producer/image_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { namespace image { 30 | 31 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 32 | const std::vector& params); 33 | 34 | }} // namespace caspar::image -------------------------------------------------------------------------------- /src/modules/ffmpeg/producer/ffmpeg_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace caspar { namespace ffmpeg { 32 | 33 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 34 | const std::vector& params); 35 | 36 | }} // namespace caspar::ffmpeg 37 | -------------------------------------------------------------------------------- /src/modules/image/util/image_loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { namespace image { 32 | 33 | std::shared_ptr load_image(const std::wstring& filename); 34 | std::shared_ptr load_from_memory(std::vector image_data); 35 | 36 | bool is_valid_file(const boost::filesystem::path& filename); 37 | 38 | }} // namespace caspar::image 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yaml: -------------------------------------------------------------------------------- 1 | name: Bug report 🐛 2 | description: Use this if you've found a bug 3 | title: "Bug: [Short description of the bug]" 4 | labels: 5 | - type/bug 6 | 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Before you post, make sure to check for existing bug reports of the issue: 12 | https://github.com/CasparCG/server/issues?q=+is%3Aissue+label%3Atype%2Fbug 13 | 14 | - type: textarea 15 | attributes: 16 | label: Observed Behavior 17 | description: What happened? 18 | validations: 19 | required: true 20 | 21 | - type: textarea 22 | attributes: 23 | label: Expected behaviour 24 | description: What did you expect to happen? 25 | validations: 26 | required: true 27 | 28 | - type: textarea 29 | attributes: 30 | label: Steps to reproduce 31 | description: How can we reproduce the issue? 32 | value: | 33 | 1. 34 | 2. 35 | 3. ... 36 | validations: 37 | required: true 38 | 39 | - type: textarea 40 | attributes: 41 | label: Environment 42 | description: What version of CasparCG and OS are you using? 43 | value: | 44 | * Commit: [e.g. ab1234c] 45 | * Server version: [e.g. v2.2] 46 | * Operating system: [e.g. Windows 10] 47 | validations: 48 | required: true 49 | -------------------------------------------------------------------------------- /src/modules/image/producer/image_scroll_producer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | * Copyright (c) 2011 Sveriges Television AB 4 | * 5 | * This file is part of CasparCG (www.casparcg.com). 6 | * 7 | * CasparCG is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * CasparCG is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with CasparCG. If not, see . 19 | * 20 | * Author: Robert Nagy, ronag89@gmail.com 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | namespace caspar { namespace image { 31 | 32 | spl::shared_ptr create_scroll_producer(const core::frame_producer_dependencies& dependencies, 33 | const std::vector& params); 34 | 35 | }} // namespace caspar::image 36 | -------------------------------------------------------------------------------- /src/accelerator/ogl/image/image_shader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace accelerator { namespace ogl { 27 | 28 | class shader; 29 | class device; 30 | 31 | enum class texture_id 32 | { 33 | plane0 = 0, 34 | plane1, 35 | plane2, 36 | plane3, 37 | local_key, 38 | layer_key, 39 | background 40 | }; 41 | 42 | std::shared_ptr get_image_shader(const spl::shared_ptr& ogl); 43 | 44 | }}} // namespace caspar::accelerator::ogl 45 | -------------------------------------------------------------------------------- /src/modules/artnet/artnet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Eliyah Sundström eliyah@sundstroem.com 20 | */ 21 | 22 | #include "artnet.h" 23 | 24 | #define WIN32_LEAN_AND_MEAN 25 | 26 | #include "consumer/artnet_consumer.h" 27 | 28 | #include 29 | 30 | #include 31 | 32 | namespace caspar { namespace artnet { 33 | 34 | void init(const core::module_dependencies& dependencies) 35 | { 36 | dependencies.consumer_registry->register_preconfigured_consumer_factory(L"artnet", create_preconfigured_consumer); 37 | } 38 | 39 | }} // namespace caspar::artnet 40 | -------------------------------------------------------------------------------- /src/protocol/util/ProtocolStrategy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "ClientInfo.h" 25 | #include 26 | 27 | namespace caspar { namespace IO { 28 | 29 | class IProtocolStrategy 30 | { 31 | public: 32 | virtual ~IProtocolStrategy() {} 33 | 34 | virtual void Parse(const std::wstring& msg, ClientInfoPtr pClientInfo) = 0; 35 | virtual std::string GetCodepage() const = 0; 36 | }; 37 | using ProtocolStrategyPtr = std::shared_ptr; 38 | 39 | }} // namespace caspar::IO 40 | -------------------------------------------------------------------------------- /src/modules/screen/screen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #include "screen.h" 23 | 24 | #include "consumer/screen_consumer.h" 25 | 26 | #include 27 | 28 | namespace caspar { namespace screen { 29 | 30 | void init(const core::module_dependencies& dependencies) 31 | { 32 | dependencies.consumer_registry->register_consumer_factory(L"Screen Consumer", create_consumer); 33 | dependencies.consumer_registry->register_preconfigured_consumer_factory(L"screen", create_preconfigured_consumer); 34 | } 35 | 36 | }} // namespace caspar::screen 37 | -------------------------------------------------------------------------------- /src/modules/newtek/producer/newtek_ndi_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Krzysztof Zegzula, zegzulakrzysztof@gmail.com 20 | * based on work of Robert Nagy, ronag89@gmail.com 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | 33 | namespace caspar { namespace newtek { 34 | 35 | spl::shared_ptr create_ndi_producer(const core::frame_producer_dependencies& dependencies, 36 | const std::vector& params); 37 | 38 | }} // namespace caspar::newtek 39 | -------------------------------------------------------------------------------- /src/accelerator/StdAfx.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | -------------------------------------------------------------------------------- /src/common/prec_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { 27 | 28 | class prec_timer 29 | { 30 | public: 31 | prec_timer(); 32 | 33 | void tick(double interval) { tick_nanos(static_cast(interval * 1000000000.0)); } 34 | 35 | void tick_millis(int64_t interval) { tick_nanos(interval * 1000000); } 36 | 37 | // Author: Ryan M. Geiss 38 | // http://www.geisswerks.com/ryan/FAQS/timing.html 39 | void tick_nanos(int64_t interval); 40 | 41 | private: 42 | int64_t time_; 43 | }; 44 | 45 | } // namespace caspar 46 | -------------------------------------------------------------------------------- /src/core/consumer/channel_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@superfly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../frame/pixel_format.h" 25 | #include "common/bit_depth.h" 26 | 27 | namespace caspar::core { 28 | 29 | struct channel_info 30 | { 31 | channel_info(int channel_index, common::bit_depth depth, color_space color_space) 32 | : index(channel_index) 33 | , depth(depth) 34 | , default_color_space(color_space) 35 | { 36 | } 37 | 38 | int index; 39 | common::bit_depth depth; 40 | color_space default_color_space; 41 | }; 42 | 43 | } // namespace caspar::core 44 | -------------------------------------------------------------------------------- /src/modules/bluefish/producer/bluefish_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | * satchit puthenveetil 21 | * James Wise, james.wise@bluefish444.com 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace caspar { namespace bluefish { 32 | 33 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 34 | const std::vector& params); 35 | 36 | }} // namespace caspar::bluefish 37 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/util/audio_resampler.cpp: -------------------------------------------------------------------------------- 1 | #include "audio_resampler.h" 2 | #include "av_assert.h" 3 | 4 | extern "C" { 5 | #include 6 | #include 7 | } 8 | 9 | namespace caspar::ffmpeg { 10 | 11 | AudioResampler::AudioResampler(int sample_rate, AVSampleFormat in_sample_fmt) 12 | { 13 | AVChannelLayout channel_layout = AV_CHANNEL_LAYOUT_7POINT1; 14 | AVChannelLayout channel_layout_out = AV_CHANNEL_LAYOUT_HEXADECAGONAL; 15 | 16 | SwrContext* raw_ctx = nullptr; 17 | FF(swr_alloc_set_opts2(&raw_ctx, 18 | &channel_layout_out, 19 | AV_SAMPLE_FMT_S32, 20 | sample_rate, 21 | &channel_layout, 22 | in_sample_fmt, 23 | sample_rate, 24 | 0, 25 | nullptr)); 26 | 27 | ctx = std::shared_ptr(raw_ctx, [](SwrContext* ptr) { swr_free(&ptr); }); 28 | 29 | FF_RET(swr_init(ctx.get()), "swr_init"); 30 | } 31 | 32 | caspar::array AudioResampler::convert(int frames, const void** src) 33 | { 34 | auto result = caspar::array(frames * 16 * sizeof(int32_t)); 35 | auto ptr = result.data(); 36 | swr_convert(ctx.get(), (uint8_t**)&ptr, frames, reinterpret_cast(src), frames); 37 | 38 | return result; 39 | } 40 | 41 | }; // namespace caspar::ffmpeg 42 | -------------------------------------------------------------------------------- /tools/windows/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set BUILD_ARCHIVE_NAME=casparcg_server 4 | set BUILD_VCVARSALL=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat 5 | set BUILD_7ZIP=C:\Program Files\7-Zip\7z.exe 6 | 7 | @REM Github Actions has Enterprise available 8 | if DEFINED CI set BUILD_VCVARSALL=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat 9 | 10 | :: Clean and enter shadow build folder 11 | echo Cleaning... 12 | if exist dist rmdir dist /s /q || goto :error 13 | mkdir dist || goto :error 14 | 15 | :: Setup VC++ environment 16 | echo Setting up VC++... 17 | call "%BUILD_VCVARSALL%" amd64 || goto :error 18 | 19 | :: Run cmake 20 | cd dist || goto :error 21 | cmake -G "Visual Studio 17 2022" -A x64 ..\src || goto :error 22 | 23 | :: Build with MSBuild 24 | echo Building... 25 | msbuild "CasparCG Server.sln" /t:Clean /p:Configuration=Release || goto :error 26 | msbuild "CasparCG Server.sln" /p:Configuration=Release /m:%NUMBER_OF_PROCESSORS% || goto :error 27 | 28 | :: Create server folder to later zip 29 | set SERVER_FOLDER=casparcg_server 30 | call ..\tools\windows\package.bat .. 31 | 32 | :: Create zip file 33 | echo Creating zip... 34 | if exist "%BUILD_ARCHIVE_NAME%.zip" unlink "%BUILD_ARCHIVE_NAME%.zip" || goto :error 35 | "%BUILD_7ZIP%" a "%BUILD_ARCHIVE_NAME%.zip" ".\%SERVER_FOLDER%\*" || goto :error 36 | 37 | :: Skip exiting with failure 38 | goto :EOF 39 | 40 | :error 41 | exit /b %errorlevel% 42 | -------------------------------------------------------------------------------- /src/modules/newtek/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (newtek) 3 | 4 | set(SOURCES 5 | consumer/newtek_ndi_consumer.cpp 6 | consumer/newtek_ndi_consumer.h 7 | 8 | producer/newtek_ndi_producer.cpp 9 | producer/newtek_ndi_producer.h 10 | 11 | util/ndi.cpp 12 | util/ndi.h 13 | 14 | newtek.cpp 15 | newtek.h 16 | 17 | interop/Processing.NDI.compat.h 18 | interop/Processing.NDI.deprecated.h 19 | interop/Processing.NDI.DynamicLoad.h 20 | interop/Processing.NDI.Find.h 21 | interop/Processing.NDI.FrameSync.h 22 | interop/Processing.NDI.Lib.cplusplus.h 23 | interop/Processing.NDI.Lib.h 24 | interop/Processing.NDI.Recv.ex.h 25 | interop/Processing.NDI.Recv.h 26 | interop/Processing.NDI.Routing.h 27 | interop/Processing.NDI.Send.h 28 | interop/Processing.NDI.structs.h 29 | interop/Processing.NDI.utilities.h 30 | 31 | StdAfx.h 32 | ) 33 | 34 | casparcg_add_module_project(newtek 35 | SOURCES ${SOURCES} 36 | INIT_FUNCTION "newtek::init" 37 | ) 38 | target_include_directories(newtek PRIVATE 39 | .. 40 | ${FFMPEG_INCLUDE_PATH} 41 | ) 42 | target_precompile_headers(newtek PRIVATE "StdAfx.h") 43 | 44 | set_target_properties(newtek PROPERTIES FOLDER modules) 45 | source_group(sources\\consumer consumer/*) 46 | source_group(sources\\producer producer/*) 47 | source_group(sources\\interop interop/*) 48 | source_group(sources\\util util/*) 49 | source_group(sources ./*) 50 | 51 | target_link_libraries(newtek PRIVATE ffmpeg) 52 | -------------------------------------------------------------------------------- /src/modules/oal/oal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #include "oal.h" 23 | 24 | #include "consumer/oal_consumer.h" 25 | 26 | #include 27 | 28 | namespace caspar { namespace oal { 29 | 30 | void init(const core::module_dependencies& dependencies) 31 | { 32 | dependencies.consumer_registry->register_consumer_factory(L"System Audio Consumer", create_consumer); 33 | dependencies.consumer_registry->register_preconfigured_consumer_factory(L"system-audio", 34 | create_preconfigured_consumer); 35 | } 36 | 37 | }} // namespace caspar::oal 38 | -------------------------------------------------------------------------------- /src/CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "" 13 | }, 14 | { 15 | "name": "x64-Release", 16 | "generator": "Ninja", 17 | "configurationType": "Release", 18 | "buildRoot": "${projectDir}\\out\\build\\${name}", 19 | "installRoot": "${projectDir}\\out\\install\\${name}", 20 | "cmakeCommandArgs": "", 21 | "buildCommandArgs": "", 22 | "ctestCommandArgs": "", 23 | "inheritEnvironments": [ "msvc_x64_x64" ] 24 | }, 25 | { 26 | "name": "x64-RelWithDebInfo", 27 | "generator": "Ninja", 28 | "configurationType": "RelWithDebInfo", 29 | "buildRoot": "${projectDir}\\out\\build\\${name}", 30 | "installRoot": "${projectDir}\\out\\install\\${name}", 31 | "cmakeCommandArgs": "", 32 | "buildCommandArgs": "", 33 | "ctestCommandArgs": "", 34 | "inheritEnvironments": [ "msvc_x64_x64" ], 35 | "variables": [] 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /src/common/utf.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | #include "utf.h" 22 | 23 | #pragma warning(push, 1) 24 | 25 | #include 26 | 27 | namespace caspar { 28 | 29 | std::wstring u16(const std::string& str) 30 | { 31 | return boost::locale::conv::utf_to_utf(str); // std::wstring(str.begin(), str.end()); 32 | } 33 | 34 | std::wstring u16(const std::wstring& str) { return str; } 35 | 36 | std::string u8(const std::wstring& str) 37 | { 38 | return boost::locale::conv::utf_to_utf(str); // std::string(str.begin(), str.end()); 39 | } 40 | 41 | std::string u8(const std::string& str) { return str; } 42 | 43 | } // namespace caspar 44 | -------------------------------------------------------------------------------- /src/common/env.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace caspar { namespace env { 29 | 30 | void configure(const std::wstring& filename); 31 | 32 | const std::wstring& initial_folder(); 33 | const std::wstring& media_folder(); 34 | const std::wstring& log_folder(); 35 | const std::wstring& template_folder(); 36 | const std::wstring& data_folder(); 37 | const std::wstring& version(); 38 | 39 | bool log_to_file(); 40 | 41 | const boost::property_tree::wptree& properties(); 42 | 43 | void log_configuration_warnings(); 44 | 45 | }} // namespace caspar::env 46 | -------------------------------------------------------------------------------- /src/core/frame/frame_visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace caspar { namespace core { 25 | 26 | class frame_visitor 27 | { 28 | public: 29 | frame_visitor() = default; 30 | frame_visitor(const frame_visitor&) = delete; 31 | virtual ~frame_visitor() = default; 32 | 33 | frame_visitor& operator=(const frame_visitor&) = delete; 34 | 35 | virtual void push(const struct frame_transform& transform) = 0; 36 | virtual void visit(const class const_frame& frame) = 0; 37 | virtual void pop() = 0; 38 | }; 39 | 40 | }} // namespace caspar::core -------------------------------------------------------------------------------- /src/common/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { 27 | 28 | class timer 29 | { 30 | std::int_least64_t start_time_; 31 | 32 | public: 33 | timer() { start_time_ = now(); } 34 | 35 | void restart() { start_time_ = now(); } 36 | 37 | double elapsed() const { return static_cast(now() - start_time_) / 1000.0; } 38 | 39 | private: 40 | static std::int_least64_t now() 41 | { 42 | using namespace std::chrono; 43 | 44 | return duration_cast(high_resolution_clock::now().time_since_epoch()).count(); 45 | } 46 | }; 47 | 48 | } // namespace caspar 49 | -------------------------------------------------------------------------------- /src/protocol/amcp/AMCPProtocolStrategy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../util/ClientInfo.h" 25 | 26 | #include 27 | 28 | #include "amcp_command_repository.h" 29 | 30 | #include 31 | 32 | namespace caspar { namespace protocol { namespace amcp { 33 | 34 | IO::protocol_strategy_factory::ptr 35 | create_char_amcp_strategy_factory(const std::wstring& name, const spl::shared_ptr& repo); 36 | 37 | IO::protocol_strategy_factory::ptr 38 | create_wchar_amcp_strategy_factory(const std::wstring& name, const spl::shared_ptr& repo); 39 | 40 | }}} // namespace caspar::protocol::amcp 41 | -------------------------------------------------------------------------------- /src/core/diagnostics/call_context.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #include "../StdAfx.h" 23 | 24 | #include "call_context.h" 25 | 26 | namespace caspar { namespace core { namespace diagnostics { 27 | 28 | thread_local call_context context; 29 | 30 | call_context& call_context::for_thread() { return context; } 31 | 32 | std::wstring call_context::to_string() const 33 | { 34 | if (video_channel == -1) 35 | return L"[]"; 36 | if (layer == -1) 37 | return L"[ch=" + std::to_wstring(video_channel) + L"]"; 38 | return L"[ch=" + std::to_wstring(video_channel) + L"; layer=" + std::to_wstring(layer) + L"]"; 39 | } 40 | 41 | }}} // namespace caspar::core::diagnostics 42 | -------------------------------------------------------------------------------- /src/modules/bluefish/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #if defined _DEBUG && defined _MSC_VER 23 | #include 24 | #endif 25 | 26 | #define NOMINMAX 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | // #include 45 | #include 46 | 47 | #include 48 | #include 49 | -------------------------------------------------------------------------------- /src/modules/newtek/util/ndi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Krzysztof Zegzula, zegzulakrzysztof@gmail.com 20 | */ 21 | #pragma once 22 | 23 | #include "../interop/Processing.NDI.Lib.h" 24 | #include "protocol/amcp/amcp_command_context.h" 25 | #include 26 | 27 | namespace caspar { namespace newtek { namespace ndi { 28 | 29 | const std::wstring& dll_name(); 30 | NDIlib_v5* load_library(); 31 | std::map get_current_sources(); 32 | void not_initialized(); 33 | void not_installed(); 34 | 35 | std::wstring list_command(protocol::amcp::command_context& ctx); 36 | 37 | }}} // namespace caspar::newtek::ndi 38 | -------------------------------------------------------------------------------- /src/modules/image/image.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #include "image.h" 23 | 24 | #include "consumer/image_consumer.h" 25 | #include "producer/image_producer.h" 26 | #include "producer/image_scroll_producer.h" 27 | 28 | #include 29 | 30 | namespace caspar { namespace image { 31 | 32 | void init(const core::module_dependencies& dependencies) 33 | { 34 | dependencies.producer_registry->register_producer_factory(L"Image Scroll Producer", create_scroll_producer); 35 | dependencies.producer_registry->register_producer_factory(L"Image Producer", create_producer); 36 | dependencies.consumer_registry->register_consumer_factory(L"Image Consumer", create_consumer); 37 | } 38 | 39 | }} // namespace caspar::image 40 | -------------------------------------------------------------------------------- /src/shell/server.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { 30 | 31 | class server final 32 | { 33 | public: 34 | explicit server(std::function shutdown_server_now); 35 | void start(); 36 | spl::shared_ptr get_amcp_command_repository() const; 37 | 38 | private: 39 | struct impl; 40 | std::shared_ptr impl_; 41 | 42 | server(const server&) = delete; 43 | server& operator=(const server&) = delete; 44 | }; 45 | 46 | } // namespace caspar 47 | -------------------------------------------------------------------------------- /src/modules/html/producer/html_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace caspar { namespace html { 32 | 33 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 34 | const std::vector& params); 35 | spl::shared_ptr create_cg_producer(const core::frame_producer_dependencies& dependencies, 36 | const std::vector& params); 37 | 38 | }} // namespace caspar::html 39 | -------------------------------------------------------------------------------- /src/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (common) 3 | 4 | set(SOURCES 5 | diagnostics/graph.cpp 6 | 7 | gl/gl_check.cpp 8 | 9 | base64.cpp 10 | env.cpp 11 | filesystem.cpp 12 | log.cpp 13 | tweener.cpp 14 | utf.cpp 15 | ) 16 | if (MSVC) 17 | list(APPEND SOURCES 18 | compiler/vs/disable_silly_warnings.h 19 | 20 | os/windows/filesystem.cpp 21 | os/windows/prec_timer.cpp 22 | os/windows/thread.cpp 23 | os/windows/windows.h 24 | ) 25 | else () 26 | list(APPEND SOURCES 27 | os/linux/filesystem.cpp 28 | os/linux/prec_timer.cpp 29 | os/linux/thread.cpp 30 | ) 31 | endif () 32 | set(HEADERS 33 | diagnostics/graph.h 34 | 35 | gl/gl_check.h 36 | 37 | os/filesystem.h 38 | os/thread.h 39 | 40 | array.h 41 | assert.h 42 | base64.h 43 | endian.h 44 | enum_class.h 45 | env.h 46 | executor.h 47 | except.h 48 | filesystem.h 49 | future.h 50 | log.h 51 | memory.h 52 | memshfl.h 53 | param.h 54 | prec_timer.h 55 | ptree.h 56 | scope_exit.h 57 | stdafx.h 58 | timer.h 59 | tweener.h 60 | utf.h 61 | ) 62 | 63 | casparcg_add_library(common SOURCES ${SOURCES} ${HEADERS}) 64 | target_include_directories(common PRIVATE ..) 65 | target_precompile_headers(common PRIVATE stdafx.h) 66 | target_link_libraries(common PRIVATE GLEW::glew) 67 | 68 | source_group(sources ./*) 69 | source_group(sources\\gl gl/*) 70 | source_group(sources\\diagnostics diagnostics/*) 71 | source_group(sources\\compiler\\vs compiler/vs/*) 72 | source_group(sources\\os\\windows os/windows/*) 73 | source_group(sources\\os os/*) 74 | -------------------------------------------------------------------------------- /src/accelerator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (accelerator) 3 | 4 | set(SOURCES 5 | ogl/image/image_kernel.cpp 6 | ogl/image/image_mixer.cpp 7 | ogl/image/image_shader.cpp 8 | 9 | ogl/util/buffer.cpp 10 | ogl/util/context.cpp 11 | ogl/util/device.cpp 12 | ogl/util/shader.cpp 13 | ogl/util/texture.cpp 14 | ogl/util/matrix.cpp 15 | ogl/util/transforms.cpp 16 | 17 | accelerator.cpp 18 | ) 19 | set(HEADERS 20 | ogl/image/image_kernel.h 21 | ogl/image/image_mixer.h 22 | ogl/image/image_shader.h 23 | 24 | ogl/util/buffer.h 25 | ogl/util/context.h 26 | ogl/util/device.h 27 | ogl/util/shader.h 28 | ogl/util/texture.h 29 | ogl/util/matrix.h 30 | ogl/util/transforms.h 31 | 32 | ogl_image_vertex.h 33 | ogl_image_fragment.h 34 | 35 | accelerator.h 36 | StdAfx.h 37 | ) 38 | 39 | bin2c("ogl/image/shader.vert" "ogl_image_vertex.h" "caspar::accelerator::ogl" "vertex_shader") 40 | bin2c("ogl/image/shader.frag" "ogl_image_fragment.h" "caspar::accelerator::ogl" "fragment_shader") 41 | 42 | casparcg_add_library(accelerator SOURCES ${SOURCES} ${HEADERS}) 43 | target_include_directories(accelerator PRIVATE .. ${CMAKE_CURRENT_BINARY_DIR}) 44 | target_precompile_headers(accelerator PRIVATE StdAfx.h) 45 | target_link_libraries(accelerator PRIVATE common core GLEW::glew) 46 | target_link_libraries(accelerator PRIVATE sfml-window) 47 | 48 | source_group(sources ./.*) 49 | source_group(sources\\cpu\\image cpu/image/.*) 50 | source_group(sources\\cpu\\util cpu/util/.*) 51 | source_group(sources\\ogl\\image ogl/image/.*) 52 | source_group(sources\\ogl\\util ogl/util/.*) 53 | -------------------------------------------------------------------------------- /src/core/producer/route/route_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { namespace core { 30 | 31 | class route_control 32 | { 33 | public: 34 | virtual ~route_control() {} 35 | 36 | virtual int get_source_channel() const = 0; 37 | virtual int get_source_layer() const = 0; 38 | 39 | virtual void set_cross_channel(bool cross) = 0; 40 | }; 41 | 42 | spl::shared_ptr create_route_producer(const core::frame_producer_dependencies& dependencies, 43 | const std::vector& params); 44 | 45 | }} // namespace caspar::core 46 | -------------------------------------------------------------------------------- /src/core/frame/frame_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace core { 27 | 28 | class frame_factory 29 | { 30 | public: 31 | frame_factory() = default; 32 | frame_factory& operator=(const frame_factory&) = delete; 33 | virtual ~frame_factory() = default; 34 | 35 | frame_factory(const frame_factory&) = delete; 36 | 37 | virtual class mutable_frame create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc) = 0; 38 | virtual class mutable_frame 39 | create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc, common::bit_depth depth) = 0; 40 | }; 41 | 42 | }} // namespace caspar::core 43 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/producer/av_input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include 18 | 19 | struct AVPacket; 20 | struct AVFormatContext; 21 | 22 | namespace caspar { namespace ffmpeg { 23 | 24 | class Input 25 | { 26 | public: 27 | Input(const std::string& filename, std::shared_ptr graph, std::optional seekable); 28 | ~Input(); 29 | 30 | static int interrupt_cb(void* ctx); 31 | 32 | bool try_pop(std::shared_ptr& packet); 33 | 34 | AVFormatContext* operator->(); 35 | 36 | AVFormatContext* const operator->() const; 37 | 38 | void reset(); 39 | void abort(); 40 | bool eof() const; 41 | void seek(int64_t ts, bool flush = true); 42 | 43 | private: 44 | void internal_reset(); 45 | 46 | std::optional seekable_; 47 | 48 | std::string filename_; 49 | std::shared_ptr graph_; 50 | 51 | mutable std::mutex ic_mutex_; 52 | std::shared_ptr ic_; 53 | std::condition_variable ic_cond_; 54 | 55 | tbb::concurrent_bounded_queue> buffer_; 56 | 57 | std::atomic eof_{false}; 58 | 59 | std::atomic abort_request_{false}; 60 | boost::thread thread_; 61 | }; 62 | 63 | }} // namespace caspar::ffmpeg 64 | -------------------------------------------------------------------------------- /src/modules/flash/producer/flash_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace caspar { namespace flash { 32 | 33 | spl::shared_ptr create_producer(const core::frame_producer_dependencies& dependencies, 34 | const std::vector& params); 35 | spl::shared_ptr create_swf_producer(const core::frame_producer_dependencies& dependencies, 36 | const std::vector& params); 37 | 38 | std::wstring find_template(const std::wstring& templateName); 39 | 40 | }} // namespace caspar::flash -------------------------------------------------------------------------------- /src/common/os/windows/filesystem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #include "../../stdafx.h" 23 | 24 | #include "../filesystem.h" 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { 30 | 31 | std::optional find_case_insensitive(const std::wstring& case_insensitive) 32 | { 33 | if (boost::filesystem::exists(case_insensitive)) 34 | return case_insensitive; 35 | 36 | return {}; 37 | } 38 | 39 | std::wstring clean_path(std::wstring path) { return path; } 40 | 41 | std::wstring ensure_trailing_slash(std::wstring folder) 42 | { 43 | auto last_char = folder.at(folder.length() - 1); 44 | if (last_char != L'/' && last_char != L'\\') 45 | folder.append(L"/"); 46 | 47 | return folder; 48 | } 49 | 50 | } // namespace caspar 51 | -------------------------------------------------------------------------------- /src/core/fwd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | #pragma once 22 | 23 | namespace caspar::accelerator { 24 | class accelerator; 25 | } 26 | namespace caspar::accelerator::ogl { 27 | class device; 28 | } 29 | 30 | namespace caspar::core { 31 | class stage; 32 | class mixer; 33 | class output; 34 | class image_mixer; 35 | struct video_format_desc; 36 | class frame_factory; 37 | class frame_producer; 38 | class frame_consumer; 39 | class draw_frame; 40 | class mutable_frame; 41 | class const_frame; 42 | class video_channel; 43 | struct pixel_format_desc; 44 | struct frame_transform; 45 | struct frame_producer_dependencies; 46 | struct module_dependencies; 47 | class cg_producer_registry; 48 | class frame_producer_registry; 49 | class frame_consumer_registry; 50 | class video_format_repository; 51 | struct channel_info; 52 | } // namespace caspar::core 53 | -------------------------------------------------------------------------------- /src/modules/image/consumer/image_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | namespace caspar { namespace image { 34 | 35 | spl::shared_ptr create_consumer(const std::vector& params, 36 | const core::video_format_repository& format_repository, 37 | const std::vector>& channels, 38 | const core::channel_info& channel_info); 39 | 40 | }} // namespace caspar::image 41 | -------------------------------------------------------------------------------- /src/core/diagnostics/call_context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace core { namespace diagnostics { 27 | 28 | struct call_context 29 | { 30 | int video_channel = -1; 31 | int layer = -1; 32 | 33 | static call_context& for_thread(); 34 | std::wstring to_string() const; 35 | }; 36 | 37 | class scoped_call_context 38 | { 39 | call_context saved_; 40 | 41 | scoped_call_context(const scoped_call_context&) = delete; 42 | scoped_call_context& operator=(const scoped_call_context&) = delete; 43 | 44 | public: 45 | scoped_call_context() { saved_ = call_context::for_thread(); } 46 | ~scoped_call_context() { call_context::for_thread() = saved_; } 47 | }; 48 | 49 | }}} // namespace caspar::core::diagnostics 50 | -------------------------------------------------------------------------------- /src/accelerator/ogl/util/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | namespace caspar { namespace accelerator { namespace ogl { 28 | 29 | class buffer final 30 | { 31 | public: 32 | static boost::property_tree::wptree info(); 33 | 34 | buffer(int size, bool write); 35 | buffer(const buffer&) = delete; 36 | buffer(buffer&& other); 37 | ~buffer(); 38 | 39 | buffer& operator=(const buffer&) = delete; 40 | buffer& operator=(buffer&& other); 41 | 42 | void bind(); 43 | void unbind(); 44 | 45 | int id() const; 46 | void* data(); 47 | int size() const; 48 | bool write() const; 49 | 50 | private: 51 | struct impl; 52 | std::unique_ptr impl_; 53 | }; 54 | 55 | }}} // namespace caspar::accelerator::ogl 56 | -------------------------------------------------------------------------------- /src/modules/artnet/consumer/artnet_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Eliyah Sundström eliyah@sundstroem.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../util/fixture_calculation.h" 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | namespace caspar { namespace artnet { 35 | 36 | spl::shared_ptr 37 | create_preconfigured_consumer(const boost::property_tree::wptree& ptree, 38 | const core::video_format_repository& format_repository, 39 | const std::vector>& channels, 40 | const core::channel_info& channel_info); 41 | }} // namespace caspar::artnet 42 | -------------------------------------------------------------------------------- /src/protocol/amcp/AMCPCommandQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "AMCPCommand.h" 25 | 26 | #include 27 | #include 28 | 29 | namespace caspar { namespace protocol { namespace amcp { 30 | 31 | class AMCPCommandQueue 32 | { 33 | public: 34 | using ptr_type = spl::shared_ptr; 35 | 36 | AMCPCommandQueue(const std::wstring& name, const spl::shared_ptr>& channels); 37 | ~AMCPCommandQueue(); 38 | 39 | void AddCommand(std::shared_ptr command); 40 | void Execute(std::shared_ptr cmd) const; 41 | 42 | private: 43 | executor executor_; 44 | const spl::shared_ptr> channels_; 45 | }; 46 | 47 | }}} // namespace caspar::protocol::amcp 48 | -------------------------------------------------------------------------------- /src/modules/flash/util/swf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar { namespace flash { 29 | 30 | struct swf_t 31 | { 32 | struct header_t 33 | { 34 | header_t(const std::wstring& filename); 35 | 36 | std::array signature; 37 | std::uint8_t version; 38 | std::uint32_t file_length; 39 | std::uint32_t frame_width; 40 | std::uint32_t frame_height; 41 | std::uint16_t frame_rate; 42 | std::uint16_t frame_count; 43 | 44 | bool valid; 45 | 46 | } header; 47 | 48 | std::vector data; 49 | 50 | swf_t(const std::wstring& filename); 51 | }; 52 | 53 | }} // namespace caspar::flash 54 | -------------------------------------------------------------------------------- /src/common/filesystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace caspar { 29 | 30 | std::optional 31 | find_file_within_dir_or_absolute(const std::wstring& parent_dir, 32 | const std::wstring& filename, 33 | const std::function& is_valid_file); 34 | 35 | boost::filesystem::path get_relative(const boost::filesystem::path& file, const boost::filesystem::path& relative_to); 36 | boost::filesystem::path get_relative_without_extension(const boost::filesystem::path& file, 37 | const boost::filesystem::path& relative_to); 38 | 39 | } // namespace caspar 40 | -------------------------------------------------------------------------------- /src/core/producer/transition/sting_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Norsk rikskringkasting AS 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@superfly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../../fwd.h" 25 | #include "../../video_format.h" 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { namespace core { 32 | 33 | struct sting_info 34 | { 35 | std::wstring mask_filename = L""; 36 | std::wstring overlay_filename = L""; 37 | uint32_t trigger_point = 0; 38 | uint32_t audio_fade_start = 0; 39 | uint32_t audio_fade_duration = UINT32_MAX; 40 | }; 41 | 42 | spl::shared_ptr create_sting_producer(const frame_producer_dependencies& dependencies, 43 | const spl::shared_ptr& destination, 44 | sting_info& info); 45 | 46 | }} // namespace caspar::core 47 | -------------------------------------------------------------------------------- /src/protocol/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #define NOMINMAX 23 | #define WIN32_LEAN_AND_MEAN 24 | 25 | #if defined(_MSC_VER) 26 | #ifndef _SCL_SECURE_NO_WARNINGS 27 | #define _SCL_SECURE_NO_WARNINGS 28 | #endif 29 | #ifndef _CRT_SECURE_NO_WARNINGS 30 | #define _CRT_SECURE_NO_WARNINGS 31 | #endif 32 | #endif 33 | 34 | #if defined _DEBUG && defined _MSC_VER 35 | #include 36 | #endif 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | #include 51 | #include 52 | #include 53 | 54 | #include 55 | #include 56 | 57 | #include 58 | #include 59 | 60 | #include 61 | -------------------------------------------------------------------------------- /src/core/mixer/image/blend_modes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace caspar { namespace core { 27 | 28 | enum class blend_mode 29 | { 30 | normal = 0, 31 | lighten, 32 | darken, 33 | multiply, 34 | average, 35 | add, 36 | subtract, 37 | difference, 38 | negation, 39 | exclusion, 40 | screen, 41 | overlay, 42 | soft_light, 43 | hard_light, 44 | color_dodge, 45 | color_burn, 46 | linear_dodge, 47 | linear_burn, 48 | linear_light, 49 | vivid_light, 50 | pin_light, 51 | hard_mix, 52 | reflect, 53 | glow, 54 | phoenix, 55 | contrast, 56 | saturation, 57 | color, 58 | luminosity, 59 | mix, 60 | blend_mode_count 61 | }; 62 | 63 | blend_mode get_blend_mode(const std::wstring& str); 64 | std::wstring get_blend_mode(blend_mode mode); 65 | 66 | }} // namespace caspar::core -------------------------------------------------------------------------------- /src/modules/flash/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #ifdef __cplusplus 23 | #define NOMINMAX 24 | #define WIN32_LEAN_AND_MEAN 25 | 26 | #include 27 | 28 | #if defined _DEBUG && defined _MSC_VER 29 | #include 30 | #endif 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #include 53 | #include 54 | 55 | #include 56 | #include 57 | #endif 58 | #include 59 | #include 60 | -------------------------------------------------------------------------------- /src/accelerator/accelerator.cpp: -------------------------------------------------------------------------------- 1 | #include "accelerator.h" 2 | 3 | #include "ogl/image/image_mixer.h" 4 | #include "ogl/util/device.h" 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace caspar { namespace accelerator { 17 | 18 | struct accelerator::impl 19 | { 20 | std::shared_ptr ogl_device_; 21 | const core::video_format_repository format_repository_; 22 | 23 | impl(const core::video_format_repository format_repository) 24 | : format_repository_(format_repository) 25 | { 26 | } 27 | 28 | std::unique_ptr create_image_mixer(int channel_id, common::bit_depth depth) 29 | { 30 | return std::make_unique( 31 | spl::make_shared_ptr(get_device()), channel_id, format_repository_.get_max_video_format_size(), depth); 32 | } 33 | 34 | std::shared_ptr get_device() 35 | { 36 | if (!ogl_device_) { 37 | ogl_device_ = std::make_shared(); 38 | } 39 | 40 | return ogl_device_; 41 | } 42 | }; 43 | 44 | accelerator::accelerator(const core::video_format_repository format_repository) 45 | : impl_(std::make_unique(format_repository)) 46 | { 47 | } 48 | 49 | accelerator::~accelerator() {} 50 | 51 | std::unique_ptr accelerator::create_image_mixer(const int channel_id, common::bit_depth depth) 52 | { 53 | return impl_->create_image_mixer(channel_id, depth); 54 | } 55 | 56 | std::shared_ptr accelerator::get_device() const 57 | { 58 | return std::dynamic_pointer_cast(impl_->get_device()); 59 | } 60 | 61 | }} // namespace caspar::accelerator 62 | -------------------------------------------------------------------------------- /src/protocol/osc/oscpack/OscTypes.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | oscpack -- Open Sound Control packet manipulation library 3 | http://www.audiomulch.com/~rossb/oscpack 4 | 5 | Copyright (c) 2004-2005 Ross Bencina 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | Any person wishing to distribute modifications to the Software is 19 | requested to send the modifications to the original developer so that 20 | they can be incorporated into the canonical version. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 26 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 27 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | #include "OscTypes.h" 31 | 32 | namespace osc { 33 | 34 | BundleInitiator BeginBundleImmediate(1); 35 | BundleTerminator EndBundle; 36 | MessageTerminator EndMessage; 37 | NilType Nil; 38 | InfinitumType Infinitum; 39 | 40 | } // namespace osc 41 | -------------------------------------------------------------------------------- /tools/linux/deb/ubuntu-noble/debian/control: -------------------------------------------------------------------------------- 1 | Source: casparcg-server-beta 2 | Maintainer: Julian Waller 3 | Section: video 4 | Priority: optional 5 | Standards-Version: 4.6.0.1 6 | Build-Depends: cmake, 7 | debhelper-compat (= 13), 8 | dh-exec, 9 | libavcodec-dev, 10 | libavdevice-dev, 11 | libavfilter-dev, 12 | libavformat-dev, 13 | libavutil-dev, 14 | libboost-coroutine-dev, 15 | libboost-date-time-dev, 16 | libboost-dev, 17 | libboost-filesystem-dev, 18 | libboost-locale-dev, 19 | libboost-log-dev, 20 | libboost-regex-dev, 21 | libboost-system-dev, 22 | libboost-thread-dev, 23 | libicu-dev, 24 | libglew-dev, 25 | libjpeg-dev, 26 | libopenal-dev, 27 | libpostproc-dev, 28 | libsfml-dev, 29 | libsimde-dev, 30 | libswresample-dev, 31 | libswscale-dev, 32 | libtbb-dev, 33 | libxrandr-dev, 34 | pkg-config, 35 | txt2man, 36 | zlib1g-dev, 37 | casparcg-cef-142-dev 38 | Homepage: https://github.com/CasparCG/server/ 39 | Vcs-Git: https://github.com/CasparCG/server.git 40 | Vcs-Browser: https://github.com/CasparCG/server/ 41 | 42 | Package: casparcg-server-beta 43 | Pre-Depends: ${misc:Pre-Depends} 44 | Depends: fonts-liberation, casparcg-cef-142 (= @CASPARCG_CEF_VER@), ${misc:Depends}, ${shlibs:Depends} 45 | Architecture: amd64 46 | Description: layered real-time video compositor to multiple outputs 47 | Play out professional graphics, audio and video to multiple outputs as a 48 | layerbased real-time compositor. 49 | -------------------------------------------------------------------------------- /src/accelerator/ogl/util/matrix.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace caspar::accelerator::ogl { 11 | 12 | typedef boost::numeric::ublas::matrix> t_matrix; 13 | 14 | typedef boost::numeric::ublas::vector> t_point; 15 | 16 | t_matrix get_vertex_matrix(const core::image_transform& transform, double aspect_ratio); 17 | 18 | } // namespace caspar::accelerator::ogl 19 | 20 | namespace boost::numeric::ublas { 21 | template 22 | boost::numeric::ublas::matrix operator*(const boost::numeric::ublas::matrix& lhs, 23 | const boost::numeric::ublas::matrix& rhs) 24 | { 25 | return boost::numeric::ublas::matrix(boost::numeric::ublas::prod(lhs, rhs)); 26 | } 27 | template 28 | boost::numeric::ublas::vector operator*(const boost::numeric::ublas::vector& lhs, 29 | const boost::numeric::ublas::matrix& rhs) 30 | { 31 | return boost::numeric::ublas::vector(boost::numeric::ublas::prod(lhs, rhs)); 32 | } 33 | template 34 | bool operator==(const boost::numeric::ublas::matrix& lhs, const boost::numeric::ublas::matrix& rhs) 35 | { 36 | if (lhs.size1() != rhs.size1() || lhs.size2() != rhs.size2()) 37 | return false; 38 | for (int y = 0; y < lhs.size1(); ++y) 39 | for (int x = 0; x < lhs.size2(); ++x) 40 | if (lhs(y, x) != rhs(y, x)) 41 | return false; 42 | return true; 43 | } 44 | } // namespace boost::numeric::ublas -------------------------------------------------------------------------------- /src/modules/ffmpeg/producer/av_producer.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace caspar { namespace ffmpeg { 14 | 15 | class AVProducer 16 | { 17 | public: 18 | AVProducer(std::shared_ptr frame_factory, 19 | core::video_format_desc format_desc, 20 | std::string name, 21 | std::string path, 22 | std::optional vfilter, 23 | std::optional afilter, 24 | std::optional start, 25 | std::optional seek, 26 | std::optional duration, 27 | std::optional loop, 28 | int seekable, 29 | core::frame_geometry::scale_mode scale_mode); 30 | 31 | core::draw_frame prev_frame(const core::video_field field); 32 | core::draw_frame next_frame(const core::video_field field); 33 | bool is_ready(); 34 | 35 | AVProducer& seek(int64_t time); 36 | int64_t time() const; 37 | 38 | AVProducer& loop(bool loop); 39 | bool loop() const; 40 | 41 | AVProducer& start(int64_t start); 42 | int64_t start() const; 43 | 44 | AVProducer& duration(int64_t duration); 45 | int64_t duration() const; 46 | 47 | caspar::core::monitor::state state() const; 48 | 49 | private: 50 | struct Impl; 51 | std::shared_ptr impl_; 52 | }; 53 | 54 | }} // namespace caspar::ffmpeg 55 | -------------------------------------------------------------------------------- /src/core/producer/color/color_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | namespace caspar { namespace core { 33 | 34 | bool try_get_color(const std::wstring& str, uint32_t& value); 35 | 36 | spl::shared_ptr create_color_producer(const spl::shared_ptr& frame_factory, 37 | uint32_t value); 38 | spl::shared_ptr create_color_producer(const spl::shared_ptr& frame_factory, 39 | const std::vector& params); 40 | draw_frame create_color_frame(void* tag, const spl::shared_ptr& frame_factory, uint32_t value); 41 | draw_frame 42 | create_color_frame(void* tag, const spl::shared_ptr& frame_factory, const std::wstring& color); 43 | 44 | }} // namespace caspar::core 45 | -------------------------------------------------------------------------------- /src/protocol/util/ClientInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Nicklas P Andersson 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "protocol_strategy.h" 29 | #include 30 | 31 | namespace caspar { namespace IO { 32 | 33 | typedef spl::shared_ptr> ClientInfoPtr; 34 | typedef std::shared_ptr> ClientInfoPtrStd; 35 | 36 | struct ConsoleClientInfo : public client_connection 37 | { 38 | void send(std::wstring&& data, bool skip_log) override 39 | { 40 | std::wcout << L"#" + caspar::log::replace_nonprintable_copy(data, L'?') << std::flush; 41 | } 42 | void disconnect() override {} 43 | std::wstring address() const override { return L"Console"; } 44 | void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr& lifecycle_bound) override {} 45 | std::shared_ptr remove_lifecycle_bound_object(const std::wstring& key) override 46 | { 47 | return std::shared_ptr(); 48 | } 49 | }; 50 | 51 | }} // namespace caspar::IO 52 | -------------------------------------------------------------------------------- /src/shell/linux_specific.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #include "platform_specific.h" 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { 32 | 33 | void setup_prerequisites() 34 | { 35 | // Enable utf8 console input and output 36 | std::wcout.sync_with_stdio(false); 37 | std::wcout.imbue(std::locale("")); 38 | std::wcin.imbue(std::locale("")); 39 | 40 | XInitThreads(); 41 | 42 | std::set_terminate([] { CASPAR_LOG_CURRENT_EXCEPTION(); }); 43 | } 44 | 45 | void setup_console_window() 46 | { 47 | // TODO: implement. 48 | } 49 | 50 | void increase_process_priority() 51 | { 52 | // TODO: implement. 53 | } 54 | 55 | void wait_for_keypress() 56 | { 57 | // TODO: implement if desirable. 58 | } 59 | 60 | std::shared_ptr setup_debugging_environment() 61 | { 62 | // TODO: implement if applicable. 63 | return nullptr; 64 | } 65 | 66 | void wait_for_remote_debugging() 67 | { 68 | // TODO: implement if applicable. 69 | } 70 | 71 | } // namespace caspar 72 | -------------------------------------------------------------------------------- /src/modules/image/util/image_algorithms.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se.com 20 | */ 21 | 22 | #include "image_algorithms.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar { namespace image { 29 | 30 | std::vector> get_line_points(int num_pixels, double angle_radians) 31 | { 32 | std::vector> line_points; 33 | line_points.reserve(num_pixels); 34 | 35 | double delta_x = std::cos(angle_radians); 36 | double delta_y = -std::sin(angle_radians); // In memory is revered 37 | double max_delta = std::max(std::abs(delta_x), std::abs(delta_y)); 38 | double amplification = 1.0 / max_delta; 39 | delta_x *= amplification; 40 | delta_y *= amplification; 41 | 42 | for (int i = 1; i <= num_pixels; ++i) 43 | line_points.push_back(std::make_pair(static_cast(std::floor(delta_x * static_cast(i) + 0.5)), 44 | static_cast(std::floor(delta_y * static_cast(i) + 0.5)))); 45 | 46 | return std::move(line_points); 47 | } 48 | 49 | }} // namespace caspar::image 50 | -------------------------------------------------------------------------------- /src/protocol/amcp/amcp_args.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Julian Waller, julian@superfly.tv 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar { namespace protocol { namespace amcp { 29 | 30 | inline bool is_args_token(const std::wstring& message) 31 | { 32 | return (message[0] == L'(' && message[message.size() - 1] == L')'); 33 | } 34 | 35 | inline bool 36 | get_arg_value(const std::map& args, const std::wstring& key, std::wstring& value) 37 | { 38 | auto it = args.find(boost::to_upper_copy(key)); 39 | if (it != args.end()) { 40 | value = it->second; 41 | return true; 42 | } 43 | return false; 44 | } 45 | 46 | inline bool get_bool_arg(const std::map& args, const std::wstring& key) 47 | { 48 | std::wstring value; 49 | if (get_arg_value(args, key, value)) { 50 | return (value != L"0" && boost::to_upper_copy(value) != L"FALSE"); 51 | } 52 | return false; 53 | } 54 | 55 | std::map tokenize_args(const std::wstring& message); 56 | 57 | }}} // namespace caspar::protocol::amcp 58 | -------------------------------------------------------------------------------- /src/modules/html/producer/html_cg_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace caspar { namespace html { 29 | 30 | class html_cg_proxy : public core::cg_proxy 31 | { 32 | public: 33 | explicit html_cg_proxy(const spl::shared_ptr& producer); 34 | ~html_cg_proxy(); 35 | 36 | void add(int layer, 37 | const std::wstring& template_name, 38 | bool play_on_load, 39 | const std::wstring& start_from_label, 40 | const std::wstring& data) override; 41 | void remove(int layer) override; 42 | void play(int layer) override; 43 | void stop(int layer) override; 44 | void next(int layer) override; 45 | void update(int layer, const std::wstring& data) override; 46 | std::wstring invoke(int layer, const std::wstring& label) override; 47 | 48 | private: 49 | spl::shared_ptr producer_; 50 | }; 51 | 52 | }} // namespace caspar::html 53 | -------------------------------------------------------------------------------- /src/accelerator/ogl/util/transforms.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "matrix.h" 14 | 15 | namespace caspar::accelerator::ogl { 16 | 17 | struct draw_crop_region 18 | { 19 | explicit draw_crop_region(double left, double top, double right, double bottom); 20 | 21 | void apply_transform(const t_matrix& matrix); 22 | 23 | std::array coords; 24 | }; 25 | 26 | struct draw_transform_step 27 | { 28 | draw_transform_step() 29 | : vertex_matrix(boost::numeric::ublas::identity_matrix(3, 3)) 30 | { 31 | } 32 | 33 | draw_transform_step(const core::corners& perspective, const t_matrix& vertex_matrix) 34 | : perspective(perspective) 35 | , vertex_matrix(vertex_matrix) 36 | { 37 | } 38 | 39 | core::corners perspective; 40 | 41 | std::vector crop_regions; 42 | 43 | t_matrix vertex_matrix; 44 | }; 45 | 46 | struct draw_transforms 47 | { 48 | std::vector steps; 49 | 50 | draw_transforms() 51 | : image_transform(core::image_transform()) 52 | , steps({draw_transform_step()}) 53 | { 54 | } 55 | 56 | explicit draw_transforms(core::image_transform transform, std::vector steps) 57 | : image_transform(transform) 58 | , steps(std::move(steps)) 59 | { 60 | } 61 | 62 | core::image_transform image_transform; 63 | 64 | draw_transform_step& current() { return steps.back(); } 65 | 66 | [[nodiscard]] draw_transforms combine_transform(const core::image_transform& transform, double aspect_ratio) const; 67 | 68 | [[nodiscard]] std::vector 69 | transform_coords(const std::vector& coords) const; 70 | }; 71 | 72 | } // namespace caspar::accelerator::ogl -------------------------------------------------------------------------------- /src/core/mixer/mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | namespace caspar::diagnostics { 31 | class graph; 32 | } 33 | 34 | namespace caspar { namespace core { 35 | 36 | class mixer final 37 | { 38 | mixer(const mixer&); 39 | mixer& operator=(const mixer&); 40 | 41 | public: 42 | explicit mixer(int channel_index, 43 | spl::shared_ptr graph, 44 | spl::shared_ptr image_mixer); 45 | 46 | const_frame operator()(std::vector frames, const video_format_desc& format_desc, int nb_samples); 47 | 48 | void set_master_volume(float volume); 49 | float get_master_volume(); 50 | 51 | mutable_frame create_frame(const void* tag, const pixel_format_desc& desc); 52 | 53 | core::monitor::state state() const; 54 | 55 | common::bit_depth depth() const; 56 | 57 | private: 58 | struct impl; 59 | spl::shared_ptr impl_; 60 | }; 61 | 62 | }} // namespace caspar::core 63 | -------------------------------------------------------------------------------- /src/protocol/util/AsyncEventServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG. 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | */ 20 | 21 | // AsyncEventServer.h: interface for the AsyncServer class. 22 | ////////////////////////////////////////////////////////////////////// 23 | #pragma once 24 | 25 | #include "protocol_strategy.h" 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { namespace IO { 32 | 33 | using lifecycle_factory_t = 34 | std::function>(const std::string& ipv4_address)>; 35 | 36 | class AsyncEventServer 37 | { 38 | public: 39 | explicit AsyncEventServer(std::shared_ptr io_context, 40 | const protocol_strategy_factory::ptr& protocol, 41 | unsigned short port); 42 | ~AsyncEventServer(); 43 | 44 | void add_client_lifecycle_object_factory(const lifecycle_factory_t& lifecycle_factory); 45 | 46 | struct implementation; 47 | 48 | private: 49 | spl::shared_ptr impl_; 50 | 51 | AsyncEventServer(const AsyncEventServer&) = delete; 52 | AsyncEventServer& operator=(const AsyncEventServer&) = delete; 53 | }; 54 | 55 | }} // namespace caspar::IO 56 | -------------------------------------------------------------------------------- /src/core/mixer/audio/audio_mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | namespace caspar::diagnostics { 34 | class graph; 35 | } 36 | 37 | namespace caspar { namespace core { 38 | 39 | class audio_mixer final : public frame_visitor 40 | { 41 | audio_mixer(const audio_mixer&); 42 | audio_mixer& operator=(const audio_mixer&); 43 | 44 | public: 45 | audio_mixer(spl::shared_ptr<::caspar::diagnostics::graph> graph); 46 | 47 | array operator()(const struct video_format_desc& format_desc, int nb_samples); 48 | void set_master_volume(float volume); 49 | float get_master_volume(); 50 | core::monitor::state state() const; 51 | 52 | void push(const struct frame_transform& transform) override; 53 | void visit(const class const_frame& frame) override; 54 | void pop() override; 55 | 56 | private: 57 | struct impl; 58 | spl::shared_ptr impl_; 59 | }; 60 | 61 | }} // namespace caspar::core 62 | -------------------------------------------------------------------------------- /src/modules/oal/consumer/oal_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | 33 | namespace caspar { namespace oal { 34 | 35 | spl::shared_ptr create_consumer(const std::vector& params, 36 | const core::video_format_repository& format_repository, 37 | const std::vector>& channels, 38 | const core::channel_info& channel_info); 39 | spl::shared_ptr 40 | create_preconfigured_consumer(const boost::property_tree::wptree&, 41 | const core::video_format_repository& format_repository, 42 | const std::vector>& channels, 43 | const core::channel_info& channel_info); 44 | 45 | }} // namespace caspar::oal 46 | -------------------------------------------------------------------------------- /src/modules/bluefish/interop/BlueTypes.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // File: BlueTypes.h 3 | // 4 | // Description: Declaration for Bluefish types 5 | // 6 | // (C) Copyright 2017 by Bluefish Technologies Pty Ltd. All Rights Reserved. 7 | //////////////////////////////////////////////////////////////////////////// 8 | 9 | 10 | #ifndef HG_BLUE_TYPES_HG 11 | #define HG_BLUE_TYPES_HG 12 | 13 | 14 | #define BLUE_TRUE 1 15 | #define BLUE_FALSE 0 16 | 17 | typedef int BERR; 18 | typedef int BErr; 19 | typedef long long BGERROR; 20 | typedef void BLUE_VOID; 21 | typedef int BLUE_BOOL; 22 | typedef unsigned char BLUE_U8; 23 | typedef unsigned short BLUE_U16; 24 | typedef unsigned int BLUE_U32; 25 | typedef unsigned long long BLUE_U64; 26 | typedef char BLUE_S8; 27 | typedef short BLUE_S16; 28 | typedef int BLUE_S32; 29 | typedef long long BLUE_S64; 30 | typedef BLUE_U8 BLUE_UINT8; 31 | typedef BLUE_U16 BLUE_UINT16; 32 | typedef BLUE_U32 BLUE_UINT32; 33 | typedef BLUE_U64 BLUE_UINT64; 34 | typedef BLUE_S8 BLUE_INT8; 35 | typedef BLUE_S16 BLUE_INT16; 36 | typedef BLUE_S32 BLUE_INT32; 37 | typedef BLUE_S64 BLUE_INT64; 38 | 39 | // TODO: maybe make a macro to do all this ifndef def etuff. 40 | #ifdef __linux__ 41 | 42 | #ifndef ULONG 43 | #define ULONG BLUE_U32 44 | #endif 45 | #ifndef BOOLEAN 46 | #define BOOLEAN bool 47 | #endif 48 | #ifndef BOOL 49 | #define BOOL bool 50 | #endif 51 | #ifndef LPVOID 52 | #define LPVOID void* 53 | #endif 54 | #ifndef LPDWORD 55 | #define LPDWORD BLUE_U32* 56 | #endif 57 | #ifndef LPOVERLAPPED 58 | #define LPOVERLAPPED void* 59 | #endif 60 | 61 | typedef void* PVOID; 62 | typedef void* PVOID64; 63 | typedef BLUE_U64 LARGE_INTEGER; 64 | typedef BLUE_U32 DWORD; 65 | #endif 66 | 67 | #endif //#define HG_BLUE_TYPES_HG 68 | -------------------------------------------------------------------------------- /src/common/scope_exit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "except.h" 4 | 5 | namespace caspar { 6 | 7 | namespace detail { 8 | template 9 | class scope_exit 10 | { 11 | scope_exit(const scope_exit&); 12 | scope_exit& operator=(const scope_exit&); 13 | 14 | public: 15 | template 16 | explicit scope_exit(T2&& func) 17 | : func_(std::forward(func)) 18 | , valid_(true) 19 | { 20 | } 21 | 22 | scope_exit(scope_exit&& other) 23 | : func_(std::move(other.func_)) 24 | , valid_(std::move(other.valid_)) 25 | { 26 | other.valid_ = false; 27 | } 28 | 29 | scope_exit& operator=(scope_exit&& other) 30 | { 31 | func_ = std::move(other.func_); 32 | valid_ = std::move(other.valid_); 33 | 34 | other.valid_ = false; 35 | 36 | return *this; 37 | } 38 | 39 | ~scope_exit() 40 | { 41 | try { 42 | if (valid_) 43 | func_(); 44 | } catch (...) { 45 | if (!std::uncaught_exception()) 46 | #pragma warning(push) 47 | #pragma warning(disable : 4297) 48 | throw; 49 | #pragma warning(pop) 50 | else 51 | CASPAR_LOG_CURRENT_EXCEPTION(); 52 | } 53 | } 54 | 55 | private: 56 | T func_; 57 | bool valid_; 58 | }; 59 | 60 | class scope_exit_helper 61 | { 62 | }; 63 | 64 | template 65 | scope_exit::type> operator+(scope_exit_helper /*unused*/, T&& exitScope) 66 | { 67 | return scope_exit::type>(std::forward(exitScope)); 68 | } 69 | } // namespace detail 70 | 71 | #define _CASPAR_EXIT_SCOPE_LINENAME_CAT(name, line) name##line 72 | #define _CASPAR_EXIT_SCOPE_LINENAME(name, line) _CASPAR_EXIT_SCOPE_LINENAME_CAT(name, line) 73 | #define CASPAR_SCOPE_EXIT \ 74 | auto _CASPAR_EXIT_SCOPE_LINENAME(EXIT, __LINE__) = ::caspar::detail::scope_exit_helper() + [&]() mutable 75 | 76 | } // namespace caspar 77 | -------------------------------------------------------------------------------- /src/modules/screen/consumer/screen_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | namespace caspar { namespace screen { 33 | 34 | spl::shared_ptr create_consumer(const std::vector& params, 35 | const core::video_format_repository& format_repository, 36 | const std::vector>& channels, 37 | const core::channel_info& channel_info); 38 | spl::shared_ptr 39 | create_preconfigured_consumer(const boost::property_tree::wptree& ptree, 40 | const core::video_format_repository& format_repository, 41 | const std::vector>& channels, 42 | const core::channel_info& channel_info); 43 | 44 | }} // namespace caspar::screen 45 | -------------------------------------------------------------------------------- /src/core/producer/transition/transition_producer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../../fwd.h" 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { namespace core { 32 | 33 | enum class transition_type 34 | { 35 | cut, 36 | mix, 37 | push, 38 | slide, 39 | wipe, 40 | fadecut, 41 | cutfade, 42 | vfade, 43 | count 44 | }; 45 | 46 | enum class transition_direction 47 | { 48 | from_left, 49 | from_right, 50 | from_top, 51 | from_bottom, 52 | count 53 | }; 54 | 55 | struct transition_info 56 | { 57 | int duration = 0; 58 | transition_direction direction = transition_direction::from_left; 59 | transition_type type = transition_type::cut; 60 | caspar::tweener tweener{L"linear"}; 61 | }; 62 | 63 | bool try_match_transition(const std::wstring& message, transition_info& transitionInfo); 64 | 65 | spl::shared_ptr create_transition_producer(const spl::shared_ptr& destination, 66 | const transition_info& info); 67 | 68 | }} // namespace caspar::core 69 | -------------------------------------------------------------------------------- /src/core/mixer/audio/audio_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar { namespace core { 29 | 30 | template 31 | std::vector audio_32_to_24(const T& audio_data) 32 | { 33 | auto size = std::distance(std::begin(audio_data), std::end(audio_data)); 34 | auto input8 = reinterpret_cast(&(*std::begin(audio_data))); 35 | auto output8 = std::vector(); 36 | 37 | output8.reserve(size * 3); 38 | for (int n = 0; n < size; ++n) { 39 | output8.push_back(input8[n * 4 + 1]); 40 | output8.push_back(input8[n * 4 + 2]); 41 | output8.push_back(input8[n * 4 + 3]); 42 | } 43 | 44 | return output8; 45 | } 46 | 47 | template 48 | std::vector audio_32_to_16(const T& audio_data) 49 | { 50 | auto size = std::distance(std::begin(audio_data), std::end(audio_data)); 51 | auto input32 = &(*std::begin(audio_data)); 52 | auto output16 = std::vector(); 53 | 54 | output16.reserve(size); 55 | for (int n = 0; n < size; ++n) 56 | output16.push_back((input32[n] >> 16) & 0xFFFF); 57 | 58 | return output16; 59 | } 60 | 61 | }} // namespace caspar::core -------------------------------------------------------------------------------- /src/modules/decklink/consumer/decklink_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | namespace caspar { namespace decklink { 35 | 36 | spl::shared_ptr create_consumer(const std::vector& params, 37 | const core::video_format_repository& format_repository, 38 | const std::vector>& channels, 39 | const core::channel_info& channel_info); 40 | spl::shared_ptr 41 | create_preconfigured_consumer(const boost::property_tree::wptree& ptree, 42 | const core::video_format_repository& format_repository, 43 | const std::vector>& channels, 44 | const core::channel_info& channel_info); 45 | 46 | }} // namespace caspar::decklink 47 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/consumer/ffmpeg_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | #include 33 | 34 | namespace caspar { namespace ffmpeg { 35 | 36 | spl::shared_ptr create_consumer(const std::vector& params, 37 | const core::video_format_repository& format_repository, 38 | const std::vector>& channels, 39 | const core::channel_info& channel_info); 40 | spl::shared_ptr 41 | create_preconfigured_consumer(const boost::property_tree::wptree&, 42 | const core::video_format_repository& format_repository, 43 | const std::vector>& channels, 44 | const core::channel_info& channel_info); 45 | 46 | }} // namespace caspar::ffmpeg 47 | -------------------------------------------------------------------------------- /src/core/producer/layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "frame_producer.h" 25 | 26 | #include "../fwd.h" 27 | #include "../monitor/monitor.h" 28 | 29 | #include 30 | 31 | namespace caspar { namespace core { 32 | 33 | class layer final 34 | { 35 | layer(const layer&); 36 | layer& operator=(const layer&); 37 | 38 | public: 39 | explicit layer(const core::video_format_desc format_desc); 40 | layer(layer&& other); 41 | 42 | layer& operator=(layer&& other); 43 | 44 | void swap(layer& other); 45 | 46 | void load(spl::shared_ptr producer, bool preview, bool auto_play = false); 47 | void play(); 48 | void preview(); 49 | void pause(); 50 | void resume(); 51 | void stop(); 52 | 53 | draw_frame receive(const video_field field, int nb_samples); 54 | draw_frame receive_background(const video_field field, int nb_samples); 55 | 56 | core::monitor::state state() const; 57 | 58 | spl::shared_ptr foreground() const; 59 | spl::shared_ptr background() const; 60 | bool has_background() const; 61 | 62 | private: 63 | struct impl; 64 | spl::shared_ptr impl_; 65 | }; 66 | 67 | }} // namespace caspar::core 68 | -------------------------------------------------------------------------------- /src/modules/ffmpeg/util/av_util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" { 4 | #include 5 | } 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | struct AVFrame; 18 | struct AVPacket; 19 | struct AVFilterContext; 20 | struct AVCodecContext; 21 | struct AVDictionary; 22 | 23 | namespace caspar { namespace ffmpeg { 24 | 25 | std::shared_ptr alloc_frame(); 26 | std::shared_ptr alloc_packet(); 27 | 28 | core::pixel_format_desc pixel_format_desc(AVPixelFormat pix_fmt, 29 | int width, 30 | int height, 31 | std::vector& data_map, 32 | core::color_space color_space = core::color_space::bt709); 33 | core::mutable_frame make_frame(void* tag, 34 | core::frame_factory& frame_factory, 35 | std::shared_ptr video, 36 | std::shared_ptr audio, 37 | core::color_space color_space = core::color_space::bt709, 38 | core::frame_geometry::scale_mode = core::frame_geometry::scale_mode::stretch, 39 | bool is_straight_alpha = false); 40 | 41 | std::shared_ptr make_av_video_frame(const core::const_frame& frame, const core::video_format_desc& format_des); 42 | std::shared_ptr make_av_audio_frame(const core::const_frame& frame, const core::video_format_desc& format_des); 43 | 44 | AVDictionary* to_dict(std::map&& map); 45 | std::map to_map(AVDictionary** dict); 46 | 47 | uint64_t get_channel_layout_mask_for_channels(int channel_count); 48 | 49 | }} // namespace caspar::ffmpeg 50 | -------------------------------------------------------------------------------- /src/modules/newtek/consumer/newtek_ndi_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Krzysztof Zegzula, zegzulakrzysztof@gmail.com 20 | * based on work of Robert Nagy, ronag89@gmail.com work 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include 31 | 32 | #include 33 | 34 | namespace caspar { namespace newtek { 35 | 36 | spl::shared_ptr 37 | create_ndi_consumer(const std::vector& params, 38 | const core::video_format_repository& format_repository, 39 | const std::vector>& channels, 40 | const core::channel_info& channel_info); 41 | spl::shared_ptr 42 | create_preconfigured_ndi_consumer(const boost::property_tree::wptree& ptree, 43 | const core::video_format_repository& format_repository, 44 | const std::vector>& channels, 45 | const core::channel_info& channel_info); 46 | 47 | }} // namespace caspar::newtek 48 | -------------------------------------------------------------------------------- /src/modules/bluefish/consumer/bluefish_consumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | * James Wise, james.wise@bluefish444.com 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | namespace caspar { namespace bluefish { 34 | 35 | spl::shared_ptr create_consumer(const std::vector& params, 36 | const core::video_format_repository& format_repository, 37 | const std::vector>& channels, 38 | const core::channel_info& channel_info); 39 | 40 | spl::shared_ptr 41 | create_preconfigured_consumer(const boost::property_tree::wptree& ptree, 42 | const core::video_format_repository& format_repository, 43 | const std::vector>& channels, 44 | const core::channel_info& channel_info); 45 | 46 | }} // namespace caspar::bluefish 47 | -------------------------------------------------------------------------------- /src/modules/newtek/newtek.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #include "newtek.h" 23 | 24 | #include "consumer/newtek_ndi_consumer.h" 25 | #include "producer/newtek_ndi_producer.h" 26 | 27 | #include "util/ndi.h" 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | namespace caspar { namespace newtek { 36 | 37 | void init(const core::module_dependencies& dependencies) 38 | { 39 | try { 40 | dependencies.consumer_registry->register_consumer_factory(L"NDI Consumer", create_ndi_consumer); 41 | dependencies.consumer_registry->register_preconfigured_consumer_factory(L"ndi", 42 | create_preconfigured_ndi_consumer); 43 | 44 | dependencies.producer_registry->register_producer_factory(L"NDI Producer", create_ndi_producer); 45 | 46 | dependencies.command_repository->register_command(L"Query Commands", L"NDI LIST", ndi::list_command, 0); 47 | 48 | bool autoload = caspar::env::properties().get(L"configuration.ndi.auto-load", false); 49 | if (autoload) 50 | ndi::load_library(); 51 | 52 | } catch (...) { 53 | } 54 | } 55 | 56 | }} // namespace caspar::newtek 57 | -------------------------------------------------------------------------------- /src/protocol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.28) 2 | project (protocol) 3 | 4 | set(SOURCES 5 | amcp/AMCPCommand.cpp 6 | amcp/AMCPCommandQueue.cpp 7 | amcp/AMCPCommandsImpl.cpp 8 | amcp/AMCPProtocolStrategy.cpp 9 | amcp/amcp_command_repository.cpp 10 | amcp/amcp_args.cpp 11 | amcp/amcp_command_repository_wrapper.cpp 12 | 13 | osc/oscpack/OscOutboundPacketStream.cpp 14 | osc/oscpack/OscPrintReceivedElements.cpp 15 | osc/oscpack/OscReceivedElements.cpp 16 | osc/oscpack/OscTypes.cpp 17 | 18 | osc/client.cpp 19 | 20 | util/AsyncEventServer.cpp 21 | util/lock_container.cpp 22 | util/strategy_adapters.cpp 23 | util/http_request.cpp 24 | util/tokenize.cpp 25 | ) 26 | 27 | set(HEADERS 28 | amcp/AMCPCommand.h 29 | amcp/AMCPCommandQueue.h 30 | amcp/AMCPCommandsImpl.h 31 | amcp/AMCPProtocolStrategy.h 32 | amcp/amcp_command_repository.h 33 | amcp/amcp_command_repository_wrapper.h 34 | amcp/amcp_shared.h 35 | amcp/amcp_args.h 36 | amcp/amcp_command_context.h 37 | 38 | osc/oscpack/MessageMappingOscPacketListener.h 39 | osc/oscpack/OscException.h 40 | osc/oscpack/OscHostEndianness.h 41 | osc/oscpack/OscOutboundPacketStream.h 42 | osc/oscpack/OscPacketListener.h 43 | osc/oscpack/OscPrintReceivedElements.h 44 | osc/oscpack/OscReceivedElements.h 45 | osc/oscpack/OscTypes.h 46 | 47 | osc/client.h 48 | 49 | util/AsyncEventServer.h 50 | util/ClientInfo.h 51 | util/lock_container.h 52 | util/ProtocolStrategy.h 53 | util/protocol_strategy.h 54 | util/strategy_adapters.h 55 | util/http_request.h 56 | util/tokenize.h 57 | 58 | StdAfx.h 59 | ) 60 | 61 | casparcg_add_library(protocol SOURCES ${SOURCES} ${HEADERS}) 62 | target_include_directories(protocol PRIVATE 63 | .. 64 | ) 65 | target_precompile_headers(protocol PRIVATE "StdAfx.h") 66 | 67 | source_group(sources\\amcp amcp/*) 68 | source_group(sources\\cii cii/*) 69 | source_group(sources\\clk clk/*) 70 | source_group(sources\\log log/*) 71 | source_group(sources\\osc\\oscpack osc/oscpack/*) 72 | source_group(sources\\osc osc/*) 73 | source_group(sources\\util util/*) 74 | source_group(sources ./*) 75 | 76 | target_link_libraries(protocol PRIVATE common core) 77 | -------------------------------------------------------------------------------- /src/accelerator/ogl/image/image_shader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | #include "image_shader.h" 22 | 23 | #include "../util/device.h" 24 | #include "../util/shader.h" 25 | 26 | #include "ogl_image_fragment.h" 27 | #include "ogl_image_vertex.h" 28 | 29 | namespace caspar { namespace accelerator { namespace ogl { 30 | 31 | std::weak_ptr g_shader; 32 | std::mutex g_shader_mutex; 33 | 34 | std::shared_ptr get_image_shader(const spl::shared_ptr& ogl) 35 | { 36 | std::lock_guard lock(g_shader_mutex); 37 | auto existing_shader = g_shader.lock(); 38 | 39 | if (existing_shader) { 40 | return existing_shader; 41 | } 42 | 43 | // The deleter is alive until the weak pointer is destroyed, so we have 44 | // to weakly reference ogl, to not keep it alive until atexit 45 | std::weak_ptr weak_ogl = ogl; 46 | 47 | auto deleter = [weak_ogl](shader* p) { 48 | auto ogl = weak_ogl.lock(); 49 | 50 | if (ogl) { 51 | ogl->dispatch_async([=] { delete p; }); 52 | } 53 | }; 54 | 55 | existing_shader.reset(new shader(std::string(vertex_shader), std::string(fragment_shader)), deleter); 56 | 57 | g_shader = existing_shader; 58 | 59 | return existing_shader; 60 | } 61 | 62 | }}} // namespace caspar::accelerator::ogl 63 | -------------------------------------------------------------------------------- /src/modules/newtek/interop/Processing.NDI.compat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOTE : The following MIT license applies to this file ONLY and not to the SDK as a whole. Please review 4 | // the SDK documentation for the description of the full license terms, which are also provided in the file 5 | // "NDI License Agreement.pdf" within the SDK or online at http://ndi.link/ndisdk_license. Your use of any 6 | // part of this SDK is acknowledgment that you agree to the SDK license terms. The full NDI SDK may be 7 | // downloaded at http://ndi.video/ 8 | // 9 | //*********************************************************************************************************** 10 | // 11 | // Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved. 12 | // 13 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 14 | // associated documentation files(the "Software"), to deal in the Software without restriction, including 15 | // without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell 16 | // copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 17 | // following conditions : 18 | // 19 | // The above copyright notice and this permission notice shall be included in all copies or substantial 20 | // portions of the Software. 21 | // 22 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 23 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 24 | // EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 25 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 26 | // THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | //*********************************************************************************************************** 29 | 30 | #ifndef __cplusplus 31 | #include 32 | #endif 33 | 34 | #include 35 | 36 | #ifndef INFINITE 37 | //#define INFINITE INFINITE 38 | static const uint32_t INFINITE = 0xFFFFFFFF; 39 | #endif 40 | -------------------------------------------------------------------------------- /src/protocol/amcp/amcp_command_repository.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Helge Norberg, helge.norberg@svt.se 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "../util/ClientInfo.h" 25 | #include "AMCPCommand.h" 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace caspar { namespace protocol { namespace amcp { 32 | 33 | class amcp_command_repository 34 | { 35 | public: 36 | amcp_command_repository(const spl::shared_ptr>& channels); 37 | 38 | std::shared_ptr 39 | parse_command(IO::ClientInfoPtr client, std::list tokens, const std::wstring& request_id) const; 40 | bool check_channel_lock(IO::ClientInfoPtr client, int channel_index) const; 41 | 42 | const spl::shared_ptr>& channels() const; 43 | 44 | void register_command(std::wstring category, std::wstring name, amcp_command_func command, int min_num_params); 45 | 46 | void 47 | register_channel_command(std::wstring category, std::wstring name, amcp_command_func command, int min_num_params); 48 | 49 | private: 50 | struct impl; 51 | spl::shared_ptr impl_; 52 | 53 | amcp_command_repository(const amcp_command_repository&) = delete; 54 | amcp_command_repository& operator=(const amcp_command_repository&) = delete; 55 | }; 56 | 57 | }}} // namespace caspar::protocol::amcp 58 | -------------------------------------------------------------------------------- /src/protocol/osc/client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Sveriges Television AB http://casparcg.com/ 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | * Author: Helge Norberg, helge.norberg@svt.se 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | namespace caspar { namespace protocol { namespace osc { 31 | 32 | class client 33 | { 34 | client(const client&); 35 | client& operator=(const client&); 36 | 37 | public: 38 | client(std::shared_ptr context); 39 | 40 | client(client&&); 41 | 42 | /** 43 | * Get a subscription token that ensures that OSC messages are sent to the 44 | * given endpoint as long as the token is alive. It will stop sending when 45 | * the token is dropped unless another token to the same endpoint has 46 | * previously been checked out. 47 | * 48 | * @param endpoint The UDP endpoint to send OSC messages to. 49 | * 50 | * @return The token. It is ok for the token to outlive the client 51 | */ 52 | std::shared_ptr get_subscription_token(const boost::asio::ip::udp::endpoint& endpoint); 53 | 54 | ~client(); 55 | 56 | client& operator=(client&&); 57 | 58 | void send(const core::monitor::state& state); 59 | 60 | private: 61 | struct impl; 62 | spl::shared_ptr impl_; 63 | }; 64 | 65 | }}} // namespace caspar::protocol::osc 66 | -------------------------------------------------------------------------------- /src/accelerator/ogl/util/texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Sveriges Television AB 3 | * 4 | * This file is part of CasparCG (www.casparcg.com). 5 | * 6 | * CasparCG is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * CasparCG is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with CasparCG. If not, see . 18 | * 19 | * Author: Robert Nagy, ronag89@gmail.com 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace caspar { namespace accelerator { namespace ogl { 29 | 30 | class texture final : public core::texture 31 | { 32 | public: 33 | texture(int width, int height, int stride, common::bit_depth depth = common::bit_depth::bit8); 34 | texture(const texture&) = delete; 35 | texture(texture&& other); 36 | ~texture(); 37 | 38 | texture& operator=(const texture&) = delete; 39 | texture& operator=(texture&& other); 40 | 41 | #ifdef WIN32 42 | void copy_from(int source); 43 | #endif 44 | void copy_from(class buffer& source); 45 | void copy_to(class buffer& dest); 46 | 47 | void attach(); 48 | void clear(); 49 | 50 | virtual void bind(int index) override; 51 | virtual void unbind() override; 52 | 53 | int width() const; 54 | int height() const; 55 | int stride() const; 56 | common::bit_depth depth() const; 57 | void set_depth(common::bit_depth depth); 58 | int size() const; 59 | int id() const; 60 | 61 | private: 62 | struct impl; 63 | std::unique_ptr impl_; 64 | }; 65 | 66 | }}} // namespace caspar::accelerator::ogl 67 | --------------------------------------------------------------------------------