Repository: CasparCG/Server
Branch: master
Commit: 7964b57a52fb
Files: 492
Total size: 3.5 MB
Directory structure:
gitextract_p4etv4dp/
├── .clang-format
├── .dockerignore
├── .editorconfig
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yaml
│ │ ├── config.yml
│ │ └── feature_request.yaml
│ ├── dependabot.yml
│ └── workflows/
│ ├── linux-system.yml
│ ├── linux.yml
│ └── windows.yml
├── .gitignore
├── BUILDING.md
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── _typos.toml
├── src/
│ ├── CMakeLists.txt
│ ├── CMakeModules/
│ │ ├── Bootstrap_Linux.cmake
│ │ ├── Bootstrap_Windows.cmake
│ │ ├── CasparCG_Util.cmake
│ │ └── FindFFmpeg.cmake
│ ├── CMakeSettings.json
│ ├── accelerator/
│ │ ├── CMakeLists.txt
│ │ ├── StdAfx.h
│ │ ├── accelerator.cpp
│ │ ├── accelerator.h
│ │ ├── d3d/
│ │ │ ├── d3d_device.cpp
│ │ │ ├── d3d_device.h
│ │ │ ├── d3d_device_context.cpp
│ │ │ ├── d3d_device_context.h
│ │ │ ├── d3d_texture2d.cpp
│ │ │ └── d3d_texture2d.h
│ │ ├── ogl/
│ │ │ ├── image/
│ │ │ │ ├── image_kernel.cpp
│ │ │ │ ├── image_kernel.h
│ │ │ │ ├── image_mixer.cpp
│ │ │ │ ├── image_mixer.h
│ │ │ │ ├── image_shader.cpp
│ │ │ │ ├── image_shader.h
│ │ │ │ ├── shader.frag
│ │ │ │ └── shader.vert
│ │ │ └── util/
│ │ │ ├── buffer.cpp
│ │ │ ├── buffer.h
│ │ │ ├── context.cpp
│ │ │ ├── context.h
│ │ │ ├── device.cpp
│ │ │ ├── device.h
│ │ │ ├── matrix.cpp
│ │ │ ├── matrix.h
│ │ │ ├── shader.cpp
│ │ │ ├── shader.h
│ │ │ ├── texture.cpp
│ │ │ ├── texture.h
│ │ │ ├── transforms.cpp
│ │ │ └── transforms.h
│ │ └── vulkan/
│ │ ├── image/
│ │ │ ├── fragment_shader.frag
│ │ │ ├── image_kernel.cpp
│ │ │ ├── image_kernel.h
│ │ │ ├── image_mixer.cpp
│ │ │ ├── image_mixer.h
│ │ │ └── vertex_shader.vert
│ │ └── util/
│ │ ├── buffer.cpp
│ │ ├── buffer.h
│ │ ├── device.cpp
│ │ ├── device.h
│ │ ├── draw_params.h
│ │ ├── matrix.cpp
│ │ ├── matrix.h
│ │ ├── pipeline.cpp
│ │ ├── pipeline.h
│ │ ├── renderpass.cpp
│ │ ├── renderpass.h
│ │ ├── texture.cpp
│ │ ├── texture.h
│ │ ├── transforms.cpp
│ │ ├── transforms.h
│ │ └── uniform_block.h
│ ├── common/
│ │ ├── CMakeLists.txt
│ │ ├── array.h
│ │ ├── assert.h
│ │ ├── base64.cpp
│ │ ├── base64.h
│ │ ├── bit_depth.h
│ │ ├── compiler/
│ │ │ └── vs/
│ │ │ └── disable_silly_warnings.h
│ │ ├── diagnostics/
│ │ │ ├── graph.cpp
│ │ │ └── graph.h
│ │ ├── endian.h
│ │ ├── enum_class.h
│ │ ├── env.cpp
│ │ ├── env.h
│ │ ├── except.h
│ │ ├── executor.h
│ │ ├── filesystem.cpp
│ │ ├── filesystem.h
│ │ ├── future.h
│ │ ├── gl/
│ │ │ ├── gl_check.cpp
│ │ │ └── gl_check.h
│ │ ├── log.cpp
│ │ ├── log.h
│ │ ├── memory.h
│ │ ├── memshfl.h
│ │ ├── os/
│ │ │ ├── filesystem.h
│ │ │ ├── linux/
│ │ │ │ ├── filesystem.cpp
│ │ │ │ ├── prec_timer.cpp
│ │ │ │ └── thread.cpp
│ │ │ ├── thread.h
│ │ │ └── windows/
│ │ │ ├── filesystem.cpp
│ │ │ ├── prec_timer.cpp
│ │ │ ├── thread.cpp
│ │ │ └── windows.h
│ │ ├── param.h
│ │ ├── prec_timer.h
│ │ ├── ptree.h
│ │ ├── scope_exit.h
│ │ ├── stdafx.cpp
│ │ ├── stdafx.h
│ │ ├── timer.h
│ │ ├── tweener.cpp
│ │ ├── tweener.h
│ │ ├── utf.cpp
│ │ └── utf.h
│ ├── core/
│ │ ├── CMakeLists.txt
│ │ ├── StdAfx.h
│ │ ├── consumer/
│ │ │ ├── channel_info.h
│ │ │ ├── frame_consumer.cpp
│ │ │ ├── frame_consumer.h
│ │ │ ├── frame_consumer_registry.cpp
│ │ │ ├── frame_consumer_registry.h
│ │ │ ├── output.cpp
│ │ │ └── output.h
│ │ ├── diagnostics/
│ │ │ ├── call_context.cpp
│ │ │ ├── call_context.h
│ │ │ ├── osd_graph.cpp
│ │ │ └── osd_graph.h
│ │ ├── frame/
│ │ │ ├── draw_frame.cpp
│ │ │ ├── draw_frame.h
│ │ │ ├── frame.cpp
│ │ │ ├── frame.h
│ │ │ ├── frame_factory.h
│ │ │ ├── frame_transform.cpp
│ │ │ ├── frame_transform.h
│ │ │ ├── frame_visitor.h
│ │ │ ├── geometry.cpp
│ │ │ ├── geometry.h
│ │ │ └── pixel_format.h
│ │ ├── fwd.h
│ │ ├── mixer/
│ │ │ ├── audio/
│ │ │ │ ├── audio_mixer.cpp
│ │ │ │ ├── audio_mixer.h
│ │ │ │ └── audio_util.h
│ │ │ ├── image/
│ │ │ │ ├── blend_modes.cpp
│ │ │ │ ├── blend_modes.h
│ │ │ │ └── image_mixer.h
│ │ │ ├── mixer.cpp
│ │ │ └── mixer.h
│ │ ├── module_dependencies.h
│ │ ├── monitor/
│ │ │ └── monitor.h
│ │ ├── producer/
│ │ │ ├── cg_proxy.cpp
│ │ │ ├── cg_proxy.h
│ │ │ ├── color/
│ │ │ │ ├── color_producer.cpp
│ │ │ │ └── color_producer.h
│ │ │ ├── frame_producer.cpp
│ │ │ ├── frame_producer.h
│ │ │ ├── frame_producer_registry.cpp
│ │ │ ├── frame_producer_registry.h
│ │ │ ├── layer.cpp
│ │ │ ├── layer.h
│ │ │ ├── route/
│ │ │ │ ├── route_producer.cpp
│ │ │ │ └── route_producer.h
│ │ │ ├── separated/
│ │ │ │ ├── separated_producer.cpp
│ │ │ │ └── separated_producer.h
│ │ │ ├── stage.cpp
│ │ │ ├── stage.h
│ │ │ └── transition/
│ │ │ ├── sting_producer.cpp
│ │ │ ├── sting_producer.h
│ │ │ ├── transition_producer.cpp
│ │ │ └── transition_producer.h
│ │ ├── video_channel.cpp
│ │ ├── video_channel.h
│ │ ├── video_format.cpp
│ │ └── video_format.h
│ ├── modules/
│ │ ├── CMakeLists.txt
│ │ ├── artnet/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── artnet.cpp
│ │ │ ├── artnet.h
│ │ │ ├── consumer/
│ │ │ │ ├── artnet_consumer.cpp
│ │ │ │ └── artnet_consumer.h
│ │ │ └── util/
│ │ │ ├── fixture_calculation.cpp
│ │ │ └── fixture_calculation.h
│ │ ├── bluefish/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── StdAfx.h
│ │ │ ├── bluefish.cpp
│ │ │ ├── bluefish.h
│ │ │ ├── consumer/
│ │ │ │ ├── bluefish_consumer.cpp
│ │ │ │ └── bluefish_consumer.h
│ │ │ ├── interop/
│ │ │ │ ├── BlueDriver_p.h
│ │ │ │ ├── BlueTypes.h
│ │ │ │ └── BlueVelvetCFuncPtr.h
│ │ │ ├── producer/
│ │ │ │ ├── bluefish_producer.cpp
│ │ │ │ └── bluefish_producer.h
│ │ │ └── util/
│ │ │ ├── blue_velvet.cpp
│ │ │ ├── blue_velvet.h
│ │ │ └── memory.h
│ │ ├── decklink/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── StdAfx.h
│ │ │ ├── consumer/
│ │ │ │ ├── config.cpp
│ │ │ │ ├── config.h
│ │ │ │ ├── decklink_consumer.cpp
│ │ │ │ ├── decklink_consumer.h
│ │ │ │ ├── format_strategy.h
│ │ │ │ ├── monitor.cpp
│ │ │ │ ├── monitor.h
│ │ │ │ ├── sdr_bgra_strategy.cpp
│ │ │ │ ├── v210_strategies.cpp
│ │ │ │ ├── vanc.cpp
│ │ │ │ ├── vanc.h
│ │ │ │ ├── vanc_op47_strategy.cpp
│ │ │ │ └── vanc_scte104_strategy.cpp
│ │ │ ├── decklink.cpp
│ │ │ ├── decklink.h
│ │ │ ├── decklink_api.h
│ │ │ ├── interop/
│ │ │ │ ├── DeckLinkAPIVersion.h
│ │ │ │ ├── DeckLinkAPI_i.c
│ │ │ │ └── DecklinkAPI.h
│ │ │ ├── linux_interop/
│ │ │ │ ├── DeckLinkAPI.h
│ │ │ │ ├── DeckLinkAPIConfiguration.h
│ │ │ │ ├── DeckLinkAPIConfiguration_v10_11.h
│ │ │ │ ├── DeckLinkAPIConfiguration_v10_2.h
│ │ │ │ ├── DeckLinkAPIConfiguration_v10_4.h
│ │ │ │ ├── DeckLinkAPIConfiguration_v10_5.h
│ │ │ │ ├── DeckLinkAPIConfiguration_v10_9.h
│ │ │ │ ├── DeckLinkAPIDeckControl.h
│ │ │ │ ├── DeckLinkAPIDiscovery.h
│ │ │ │ ├── DeckLinkAPIDispatch.cpp
│ │ │ │ ├── DeckLinkAPIDispatch_v10_11.cpp
│ │ │ │ ├── DeckLinkAPIDispatch_v10_8.cpp
│ │ │ │ ├── DeckLinkAPIDispatch_v7_6.cpp
│ │ │ │ ├── DeckLinkAPIDispatch_v8_0.cpp
│ │ │ │ ├── DeckLinkAPIModes.h
│ │ │ │ ├── DeckLinkAPITypes.h
│ │ │ │ ├── DeckLinkAPIVersion.h
│ │ │ │ ├── DeckLinkAPIVideoEncoderInput_v10_11.h
│ │ │ │ ├── DeckLinkAPIVideoInput_v10_11.h
│ │ │ │ ├── DeckLinkAPIVideoInput_v11_4.h
│ │ │ │ ├── DeckLinkAPIVideoInput_v11_5_1.h
│ │ │ │ ├── DeckLinkAPIVideoOutput_v10_11.h
│ │ │ │ ├── DeckLinkAPIVideoOutput_v11_4.h
│ │ │ │ ├── DeckLinkAPI_v10_11.h
│ │ │ │ ├── DeckLinkAPI_v10_2.h
│ │ │ │ ├── DeckLinkAPI_v10_4.h
│ │ │ │ ├── DeckLinkAPI_v10_5.h
│ │ │ │ ├── DeckLinkAPI_v10_6.h
│ │ │ │ ├── DeckLinkAPI_v10_9.h
│ │ │ │ ├── DeckLinkAPI_v11_5.h
│ │ │ │ ├── DeckLinkAPI_v11_5_1.h
│ │ │ │ ├── DeckLinkAPI_v7_1.h
│ │ │ │ ├── DeckLinkAPI_v7_3.h
│ │ │ │ ├── DeckLinkAPI_v7_6.h
│ │ │ │ ├── DeckLinkAPI_v7_9.h
│ │ │ │ ├── DeckLinkAPI_v8_0.h
│ │ │ │ ├── DeckLinkAPI_v8_1.h
│ │ │ │ ├── DeckLinkAPI_v9_2.h
│ │ │ │ ├── DeckLinkAPI_v9_9.h
│ │ │ │ └── LinuxCOM.h
│ │ │ ├── producer/
│ │ │ │ ├── decklink_producer.cpp
│ │ │ │ └── decklink_producer.h
│ │ │ └── util/
│ │ │ └── util.h
│ │ ├── ffmpeg/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── StdAfx.h
│ │ │ ├── consumer/
│ │ │ │ ├── ffmpeg_consumer.cpp
│ │ │ │ └── ffmpeg_consumer.h
│ │ │ ├── ffmpeg.cpp
│ │ │ ├── ffmpeg.h
│ │ │ ├── producer/
│ │ │ │ ├── av_input.cpp
│ │ │ │ ├── av_input.h
│ │ │ │ ├── av_producer.cpp
│ │ │ │ ├── av_producer.h
│ │ │ │ ├── ffmpeg_producer.cpp
│ │ │ │ └── ffmpeg_producer.h
│ │ │ └── util/
│ │ │ ├── audio_resampler.cpp
│ │ │ ├── audio_resampler.h
│ │ │ ├── av_assert.h
│ │ │ ├── av_util.cpp
│ │ │ └── av_util.h
│ │ ├── flash/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── StdAfx.h
│ │ │ ├── flash.cpp
│ │ │ ├── flash.h
│ │ │ ├── interop/
│ │ │ │ ├── Flash9e.IDL
│ │ │ │ ├── Flash9e_i.c
│ │ │ │ ├── TimerHelper.h
│ │ │ │ └── axflash.h
│ │ │ ├── producer/
│ │ │ │ ├── FlashAxContainer.cpp
│ │ │ │ ├── FlashAxContainer.h
│ │ │ │ ├── flash_producer.cpp
│ │ │ │ └── flash_producer.h
│ │ │ └── util/
│ │ │ ├── swf.cpp
│ │ │ └── swf.h
│ │ ├── html/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── html.cpp
│ │ │ ├── html.h
│ │ │ ├── producer/
│ │ │ │ ├── html_cg_proxy.cpp
│ │ │ │ ├── html_cg_proxy.h
│ │ │ │ ├── html_producer.cpp
│ │ │ │ └── html_producer.h
│ │ │ └── util.h
│ │ ├── image/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── consumer/
│ │ │ │ ├── image_consumer.cpp
│ │ │ │ └── image_consumer.h
│ │ │ ├── image.cpp
│ │ │ ├── image.h
│ │ │ ├── producer/
│ │ │ │ ├── image_producer.cpp
│ │ │ │ ├── image_producer.h
│ │ │ │ ├── image_scroll_producer.cpp
│ │ │ │ └── image_scroll_producer.h
│ │ │ └── util/
│ │ │ ├── image_algorithms.cpp
│ │ │ ├── image_algorithms.h
│ │ │ ├── image_converter.cpp
│ │ │ ├── image_converter.h
│ │ │ ├── image_loader.cpp
│ │ │ ├── image_loader.h
│ │ │ └── image_view.h
│ │ ├── newtek/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── StdAfx.h
│ │ │ ├── consumer/
│ │ │ │ ├── newtek_ndi_consumer.cpp
│ │ │ │ └── newtek_ndi_consumer.h
│ │ │ ├── interop/
│ │ │ │ ├── Processing.NDI.DynamicLoad.h
│ │ │ │ ├── Processing.NDI.Find.h
│ │ │ │ ├── Processing.NDI.FrameSync.h
│ │ │ │ ├── Processing.NDI.Lib.cplusplus.h
│ │ │ │ ├── Processing.NDI.Lib.h
│ │ │ │ ├── Processing.NDI.Recv.ex.h
│ │ │ │ ├── Processing.NDI.Recv.h
│ │ │ │ ├── Processing.NDI.RecvAdvertiser.h
│ │ │ │ ├── Processing.NDI.RecvListener.h
│ │ │ │ ├── Processing.NDI.Routing.h
│ │ │ │ ├── Processing.NDI.Send.h
│ │ │ │ ├── Processing.NDI.SendAdvertiser.h
│ │ │ │ ├── Processing.NDI.SendListener.h
│ │ │ │ ├── Processing.NDI.compat.h
│ │ │ │ ├── Processing.NDI.deprecated.h
│ │ │ │ ├── Processing.NDI.structs.h
│ │ │ │ └── Processing.NDI.utilities.h
│ │ │ ├── newtek.cpp
│ │ │ ├── newtek.h
│ │ │ ├── producer/
│ │ │ │ ├── newtek_ndi_producer.cpp
│ │ │ │ └── newtek_ndi_producer.h
│ │ │ └── util/
│ │ │ ├── ndi.cpp
│ │ │ └── ndi.h
│ │ ├── oal/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── consumer/
│ │ │ │ ├── oal_consumer.cpp
│ │ │ │ └── oal_consumer.h
│ │ │ ├── oal.cpp
│ │ │ └── oal.h
│ │ └── screen/
│ │ ├── CMakeLists.txt
│ │ ├── consumer/
│ │ │ ├── screen.frag
│ │ │ ├── screen.vert
│ │ │ ├── screen_consumer.cpp
│ │ │ └── screen_consumer.h
│ │ ├── screen.cpp
│ │ ├── screen.h
│ │ └── util/
│ │ ├── x11_util.cpp
│ │ └── x11_util.h
│ ├── protocol/
│ │ ├── CMakeLists.txt
│ │ ├── StdAfx.h
│ │ ├── amcp/
│ │ │ ├── AMCPCommand.cpp
│ │ │ ├── AMCPCommand.h
│ │ │ ├── AMCPCommandQueue.cpp
│ │ │ ├── AMCPCommandQueue.h
│ │ │ ├── AMCPCommandsImpl.cpp
│ │ │ ├── AMCPCommandsImpl.h
│ │ │ ├── AMCPProtocolStrategy.cpp
│ │ │ ├── AMCPProtocolStrategy.h
│ │ │ ├── amcp_args.cpp
│ │ │ ├── amcp_args.h
│ │ │ ├── amcp_command_context.h
│ │ │ ├── amcp_command_repository.cpp
│ │ │ ├── amcp_command_repository.h
│ │ │ ├── amcp_command_repository_wrapper.cpp
│ │ │ ├── amcp_command_repository_wrapper.h
│ │ │ └── amcp_shared.h
│ │ ├── osc/
│ │ │ ├── client.cpp
│ │ │ ├── client.h
│ │ │ └── oscpack/
│ │ │ ├── MessageMappingOscPacketListener.h
│ │ │ ├── OscException.h
│ │ │ ├── OscHostEndianness.h
│ │ │ ├── OscOutboundPacketStream.cpp
│ │ │ ├── OscOutboundPacketStream.h
│ │ │ ├── OscPacketListener.h
│ │ │ ├── OscPrintReceivedElements.cpp
│ │ │ ├── OscPrintReceivedElements.h
│ │ │ ├── OscReceivedElements.cpp
│ │ │ ├── OscReceivedElements.h
│ │ │ ├── OscTypes.cpp
│ │ │ └── OscTypes.h
│ │ └── util/
│ │ ├── AsyncEventServer.cpp
│ │ ├── AsyncEventServer.h
│ │ ├── ClientInfo.h
│ │ ├── ProtocolStrategy.h
│ │ ├── http_request.cpp
│ │ ├── http_request.h
│ │ ├── lock_container.cpp
│ │ ├── lock_container.h
│ │ ├── protocol_strategy.h
│ │ ├── strategy_adapters.cpp
│ │ ├── strategy_adapters.h
│ │ ├── tokenize.cpp
│ │ └── tokenize.h
│ ├── shell/
│ │ ├── CMakeLists.txt
│ │ ├── casparcg.config
│ │ ├── casparcg_auto_restart.bat
│ │ ├── copy_deps.sh
│ │ ├── included_modules.tmpl
│ │ ├── liberation-fonts/
│ │ │ ├── AUTHORS
│ │ │ ├── ChangeLog
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ └── TODO
│ │ ├── linux_specific.cpp
│ │ ├── main.cpp
│ │ ├── platform_specific.h
│ │ ├── resource.h
│ │ ├── run.sh
│ │ ├── server.cpp
│ │ ├── server.h
│ │ ├── shell.rc
│ │ └── windows_specific.cpp
│ ├── tools/
│ │ ├── CMakeLists.txt
│ │ └── bin2c.cpp
│ └── version.tmpl
└── tools/
├── linux/
│ ├── Dockerfile
│ ├── build-in-docker
│ ├── deb/
│ │ ├── INSTALLING
│ │ ├── debian-sid/
│ │ │ └── debian/
│ │ │ ├── .gitignore
│ │ │ ├── casparcg-server-beta.docs
│ │ │ ├── casparcg-server-beta.manpages
│ │ │ ├── casparcg.txt2man
│ │ │ ├── control
│ │ │ ├── copyright
│ │ │ ├── gbp.conf
│ │ │ ├── patches/
│ │ │ │ ├── README
│ │ │ │ └── series
│ │ │ ├── rules
│ │ │ ├── source/
│ │ │ │ └── format
│ │ │ ├── upstream/
│ │ │ │ └── metadata
│ │ │ └── watch
│ │ ├── debian-trixie/
│ │ │ └── debian/
│ │ │ ├── .gitignore
│ │ │ ├── casparcg-server-beta.docs
│ │ │ ├── casparcg-server-beta.manpages
│ │ │ ├── casparcg.txt2man
│ │ │ ├── control
│ │ │ ├── copyright
│ │ │ ├── gbp.conf
│ │ │ ├── patches/
│ │ │ │ ├── README
│ │ │ │ └── series
│ │ │ ├── rules
│ │ │ ├── source/
│ │ │ │ └── format
│ │ │ ├── upstream/
│ │ │ │ └── metadata
│ │ │ └── watch
│ │ ├── ubuntu-noble/
│ │ │ └── debian/
│ │ │ ├── .gitignore
│ │ │ ├── casparcg-server-beta.docs
│ │ │ ├── casparcg-server-beta.manpages
│ │ │ ├── casparcg.txt2man
│ │ │ ├── control
│ │ │ ├── copyright
│ │ │ ├── gbp.conf
│ │ │ ├── patches/
│ │ │ │ ├── README
│ │ │ │ └── series
│ │ │ ├── rules
│ │ │ ├── source/
│ │ │ │ └── format
│ │ │ ├── upstream/
│ │ │ │ └── metadata
│ │ │ └── watch
│ │ └── ubuntu-resolute/
│ │ └── debian/
│ │ ├── .gitignore
│ │ ├── casparcg-server-beta.docs
│ │ ├── casparcg-server-beta.manpages
│ │ ├── casparcg.txt2man
│ │ ├── control
│ │ ├── copyright
│ │ ├── gbp.conf
│ │ ├── patches/
│ │ │ ├── README
│ │ │ └── series
│ │ ├── rules
│ │ ├── source/
│ │ │ └── format
│ │ ├── upstream/
│ │ │ └── metadata
│ │ └── watch
│ ├── extract-from-docker
│ ├── install-dependencies
│ ├── run_docker.sh
│ └── start_docker.sh
├── update-format.sh
├── verify-format.sh
└── windows/
├── build.bat
└── package.bat
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
---
# TODO BreakBeforeLambdaBody
# TODO IncludeBlocks
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
#AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
#IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
#RawStringFormats:
# - Delimiter: pb
# Language: TextProto
# BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
UseTab: Never
...
================================================
FILE: .dockerignore
================================================
src/packages
src/cmake-build-*
build-scripts
build
resources
.git
.vscode
CMakeFiles
casparcg_server
dist
build
src/cmake-build-*
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.diff]
trim_trailing_whitespace = false
[*.patch]
trim_trailing_whitespace = false
[debian/rules]
indent_style = tab
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yaml
================================================
name: Bug report 🐛
description: Use this if you've found a bug
title: "Bug: [Short description of the bug]"
labels:
- type/bug
body:
- type: markdown
attributes:
value: |
Before you post, make sure to check for existing bug reports of the issue:
https://github.com/CasparCG/server/issues?q=+is%3Aissue+label%3Atype%2Fbug
- type: textarea
attributes:
label: Observed Behavior
description: What happened?
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
description: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: How can we reproduce the issue?
value: |
1.
2.
3. ...
validations:
required: true
- type: textarea
attributes:
label: Environment
description: What version of CasparCG and OS are you using?
value: |
* Commit: [e.g. ab1234c]
* Server version: [e.g. v2.2]
* Operating system: [e.g. Windows 10]
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: Question or need help?
url: https://casparcgforum.org/
about: Ask the community here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yaml
================================================
name: Feature request
description: Suggest an idea for this project
labels:
- type/enhancement
body:
- type: markdown
attributes:
value: |
Before you post, make sure to check for existing matching feature requests:
https://github.com/CasparCG/server/issues?q=+is%3Aissue+label%3Atype%2Fbug
- type: textarea
attributes:
label: Description
description: How should the feature/enhancement work?
validations:
required: true
- type: textarea
attributes:
label: Solution suggestion
description: If you have any suggestions on how the solution should work, add that here.
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/linux-system.yml
================================================
name: Build Linux with system dependencies
on:
push:
# branches: [ "master" ]
pull_request:
branches: ["master"]
jobs:
build:
name: ${{ matrix.container || matrix.os }} ${{ matrix.arch }} (${{matrix.family}}:${{ matrix.distribution }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
family: ubuntu
distribution: noble
arch: amd64
container: ""
apt_prefix: sudo
upload_artifacts: true
- os: ubuntu-latest
family: ubuntu
distribution: resolute
arch: amd64
container: ubuntu:26.04
apt_prefix: ""
upload_artifacts: false
- os: ubuntu-24.04-arm
family: ubuntu
distribution: resolute
arch: arm64
container: ubuntu:26.04
apt_prefix: ""
upload_artifacts: false
- os: ubuntu-latest
family: debian
distribution: trixie
arch: amd64
container: debian:trixie # Debian 13
apt_prefix: ""
upload_artifacts: false # Because of CEF, this is not built correctly
- os: ubuntu-latest
family: debian
distribution: sid
arch: amd64
container: debian:sid # Debian Testing
apt_prefix: ""
upload_artifacts: false # Because of CEF, this is not built correctly
- os: ubuntu-latest
family: debian
distribution: trixie
arch: amd64
container: debian:trixie
apt_prefix: ""
upload_artifacts: false # Because of CEF, this is not built correctly
- os: ubuntu-latest
family: archlinux
distribution: latest
arch: amd64
container: archlinux:latest
apt_prefix: ""
upload_artifacts: false # Not supported
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
defaults:
run:
shell: bash
steps:
- name: Install git (archlinux)
if: ${{ matrix.family == 'archlinux' }}
run: pacman -Sy --noconfirm git
- uses: actions/checkout@v6
- name: Setup environment
id: setup-env
if: ${{ matrix.family == 'ubuntu' || matrix.family == 'debian' }}
run: |
ln -s tools/linux/deb/${{ matrix.family }}-${{ matrix.distribution }}/debian ./
# Build a version number for this build
GH_REF="${GITHUB_REF##*/}"
GH_REF=$(echo "$GH_REF" | sed 's/[\/]/_/g' | sed 's/ /_/g')
VERSION_MAJOR=$(grep -oPi 'set\(CONFIG_VERSION_MAJOR \K\d+' src/CMakeLists.txt)
VERSION_MINOR=$(grep -oPi 'set\(CONFIG_VERSION_MINOR \K\d+' src/CMakeLists.txt)
VERSION_PATCH=$(grep -oPi 'set\(CONFIG_VERSION_BUG \K\d+' src/CMakeLists.txt)
BUILD_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}~${GH_REF}-${{ matrix.distribution }}+${GITHUB_SHA:0:7}"
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_OUTPUT
echo "Building as $BUILD_VERSION"
BUILD_FILENAME="casparcg-server-${BUILD_VERSION}"
echo "BUILD_FILENAME=$BUILD_FILENAME" >> $GITHUB_OUTPUT
# install some needed tooling
$APT_PREFIX apt-get update
$APT_PREFIX apt-get -y install build-essential dpkg-dev debhelper devscripts
if [[ "${{ matrix.family }}" == "ubuntu" ]]; then
$APT_PREFIX apt-get -y install software-properties-common
$APT_PREFIX add-apt-repository ppa:casparcg/ppa
fi
# Put something in the changelog
export DEBEMAIL="builds@casparcg.com"
export DEBFULLNAME="CasparCG Builds"
dch -v "$BUILD_VERSION" --create -D ${{ matrix.distribution }} --package casparcg-server-beta "Build"
# Install build dependencies
$APT_PREFIX apt-get -y build-dep .
if [[ "${{ matrix.family }}" == "ubuntu" ]]; then
# update the control file to reference the current cef version
CASPARCG_CEF_VER=$(dpkg-query -W -f='${Version}' casparcg-cef-142)
sed -i "s/@CASPARCG_CEF_VER@/${CASPARCG_CEF_VER}/" debian/control
# Download required packages
cd ..
apt-get download casparcg-cef-142=$CASPARCG_CEF_VER
apt-get download casparcg-scanner
fi
env:
CI: 1
DEBIAN_FRONTEND: noninteractive
APT_PREFIX: ${{ matrix.apt_prefix }}
- name: Run build
if: ${{ matrix.family == 'ubuntu' || matrix.family == 'debian' }}
run: |
# Perform build
debuild -b -uc -us
env:
CI: 1
- name: Collect artifacts
id: artifacts
if: ${{ (matrix.family == 'ubuntu' || matrix.family == 'debian') && matrix.upload_artifacts }}
run: |
mkdir -p dist
mv ../*.deb dist/
# collect some docs for the zip
cp README.md dist/
cp tools/linux/deb/INSTALLING dist/
# check if a release branch, or master, or a tag
if [[ "${{ github.ref_name }}" == "master" || "${{ github.ref_name }}" == "2.3.x-lts" ]]
then
# Only proceed if we have an sftp password
if [ -n "${{ secrets.SFTP_PASSWORD }}" ]
then
zip -r "${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip" dist
set -x
eval $(ssh-agent -s)
mkdir -v -m 700 $HOME/.ssh
ssh-keyscan -H ${{ secrets.SFTP_HOST }} > $HOME/.ssh/known_hosts
sshpass -p '${{ secrets.SFTP_PASSWORD }}' rsync -avvz --mkpath "${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip" "${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip"
fi
fi
env:
CI: 1
- uses: actions/upload-artifact@v7
if: ${{ (matrix.family == 'ubuntu' || matrix.family == 'debian') && matrix.upload_artifacts }}
with:
name: ${{ steps.setup-env.outputs.BUILD_FILENAME }}
path: dist
- name: Setup environment (archlinux)
if: ${{ matrix.family == 'archlinux' }}
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm --needed \
base-devel cmake ninja pkg-config \
boost boost-libs ffmpeg glew libglvnd \
onetbb openal sfml \
libxrandr simde
env:
CI: 1
- name: Run build (archlinux)
if: ${{ matrix.family == 'archlinux' }}
run: |
cmake -B build -S src \
-DCMAKE_BUILD_TYPE=Release \
-DDIAG_FONT_PATH="/usr/share/fonts/liberation/LiberationMono-Regular.ttf" \
-DENABLE_HTML=OFF \
-G Ninja
cmake --build build
env:
CI: 1
================================================
FILE: .github/workflows/linux.yml
================================================
name: Build Linux
on:
push:
# branches: [ "master" ]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v6
- name: Run build
run: |
./tools/linux/build-in-docker
env:
CI: 1
================================================
FILE: .github/workflows/windows.yml
================================================
name: Build Windows
on:
push:
# branches: [ "master" ]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v6
- name: Download media-scanner
uses: robinraju/release-downloader@v1.12
with:
repository: "casparcg/media-scanner"
latest: true
fileName: "*-win32-x64.zip"
tarBall: false
zipBall: false
out-file-path: "media-scanner"
extract: true
- name: Tidy media-scanner download
shell: bash
run: |
rm media-scanner/*.zip
- name: Run build
run: |
./tools/windows/build.bat
env:
CI: 1
MEDIA_SCANNER_FOLDER: "..\\media-scanner"
- name: Rename build
id: "rename-build"
shell: bash
run: |
TARGET=casparcg-server-${{ github.sha }}-windows.zip
mv dist/casparcg_server.zip "$TARGET"
echo "artifactname=$TARGET" >> $GITHUB_OUTPUT
# check if a release branch, or master, or a tag
if [[ "${{ github.ref_name }}" == "master" || "${{ github.ref_name }}" == "2.3.x-lts" ]]
then
# Only report if we have an sftp password
if [ -n "${{ secrets.SFTP_PASSWORD }}" ]
then
echo "uploadname=$TARGET" >> $GITHUB_OUTPUT
fi
fi
- uses: actions/upload-artifact@v7
with:
path: ${{ steps.rename-build.outputs.artifactname }}
archive: false
- name: Copy single file to remote
uses: garygrossgarten/github-action-scp@0.10.0
if: ${{ steps.rename-build.outputs.uploadname }}
timeout-minutes: 5
with:
local: "${{ steps.rename-build.outputs.uploadname }}"
remote: "${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.rename-build.outputs.uploadname }}"
host: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
================================================
FILE: .gitignore
================================================
*.dir
*.vcxproj
*.vcxproj.filters
*.tlog
*.sln
.settings
.vscode
.idea
.vs
build
dist
CMakeFiles
casparcg_server
*.spv
src/cmake-build-*
src/.idea
# debian build artifacts
/debian
/obj-*
================================================
FILE: BUILDING.md
================================================
# Building the CasparCG Server
The CasparCG Server source code uses the CMake build system in order to easily
generate build systems for multiple platforms. CMake is basically a build
system for generating build systems.
On Windows we can use CMake to generate a .sln file and .vcproj files. On
Linux CMake can generate make files or ninja files. Qt Creator has support for
loading CMakeLists.txt files directly.
# Dependency caching
CMake will automatically download some dependencies as part of the build process.
These are taken from https://github.com/CasparCG/dependencies/releases (make sure to expand the 'Assets' group under each release to see the files), most of which are direct copies of distributions from upstream.
During the build, you can specify the CMake option `CASPARCG_DOWNLOAD_MIRROR` to download from an alternate HTTP server (such as an internally hosted mirror), or `CASPARCG_DOWNLOAD_CACHE` to use a specific path on disk for the local cache of these files, by default a folder called `external` will be created inside the build directory to cache these files.
If you want to be able to build CasparCG offline, you may need to manually seed this cache. You can do so by placing the correct tar.gz or zip into a folder and using `CASPARCG_DOWNLOAD_CACHE` to tell CMake where to find it.
You can figure out which files you need by looking at each of the `ExternalProject_Add` function calls inside of [Bootstrap_Linux.cmake](./src/CMakeModules/Bootstrap_Linux.cmake) or [Bootstrap_Windows.cmake](./src/CMakeModules/Bootstrap_Windows.cmake). Some of the ones listed are optional, depending on other CMake flags.
# Windows
## Building distributable
1. Install Visual Studio 2022.
2. Install 7-zip (https://www.7-zip.org/).
3. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
4. `cd casparcg-server-master`
5. `.\tools\windows\build.bat`
6. Copy the `dist\casparcg_server.zip` file for distribution
## Development using Visual Studio
1. Install Visual Studio 2022.
2. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
3. Open the cloned folder in Visual Studio.
4. Build All and ensure it builds successfully
# Linux
## Building on your system
We only officially support Ubuntu LTS releases, other distros may work but often run into build issues. We are happy to accept PRs to resolve these issues, but are unlikely to write fixes ourselves.
We currently document two approaches to building CasparCG. The recommended way is to use the `deb` packaging we have in the repository, but we only provide that for Ubuntu LTS releases.
Other deb based distros can work with some tweaks to one of those, other distros will need something else which is not documented here.
We also provide a script to produce a build in docker, but this is not recommended unless absolutely necessary. The resulting builds are often rather brittle depending on where they are used.
To perform a custom build, follow the Development steps below, and you may need to do some extra packaging steps, or install steps on the target systems.
### Building inside Docker
1. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
2. `cd casparcg-server-master`
3. `./tools/linux/build-in-docker`
If all goes to plan, a docker image `casparcg/server` has been created containing CasparCG Server.
### Extracting CasparCG Server from Docker
1. `./tools/linux/extract-from-docker`
You will then find a folder called `casparcg_server` which should contain everything you need to run CasparCG Server.
_Note: if you ran docker with sudo, CasparCG server will not be able to run without sudo out of the box. For security reasons we do not recommend to run CasparCG with sudo. Instead you can use chown to change the ownership of the CasparCG Server folder._
## Development
Before beginning, check the build options section below, to decide if you want to use any to simplify or customise your build.
1. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
2. `cd casparcg-server-master`
3. Install dependencies, this can be done with `sudo ./tools/linux/install-dependencies`
4. If using system CEF (default & recommended), `sudo add-apt-repository ppa:casparcg/ppa` and `sudo apt-get install casparcg-cef-142-dev`
5. `mkdir build && cd build`
6. `cmake ../src` You can add any of the build options from below to this command
7. `cmake --build . --parallel`
8. `cmake --install . --prefix staging`
If all goes to plan, a folder called 'staging' has been created with everything you need to run CasparCG server.
## Build options
-DENABLE_HTML=OFF - useful if you lack CEF, and would like to build without that module.
-DUSE_STATIC_BOOST=ON - (Linux only, default OFF) statically link against Boost.
-DUSE_SYSTEM_CEF=OFF - (Linux only, default ON) use the version of CEF from your OS. This expects to be using builds from https://launchpad.net/~casparcg/+archive/ubuntu/ppa
-DENABLE_AVX2=ON (Linux only, default OFF) Enable the AVX and AVX2 instruction sets (requires a CPU that supports it)
-DDIAG_FONT_PATH - Specify an alternate path/font to use for the DIAG window. On linux, this will often want to be set to an absolute path of a font
-DCASPARCG_BINARY_NAME=casparcg-server - (Linux only) generate the executable with the specified name. This also reconfigures the install target to be a bit more friendly with system package managers.
================================================
FILE: CHANGELOG.md
================================================
CasparCG 2.5.0 Stable
==========================================
### Core
##### Improvements
* Initial support for HDR. This is limited to a subset of producers and consumers at this stage.
* Build for Windows with VS2022
* Rework linux builds to produce ubuntu deb files
* Update ffmpeg to 7.0
* Reimplement mixer transforms, to handle routes correctly
* Support more pixel formats from ffmpeg, to preserve colour accuracy better
* Support running on headless linux
* Transitions: Additional behaviours
##### Fixes
* Build with boost 1.85/1.86/1.87/1.88
* Build with ffmpeg 7.1
* Only produce mixed frames on channels which have consumers
* Routed channels not compositing correctly when channel used a MIXER KEY
* Handle audio for fractional framerates properly
* Gracefully exit on SIGINT and SIGTERM
### Producers
##### Improvements
* FFmpeg: Support loading with a scaling-mode, to configure how clips get fit into the channel
* FFmpeg: Support more pixel formats without cpu conversion
* FFmpeg: Enable alpha for webm videos
* Image: Support loading with a scaling-mode, to configure how images get fit into the channel
* Image: Replace freeimage with ffmpeg
* HTML: Update CEF to 142
* HTML: Support audio
##### Fixes
* Route: Use full field rate when performing i->p channel route
* HTML: Gracefully handle page load errors
* HTML: Always set cache path
### Consumers
##### Improvements
* Screen: Set size and position from AMCP
* Screen: Improve performance
* Image: Propagate AMCP parameters from PRINT command
* FFmpeg: Remove unnecessary forced conversion to YUVA422
* Decklink: Support explicit yuv output (requires AVX2)
* Decklink: Allow selecting device by hardware persistent id
##### Fixes
* FFmpeg: Correctly handle PTS on frame drop
CasparCG 2.4.3 Stable
==========================================
### Core
##### Fixes
* Improve error handling for invalid config files #1571
* Flush logs before exit #1571
* Check audio cadence values look sane before accepting format #1588
* Cross-channel routes from progressive to interlaced showing lots of black #1576
* Transition: ignoring some transforms of input frames #1602
### Producers
##### Fixes
* FFmpeg: fix crash on invalid frame header
* Decklink: Crash with ffmpeg 7 #1582
* HTML: Fix crash during uninit on exit
* Image: update state during init #1601
### Consumers
##### Fixes
* FFmpeg: set frame_rate for rtmp streams #1462
CasparCG 2.4.2 Stable
==========================================
### Consumers
##### Fixes
* Decklink: fix support for driver 14.3 and later
CasparCG 2.4.1 Stable
==========================================
### Core
##### Fixes
* Fix bad config file examples
* Fix `casparcg_auto_restart.bat` not starting scanner
* Revert removal of tbbmalloc, due to notable performance loss on windows
* Suppress some cmake build warnings
* Build failure when doxygen installed on system
* Build failures with ffmpeg 7.0
* Revert RPATH linking changes
### Producers
##### Fixes
* FFmpeg: Ignore ndi:// urls
* FFmpeg: Using both in and seek could result in incorrect duration
* Route: Race condition during destruction
* Image: Update freeimage on windows with some CVE fixes and failures with certain pngs
* Image: Respect EXIF rotate flag
* NDI: list local sources
### Consumers
##### Fixes
* Decklink: subregion copy not respecting frame height
* Decklink: subregion vertical offset
* Decklink: subregion height limited with some formats
CasparCG 2.4.0 Stable
==========================================
### Core
##### Improvements
* Custom resolutions can be specified in casparcg.config
* Interlaced mixer pipeline to ensure field accuracy
* Preserve unicode characters in console input/output
* Producers to be run at startup can be defined in casparcg.config
* Support 8K frames
* Support 4K DCI frames
* Remove undocumented CII and CLK protocol implementations
* Config parameter can be an absolute system path, not just relative to the working directory
* AMCP: Add CLEAR ALL command
* AMCP: Command batching syntax
* AMCP: LOAD/LOADBG/PLAY commands accept a CLEAR_ON_404 parameter, to instruct the layer to be cleared when the requested file was not found
* AMCP: Add commands to subscribe and unsubscribe to OSC on any port number
* AMCP: Add CALLBG command to perform CALL on background producer
* Build: Require C++17 for building
* Build: Support newer versions of Boost
* Build: Support newer versions of TBB
* Build: Disable precompiled headers for linux
* Build: Support VS2022
* Build: Replace nuget and locally committed dependencies with direct http downloads
* Build: Allow configuring diag font path at build time
* Linux: Support setting thread priorities
* Linux: Initial ARM64 compatibility
* Linux: Rework build to always use system boost
* Linux: Rework build process to better support being build as a system package
* Logging: add config option to disable logging to file and to disable column alignment
* Transitions: Support additional audio fade properties for STING transition
##### Fixes
* Crash upon exiting if HTML producer was running
* AMCP: Ensure all consumers and producers are reported in `INFO` commands
* AMCP: Deferred mixer operations were not being cleared after being applied
* AMCP: `LOAD` command would show a frame or two of black while new producer was loading
* OpenGL: Fix support for recent Linux drivers
* Linux: Fix endless looping on stdin
* Route: Fix error when clearing layer
* Transitions: Fix wipe duration
### Producers
##### Improvements
* Decklink: Require driver 11.0 or later
* Decklink: Scale received frames on GPU
* FFmpeg: Update to v5.1
* FFmpeg: Improve performance
* FFmpeg: Allow specifying both SEEK and IN for PLAY commands
* HTML: Update to CEF 117
* HTML: `CALL 1-10 RELOAD` to reload a renderer
* HTML: Expose `cache-path` setting
* NDI: Upgrade to NDI5
* System Audio: Allow specifying output device to use
##### Fixes
* Decklink: Log spamming when using some input formats
* FFmpeg: Prevent loading unreadable files
* FFmpeg: Unable to play files with unicode filenames
* FFmpeg: Don't lowercase filter parameters
* FFmpeg: Support parameters with name containing a dash
* HTML: media-stream permission denied
* HTML: Expose angle backend config field, the best backend varies depending on the templates and machine
* HTML: Crash when multiple iframes were loaded within a renderer
* Image: Improve file loading algorithm to match the case insensitive and absolute path support already used by ffmpeg
### Consumers
##### Improvements
* Artnet: New artnet consumer
* Decklink: Configure device duplex modes in casparcg.config
* Decklink: Output a subregion of the channel
* Decklink: Add secondary outputs in a consumer, to ensure sync when used within a single card
* iVGA: Remove consumer
* NDI: Upgrade to NDI5
##### Fixes
* Decklink: Fix stutter when loading clips
* FFmpeg: Fix RTMP streaming missing headers
* NDI: dejitter
CasparCG 2.3.3 LTS Stable
==========================================
### Producers
##### Improvements
* Image Scroll Producer: Ported from 2.1
CasparCG 2.3.2 LTS Stable
==========================================
### Producers
##### Fixes
* Packages: Update TBB library to v2021.1.1 - fixes CPU and memory growth when deleting threads
* FFmpeg: Fix possible deadlock leading to producer not being cleaned up correctly
CasparCG 2.3.2 Beta
==========================================
### Producers
##### Fixes
* Packages: Update TBB library to v2021.1.1 - fixes CPU and memory growth when deleting threads
* FFmpeg: Fix possible deadlock leading to producer not being cleaned up correctly
CasparCG 2.3.1 Stable
==========================================
### Producers
##### Fixes
* Flash: Use proper file urls when loading templates, to allow it to work after Flash Player EOL
* FFmpeg: Various HTTP playback improvements
CasparCG 2.3.0 Stable
==========================================
### Producers
##### Features
* FFmpeg: Add more common file extensions to the supported list
* NDI: Require minimum of NDI v4.0
##### Fixes
* HTML: Minimise performance impact on other producers
CasparCG 2.3.0 RC
==========================================
### Producers
##### Features
* Flash: Disable by default, requires enabling in the config file
* FFmpeg: Remove fixed thread limit to better auto select a number
##### Fixes
* Decklink: Downgrade severity of video-format not supported
* FFmpeg: Correctly handle error codes. Ignore exit errors during initialisation
* Route: Detect circular routes and break the loop
### Consumers
##### Features
* Bluefish: Various improvmements including support for Kronos K8
### General
##### Fixes
* Diag not reflecting channel videoformat changes
CasparCG 2.3.0 Beta 1
==========================================
### Producers
##### Features
* Decklink: Detect and update input format when no format is specified in AMCP
* Decklink: Improve performance (gpu colour conversion & less heavy deinterlacing when possible)
* Decklink: `LOAD DECKLINK` will display live frames instead of black
* FFmpeg: Update to 4.2.2
* HTML: Better performance for gpu-enabled mode
* HTML: `window.remove()` has been partially reimplemented
* NDI: Native NDI producer
* Route: Allow routing first frame of background producer
* Route: zero delay routes when within a channel, with 1 frame when cross-channel
* Transition: Add sting transitions
* Add frames_left field to osc/info for progress towards autonext
##### Fixes
* Colour: parsing too much of amcp string as list of colours
* FFmpeg: Always resample clips to 48khz
* FFmpeg: Ensure frame time reaches the end of the clip
* FFmpeg: RTMP stream playback
* FFmpeg: SEEK and LENGTH parameters causing issues with AUTONEXT
* FFmpeg: Ensure packets/frames after the decided end of the clip are not displayed
* FFmpeg: Incorrect seek for audio when not 48khz
* FFmpeg: Some cases where it would not be destroyed if playing a bad stream
* HTML: unlikely but possible exception when handling frames
* HTML: set autoplay-policy
* HTML: animations being ticked too much
* Route: Sending empty frame into a route would cause the destination to reuse the last frame
### Consumers
##### Features
* Audio: Fix audio crackling
* Audio: Fix memory leak
* Bluefish: Various improvmements including supporting more channels and UHD.
* NDI: Native NDI consumer
* Screen: Add side by side key output
* Screen: Add support for Datavideo TC-100/TC-200
##### Fixes
* Decklink: Tick channel at roughly consistent rate when running interlaced output
* Possible crash when adding/removing consumers
### General
##### Features
* Add mixer colour invert property
* Restore `INFO CONFIG` and `INFO PATHS` commands
* Linux: Update docker images to support running in docker (not recommended for production use)
##### Fixes
* NTSC audio cadence
* Ignore empty lines in console input
* Fix building with clang on linux
* Fix building with vs2019
* Better error when startup fails due to AMCP port being in use
* Backslash is a valid trailing slash for windows
CasparCG 2.2.0
==========================================
General
-------
* C++14
* Major refactoring, cleanup, optimization
and stability improvements.
* Removed unmaintained documentation API.
* Removed unmaintained program options API.
* Removed unused frame age API.
* Removed misc unused and/or unmaintained APIs.
* Removed TCP logger.
* Fixed memory leak in transition producer.
* Removed PSD Producer (moved to 3.0.0).
* Removed Text Producer (moved to 3.0.0).
* Removed SyncTo consumer.
* Removed channel layout in favor of 8 channel passthrough
and FFMPEG audio filters.
* Major stability and performance improvements of GPU code.
* Requires OpenGL 4.5.
* Repo cleanup (>2GB => <100MB when cloning).
* Misc cleanup and fixes.
Build
-----
* Linux build re done with Docker.
* Windows build re done with Nuget.
HTML
----
* Updated to Chromium 63 (Julusian).
* Allow running templates from arbitrary urls (Julusian).
DECKLINK
--------
* Fixed broken Linux.
* Misc cleanup and fixes.
* Complex FFMPEG filters (VF, AF).
MIXER
-----
* Performance improvements.
* Removed straight output (moved to 3.0.0).
* Proper OpenGL pipelining.
* Blend modes are always enabled.
* Misc cleanup and fixes.
* Removed CPU mixer.
* Mixer always runs in progressive mode. Consumers are expected to convert to interlaced if required.
IMAGE
-----
* Correctly apply alpha to base64 encoded pngs from AMCP (Julusian).
* Unmultiply frame before writing to png (Julusian).
* Removed scroll producer (moved to 3.0.0)
ROUTE
-----
* Reimplemented, simplified.
* Cross channel routing will render full stage instead of simply copying channel output.
* Reduced overhead and latency.
FFMPEG
------
* Rewritten from scratch for better accuracy, stability and
performance.
* Update freezed frame during seeking.
* FFMPEG 3.4.1.
* Reduce blocking during initialization.
* Fixed timestamp handling.
* Fixed V/A sync.
* Fixed interlacing.
* Fixed framerate handling.
* Fixed looping.
* Fixed seeking.
* Fixed duration.
* Audio resampling to match timestamps.
* Fixed invalid interlaced YUV (411, 420) handling.
* Added YUV(A)444.
* Added IO timeout.
* Added HTTP reconnect.
* FFMPEG video filter support.
* FFMPEG audio filter support.
* Complex FFMPEG filters (VF, AF).
* CALL SEEK return actually sought value.
* All AMCP options are based on channel format.
* Misc improvements, cleanup and fixes.
Bluefish
--------
* Misc cleanup and fixes.
OAL
------------
* Added audio sample compensation to avoid audio distortions
during time drift.
* Misc cleanup and fixes.
Screen
---------------
* Proper OpenGL pipelining.
* Misc cleanup and fixes.
AMCP
----
* Added PING command (Julusian).
* Removed INFO commands in favor of OSC.
* Moved CLS, CINF, TLS, FLS, TLS, THUMBNAIL implementations into
a separate NodeJS service which is proxied through
an HTTP API.
* Misc cleanup and fixes.
CasparCG 2.1.0 Next (w.r.t 2.1.0 Beta 2)
==========================================
General
-------
* Removed asmlib dependency in favor of using standard library std::memcpy and
std::memset, because of better performance.
CasparCG 2.1.0 Beta 2 (w.r.t 2.1.0 Beta 1)
==========================================
General
-------
* Fail early with clear error message if configured paths are not
creatable/writable.
* Added backwards compatibility (with deprecation warning) for using
thumbnails-path instead of thumbnail-path in casparcg.config.
* Suppress the logging of full path names in stack traces so that only the
relative path within the source tree is visible.
* General stability improvements.
* Native thread id is now logged in Linux as well. Finally they are mappable
against INFO THREADS, ps and top.
* Created automatically generated build number, so that it is easier to see
whether a build is newer or older than an other.
* Changed configuration element mipmapping_default_on to mipmapping-default-on
for consistency with the rest of the configuration (Jesper Stærkær).
* Handle stdin EOF as EXIT.
* Added support for RESTART in Linux startup script run.sh.
* Copy casparcg_auto_restart.bat into Windows releases.
* Fixed bug with thumbnail generation when there are .-files in the media
folder.
* Removed CMake platform specification in Linux build script
(Krzysztof Pyrkosz).
* Build script for building FFmpeg for Linux now part of the repository.
Contributions during development (not w.r.t 2.1.0 Beta 1):
* Fix ffmpeg build dependencies on clean Ubuntu desktop amd64 14.04.3 or
higher (Walter Sonius).
* Added support for video modes 2160p5000, 2160p5994 and 2160p6000
(Antonio Ruano Cuesta).
* Fixed serious buffer overrun in FFmpeg logging code.
Consumers
---------
* FFmpeg consumer:
* Fixed long overdue bug where HD material was always recorded using the
BT.601 color matrix instead of the BT.709 color matrix. RGB codecs like
qtrle was never affected but all the YCbCr based codecs were.
* Fixed bug in parsing of paths containing -.
* Fixed bugs where previously effective arguments like -pix_fmt were
ignored.
* Fixed bug where interlaced channels where not recorded correctly for
some codecs.
* DeckLink consumer:
* Rewrote the frame hand-off between send() and ScheduledFrameCompleted() in
a way that hopefully resolves all dead-lock scenarios previously possible.
* Bluefish consumer:
* Largely rewritten against newest SDK Driver 5.11.0.47 (Satchit Nambiar and
James Wise sponsored by Bluefish444):
* Added support for Epoch Neutron and Supernova CG. All current Epoch
cards are now supported.
* Added support for for multiple SDI channels per card. 1 to 4 channels
per Bluefish444 card depending on model and firmware.
* Added support for single SDI output, complementing existing external key
output support.
* Added support for internal key using the Bluefish444 hardware keyer.
* Screen consumer:
* Fixed full screen mode.
Producers
---------
* FFmpeg producer:
* Increased the max number of frames that audio/video can be badly
interleaved with (Dimitry Ishenko).
* Fixed bug where decoders sometimes requires more than one video packet to
decode the first frame.
* Added support for IN and OUT parameters (Dimitry Ishenko).
* Added DV/HDV video device support under Linux (Walter Sonius).
* Remove unused flags variable in queued_seek (Dimitry Ishenko).
* Now recognizes .ts files without probing contents (Ovidijus Striaukas).
* Fixed uninitialized value causing initial log printout to usually say that
clips are interlaced when they are not.
* Destroy producer proxy:
* Created workaround for bug in FFmpeg where every new thread used to
cleanup caused handles to leak (not sure why). Reduced the effect by using
only one thread for all producer destructions.
* Framerate producer:
* Fixed bug when INFO was used on a not yet playing framerate producer.
* HTML producer:
* Fixed bug where only URL:s with . in them where recognized.
* Image producer:
* Added LENGTH parameter to allow for queueing with LOADBG AUTO.
* Fixed inconsistency in what file extensions are supported vs listed in
CLS/CINF.
* Layer producer:
* Fixed serious bug where a circular reference of layer producers caused a
stack overflow and server crash.
* Can now route from layer on a channel with an incompatible framerate.
* Channel producer:
* Can now route from channel with an incompatible framerate.
* Deinterlaces interlaced content from source channel.
* Added optional NO_AUTO_DEINTERLACE parameter to opt out of the mentioned
deinterlacing.
* Scene producer:
* Added abs(), floor(), to_lower(), to_upper() and length() functions to the
expression language.
* Created XML Schema for the *.scene XML format. Allows for IDE-like auto-
completion, API documentation and validation.
* Added possibility to specify the width and height of a layer instead of
letting the producer on the layer decide.
* Added global variables scene_width, scene_height and fps.
* Made it possible to use expressions in keyframe values.
* Fixed serious bug where uninitialized values were used.
* Created more example scenes.
* Can now forward CALL, CG PLAY, CG STOP, CG NEXT and CG INVOKE to the
producer on a layer.
* CG proxy wrapper producer:
* New in 2.1.0.
* Allows all CG producers to be used as an ordinary producer inside a layer
in a scene.
* Allows the Scene producer to know what variables are available in a
template.
* Color producer:
* Now has support for gradients.
* PSD producer:
* Added support for centered and right justified text.
* Text producer:
* Fixed bug where tracking contributed to the overall text width on the
last character.
Mixer
-----
* Fixed bug in the contrast/saturation/brightness code where the wrong luma
coefficients was used.
* Rewrote the chroma key code to support variable hue, instead of fixed green
or blue. Threshold setting was removed in favour of separate hue width,
minimum saturation and minimum brightness constraints. Also a much more
effective spill suppression method was implemented.
* Fixed bug where glReadPixels() was done from the last drawn to texture
instead of always from the target texture. This means that for example a
MIXER KEYER layer without a layer above to key, as well as a separate alpha
file with MIXER OPACITY 0 now works as expected.
* Fixed bug where already drawn GL_QUADS were not composited against, causing
for example italic texts to be rendered incorrectly in the text_producer.
AMCP
----
* INFO PATHS now adds all the path elements even if they are using the default
values.
* MIXER CHROMA syntax deprecated (still supported) in favour of the more
advanced syntax required by the rewritten chroma key code.
* Added special command REQ that can be prepended before any command to
identify the response with a client specified request id, allowing a client
to know exactly what asynchronous response matched a specific request.
* Added support for listing contents of a specific directory for CLS, TLS,
DATA LIST and THUMBNAIL LIST.
* Fixed bug where CINF only returned the first match.
* Fixed bug where a client closing the connection after BYE instead of
letting the server close the connection caused an exception to be logged.
CasparCG 2.1.0 Beta 1 (w.r.t 2.0.7 Stable)
==========================================
General
-------
* 64 bit!
* Linux support!
* Moved to CMake build system for better platform independence.
* Contributions before build system switch (not w.r.t 2.0.7 Stable):
* gitrev.bat adaptions for 2.1 (Thomas Kaltz III).
* Thanks to our already heavy use of the pimpl idiom, abstracting platform
specifics was easily done by having different versions of the .cpp files
included in the build depending on target platform. No #ifdef necessary,
except for in header only platform specific code.
* Flash, Bluefish and NewTek modules are not ported to the Linux build.
* Contributions during development (not w.r.t 2.0.7 Stable):
* Fixed compilation problems in Linux build (Dimitry Ishenko).
* Fixed compilation problem in GCC 5 (Krzysztof Pyrkosz).
* Fixed thumbnail image saving on Linux (Krzysztof Pyrkosz).
* Fixed compilation problem in PSD module (Krzysztof Pyrkosz).
* Major code refactoring:
* Mixer abstraction so different implementations can be created. Currently
CPU mixer and GPU mixer (previously the usage of the GPU was mandatory)
exists.
* Flattened folder structure for easier inclusion of header files.
* Many classes renamed to better describe the abstractions they provide.
* Sink parameters usually taken by value and moved into place instead of
taken by const reference as previously done.
* Old Windows specific AsyncEventServer class has been replaced by platform
independent implementation based on Boost.Asio.
* Pimpl classes are now stack allocated with internal shared_ptr to
implementation, instead of both handle and body being dynamically
allocated. This means that objects are now often passed by value instead
of via safe_ptr/shared_ptr, because they are internally reference counted.
* Protocol strategies are now easier to implement correctly, because of
separation of state between different client connections.
* Complete AMCP command refactoring.
* On-line help system that forces the developer to document AMCP commands,
producer syntaxes and consumer syntaxes making the documentation coupled
to the code, which is great.
* Added missing help for VERSION command (Jesper Stærkær).
* Upgraded Windows build to target Visual Studio 2015 making it possible to
use the C++11 features also supported by GCC 4.8 which is targeted on
Linux.
* Fixed compilation problems in Visual Studio 2015 Update 1
(Roman Tarasov)
* Created abstraction of the different forms of templates (flash, html, psd
and scene). Each module registers itself as a CG producer provides. All CG
commands transparently works with all of them.
* Audio mixer now uses double samples instead of float samples to fully
accommodate all int32 samples.
* Reduced coupling between core and modules (and modules and modules):
* Modules can register system info providers to contribute to INFO SYSTEM.
* XML configuration factories for adding support for new consumer elements
in casparcg.config.
* Server startup hooks can be registered (used by HTML producer to fork
its sub process).
* Version providers can contribute content to the VERSION command.
* Refactored multichannel audio support to use FFmpeg's PAN filter and
simplified the configuration a lot.
* Upgraded most third party libraries we depend on.
* Some unit tests have been created.
* Renamed README.txt to README, CHANGES.txt to CHANGELOG and LICENSE.txt to
LICENSE
* Created README.md for github front page in addition to README which is
distributed with builds.
* README file updates (Jonas Hummelstrand).
* Created BUILDING file describing how to build the server on Windows and
Linux.
* Diagnostics:
* Now also sent over OSC.
* Diag window is now scrollable and without squeezing of graphs.
* Contextual information such as video channel and video layer now included
in graphs.
* Logging:
* Implemented a TCP server, simply sending every log line to each connected
client. Default port is 3250.
* Changed default log level to info and moved debug statements that are
interesting in a production system to info.
* Try to not log full stack traces when user error is the cause. Stacktraces
should ideally only be logged when a system error or a programming error
has occurred.
* More contextual information about an error added to exceptions. An example
of this is that XML configuration errors now cause the XPath of the error
is logged.
* Improved the readability of the log format.
* Added optional calltrace.log for logging method calls. Allows for trace
logging to be enabled while calltracing is disabled etc.
OSC
---
* Improved message formatting performance.
* Added possibility to disable sending OSC to connected AMCP clients.
* Fixed inconsistent element name predefined_client to predefined-client in
casparcg.config (Krzysztof Pyrkosz).
Consumers
---------
* System audio consumer:
* Pushes data to openal instead of being callbacked by SFML when data is
needed.
* Added possibility to specify the expected delay in the sound card. Might
help get better consumer synchronization.
* Screen consumer:
* Added mouse interaction support, usable by the producers running on the
video channel.
* FFmpeg consumer:
* Replaced by Streaming Consumer after it was adapted to support everything
that FFmpeg Consumer did.
* Added support for recording all audio channels into separate mono audio
streams.
* Now sends recording progress via OSC.
* SyncTo consumer:
* New in 2.1.0.
* Allows the pace of a channel to follow another channel. This is useful for
virtual "precomp" channels without a DeckLink consumer to pace it.
* DeckLink consumer:
* Added workaround for timescale bug found in Decklink SDK 10.7.
* Now ScheduledFrameCompleted is no longer only used for video scheduling
but for audio as well, simplifying the code a lot.
* iVGA consumer:
* No longer provides sync to the video channel.
* Supports NewTek NDI out of the box just by upgrading the
Processing.AirSend library.
Producers
---------
* Scene producer:
* New in 2.1.0.
* Utilizes CasparCG concepts such as producers, mixer transforms and uses
them in a nested way to form infinite number of sub layers. Think movie
clip in Flash.
* A scene consists of variables, layers, timelines and marks (intro and
outro for example).
* Mostly for use by other producers but comes with a XML based producer that
is a registered CG producer and shows up in TLS.
* Enables frame accurate compositions and animations.
* Has a powerful variable binding system (think expressions in After Effects
or JavaFX Bindings).
* PSD producer:
* New in 2.1.0.
* Parses PSD files and sets up a scene for the Scene producer to display.
* Text layers based on CG parameters.
* Supports Photoshop timeline.
* Uses Photoshop comment key-frames to describe where intro and outro (CG
PLAY and CG STOP) should be in the timeline.
* Shows up as regular templates in TLS.
* Text producer:
* New in 2.1.0.
* Renders text using FreeType library.
* Is used by the PSD producer for dynamic text layers.
* Image scroll producer:
* Speed can be changed while running using a CALL. The speed change can be
tweened.
* Added support for an absolute end time so that the duration is calculated
based on when PLAY is called for shows when an exact end time is
important.
* Image producer:
* Fixed bug where too large (OpenGL limit) images were accepted, causing
problems during thumbnail generation.
* Framerate producer:
* New in 2.1.0.
* Wraps a producer with one framerate and converts it to another. It is not
usable on its own but is utilized in the FFmpeg producer and the DeckLink
consumer.
* Supports different interpolation algorithms. Currently a no-op
drop-and-repeat mode and a two different frame blending modes.
* It also supports changing the speed on demand with tweening support.
* FFmpeg producer:
* Supports decoding all audio streams from a clip. Useful with .mxf files
which usually have separate mono streams for every audio channel.
* No longer do framerate conversion (half or double), but delegates that
task to the Framerate producer.
* Added support for v4l2 devices.
* Added relative and "from end" seeking (Dimitry Ishenko).
* Contributions during development (not w.r.t 2.0.7 Stable):
* Fixed 100% CPU problem on clip EOF (Peter Keuter, Robert Nagy).
* Constrained SEEK within the length of a clip (Dimitry Ishenko).
* Fixed a regular expression (Dimitry Ishenko).
* DeckLink producer:
* No longer do framerate conversion (half or double), but delegates that
task to the Framerate producer.
* Route producer:
* Added possibility to delay frames routed from a layer or a channel.
* HTML Producer:
* Disabled web security in HTML Producer (Robert Nagy).
* Reimplemented requestAnimationFrame handling in Javascript instead of C++.
* Implemented cancelAnimationFrame.
* Increased animation smoothness in HTML Producer with interlaced video
modes.
* Added remote debugging support.
* Added mouse interaction support by utilizing the Screen consumer's new
interaction support.
* Flash Producer:
* Contributions during development (not w.r.t 2.0.7 Stable):
* Workaround for flickering with high CPU usage and CPU accelerator
(Robert Nagy)
AMCP
----
* TLS has a new column for "template type" for clients that want to
differentiate between html and flash for example.
* SET CHANNEL_LAYOUT added to be able to change the audio channel layout of a
video channel at runtime.
* HELP command added for accessing the new on-line help system.
* FLS added to list the fonts usable by the Text producer.
* LOCK command added for controlling/gaining exclusive access to a video
channel.
* LOG CATEGORY command added to enable/disable the new log categories.
* SWAP command now optionally supports swapping the transforms as well as the
layers.
* VERSION command can now provide CEF version.
CasparCG Server 2.0.7 Stable (as compared to CasparCG Server 2.0.7 Beta 2)
==========================================================================
General
-------
* Added support for using a different configuration file at startup than the
default casparcg.config by simply adding the name of the file to use as the
first command line argument to casparcg.exe.
* Upgraded FFmpeg to latest stable.
* Created build script.
* Fixed bug where both layer_producer and channel_producer display:s and
empty/late first frame when the producer is called before the consumer in
the other end has received the first frame.
* Added rudimentary support for audio for layer_producer and channel_producer.
* Upgraded DeckLink SDK to 10.1.4, bringing new 2K and 4K DCI video modes. New
template hosts also available for those modes.
* General bug fixes (mostly memory and resource leaks, some serious).
* Updated Boost to version 1.57
* Frontend no longer maintained and therefore not included in the release.
Mixer
-----
* Added support for rotation.
* Added support for changing the anchor point around which fill_translation,
fill_scale and rotation will be done from.
* Added support for perspective correct corner pinning.
* Added support for mipmapped textures with anisotropic filtering for
increased downscaling quality. Whether to enable by default can be
configured in casparcg.config.
* Added support for cropping a layer. Not the same as clipping.
AMCP
----
* Added RESUME command to complement PAUSE. (Peter Keuter)
* To support the new mixer features the following commands has been added:
* MIXER ANCHOR -- will return or modify the anchor point for a layer
(default is 0 0 for backwards compatibility). Example:
MIXER 1-10 ANCHOR 0.5 0.5
...for changing the anchor to the middle of the layer
(a MIXER 1-10 FILL 0.5 0.5 1 1 will be necessary to place the layer at the
same place on screen as it was before).
* MIXER ROTATION -- will return or modify the angle of which a layer is
rotated by (clockwise degrees) around the point specified by ANCHOR.
* MIXER PERSPECTIVE -- will return or modify the corners of the perspective
transformation of a layer. One X Y pair for each corner (order upper left,
upper right, lower right and lower left). Example:
MIXER 1-10 PERSPECTIVE 0.4 0.4 0.6 0.4 1 1 0 1
* MIXER MIPMAP -- will return or modify whether to enable mipmapping of
textures produced on a layer. Only frames produced after a change will be
affected. So for example image_producer will not be affected while the
image is displayed.
* MIXER CROP -- will return or modify how textures on a layer will be
cropped. One X Y pair each for the upper left corner and for the lower
right corner.
* Added INFO QUEUES command for debugging AMCP command queues. Useful for
debugging command queue overflows, where a command is deadlocked. Hopefully
always accessible via console, even though the TCP command queue may be
full.
* Added GL command:
- GL INFO prints information about device buffers and host buffers.
- GL GC garbage collects pooled but unused GL resources.
* Added INFO THREADS command listing the known threads and their descriptive
names. Can be matched against the thread id column of log entries.
Consumers
---------
* Removed blocking_decklink_consumer. It was more like an experiment at best
and its usefulness was questionable.
* Added a 10 second time-out for consumer sends, to detect/recover from
blocked consumers.
* Some consumers which are usually added and removed during playout (for
example ffmpeg_consumer, streaming_consumer and channel_consumer) no longer
affect the presentation time on other consumers. Previously a lag on the SDI
output could be seen when adding such consumers.
HTML producer
-------------
* No longer tries to play all files with a . in their name.
(Georgi Chorbadzhiyski)
* Reimplemented using CEF3 instead of Berkelium, which enables use of WebGL
and more. CEF3 is actively maintained, which Berkelium is not. (Robert Nagy)
* Implements a custom version of window.requestAnimationFrame which will
follow the pace of the channel, for perfectly smooth animations.
* No longer manually interlaces frames, to allow for mixer fill transforms
without artifacts.
* Now uses CEF3 event loop to avoid 100% CPU core usage.
CasparCG Server 2.0.7 Beta 2 (as compared to CasparCG Server 2.0.7 Beta 1)
==========================================================================
General
-------
* Added sending of OSC messages for channel_grid channel in addition to
regular channels.
Producers
---------
* FFmpeg: Reports correct nb_frames() when using SEEK (Thomas Kaltz III)
* Flash: Fixed bug where CG PLAY, CG INVOKE did not work.
Consumers
---------
* channel_consumer: Added support for more than one channel_consumer per
channel.
* decklink_consumer: Added support for a single instance of the consumer to
manage a separate key output for use with DeckLink Duo/Quad cards:
1
2
external_separate_device
...in the configuration will enable the feature. The value of
defaults to the value of + 1.
* synchronizing_consumer: Removed in favour of a single decklink_consumer
managing both fill and key device.
* streaming_consumer: A new implementation of ffmpeg_consumer with added
support for streaming and other PTS dependent protocols. Examples:
udp://localhost:5004
-vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180
...in configuration or:
ADD 1 STREAM udp://localhost:5004 -vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180
...via AMCP. (Robert Nagy sponsored by Ericsson Broadcasting Services)
* newtek_ivga_consumer: Added support for iVGA consumer to not provide channel
sync even though connected. Useful for iVGA clients that downloads as fast
as possible instead of in frame-rate pace, like Wirecast. To enable:
false
...in config to not provide channel sync when connected. The default is
true.
AMCP
----
* Added support in ADD and REMOVE for a placeholder which
will resolve to the connected AMCP client's IPV4 address.
* Fixed bug where AMCP commands split into multiple TCP packets where not
correctly parsed (http://casparcg.com/forum/viewtopic.php?f=3&t=2480)
CasparCG Server 2.0.7 Beta 1 (as compared to 2.0.6 Stable)
==========================================================
General
-------
* FFmpeg: Upgraded to master and adapted CasparCG to FFmpeg API changes
(Robert Nagy sponsored by SVT)
* FFmpeg: Fixed problem with frame count calculation (Thomas Kaltz III)
* Fixed broken CG UPDATE.
Producers
---------
* New HTML producer has been created (Robert Nagy sponsored by Flemish Radio
and Television Broadcasting Organization, VRT)
CasparCG Server 2.0.6 Stable (as compared to 2.0.4 Stable)
==========================================================
General
-------
* iVGA: Allow for the server to work without Processing.AirSend.x86.dll to
prevent a possible GPL violation. It is available as a separate optional
download.
* iVGA: Only provide sync to channel while connected, to prevent channel
ticking too fast.
* FFmpeg: Fixed bug during deinterlace-bob-reinterlace where output fields
were offset by one field in relation to input fields.
* FFmpeg: Fixed bug in ffmpeg_consumer where an access violation occurred
during destruction.
* FFmpeg: Improved seeking. (Robert Nagy and Thomas Kaltz III)
* Frontend: Only writes elements to casparcg.config which overrides a default
value to keep the file as compact as possible.
* System audio: Patched sfml-audio to work better with oal-consumer and
therefore removed PortAudio as the system audio implementation and went back
to oal.
* Flash: Changed so that the initial buffer fill of frames is rendered at a
frame-duration pace instead of as fast as possible. Otherwise time based
animations render incorrectly. During buffer recovery, a higher paced
rendering takes place, but still not as fast as possible, which can cause
animations to be somewhat incorrectly rendered. This is the only way though
if we want the buffer to be able to recover after depletion.
* Fixed race condition during server shutdown.
* OSC: outgoing audio levels from the audio mixer for each audio channel is
now transmitted (pFS and dBFS). (Thomas Kaltz III)
* Stage: Fixed bug where tweened transforms were only ticked when a
corresponding layer existed.
* Screen consumer: Added borderless option and correct handling of name
option. (Thomas Kaltz III)
* AMCP: CLS now reports duration and framerate for MOVIE files were
information is possible to extract. (Robert Nagy)
* Version bump to keep up with CasparCG Client version.
CasparCG Server 2.0.4 Stable (as compared to 2.0.4 Beta 1)
==========================================================
General
-------
* Can now open media with file names that only consist of digits.
(Cambell Prince)
* Miscellaneous stability and performance improvements.
Video mixer
-----------
* Conditional compilation of chroma key support and straight alpha output
support in shader (just like with blend-modes) because of performance impact
even when not in use on a layer or on a channel. New element added
to configuration for turning on mixer features that not everybody would want
to pay for (performance-wise.) blend-modes also moved into this element.
* Fixed bug where MIXER LEVELS interpreted arguments in the wrong order, so
that gamma was interpreted as max_input and vice versa.
Consumers
---------
* Added support for NewTek iVGA, which enables the use of CasparCG Server
fill+key output(s) as input source(s) to a NewTek TriCaster without
requiring video card(s) in the CasparCG Server machine, or taking up inputs
in the TriCaster. element in config enables iVGA on a
channel. (Robert Nagy sponsored by NewTek)
* DeckLink: Created custom decklink allocator to reduce the memory footprint.
* Replaced usage of SFML for with PortAudio, because of
problems with SFML since change to static linkage. Also PortAudio seems to
give lower latency.
Producers
---------
* FFmpeg: Added support for arbitrary FFmpeg options/parameters
in ffmpeg_producer. (Cambell Prince)
* Flash: Flash Player 11.8 now tested and fully supported.
* Flash: No longer starts a Flash Player to service CG commands that mean
nothing without an already running Flash Player.
* Flash: globally serialize initialization and destruction of Flash Players,
to avoid race conditions in Flash.
* Flash: changed so that the Flash buffer is filled with Flash Player
generated content at initialization instead of empty frames.
OSC
---
* Performance improvements. (Robert Nagy sponsored by Boffins Technologies)
* Never sends old values to OSC receivers. Collects the latest value of each
path logged since last UDP send, and sends the new UDP packet (to each
subscribing OSC receiver) with the values collected. (Robert Nagy sponsored
by Boffins Technologies)
* Batches as many OSC messages as possible in an OSC bundle to reduce the
number of UDP packets sent. Breakup into separate packages if necessary to
avoid fragmentation. (Robert Nagy sponsored by Boffins Technologies)
* Removed usage of Microsoft Agents library (Server ran out of memory after a
while) in favour of direct synchronous invocations.
CasparCG Server 2.0.4 Beta 1 (as compared to 2.0.3 Stable)
==========================================================
General
-------
* Front-end GUI for simplified configuration and easy access to common tasks.
(Thomas Kaltz III and Jeff Lafforgue)
* Added support for video and images file thumbnail generation. By default the
media directory is scanned every 5 seconds for new/modified/removed files
and thumbnails are generated/regenerated/removed accordingly.
* Support for new video modes: 1556p2398, 1556p2400, 1556p2500, 2160p2398,
2160p2400, 2160p2500, 2160p2997 and 2160p3000.
* Experimental ATI graphics card support by using static linking against SFML
instead of dynamic. Should improve ATI GPU support, but needs testing.
* Added support for playback and pass-through of up to 16 audio channels. See
http://casparcg.com/forum/viewtopic.php?f=3&t=1453 for more information.
* Optimizations in AMCP protocol implementations for large incoming messages,
for example base64 encoded PNG images.
* Logging output now includes milliseconds and has modified format:
YYYY-MM-DD hh:mm:ss.zzz
* Improved audio playback with 720p5994 and 720p6000 channels.
* An attempt to improve output synchronization of consumers has been made. Use
for example:
1
true
2
true
...to instruct the server to keep both DeckLink consumers in sync with each
other. Consider this experimental, so don't wrap everything in
unless synchronization of consumer outputs is needed. For
synchronization to be effective all synchronized cards must have genlock
reference signal connected.
* Transfer of source code and issue tracker to github. (Thomas Kaltz III)
Layer
-----
* Fixed a problem where the first frame was not always shown on LOAD.
(Robert Nagy)
Stage
-----
* Support for layer consumers for listening to frames coming out of producers.
(Cambell Prince)
Audio mixer
-----------
* Added support for a master volume mixer setting for each channel.
Video mixer
-----------
* Added support for chroma keying. (Cambell Prince)
* Fixed bug where MIXER CONTRAST set to < 1 can cause transparency issues.
* Experimental support for straight alpha output.
Consumers
---------
* Avoid that the FFmpeg consumer blocks the channel output when it can't keep
up with the frame rate (drops frames instead).
* Added support for to create a separate key and fill file when recording with
the FFmpeg consumer. Add the SEPARATE_KEY parameter to the FFmpeg consumer
parameter list. The key file will get the _A file name suffix to be picked
up by the separated_producer when doing playback.
* The Image consumer now writes to the media folder instead of the data
folder.
* Fixed bug in DeckLink consumer where we submit too few audio samples to the
driver when the video format has a frame rate > 50.
* Added another experimental DeckLink consumer implementation where scheduled
playback is not used, but a similar approach as in the bluefish consumer
where we wait for a frame to be displayed and then display the next frame.
It is configured via a consumer element. The benefits of
this consumer is lower latency and more deterministic synchronization
between multiple instances (should not need to be wrapped in a
element when separated key/fill is used).
Producers
---------
* Added support for playing .swf files using the Flash producer. (Robert Nagy)
* Image producer premultiplies PNG images with their alpha.
* Image producer can load a PNG image encoded as base64 via:
PLAY 1-0 [PNG_BASE64]
* FFmpeg producer can now use a directshow input filters:
PLAY 1-10 "dshow://video=Some Camera"
(Cambell Prince, Julian Waller and Robert Nagy)
* New layer producer which directs the output of a layer to another layer via
a layer consumer. (Cambell Prince)
AMCP
----
* The master volume feature is controlled via the MASTERVOLUME MIXER
parameter. Example: MIXER 1 MASTERVOLUME 0.5
* THUMBNAIL LIST/RETRIEVE/GENERATE/GENERATE_ALL command was added to support
the thumbnail feature.
* ADD 1 FILE output.mov SEPARATE_KEY activates the separate key feature of the
FFmpeg consumer creating an additional output_a.mov containing only the key.
* Added KILL command for shutting down the server without console access.
* Added RESTART command for shutting down the server in the same way as KILL
except that the return code from CasparCG Server is 5 instead of 0, which
can be used by parent process to take other actions. The
'casparcg_auto_restart.bat' script restarts the server if the return code is
5.
* DATA RETRIEVE now returns linefeeds encoded as an actual linefeed (the
single character 0x0a) instead of the previous two characters:
\ followed by n.
* MIXER CHROMA command added to control the chroma keying. Example:
MIXER 1-1 CHROMA GREEN|BLUE 0.10 0.04
(Cambell Prince)
* Fixed bug where MIXER FILL overrides any previous MIXER CLIP on the same
layer. The bug-fix also has the side effect of supporting negative scale on
MIXER FILL, causing the image to be flipped.
* MIXER STRAIGHT_ALPHA_OUTPUT added to control whether to output straight
alpha or not.
* Added INFO DELAY and INFO - DELAY commands for showing some
delay measurements.
* PLAY 1-1 2-10 creates a layer producer on 1-1 redirecting the output of
2-10. (Cambell Prince)
OSC
---
* Support for sending OSC messages over UDP to either a predefined set of
clients (servers in the OSC sense) or dynamically to the ip addresses of the
currently connected AMCP clients.
(Robert Nagy sponsored by Boffins Technologies)
* /channel/[1-9]/stage/layer/[0-9]
* always /paused [paused or not]
* color producer /color [color string]
* ffmpeg producer /profiler/time [render time] [frame duration]
* ffmpeg producer /file/time [elapsed seconds] [total seconds]
* ffmpeg producer /file/frame [frame] [total frames]
* ffmpeg producer /file/fps [fps]
* ffmpeg producer /file/path [file path]
* ffmpeg producer /loop [looping or not]
* during transitions /transition/frame [current frame] [total frames]
* during transitions /transition/type [transition type]
* flash producer /host/path [filename]
* flash producer /host/width [width]
* flash producer /host/height [height]
* flash producer /host/fps [fps]
* flash producer /buffer [buffered] [buffer size]
* image producer /file/path [file path]
CasparCG Server 2.0.3 Stable (as compared to 2.0.3 Alpha)
=========================================================
Stage
-----
* Fixed dead-lock that can occur with multiple mixer tweens. (Robert Nagy)
AMCP
----
* DATA STORE now supports creating folders of path specified if they does not
exist. (Jeff Lafforgue)
* DATA REMOVE command was added. (Jeff Lafforgue)
CasparCG Server 2.0.3 Alpha (as compared to 2.0 Stable)
=======================================================
General
-------
* Data files are now stored in UTF-8 with BOM. Latin1 files are still
supported for backwards compatibility.
* Commands written in UTF-8 to log file but only ASCII characters to console.
* Added supported video formats:
* 720p2398 (not supported by DeckLink)
* 720p2400 (not supported by DeckLink)
* 1080p5994
* 1080p6000
* 720p30 (not supported by DeckLink)
* 720p29.976 (not supported by DeckLink)
CLK
---
* CLK protocol implementation can now serve more than one connection at a time
safely.
* Added timeline support to the CLK protocol.
* Refactored parts of the CLK parser implementation.
Consumers
---------
* Consumers on same channel now invoked asynchronously to allow for proper
sync of multiple consumers.
* System audio consumer:
* no longer provides sync to the video channel.
* Screen consumer:
* Support for multiple screen consumers on the same channel
* No longer spin-waits for vsync.
* Now deinterlaces to two separate frames so for example 50i will no longer
be converted to 25p but instead to 50p for smooth playback of interlaced
content.
* DeckLink consumer now logs whether a reference signal is detected or not.
Producers
---------
* Image scroll producer:
* Field-rate motion instead of frame-rate motion with interlaced video
formats. This can be overridden by giving the PROGRESSIVE parameter.
* SPEED parameter now defines pixels per frame/field instead of half pixels
per frame. The scrolling direction is also reversed so SPEED 0.5 is the
previous equivalent of SPEED -1. Movements are done with sub-pixel
accuracy.
* Fixed incorrect starting position of image.
* Rounding error fixes to allow for more exact scrolling.
* Added support for motion blur via a new BLUR parameter
* Added PREMULTIPLY parameter to support images stored with straight alpha.
CasparCG Server 2.0 Stable (as compared to Beta 3)
==================================================
General
-------
* Misc stability and performance fixes.
Consumers
---------
* File Consumer
* Changed semantics to more closely follow FFmpeg (see forums).
* Added options, -r, -acodec, -s, -pix_fmt, -f and more.
* Screen Consumer
* Added vsync support.
CasparCG Server 2.0 Beta 3 (as compared to Beta 1)
==================================================
Formats
-------
* ProRes Support
* Both encoding and decoding.
* NTSC Support
* Updated audio-pipeline for native NTSC support. Previous implementation
did not fully support NTSC audio and could cause incorrect behaviour or
even crashes.
Consumers
---------
* File Consumer added
* See updated wiki or ask in forum for more information.
* Should support anything FFmpeg supports. However, we will work mainly with
DNxHD, PRORES and H264.
- Key-only is not supported.
* Bluefish Consumer
* 24 bit audio support.
- Embedded-audio does not work with Epoch cards.
* DeckLink Consumer
* Low latency enabled by default.
* Added graphs for driver buffers.
* Screen Consumer
* Changed screen consumer square PAL to the more common wide-square PAL.
* Can now be closed.
* Fixed interpolation artifacts when running non-square video-modes.
* Automatically deinterlace interlaced input.
Producers
---------
* DeckLink Producer
* Improved color quality be avoiding unnecessary conversion to BGRA.
* FFMPEG Producer
* Fixed missing alpha for (RGB)A formats when deinterlacing.
* Updated buffering to work better with files with long audio/video
interleaving.
* Seekable while running and after reaching EOF. CALL 1-1 SEEK 200.
* Enable/disable/query looping while running. CALL 1-1 LOOP 1.
* Fixed bug with duration calculation.
* Fixed bug with fps calculation.
* Improved auto-transcode accuracy.
* Improved seeking accuracy.
* Fixed bug with looping and LENGTH.
* Updated to newer FFmpeg version.
* Fixed incorrect scaling of NTSC DV files.
* Optimized color conversion when using YADIF filters.
* Flash Producer
* Release Flash Player when empty.
* Use native resolution TemplateHost.
* TemplateHosts are now chosen automatically if not configured. The
TemplateHost with the corresponding video-mode name is now chosen.
* Use square pixel dimensions.
AMCP
----
* When possible, commands will no longer wait for rendering pipeline. This
reduces command execution latencies, especially when sending a lot of
commands in a short timespan.
* Fixed CINF command.
* ADD/REMOVE no longer require subindex,
e.g. "ADD 1 SCREEN" / "REMOVE 1 SCREEN" instead of "ADD 1-1 SCREEN" / ...
* PARAM is renamed to CALL.
* STATUS command is replaced by INFO.
* INFO command has been extended:
* INFO (lists channels).
* INFO 1 (channel info).
* INFO 1-1 (layer info).
* INFO 1-1 F (foreground producer info).
* INFO 1-1 B (background producer info).
* INFO TEMPLATE mytemplate (template meta-data info, e.g. field names).
* CG INFO command has been extended.
* CG INFO 1 (template-host information, e.g. what layers are occupied).
Mixer
-----
* Fixed alpha with blend modes.
* Automatically deinterlace for MIXER FILL commands.
Channel
-------
* SET MODE now reverts back to old video-mode on failure.
Diagnostics
-----------
* Improved graphs and added more status information.
* Print configuration into log at startup.
* Use the same log file for the entire day, instead of one per startup as
previously.
* Diagnostics window is now closable.
CasparCG Server 2.0 Beta 1 (as compared to Alpha)
=================================================
* Blending Modes (needs to be explicitly enabled)
* overlay
* screen
* multiply
* and many more.
* Added additive keyer in addition to linear keyer.
* Image adjustments
* saturation
* brightness
* contrast
* min input-level
* max input-level
* min output-level
* max output-level
* gamma
* Support for FFmpeg-filters such as (ee http://ffmpeg.org/libavfilter.html)
* yadif deinterlacer (optimized in CasparCG for full multi-core support)
* de-noising
* dithering
* box blur
* and many more
* 32-bit SSE optimized audio pipeline.
* DeckLink-Consumer uses external-key by default.
* DeckLink-Consumer has 24 bit embedded-audio support.
* DeckLink-Producer has 24 bit embedded-audio support.
* LOADBG with AUTO feature which automatically plays queued clip when
foreground clip has ended.
* STATUS command for layers.
* LOG LEVEL command for log filtering.
* MIX transition works with transparent clips.
* Freeze on last frame.
* Producer buffering is now configurable.
* Consumer buffering is now configurable.
* Now possible to configure template-hosts for different video-modes.
* Added auto transcoder for FFmpeg producer which automatically transcodes
input video into compatible video format for the channel.
* interlacing (50p -> 50i)
* deinterlacing (50i -> 25p)
* bob-deinterlacing (50i -> 50p)
* bob-deinterlacing and reinterlacing (w1xh150i -> w2xh250i)
* doubling (25p -> 50p)
* halfing (50p -> 25p)
* field-order swap (upper <-> lower)
* Screen consumer now automatically deinterlaces when receiving interlaced
content.
* Optimized renderer.
* Renderer can now be run asynchronously with producer by using a
producer-buffer size greater than 0.
* Improved error and crash recovery.
* Improved logging.
* Added Image-Scroll-Producer.
* Key-only has now near zero performance overhead.
* Reduced memory requirements.
* Removed "warm up lag" which occurred when playing the first media clip after
the server has started.
* Added read-back fence for OpenGL device for improved multi-channel
performance.
* Memory support increased from standard 2 GB to 4 GB on 64 bit Win 7 OS.
* Added support for 2* DeckLink cards in Full HD.
* Misc bugs fixes and performance improvements.
* Color producer now support some color codes in addition to color codes, e.g.
EMPTY, BLACK, RED etc...
* Alpha value in color codes is now optional.
* More than 2 DeckLink cards might be possible but have not yet been tested.
CasparCG Server 2.0 Alpha (as compared to 1.8)
==============================================
General
-------
* Mayor refactoring for improved readability and maintainability.
* Some work towards platform-independence. Currently the greatest challenge
for full platform-independence is flash-producer.
* Misc improved scalability.
* XML-configuration.
* DeckLink
* Support for multiple DeckLink cards.
Core
----
* Multiple producers per video_channel.
* Multiple consumers per video_channel.
* Swap producers between layers and channels during run-time.
* Support for upper-field and lower-field interlacing.
* Add and remove consumers during run-time.
* Preliminary support for NTSC.
AMCP
----
* Query flash and template-host version.
* Recursive media-folder listing.
* Misc changes.
Mixer
-----
* Animated tween transforms.
* Image-Mixer
* Fully GPU accelerated (all features listed below are done on the GPU),
* Layer composition.
* Color spaces (rgba, bgra, argb, yuv, yuva, yuv-hd, yuva-hd).
* Interlacing.
* Per-layer image transforms:
* Opacity
* Gain
* Scaling
* Clipping
* Translation
* Audio Mixer
* Per-layer and per-sample audio transforms:
* Gain
* Fully internal audio mixing. Single output video_channel.
Consumers
---------
* DeckLink Consumer
* Embedded audio.
* HD support.
* Hardware clock.
* Bluefish Consumer
* Drivers are loaded on-demand (server now runs on computers without
installed Bluefish drivers).
* Embedded audio.
* Allocated frames are no longer leaked.
Producers
---------
* Decklink Producer
* Embedded audio.
* HD support.
* Color Producer
* GPU accelerated.
* FFMPEG Producer
* Asynchronous file IO.
* Parallel decoding of audio and video.
* Color space transform are moved to GPU.
* Transition Producer
* Fully interlaced transition (previously only progressive, even when
running in interlaced mode).
* Per-sample mixing between source and destination clips.
* Tween transitions.
* Flash Producer
* DirectDraw access (slightly improved performance).
* Improved time-sync. Smoother animations and proper interlacing.
* Image Producer
* Support for various image formats through FreeImage library.
Diagnostics
-----------
* Graphs for monitoring performance and events.
* Misc logging improvements.
* Separate log file for every run of the server.
* Error logging provides full exception details, instead of only printing that
an error has occurred.
* Console with real-time logging output.
* Console with AMCP input.
Removed
-------
* Registry configuration (replaced by XML Configuration).
* TGA Producer (replaced by Image Producer).
* TGA Scroll Producer
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# CasparCG Code of Conduct
> CasparCG is all about showing respect and professionalism one to another.
## Community
We want a positive and inspiring community that welcomes and embraces new ideas with respect and professionalism. CasparCG community has arisen through hard work and tremendous enthusiasm of hundreds of people around the world.
This Code of Conduct is about how we behave, act and cooperate in this positive and inspiring community. Contributors and users who engage in the CasparCG project in one way or another share this Code of Conduct.
## We strive to:
### Be considerate
CasparCG is used by other people and in various environments such as production. Your actions will affect other community members and therefore we expect you to take those consequences into account when making decisions.
### Be respectful
In a community there will always be some form of disagreement, but that is no excuse for poor behavior and poor manners. Treat one another with respect and professionalism to make community members feel comfortable. We work together, as a union, to resolve conflicts and to maintain the positive and inspiring atmosphere in our community.
We do not tolerate personal attacks, racism, sexism or any other form of discrimination or abuses. Maintainers of the project have right to suspend the person who persistently breaks to our Code of Conduct.
### Be collaborative
Collaboration helps to reduce redundancy while improving the quality of the project and the software produced. To avoid misunderstanding, try to be clear when requesting for help, giving help or asking for feedback. If something is unclear ask for clarification.
### Be supportive
CasparCG community is made up by mutual respect, collaboration and professional behavior. If you witness others being discriminated or abused, think about how you can be supportive. If the identified situation is beyond your ability, ask the victim privately if some form of official intervention is needed to solve the uncomfortable situation.
### Ask for help
By asking questions early we can avoid many problems that can arise later on. We encourage you to ask questions. Those who are asked should be helpful and answer with professionalism in mind.
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: README.md
================================================
CasparCG Server
===============
Thank you for your interest in CasparCG Server, a professional software used to
play out and record professional graphics, audio and video to multiple outputs.
CasparCG Server has been in 24/7 broadcast production since 2006.
The CasparCG Server works on Windows and Linux.
System Requirements
-------------------
- A graphics card (GPU) capable of OpenGL 4.5 is required.
- An Nvidia GPU is recommended, but other GPU's will likely work fine.
- Intel and AMD CPU's have been tested and are known to work
- PCIE bandwidth is important between your GPU and CPU, as well as Decklink and CPU. Avoid chipset lanes when possible.
### Windows
- Windows 11 is recommended
- Windows 10 is supported as best effort
### Linux
- Ubuntu 24.04 is recommended
- Other distributions and releases will work but you will need to compile it yourself and have not been tested
Getting Started
---------------
1. Download a release from (http://casparcg.com/downloads).
Alternatively, newer testing versions can be downloaded from (http://builds.casparcg.com) or [built from source](BUILDING.md)
2. Install any optional non-GPL modules
- Flash template support (Windows only):
1. Uninstall any previous version of the Adobe Flash Player using this file:
(http://download.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe)
2. Download and unpack
(http://download.macromedia.com/pub/flashplayer/installers/archive/fp_11.8.800.94_archive.zip)
3. Install Adobe Flash Player 11.8.800.94 from the unpacked archive:
fp_11.8.800.94_archive\11_8_r800_94\flashplayer11_8r800_94_winax.exe
3. Configure the server by editing the self-documented "casparcg.config" file in
a text editor.
4.
1. Windows: start `casparcg_auto_restart.bat`, or `casparcg.exe` and `scanner.exe` separately.
1. Linux: start the `run.sh` program or use tools/linux/start_docker.sh to run within docker (documentation is at the top of the file).
5. Connect to the Server from a client software, such as the "CasparCG Client"
which is available as a separate download.
Documentation
-------------
The most up-to-date documentation is always available at
https://github.com/CasparCG/help/wiki
Ask questions in the forum: https://casparcgforum.org/
Development
-----------
See [BUILDING](BUILDING.md) for instructions on how to build the CasparCG Server from source manually.
License
---------
CasparCG Server is distributed under the GNU General Public License GPLv3 or
higher, see [LICENSE](LICENSE) for details.
CasparCG Server uses the following third party libraries:
- FFmpeg (http://ffmpeg.org/) under the GPLv2 Licence.
FFmpeg is a trademark of Fabrice Bellard, originator of the FFmpeg project.
- Threading Building Blocks (http://www.threadingbuildingblocks.org/) library under the GPLv2 Licence.
- SFML (http://www.sfml-dev.org/) under the zlib/libpng License.
- GLEW (http://glew.sourceforge.net) under the modified BSD License.
- boost (http://www.boost.org/) under the Boost Software License, version 1.0.
================================================
FILE: _typos.toml
================================================
[default]
# Ignore lines following the commment `// typos: ignore-next
extend-ignore-re = [".*// typos: ignore-next\\n[^\\n]*\\n"]
[default.extend-words]
# NDI is a common acronym in the context of video and audio over IP
ndi = "ndi"
# it was seeoing NDIfoo as ND-Ifoo and turning it into ANDIfoo
nd = "nd"
# ANC is short for "ancillary" and is used in the bluefish drivers
anc = "anc"
================================================
FILE: src/CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.16)
# Project settings
project("CasparCG Server")
set(CONFIG_VERSION_MAJOR 2)
set(CONFIG_VERSION_MINOR 6)
set(CONFIG_VERSION_BUG 0)
set(CONFIG_VERSION_TAG "Dev")
# support for language servers (eg, clangd or ccls)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CASPARCG_DOWNLOAD_MIRROR https://github.com/CasparCG/dependencies/releases/download/ CACHE STRING "Source/mirror to use for external dependencies")
set(CASPARCG_DOWNLOAD_CACHE ${CMAKE_CURRENT_BINARY_DIR}/external CACHE STRING "Download cache directory for cmake ExternalProjects")
option(ENABLE_HTML "Enable HTML module, require CEF" ON)
set(DIAG_FONT_PATH "LiberationMono-Regular.ttf" CACHE STRING
"Path to font that will be used to load diag font at runtime. By default
this loads the font distributed with the application from the working
directory. It can be set to an absolute path to instead load a font from
the system."
)
add_compile_definitions("DIAG_FONT_PATH=\"${DIAG_FONT_PATH}\"")
# Add custom cmake modules path
set(CASPARCG_PATCH_DIR ${CMAKE_SOURCE_DIR}/CMakeModules/patches)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
# Determine the git hash
find_package(Git)
set(CONFIG_VERSION_GIT_HASH "N/A")
if(DEFINED ENV{GIT_HASH} AND NOT $ENV{GIT_HASH} STREQUAL "")
set(CONFIG_VERSION_GIT_HASH "$ENV{GIT_HASH}")
elseif(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git")
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --verify --short HEAD
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/../"
OUTPUT_VARIABLE CONFIG_VERSION_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
cmake_host_system_information(RESULT CONFIG_CPU_COUNT QUERY NUMBER_OF_PHYSICAL_CORES)
include(CasparCG_Util)
configure_file("${PROJECT_SOURCE_DIR}/version.tmpl" "${CMAKE_BINARY_DIR}/generated/version.h")
if(MSVC)
include(Bootstrap_Windows)
else ()
include(Bootstrap_Linux)
# Output build settings
message(STATUS "Target architecture: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CPU Count: ${CONFIG_CPU_COUNT}")
message(STATUS "Target build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build Version: ${CONFIG_VERSION_MAJOR}.${CONFIG_VERSION_MINOR}.${CONFIG_VERSION_BUG} ${CONFIG_VERSION_TAG} (Revision: ${CONFIG_VERSION_GIT_HASH})")
endif ()
IF(ENABLE_VULKAN)
add_definitions(-DENABLE_VULKAN)
ENDIF()
include_directories("${CMAKE_BINARY_DIR}/generated")
add_subdirectory(tools)
add_subdirectory(accelerator)
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(modules)
add_subdirectory(protocol)
add_subdirectory(shell)
================================================
FILE: src/CMakeModules/Bootstrap_Linux.cmake
================================================
cmake_minimum_required (VERSION 3.28)
include(ExternalProject)
include(FetchContent)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# Prefer the new boost helper
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
set(ENABLE_HTML ON CACHE BOOL "Enable CEF and HTML producer")
set(USE_STATIC_BOOST OFF CACHE BOOL "Use shared library version of Boost")
set(USE_SYSTEM_CEF ON CACHE BOOL "Use the version of cef from your OS (only tested with Ubuntu)")
set(CASPARCG_BINARY_NAME "casparcg" CACHE STRING "Custom name of the binary to build (this disables some install files)")
set(ENABLE_AVX2 OFF CACHE BOOL "Enable the AVX2 instruction set (requires a CPU that supports it)")
set(ENABLE_VULKAN OFF CACHE BOOL "Enable Vulkan support")
# Determine build (target) platform
SET (PLATFORM_FOLDER_NAME "linux")
IF (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE (STATUS "Setting build type to 'Release' as none was specified.")
SET (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
SET_PROPERTY (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF ()
MARK_AS_ADVANCED (CMAKE_INSTALL_PREFIX)
if (USE_STATIC_BOOST)
SET (Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost 1.83.0 COMPONENTS thread filesystem log_setup log locale regex date_time coroutine REQUIRED)
find_package(FFmpeg REQUIRED)
find_package(OpenGL REQUIRED COMPONENTS OpenGL GLX EGL)
find_package(GLEW REQUIRED)
find_package(TBB REQUIRED)
find_package(OpenAL REQUIRED)
find_package(SFML 3 COMPONENTS Graphics System Window QUIET)
if(NOT SFML_FOUND)
find_package(SFML 2 COMPONENTS graphics system window REQUIRED)
endif()
IF (ENABLE_VULKAN)
find_package(Vulkan REQUIRED)
FetchContent_Declare(vk_bootstrap
URL ${CASPARCG_DOWNLOAD_MIRROR}/vk-bootstrap/vk-bootstrap-1.4.328.tar.gz
URL_HASH SHA256=3be0220de218dc3e692aeac552b2953860a0e0a48257f4a61c3f1c1472674744
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(vk_bootstrap)
FetchContent_Declare(vma
URL ${CASPARCG_DOWNLOAD_MIRROR}/VulkanMemoryAllocator/VulkanMemoryAllocator-3.3.0.tar.gz
URL_HASH SHA256=c4f6bbe6b5a45c2eb610ca9d231158e313086d5b1a40c9922cb42b597419b14e
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(vma)
endif()
find_package(X11 REQUIRED)
if (ENABLE_HTML)
if (USE_SYSTEM_CEF)
set(CEF_LIB_PATH "/usr/lib/casparcg-cef-142")
add_library(CEF::CEF INTERFACE IMPORTED)
target_include_directories(CEF::CEF INTERFACE
"/usr/include/casparcg-cef-142"
)
target_link_libraries(CEF::CEF INTERFACE
"-Wl,-rpath,${CEF_LIB_PATH} ${CEF_LIB_PATH}/libcef.so"
"${CEF_LIB_PATH}/libcef_dll_wrapper.a"
)
else()
casparcg_add_external_project(cef)
ExternalProject_Add(cef
URL ${CASPARCG_DOWNLOAD_MIRROR}/cef/cef_binary_142.0.17+g60aac24+chromium-142.0.7444.176_linux64_minimal.tar.bz2
URL_HASH SHA256=1d89e19b2f446105f9a1fe6fdc96bced86249b5884241dcc4013b7c94dabf424
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CMAKE_ARGS -DUSE_SANDBOX=Off
INSTALL_COMMAND ""
BUILD_BYPRODUCTS
"/Release/libcef.so"
"/libcef_dll_wrapper/libcef_dll_wrapper.a"
)
ExternalProject_Get_Property(cef SOURCE_DIR)
ExternalProject_Get_Property(cef BINARY_DIR)
add_library(CEF::CEF INTERFACE IMPORTED)
target_include_directories(CEF::CEF INTERFACE
"${SOURCE_DIR}"
)
target_link_libraries(CEF::CEF INTERFACE
# Note: All of these must be referenced in the BUILD_BYPRODUCTS above, to satisfy ninja
"${SOURCE_DIR}/Release/libcef.so"
"${BINARY_DIR}/libcef_dll_wrapper/libcef_dll_wrapper.a"
)
install(DIRECTORY ${SOURCE_DIR}/Resources/locales TYPE LIB)
install(FILES ${SOURCE_DIR}/Resources/chrome_100_percent.pak TYPE LIB)
install(FILES ${SOURCE_DIR}/Resources/chrome_200_percent.pak TYPE LIB)
install(FILES ${SOURCE_DIR}/Resources/icudtl.dat TYPE LIB)
install(FILES ${SOURCE_DIR}/Resources/resources.pak TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/chrome-sandbox TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/libcef.so TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/libEGL.so TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/libGLESv2.so TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/libvk_swiftshader.so TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/libvulkan.so.1 TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/v8_context_snapshot.bin TYPE LIB)
install(FILES ${SOURCE_DIR}/Release/vk_swiftshader_icd.json TYPE LIB)
endif()
endif ()
SET (BOOST_INCLUDE_PATH "${Boost_INCLUDE_DIRS}")
SET (FFMPEG_INCLUDE_PATH "${FFMPEG_INCLUDE_DIRS}")
LINK_DIRECTORIES("${FFMPEG_LIBRARY_DIRS}")
SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
ADD_DEFINITIONS (-DSFML_STATIC)
ADD_DEFINITIONS (-DUNICODE)
ADD_DEFINITIONS (-D_UNICODE)
ADD_DEFINITIONS (-DGLEW_NO_GLU)
ADD_DEFINITIONS (-DGLEW_EGL)
ADD_DEFINITIONS (-D__NO_INLINE__) # Needed for precompiled headers to work
ADD_DEFINITIONS (-DBOOST_NO_SWPRINTF) # swprintf on Linux seems to always use , as decimal point regardless of C-locale or C++-locale
ADD_DEFINITIONS (-DTBB_USE_CAPTURED_EXCEPTION=1)
ADD_DEFINITIONS (-DNDEBUG) # Needed for precompiled headers to work
ADD_DEFINITIONS (-DBOOST_LOCALE_HIDE_AUTO_PTR) # Needed for C++17 in boost 1.67+
if (NOT USE_STATIC_BOOST)
ADD_DEFINITIONS (-DBOOST_ALL_DYN_LINK)
endif()
IF (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_COMPILE_OPTIONS (-O3) # Needed for precompiled headers to work
endif()
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x64|x86_64|amd64|e2k)")
ADD_COMPILE_OPTIONS (-msse3)
ADD_COMPILE_OPTIONS (-mssse3)
ADD_COMPILE_OPTIONS (-msse4.1)
IF (ENABLE_AVX2)
ADD_COMPILE_OPTIONS (-mfma)
ADD_COMPILE_OPTIONS (-mavx)
ADD_COMPILE_OPTIONS (-mavx2)
ENDIF ()
ELSE ()
ADD_COMPILE_DEFINITIONS (USE_SIMDE) # Enable OpenMP support in simde
ADD_COMPILE_DEFINITIONS (SIMDE_ENABLE_OPENMP) # Enable OpenMP support in simde
ADD_COMPILE_OPTIONS (-fopenmp-simd) # Enable OpenMP SIMD support
ENDIF ()
ADD_COMPILE_OPTIONS (-fnon-call-exceptions) # Allow signal handler to throw exception
ADD_COMPILE_OPTIONS (-Wno-deprecated-declarations -Wno-write-strings -Wno-multichar -Wno-cpp -Werror)
IF (ENABLE_VULKAN)
ADD_COMPILE_OPTIONS (-Wno-nonnull -Wno-nullability-completeness)
ENDIF()
IF (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
ADD_COMPILE_OPTIONS (-Wno-terminate)
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Help TBB figure out what compiler support for c++11 features
# https://github.com/01org/tbb/issues/22
string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION})
message(STATUS "ADDING: -DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION}")
add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION})
ENDIF ()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
================================================
FILE: src/CMakeModules/Bootstrap_Windows.cmake
================================================
cmake_minimum_required (VERSION 3.28)
include(ExternalProject)
include(FetchContent)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# Prefer the new boost helper
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
set(BOOST_USE_PRECOMPILED ON CACHE BOOL "Use precompiled boost")
set(ENABLE_VULKAN OFF CACHE BOOL "Enable Vulkan support")
set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE "" CACHE INTERNAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES_DEBUG "" CACHE INTERNAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE_DIRS "" CACHE INTERNAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES_DEBUG_DIRS "" CACHE INTERNAL "")
function(casparcg_add_runtime_dependency FILE_TO_COPY)
if ("${ARGV1}" STREQUAL "Release" OR NOT ARGV1)
set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE "${CASPARCG_RUNTIME_DEPENDENCIES_RELEASE}" "${FILE_TO_COPY}" CACHE INTERNAL "")
endif()
if ("${ARGV1}" STREQUAL "Debug" OR NOT ARGV1)
set(CASPARCG_RUNTIME_DEPENDENCIES_DEBUG "${CASPARCG_RUNTIME_DEPENDENCIES_DEBUG}" "${FILE_TO_COPY}" CACHE INTERNAL "")
endif()
endfunction()
function(casparcg_add_runtime_dependency_dir FILE_TO_COPY)
if ("${ARGV1}" STREQUAL "Release" OR NOT ARGV1)
set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE_DIRS "${CASPARCG_RUNTIME_DEPENDENCIES_RELEASE_DIRS}" "${FILE_TO_COPY}" CACHE INTERNAL "")
endif()
if ("${ARGV1}" STREQUAL "Debug" OR NOT ARGV1)
set(CASPARCG_RUNTIME_DEPENDENCIES_DEBUG_DIRS "${CASPARCG_RUNTIME_DEPENDENCIES_DEBUG_DIRS}" "${FILE_TO_COPY}" CACHE INTERNAL "")
endif()
endfunction()
function(casparcg_add_runtime_dependency_from_target TARGET)
get_target_property(_runtime_lib_name ${TARGET} IMPORTED_LOCATION_RELEASE)
if (NOT "${_runtime_lib_name}" STREQUAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES_RELEASE "${CASPARCG_RUNTIME_DEPENDENCIES_RELEASE}" "${_runtime_lib_name}" CACHE INTERNAL "")
endif()
get_target_property(_runtime_lib_name ${TARGET} IMPORTED_LOCATION_DEBUG)
if (NOT "${_runtime_lib_name}" STREQUAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES_DEBUG "${CASPARCG_RUNTIME_DEPENDENCIES_DEBUG}" "${_runtime_lib_name}" CACHE INTERNAL "")
endif()
endfunction()
casparcg_add_runtime_dependency("${PROJECT_SOURCE_DIR}/shell/casparcg.config")
# BOOST
casparcg_add_external_project(boost)
if (BOOST_USE_PRECOMPILED)
ExternalProject_Add(boost
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_83_0-win32-x64-debug-release.zip
URL_HASH MD5=0b9990a24259867c8c04ae30c423f86b
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(boost SOURCE_DIR)
set(BOOST_INCLUDE_PATH "${SOURCE_DIR}/include/boost-1_83")
link_directories("${SOURCE_DIR}/lib")
else ()
set(BOOST_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost-install)
ExternalProject_Add(boost
URL ${CASPARCG_DOWNLOAD_MIRROR}/boost/boost_1_83_0.zip
URL_HASH MD5=03d5aea72401ffed848cb5daf8cd2b9b
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./bootstrap.bat
--with-libraries=filesystem
--with-libraries=locale
--with-libraries=log
--with-libraries=log_setup
--with-libraries=regex
--with-libraries=system
--with-libraries=thread
BUILD_COMMAND ./b2 install debug release --prefix=${BOOST_INSTALL_DIR} link=static threading=multi runtime-link=shared -j ${CONFIG_CPU_COUNT}
INSTALL_COMMAND ""
)
set(BOOST_INCLUDE_PATH "${BOOST_INSTALL_DIR}/include/boost-1_83")
link_directories("${BOOST_INSTALL_DIR}/lib")
endif ()
add_definitions( -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE )
add_definitions( -DBOOST_COROUTINES_NO_DEPRECATION_WARNING )
add_definitions( -DBOOST_LOCALE_HIDE_AUTO_PTR )
# FFMPEG
casparcg_add_external_project(ffmpeg-lib)
ExternalProject_Add(ffmpeg-lib
URL ${CASPARCG_DOWNLOAD_MIRROR}/ffmpeg/ffmpeg-7.0.2-full_build-shared.7z
URL_HASH MD5=c5127aeed36a9a86dd3b84346be182f8
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(ffmpeg-lib SOURCE_DIR)
set(FFMPEG_INCLUDE_PATH "${SOURCE_DIR}/include")
set(FFMPEG_BIN_PATH "${SOURCE_DIR}/bin")
link_directories("${SOURCE_DIR}/lib")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avcodec-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avdevice-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avfilter-10.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avformat-61.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avutil-59.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-58.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-5.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-8.dll")
# for scanner:
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/ffmpeg.exe")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/ffprobe.exe")
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set(EXTERNAL_CMAKE_ARGS "")
if (is_multi_config)
set(EXTERNAL_CMAKE_ARGS "-DCMAKE_BUILD_TYPE:STRING=$")
else()
set(EXTERNAL_CMAKE_ARGS "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}")
endif ()
# TBB
FetchContent_Declare(tbb
URL ${CASPARCG_DOWNLOAD_MIRROR}/tbb/oneapi-tbb-2022.3.0-win.zip
URL_HASH SHA256=e1b2373f25558bf47d16b4c89cf0a31e6689aaf7221400d209e8527afc7c9eee
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(tbb)
list(APPEND CMAKE_PREFIX_PATH ${tbb_SOURCE_DIR}/lib/cmake/tbb)
find_package(tbb REQUIRED)
casparcg_add_runtime_dependency_from_target(TBB::tbb)
casparcg_add_runtime_dependency_from_target(TBB::tbbmalloc)
casparcg_add_runtime_dependency_from_target(TBB::tbbmalloc_proxy)
# GLEW
FetchContent_Declare(glew
URL ${CASPARCG_DOWNLOAD_MIRROR}/glew/glew-2.2.0-win32.zip
URL_HASH MD5=1feddfe8696c192fa46a0df8eac7d4bf
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(glew)
add_library(GLEW::glew INTERFACE IMPORTED)
target_include_directories(GLEW::glew INTERFACE ${glew_SOURCE_DIR}/include)
target_link_directories(GLEW::glew INTERFACE ${glew_SOURCE_DIR}/lib/Release/x64)
target_link_libraries(GLEW::glew INTERFACE glew32)
casparcg_add_runtime_dependency("${glew_SOURCE_DIR}/bin/Release/x64/glew32.dll")
IF(ENABLE_VULKAN)
find_package(Vulkan REQUIRED)
FetchContent_Declare(vk_bootstrap
URL ${CASPARCG_DOWNLOAD_MIRROR}/vk-bootstrap/vk-bootstrap-1.4.328.zip
URL_HASH SHA256=10f257c30a0a49d30b28a72cf3a7942d93a61f977adaa04bee29304c6506dc12
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(vk_bootstrap)
FetchContent_Declare(vma
URL ${CASPARCG_DOWNLOAD_MIRROR}/VulkanMemoryAllocator/VulkanMemoryAllocator-3.3.0.zip
URL_HASH SHA256=81755d8fcb411b97292c6682e828501315db319374c7c34ba6e1226452c6c392
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(vma)
ENDIF()
# SFML
FetchContent_Declare(sfml
URL ${CASPARCG_DOWNLOAD_MIRROR}/sfml/SFML-2.6.2-windows-vc17-64-bit.zip
URL_HASH MD5=dee0602d6f94d1843eef4d7568d2c23d
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(sfml)
list(APPEND CMAKE_PREFIX_PATH ${sfml_SOURCE_DIR}/lib/cmake/SFML)
# set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2 COMPONENTS graphics system window REQUIRED)
casparcg_add_runtime_dependency_from_target(sfml-graphics)
casparcg_add_runtime_dependency_from_target(sfml-system)
casparcg_add_runtime_dependency_from_target(sfml-window)
#ZLIB
casparcg_add_external_project(zlib)
ExternalProject_Add(zlib
URL ${CASPARCG_DOWNLOAD_MIRROR}/zlib/zlib-1.3.tar.gz
URL_HASH MD5=60373b133d630f74f4a1f94c1185a53f
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS}
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(zlib SOURCE_DIR)
ExternalProject_Get_Property(zlib BINARY_DIR)
set(ZLIB_INCLUDE_PATH "${SOURCE_DIR};${BINARY_DIR}")
link_directories(${BINARY_DIR})
# OpenAL
FetchContent_Declare(openal
URL ${CASPARCG_DOWNLOAD_MIRROR}/openal/openal-soft-1.19.1-bin.zip
URL_HASH MD5=b78ef1ba26f7108e763f92df6bbc3fa5
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
)
FetchContent_MakeAvailable(openal)
file(COPY_FILE ${openal_SOURCE_DIR}/bin/Win64/soft_oal.dll ${openal_SOURCE_DIR}/bin/Win64/OpenAL32.dll)
add_library(OpenAL::OpenAL INTERFACE IMPORTED)
target_include_directories(OpenAL::OpenAL INTERFACE ${openal_SOURCE_DIR}/include)
target_link_directories(OpenAL::OpenAL INTERFACE ${openal_SOURCE_DIR}/libs/Win64)
target_link_libraries(OpenAL::OpenAL INTERFACE OpenAL32)
casparcg_add_runtime_dependency("${openal_SOURCE_DIR}/bin/Win64/OpenAL32.dll")
# flash template host
casparcg_add_external_project(flashtemplatehost)
ExternalProject_Add(flashtemplatehost
URL ${CASPARCG_DOWNLOAD_MIRROR}/flash-template-host/flash-template-host-files.zip
URL_HASH MD5=360184ce21e34d585d1d898fdd7a6bd8
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(flashtemplatehost SOURCE_DIR)
set(TEMPLATE_HOST_PATH "${SOURCE_DIR}")
# casparcg_add_runtime_dependency_dir("${TEMPLATE_HOST_PATH}")
# LIBERATION_FONTS
set(LIBERATION_FONTS_BIN_PATH "${PROJECT_SOURCE_DIR}/shell/liberation-fonts")
casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationMono-Regular.ttf")
# CEF
if (ENABLE_HTML)
casparcg_add_external_project(cef)
ExternalProject_Add(cef
URL ${CASPARCG_DOWNLOAD_MIRROR}/cef/cef_binary_142.0.17+g60aac24+chromium-142.0.7444.176_windows64_minimal.tar.bz2
URL_HASH SHA256=16c072a44484fe521037c74d03a339a77573b1fc0146cf44cc71e79fd0cc0198
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CMAKE_ARGS -DUSE_SANDBOX=Off -DCEF_RUNTIME_LIBRARY_FLAG=/MD ${EXTERNAL_CMAKE_ARGS}
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(cef SOURCE_DIR)
ExternalProject_Get_Property(cef BINARY_DIR)
add_library(CEF::CEF INTERFACE IMPORTED)
add_dependencies(CEF::CEF cef)
target_include_directories(CEF::CEF INTERFACE
"${SOURCE_DIR}"
)
set(CEF_RESOURCE_PATH ${SOURCE_DIR}/Resources)
set(CEF_BIN_PATH ${SOURCE_DIR}/Release)
if (is_multi_config)
target_link_libraries(CEF::CEF INTERFACE
${SOURCE_DIR}/Release/libcef.lib
optimized ${BINARY_DIR}/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib
debug ${BINARY_DIR}/libcef_dll_wrapper/Debug/libcef_dll_wrapper.lib)
else()
link_directories(${SOURCE_DIR}/Release ${BINARY_DIR}/libcef_dll_wrapper)
target_link_libraries(CEF::CEF INTERFACE
libcef.lib
libcef_dll_wrapper.lib)
endif()
casparcg_add_runtime_dependency_dir("${CEF_RESOURCE_PATH}/locales")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/chrome_100_percent.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/chrome_200_percent.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/resources.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/icudtl.dat")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/v8_context_snapshot.bin")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libcef.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/chrome_elf.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/d3dcompiler_47.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libEGL.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libGLESv2.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/vk_swiftshader.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/vk_swiftshader_icd.json")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/vulkan-1.dll")
endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT casparcg)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-DCASPAR_SOURCE_PREFIX="${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-D_WIN32_WINNT=0x601)
# ignore boost deprecated headers, as these are often reported inside boost
add_definitions("-DBOOST_ALLOW_DEPRECATED_HEADERS")
# Ensure /EHsc is not defined as it clashes with EHa below
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa /Zi /W4 /WX /MP /fp:fast /Zm192 /FIcommon/compiler/vs/disable_silly_warnings.h")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D TBB_USE_ASSERT=1 /D TBB_USE_DEBUG /bigobj")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /arch:AVX /Ot /Gy /bigobj")
================================================
FILE: src/CMakeModules/CasparCG_Util.cmake
================================================
# Collect all ExternalProjects that have been defined
set(CASPARCG_EXTERNAL_PROJECTS "" CACHE INTERNAL "")
FUNCTION (casparcg_add_external_project NAME)
SET (CASPARCG_EXTERNAL_PROJECTS "${CASPARCG_EXTERNAL_PROJECTS}" "${NAME}" CACHE INTERNAL "")
ENDFUNCTION()
# Mark a project as depending on all of the ExternalProjects, to ensure build order
FUNCTION(casparcg_add_build_dependencies TARGET)
if (CASPARCG_EXTERNAL_PROJECTS)
ADD_DEPENDENCIES (${TARGET} ${CASPARCG_EXTERNAL_PROJECTS})
endif()
ENDFUNCTION()
SET (CASPARCG_MODULE_INCLUDE_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_INIT_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_UNINIT_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_TARGETS "" CACHE INTERNAL "")
# CasparCG version of CMake `add_library`
FUNCTION (casparcg_add_library TARGET)
cmake_parse_arguments(
PARSED_ARGS # prefix of output variables
"" # list of names of the boolean arguments (only defined ones will be true)
"" # list of names of mono-valued arguments
"SOURCES" # list of names of multi-valued arguments (output variables are lists)
${ARGN} # arguments of the function to parse, here we take the all original ones
)
if(NOT TARGET)
message(FATAL_ERROR "You must provide a target name")
endif()
# Setup the library and some default config
ADD_LIBRARY (${TARGET} ${PARSED_ARGS_SOURCES})
target_compile_features (${TARGET} PRIVATE cxx_std_20)
target_include_directories(${TARGET} SYSTEM PRIVATE
${BOOST_INCLUDE_PATH}
)
target_link_libraries(${TARGET} PRIVATE TBB::tbb)
if (CASPARCG_EXTERNAL_PROJECTS)
# Setup dependency on ExternalProject
ADD_DEPENDENCIES (${TARGET} ${CASPARCG_EXTERNAL_PROJECTS})
endif()
ENDFUNCTION ()
# CasparCG version of CMake `add_library` specifically for modules
SET (CASPARCG_MODULE_TARGETS "" CACHE INTERNAL "")
FUNCTION (casparcg_add_module_project TARGET)
cmake_parse_arguments(
PARSED_ARGS # prefix of output variables
"" # list of names of the boolean arguments (only defined ones will be true)
"NAME;HEADER_FILE;INIT_FUNCTION;UNINIT_FUNCTION;CLI_INTERCEPTOR" # list of names of mono-valued arguments
"SOURCES" # list of names of multi-valued arguments (output variables are lists)
${ARGN} # arguments of the function to parse, here we take the all original ones
)
# Use target if name is missing
if (NOT PARSED_ARGS_NAME)
set (PARSED_ARGS_NAME ${TARGET})
endif()
# Use default path if header not defined
if (NOT PARSED_ARGS_HEADER_FILE)
set (PARSED_ARGS_HEADER_FILE "modules/${TARGET}/${TARGET}.h")
endif()
# Use default init name if not d
if (NOT PARSED_ARGS_INIT_FUNCTION)
message(FATAL_ERROR "You must provide an INIT_FUNCTION")
endif()
# Setup the library and some default config
casparcg_add_library (${TARGET} SOURCES ${PARSED_ARGS_SOURCES})
target_link_libraries(${TARGET} PRIVATE common core)
target_include_directories(${TARGET} PRIVATE
# TODO: This should be replaced by the linked libraries eventually
../..
)
# Setup linker and code loading
SET (CASPARCG_MODULE_TARGETS "${CASPARCG_MODULE_TARGETS}" "${TARGET}" CACHE INTERNAL "")
SET (CASPARCG_MODULE_INCLUDE_STATEMENTS "${CASPARCG_MODULE_INCLUDE_STATEMENTS}"
"#include <${PARSED_ARGS_HEADER_FILE}>"
CACHE INTERNAL ""
)
SET (CASPARCG_MODULE_INIT_STATEMENTS "${CASPARCG_MODULE_INIT_STATEMENTS}"
" ${PARSED_ARGS_INIT_FUNCTION}(dependencies)\;"
" CASPAR_LOG(info) << L\"Initialized ${PARSED_ARGS_NAME} module.\"\;"
""
CACHE INTERNAL ""
)
IF (PARSED_ARGS_UNINIT_FUNCTION)
SET (CASPARCG_MODULE_UNINIT_STATEMENTS
" ${PARSED_ARGS_UNINIT_FUNCTION}()\;"
"${CASPARCG_MODULE_UNINIT_STATEMENTS}"
CACHE INTERNAL ""
)
ENDIF ()
IF (PARSED_ARGS_CLI_INTERCEPTOR)
SET (CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}"
" if (${PARSED_ARGS_CLI_INTERCEPTOR}(argc, argv))"
" return true\;"
""
CACHE INTERNAL ""
)
ENDIF ()
ENDFUNCTION ()
# http://stackoverflow.com/questions/7172670/best-shortest-way-to-join-a-list-in-cmake
FUNCTION (join_list VALUES GLUE OUTPUT)
STRING (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
STRING (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
SET (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
ENDFUNCTION ()
================================================
FILE: src/CMakeModules/FindFFmpeg.cmake
================================================
# vim: ts=2 sw=2
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
#
# Once done this will define
# FFMPEG_FOUND - System has the all required components.
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
#
# For each of the components it will additionally set.
# - AVCODEC
# - AVDEVICE
# - AVFORMAT
# - AVFILTER
# - AVUTIL
# - SWSCALE
# the following variables will be defined
# _FOUND - System has
# _INCLUDE_DIRS - Include directory necessary for using the headers
# _LIBRARIES - Link these to use
# _DEFINITIONS - Compiler switches required for using
# _VERSION - The components version
#
# Copyright (c) 2006, Matthias Kretz,
# Copyright (c) 2008, Alexander Neundorf,
# Copyright (c) 2011, Michael Jansen,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(FindPackageHandleStandardArgs)
# The default components were taken from a survey over other FindFFMPEG.cmake files
if (NOT FFmpeg_FIND_COMPONENTS)
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE)
endif ()
#
### Macro: set_component_found
#
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
#
macro(set_component_found _component )
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
# message(STATUS " - ${_component} found.")
set(${_component}_FOUND TRUE)
else ()
# message(STATUS " - ${_component} not found.")
endif ()
endmacro()
#
### Macro: find_component
#
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
# include directories.
#
macro(find_component _component _pkgconfig _library _header)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${_component} ${_pkgconfig})
endif ()
endif (NOT WIN32)
find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS
${PC_LIB${_component}_INCLUDEDIR}
${PC_LIB${_component}_INCLUDE_DIRS}
PATH_SUFFIXES
ffmpeg
)
find_library(${_component}_LIBRARIES NAMES ${_library}
HINTS
${PC_LIB${_component}_LIBDIR}
${PC_LIB${_component}_LIBRARY_DIRS}
)
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
set_component_found(${_component})
mark_as_advanced(
${_component}_LIBRARY_DIRS
${_component}_INCLUDE_DIRS
${_component}_LIBRARIES
${_component}_DEFINITIONS
${_component}_VERSION
)
endmacro()
# Check for cached results. If there are skip the costly part.
if (NOT FFMPEG_LIBRARIES)
# Check for all possible component.
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
foreach (_component ${FFmpeg_FIND_COMPONENTS})
if (${_component}_FOUND)
# message(STATUS "Required component ${_component} present.")
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
list(APPEND FFMPEG_LIBRARY_DIRS ${${_component}_LIBRARY_DIRS})
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
else ()
# message(STATUS "Required component ${_component} missing.")
endif ()
endforeach ()
# Build the include path with duplicates removed.
if (FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
endif ()
# Build the lib path with duplicates removed.
if (FFMPEG_LIBRARY_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
endif ()
# cache the vars.
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "The FFmpeg lib directories." FORCE)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
mark_as_advanced(
FFMPEG_INCLUDE_DIRS
FFMPEG_LIBRARY_DIRS
FFMPEG_LIBRARIES
FFMPEG_DEFINITIONS
)
endif ()
# Now set the noncached _FOUND vars for the components.
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL SWSCALE)
set_component_found(${_component})
endforeach ()
# Compile the list of required vars
if (FFMPEG_INCLUDE_DIRS)
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
else ()
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES)
endif ()
foreach (_component ${FFmpeg_FIND_COMPONENTS})
if (${_component}_INCLUDE_DIRS)
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
else ()
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES)
endif ()
endforeach ()
# Give a nice error message if some of the required vars are missing.
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
================================================
FILE: src/CMakeSettings.json
================================================
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
},
{
"name": "x64-RelWithDebInfo",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}
================================================
FILE: src/accelerator/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.28)
project (accelerator)
set(SOURCES
ogl/image/image_kernel.cpp
ogl/image/image_mixer.cpp
ogl/image/image_shader.cpp
ogl/util/buffer.cpp
ogl/util/context.cpp
ogl/util/device.cpp
ogl/util/shader.cpp
ogl/util/texture.cpp
ogl/util/matrix.cpp
ogl/util/transforms.cpp
accelerator.cpp
)
set(HEADERS
ogl/image/image_kernel.h
ogl/image/image_mixer.h
ogl/image/image_shader.h
ogl/util/buffer.h
ogl/util/context.h
ogl/util/device.h
ogl/util/shader.h
ogl/util/texture.h
ogl/util/matrix.h
ogl/util/transforms.h
ogl_image_vertex.h
ogl_image_fragment.h
accelerator.h
StdAfx.h
)
IF(ENABLE_VULKAN)
list(APPEND SOURCES
vulkan/image/image_kernel.cpp
vulkan/image/image_mixer.cpp
vulkan/util/buffer.cpp
vulkan/util/device.cpp
vulkan/util/pipeline.cpp
vulkan/util/renderpass.cpp
vulkan/util/texture.cpp
vulkan/util/matrix.cpp
vulkan/util/transforms.cpp
)
list(APPEND HEADERS
vulkan/image/image_kernel.h
vulkan/image/image_mixer.h
vulkan/util/buffer.h
vulkan/util/device.h
vulkan/util/draw_params.h
vulkan/util/pipeline.h
vulkan/util/texture.h
vulkan/util/matrix.h
vulkan/util/transforms.h
vulkan/util/uniform_block.h
vulkan_image_vertex.h
vulkan_image_fragment.h
)
ENDIF()
if (MSVC)
list(APPEND SOURCES
d3d/d3d_device.cpp
d3d/d3d_device_context.cpp
d3d/d3d_texture2d.cpp
)
list(APPEND HEADERS
d3d/d3d_device.h
d3d/d3d_device_context.h
d3d/d3d_texture2d.h
)
endif ()
IF (ENABLE_VULKAN)
find_program(glslc_executable NAMES glslc HINTS Vulkan::glslc)
set(SHADER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vulkan/image)
set(SHADER_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vulkan/image)
file(GLOB SHADERS
${SHADER_SOURCE_DIR}/vertex_shader.vert
${SHADER_SOURCE_DIR}/fragment_shader.frag)
foreach(source IN LISTS SHADERS)
get_filename_component(FILENAME ${source} NAME_WLE)
add_custom_command(
COMMAND
${glslc_executable}
# -MD -MF ${SHADER_BINARY_DIR}/${FILENAME}.d
-o ${SHADER_BINARY_DIR}/${FILENAME}.spv
${source}
OUTPUT ${SHADER_BINARY_DIR}/${FILENAME}.spv
DEPENDS ${source} ${SHADER_BINARY_DIR}
COMMENT "Compiling ${FILENAME}"
)
list(APPEND SPV_SHADERS ${SHADER_BINARY_DIR}/${FILENAME}.spv)
endforeach()
add_custom_target(shaders ALL DEPENDS ${SPV_SHADERS})
bin2c("vulkan/image/vertex_shader.spv" "vulkan_image_vertex.h" "caspar::accelerator::vulkan" "vertex_shader")
bin2c("vulkan/image/fragment_shader.spv" "vulkan_image_fragment.h" "caspar::accelerator::vulkan" "fragment_shader")
ENDIF()
bin2c("ogl/image/shader.vert" "ogl_image_vertex.h" "caspar::accelerator::ogl" "vertex_shader")
bin2c("ogl/image/shader.frag" "ogl_image_fragment.h" "caspar::accelerator::ogl" "fragment_shader")
casparcg_add_library(accelerator SOURCES ${SOURCES} ${HEADERS})
target_include_directories(accelerator PRIVATE .. ${CMAKE_CURRENT_BINARY_DIR})
target_precompile_headers(accelerator PRIVATE StdAfx.h)
target_link_libraries(accelerator PRIVATE common core GLEW::glew sfml-window)
IF(ENABLE_VULKAN)
target_link_libraries(accelerator PRIVATE vk-bootstrap::vk-bootstrap GPUOpen::VulkanMemoryAllocator Vulkan::Headers)
target_compile_definitions(accelerator PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
ENDIF()
source_group(sources ./.*)
source_group(sources\\cpu\\image cpu/image/.*)
source_group(sources\\cpu\\util cpu/util/.*)
source_group(sources\\ogl\\image ogl/image/.*)
source_group(sources\\ogl\\util ogl/util/.*)
IF(ENABLE_VULKAN)
source_group(sources\\vulkan\\image vulkan/image/.*)
source_group(sources\\vulkan\\util vulkan/util/.*)
ENDIF()
================================================
FILE: src/accelerator/StdAfx.h
================================================
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
================================================
FILE: src/accelerator/accelerator.cpp
================================================
#include "accelerator.h"
#include "ogl/image/image_mixer.h"
#include "ogl/util/device.h"
#ifdef ENABLE_VULKAN
#include "vulkan/image/image_mixer.h"
#include "vulkan/util/device.h"
#endif
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator {
struct accelerator::impl
{
std::shared_ptr device_;
const core::video_format_repository format_repository_;
accelerator_backend backend_;
impl(const core::video_format_repository format_repository)
: format_repository_(format_repository)
, backend_(accelerator_backend::invalid)
{
}
void set_backend(accelerator_backend backend)
{
if (backend_ != accelerator_backend::invalid) {
CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Accelerator backend already set"));
}
backend_ = backend;
}
std::unique_ptr create_image_mixer(int channel_id, common::bit_depth depth)
{
#ifdef ENABLE_VULKAN
if (backend_ == accelerator_backend::vulkan) {
return std::make_unique(
spl::make_shared_ptr(std::dynamic_pointer_cast(get_device())),
channel_id,
format_repository_.get_max_video_format_size(),
depth);
}
#endif
return std::make_unique(
spl::make_shared_ptr(std::dynamic_pointer_cast(get_device())),
channel_id,
format_repository_.get_max_video_format_size(),
depth);
}
std::shared_ptr get_device()
{
if (backend_ == accelerator_backend::invalid) {
CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Accelerator backend not set"));
}
#ifdef ENABLE_VULKAN
if (backend_ == accelerator_backend::vulkan) {
if (!device_) {
device_ = std::dynamic_pointer_cast(std::make_shared());
}
return device_;
}
#endif
if (!device_) {
device_ = std::dynamic_pointer_cast(std::make_shared());
}
return device_;
}
};
accelerator::accelerator(const core::video_format_repository format_repository)
: impl_(std::make_unique(format_repository))
{
}
accelerator::~accelerator() {}
void accelerator::set_backend(accelerator_backend backend) { impl_->set_backend(backend); }
std::unique_ptr accelerator::create_image_mixer(const int channel_id, common::bit_depth depth)
{
return impl_->create_image_mixer(channel_id, depth);
}
std::shared_ptr accelerator::get_device() const { return impl_->get_device(); }
}} // namespace caspar::accelerator
================================================
FILE: src/accelerator/accelerator.h
================================================
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator {
class accelerator_device
{
public:
virtual boost::property_tree::wptree info() const = 0;
virtual std::future gc() = 0;
};
enum class accelerator_backend
{
invalid = 0,
opengl,
#ifdef ENABLE_VULKAN
vulkan,
#endif
};
class accelerator
{
public:
explicit accelerator(const core::video_format_repository format_repository);
accelerator(accelerator&) = delete;
~accelerator();
accelerator& operator=(accelerator&) = delete;
void set_backend(accelerator_backend backend);
std::unique_ptr create_image_mixer(int channel_id, common::bit_depth depth);
std::shared_ptr get_device() const;
private:
struct impl;
std::unique_ptr impl_;
};
}} // namespace caspar::accelerator
================================================
FILE: src/accelerator/d3d/d3d_device.cpp
================================================
#include "d3d_device.h"
#include "d3d_device_context.h"
#include "d3d_texture2d.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace d3d {
struct d3d_device::impl : public std::enable_shared_from_this
{
using texture_queue_t = tbb::concurrent_bounded_queue>;
mutable std::mutex device_pools_mutex_;
tbb::concurrent_unordered_map device_pools_;
std::wstring adaptor_name_ = L"N/A";
std::shared_ptr device_;
std::shared_ptr ctx_;
impl()
{
HRESULT hr;
UINT flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
D3D_FEATURE_LEVEL feature_levels[] = {
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
};
UINT num_feature_levels = sizeof(feature_levels) / sizeof(feature_levels[0]);
D3D_FEATURE_LEVEL selected_level = D3D_FEATURE_LEVEL_9_3;
ID3D11Device* pdev = nullptr;
ID3D11DeviceContext* pctx = nullptr;
hr = D3D11CreateDevice(nullptr,
D3D_DRIVER_TYPE_HARDWARE,
nullptr,
flags,
feature_levels,
num_feature_levels,
D3D11_SDK_VERSION,
&pdev,
&selected_level,
&pctx);
if (hr == E_INVALIDARG) {
// DirectX 11.0 platforms will not recognize D3D_FEATURE_LEVEL_11_1
// so we need to retry without it
hr = D3D11CreateDevice(nullptr,
D3D_DRIVER_TYPE_HARDWARE,
nullptr,
flags,
&feature_levels[1],
num_feature_levels - 1,
D3D11_SDK_VERSION,
&pdev,
&selected_level,
&pctx);
}
if (SUCCEEDED(hr)) {
device_ = std::shared_ptr(pdev, [](ID3D11Device* p) {
if (p)
p->Release();
});
ctx_ = std::make_shared(pctx);
CComQIPtr d3d11_1(device_.get());
if (!d3d11_1) {
return;
}
/* needs to support extended resource sharing */
D3D11_FEATURE_DATA_D3D11_OPTIONS opts = {};
hr = d3d11_1->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &opts, sizeof(opts));
if (FAILED(hr) || !opts.ExtendedResourceSharing) {
CASPAR_THROW_EXCEPTION(bad_alloc() << msg_info(L"Device does not support ExtendedResourceSharing"));
}
{
CComQIPtr dxgi_dev = device_.get();
if (dxgi_dev) {
IDXGIAdapter* dxgi_adapt = nullptr;
hr = dxgi_dev->GetAdapter(&dxgi_adapt);
if (SUCCEEDED(hr)) {
DXGI_ADAPTER_DESC desc;
hr = dxgi_adapt->GetDesc(&desc);
dxgi_adapt->Release();
if (SUCCEEDED(hr)) {
adaptor_name_ = u16(desc.Description);
}
}
}
}
CASPAR_LOG(info) << L"D3D11: Selected adapter: " << adaptor_name_;
CASPAR_LOG(info) << L"D3D11: Selected feature level: " << selected_level;
} else
CASPAR_THROW_EXCEPTION(bad_alloc() << msg_info(L"Failed to create d3d11 device"));
}
std::shared_ptr open_shared_texture(void* handle)
{
ID3D11Texture2D* tex = nullptr;
CComQIPtr dev = device_.get();
if (dev) {
auto hr = dev->OpenSharedResource1((HANDLE)(uintptr_t)handle, __uuidof(ID3D11Texture2D), (void**)(&tex));
if (SUCCEEDED(hr))
return std::make_shared(tex);
}
return nullptr;
}
};
d3d_device::d3d_device()
: impl_(new impl())
{
}
d3d_device::~d3d_device() {}
std::wstring d3d_device::adapter_name() const { return impl_->adaptor_name_; }
void* d3d_device::device() const { return impl_->device_.get(); }
std::shared_ptr d3d_device::immedidate_context() { return impl_->ctx_; }
std::shared_ptr d3d_device::open_shared_texture(void* handle)
{
return impl_->open_shared_texture(handle);
}
const std::shared_ptr& d3d_device::get_device()
{
static std::shared_ptr device = []() -> std::shared_ptr {
if (!WGLEW_NV_DX_interop2) {
// Device doesn't support the extension, so skip
return nullptr;
}
try {
return std::make_shared();
} catch (...) {
CASPAR_LOG_CURRENT_EXCEPTION();
}
return nullptr;
}();
return device;
}
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/d3d/d3d_device.h
================================================
#pragma once
#include
#include
namespace caspar { namespace accelerator { namespace d3d {
class d3d_device
{
public:
d3d_device();
~d3d_device();
d3d_device(const d3d_device&) = delete;
d3d_device& operator=(const d3d_device&) = delete;
std::wstring adapter_name() const;
void* device() const;
std::shared_ptr immedidate_context();
std::shared_ptr open_shared_texture(void* handle);
static const std::shared_ptr& get_device();
private:
struct impl;
std::shared_ptr impl_;
};
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/d3d/d3d_device_context.cpp
================================================
#include "d3d_device_context.h"
namespace caspar { namespace accelerator { namespace d3d {
d3d_device_context::d3d_device_context(ID3D11DeviceContext* ctx)
: ctx_(std::shared_ptr(ctx, [](ID3D11DeviceContext* p) {
if (p)
p->Release();
}))
{
}
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/d3d/d3d_device_context.h
================================================
#pragma once
#undef NOMINMAX
#define NOMINMAX
#include
#include
namespace caspar { namespace accelerator { namespace d3d {
class d3d_device_context
{
public:
d3d_device_context(ID3D11DeviceContext* ctx);
d3d_device_context(const d3d_device_context&) = delete;
d3d_device_context& operator=(const d3d_device_context&) = delete;
ID3D11DeviceContext* context() const { return ctx_.get(); }
private:
std::shared_ptr const ctx_;
};
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/d3d/d3d_texture2d.cpp
================================================
#include "d3d_texture2d.h"
#include
#include
#include
#include
#include "../ogl/util/device.h"
namespace caspar { namespace accelerator { namespace d3d {
d3d_texture2d::d3d_texture2d(ID3D11Texture2D* tex)
: texture_(tex)
{
share_handle_ = nullptr;
D3D11_TEXTURE2D_DESC desc;
texture_->GetDesc(&desc);
width_ = desc.Width;
height_ = desc.Height;
format_ = desc.Format;
if ((desc.MiscFlags & D3D11_RESOURCE_MISC_SHARED_NTHANDLE) == 0) {
CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("D3D texture is not sharable."));
}
{
CComQIPtr res = texture_;
if (res) {
res->CreateSharedHandle(nullptr, DXGI_SHARED_RESOURCE_READ, nullptr, &share_handle_);
}
}
if (share_handle_ == nullptr || !wglDXSetResourceShareHandleNV(texture_, share_handle_)) {
CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to setup shared d3d texture."));
}
}
d3d_texture2d::~d3d_texture2d()
{
const std::shared_ptr ogl = ogl_.lock();
if (ogl != nullptr) {
// The cleanup must happen be done on the opengl thread
ogl->dispatch_sync([&] {
const std::shared_ptr interop = ogl->d3d_interop();
if (texture_handle_ != nullptr && interop != nullptr) {
wglDXUnlockObjectsNV(interop.get(), 1, &texture_handle_);
wglDXUnregisterObjectNV(interop.get(), texture_handle_);
texture_handle_ = nullptr;
}
if (gl_texture_id_ != 0) {
GL(glDeleteTextures(1, &gl_texture_id_));
gl_texture_id_ = 0;
}
// TODO: This appears to be leaking something opengl, but it is not clear what that is.
if (share_handle_ != nullptr) {
CloseHandle(share_handle_);
share_handle_ = nullptr;
}
});
}
if (texture_ != nullptr) {
texture_->Release();
texture_ = nullptr;
}
}
void d3d_texture2d::gen_gl_texture(std::shared_ptr ogl)
{
if (gl_texture_id_ != 0 || texture_ == nullptr)
return;
ogl_ = ogl;
const std::shared_ptr interop = ogl->d3d_interop();
if (!interop) {
CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("d3d interop not setup to bind shared d3d texture."));
}
ogl->dispatch_sync([&] {
GL(glGenTextures(1, &gl_texture_id_));
texture_handle_ =
wglDXRegisterObjectNV(interop.get(), texture_, gl_texture_id_, GL_TEXTURE_2D, WGL_ACCESS_READ_ONLY_NV);
if (!texture_handle_) {
GL(glDeleteTextures(1, &gl_texture_id_));
gl_texture_id_ = 0;
CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to bind shared d3d texture."));
}
if (!wglDXLockObjectsNV(interop.get(), 1, &texture_handle_)) {
wglDXUnregisterObjectNV(interop.get(), texture_handle_);
texture_handle_ = nullptr;
GL(glDeleteTextures(1, &gl_texture_id_));
gl_texture_id_ = 0;
CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to lock shared d3d texture."));
}
});
}
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/d3d/d3d_texture2d.h
================================================
#pragma once
#undef NOMINMAX
#define NOMINMAX
#include
#include
namespace caspar { namespace accelerator { namespace d3d {
class d3d_texture2d
{
public:
d3d_texture2d(ID3D11Texture2D* tex);
~d3d_texture2d();
d3d_texture2d(const d3d_texture2d&) = delete;
d3d_texture2d& operator=(const d3d_texture2d&) = delete;
uint32_t width() const { return width_; }
uint32_t height() const { return height_; }
DXGI_FORMAT format() const { return format_; }
void* share_handle() const { return share_handle_; }
ID3D11Texture2D* texture() const { return texture_; }
uint32_t gl_texture_id() const { return gl_texture_id_; }
void gen_gl_texture(std::shared_ptr);
private:
HANDLE share_handle_;
ID3D11Texture2D* texture_;
uint32_t width_ = 0;
uint32_t height_ = 0;
DXGI_FORMAT format_ = DXGI_FORMAT::DXGI_FORMAT_UNKNOWN;
std::weak_ptr ogl_;
HANDLE texture_handle_ = nullptr;
uint32_t gl_texture_id_ = 0;
};
}}} // namespace caspar::accelerator::d3d
================================================
FILE: src/accelerator/ogl/image/image_kernel.cpp
================================================
/*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "image_kernel.h"
#include "image_shader.h"
#include "../util/device.h"
#include "../util/shader.h"
#include "../util/texture.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar::accelerator::ogl {
double get_precision_factor(common::bit_depth depth)
{
switch (depth) {
case common::bit_depth::bit8:
return 1.0;
case common::bit_depth::bit10:
return 64.0;
case common::bit_depth::bit12:
return 16.0;
case common::bit_depth::bit16:
return 1.0;
default:
return 1.0;
}
}
bool is_above_screen(double y) { return y < 0.0; }
bool is_below_screen(double y) { return y > 1.0; }
bool is_left_of_screen(double x) { return x < 0.0; }
bool is_right_of_screen(double x) { return x > 1.0; }
bool is_outside_screen(const std::vector& coords)
{
auto x_coords =
coords | boost::adaptors::transformed([](const core::frame_geometry::coord& c) { return c.vertex_x; });
auto y_coords =
coords | boost::adaptors::transformed([](const core::frame_geometry::coord& c) { return c.vertex_y; });
return boost::algorithm::all_of(x_coords, &is_left_of_screen) ||
boost::algorithm::all_of(x_coords, &is_right_of_screen) ||
boost::algorithm::all_of(y_coords, &is_above_screen) || boost::algorithm::all_of(y_coords, &is_below_screen);
}
static const double epsilon = 0.001;
struct image_kernel::impl
{
spl::shared_ptr ogl_;
spl::shared_ptr shader_;
GLuint vao_;
GLuint vbo_;
explicit impl(const spl::shared_ptr& ogl)
: ogl_(ogl)
, shader_(ogl_->dispatch_sync([&] { return get_image_shader(ogl); }))
{
ogl_->dispatch_sync([&] {
GL(glGenVertexArrays(1, &vao_));
GL(glGenBuffers(1, &vbo_));
});
}
~impl()
{
ogl_->dispatch_sync([&] {
GL(glDeleteVertexArrays(1, &vao_));
GL(glDeleteBuffers(1, &vbo_));
});
}
void draw(draw_params params)
{
CASPAR_ASSERT(params.pix_desc.planes.size() == params.textures.size());
if (params.textures.empty() || !params.background) {
return;
}
if (params.transforms.image_transform.opacity < epsilon) {
return;
}
auto coords = params.geometry.data();
if (coords.empty()) {
return;
}
auto transforms = params.transforms;
auto const first_plane = params.pix_desc.planes.at(0);
if (params.geometry.mode() != core::frame_geometry::scale_mode::stretch && first_plane.width > 0 &&
first_plane.height > 0) {
auto width_scale = static_cast(params.target_width) / static_cast(first_plane.width);
auto height_scale = static_cast(params.target_height) / static_cast(first_plane.height);
core::image_transform transform;
double target_scale;
switch (params.geometry.mode()) {
case core::frame_geometry::scale_mode::fit:
target_scale = std::min(width_scale, height_scale);
transform.fill_scale[0] *= target_scale / width_scale;
transform.fill_scale[1] *= target_scale / height_scale;
break;
case core::frame_geometry::scale_mode::fill:
target_scale = std::max(width_scale, height_scale);
transform.fill_scale[0] *= target_scale / width_scale;
transform.fill_scale[1] *= target_scale / height_scale;
break;
case core::frame_geometry::scale_mode::original:
transform.fill_scale[0] /= width_scale;
transform.fill_scale[1] /= height_scale;
break;
case core::frame_geometry::scale_mode::hfill:
transform.fill_scale[1] *= width_scale / height_scale;
break;
case core::frame_geometry::scale_mode::vfill:
transform.fill_scale[0] *= height_scale / width_scale;
break;
default:;
}
transforms = transforms.combine_transform(transform, params.aspect_ratio);
}
coords = transforms.transform_coords(coords);
// Skip drawing if all the coordinates will be outside the screen.
if (coords.size() < 3 || is_outside_screen(coords)) {
return;
}
double precision_factor[4] = {1, 1, 1, 1};
// Bind textures
for (int n = 0; n < params.textures.size(); ++n) {
params.textures[n]->bind(n);
precision_factor[n] = get_precision_factor(params.textures[n]->depth());
}
if (params.local_key) {
params.local_key->bind(static_cast(texture_id::local_key));
}
if (params.layer_key) {
params.layer_key->bind(static_cast(texture_id::layer_key));
}
const auto is_hd = params.pix_desc.planes.at(0).height > 700;
const auto color_space = is_hd ? params.pix_desc.color_space : core::color_space::bt601;
const float color_matrices[3][9] = {
{1.0, 0.0, 1.402, 1.0, -0.344, -0.509, 1.0, 1.772, 0.0}, // bt.601
{1.0, 0.0, 1.5748, 1.0, -0.1873, -0.4681, 1.0, 1.8556, 0.0}, // bt.709
{1.0, 0.0, 1.4746, 1.0, -0.16455312684366, -0.57135312684366, 1.0, 1.8814, 0.0}}; // bt.2020
const auto color_matrix = color_matrices[static_cast(color_space)];
const float luma_coefficients[3][3] = {{0.299, 0.587, 0.114}, // bt.601
{0.2126, 0.7152, 0.0722}, // bt.709
{0.2627, 0.6780, 0.0593}}; // bt.2020
const auto luma_coeff = luma_coefficients[static_cast(color_space)];
// Setup shader
shader_->use();
shader_->set("is_straight_alpha", params.pix_desc.is_straight_alpha);
shader_->set("plane[0]", texture_id::plane0);
shader_->set("plane[1]", texture_id::plane1);
shader_->set("plane[2]", texture_id::plane2);
shader_->set("plane[3]", texture_id::plane3);
shader_->set("precision_factor[0]", precision_factor[0]);
shader_->set("precision_factor[1]", precision_factor[1]);
shader_->set("precision_factor[2]", precision_factor[2]);
shader_->set("precision_factor[3]", precision_factor[3]);
shader_->set("local_key", texture_id::local_key);
shader_->set("layer_key", texture_id::layer_key);
shader_->set_matrix3("color_matrix", color_matrix);
shader_->set("luma_coeff", luma_coeff[0], luma_coeff[1], luma_coeff[2]);
shader_->set("has_local_key", static_cast(params.local_key));
shader_->set("has_layer_key", static_cast(params.layer_key));
shader_->set("pixel_format", params.pix_desc.format);
shader_->set("opacity", transforms.image_transform.is_key ? 1.0 : transforms.image_transform.opacity);
if (transforms.image_transform.chroma.enable) {
shader_->set("chroma", true);
shader_->set("chroma_show_mask", transforms.image_transform.chroma.show_mask);
shader_->set("chroma_target_hue", transforms.image_transform.chroma.target_hue / 360.0);
shader_->set("chroma_hue_width", transforms.image_transform.chroma.hue_width);
shader_->set("chroma_min_saturation", transforms.image_transform.chroma.min_saturation);
shader_->set("chroma_min_brightness", transforms.image_transform.chroma.min_brightness);
shader_->set("chroma_softness", 1.0 + transforms.image_transform.chroma.softness);
shader_->set("chroma_spill_suppress", transforms.image_transform.chroma.spill_suppress / 360.0);
shader_->set("chroma_spill_suppress_saturation",
transforms.image_transform.chroma.spill_suppress_saturation);
} else {
shader_->set("chroma", false);
}
// Setup blend_func
if (transforms.image_transform.is_key) {
params.blend_mode = core::blend_mode::normal;
}
params.background->bind(static_cast(texture_id::background));
shader_->set("background", texture_id::background);
shader_->set("blend_mode", params.blend_mode);
shader_->set("keyer", params.keyer);
// Setup image-adjustments
shader_->set("invert", transforms.image_transform.invert);
if (transforms.image_transform.levels.min_input > epsilon ||
transforms.image_transform.levels.max_input < 1.0 - epsilon ||
transforms.image_transform.levels.min_output > epsilon ||
transforms.image_transform.levels.max_output < 1.0 - epsilon ||
std::abs(transforms.image_transform.levels.gamma - 1.0) > epsilon) {
shader_->set("levels", true);
shader_->set("min_input", transforms.image_transform.levels.min_input);
shader_->set("max_input", transforms.image_transform.levels.max_input);
shader_->set("min_output", transforms.image_transform.levels.min_output);
shader_->set("max_output", transforms.image_transform.levels.max_output);
shader_->set("gamma", transforms.image_transform.levels.gamma);
} else {
shader_->set("levels", false);
}
if (std::abs(transforms.image_transform.brightness - 1.0) > epsilon ||
std::abs(transforms.image_transform.saturation - 1.0) > epsilon ||
std::abs(transforms.image_transform.contrast - 1.0) > epsilon) {
shader_->set("csb", true);
shader_->set("brt", transforms.image_transform.brightness);
shader_->set("sat", transforms.image_transform.saturation);
shader_->set("con", transforms.image_transform.contrast);
} else {
shader_->set("csb", false);
}
// Setup drawing area
GL(glViewport(0, 0, params.background->width(), params.background->height()));
glDisable(GL_DEPTH_TEST);
// Set render target
params.background->attach();
// Draw
GL(glBindVertexArray(vao_));
GL(glBindBuffer(GL_ARRAY_BUFFER, vbo_));
GL(glBufferData(GL_ARRAY_BUFFER,
static_cast(sizeof(core::frame_geometry::coord)) * coords.size(),
coords.data(),
GL_STATIC_DRAW));
auto stride = static_cast(sizeof(core::frame_geometry::coord));
auto vtx_loc = shader_->get_attrib_location("Position");
auto tex_loc = shader_->get_attrib_location("TexCoordIn");
GL(glEnableVertexAttribArray(vtx_loc));
GL(glEnableVertexAttribArray(tex_loc));
GL(glVertexAttribPointer(vtx_loc, 2, GL_DOUBLE, GL_FALSE, stride, nullptr));
GL(glVertexAttribPointer(tex_loc, 4, GL_DOUBLE, GL_FALSE, stride, (GLvoid*)(2 * sizeof(GLdouble))));
GL(glDrawArrays(GL_TRIANGLE_FAN, 0, static_cast(coords.size())));
GL(glTextureBarrier());
GL(glDisableVertexAttribArray(vtx_loc));
GL(glDisableVertexAttribArray(tex_loc));
GL(glBindVertexArray(0));
GL(glBindBuffer(GL_ARRAY_BUFFER, 0));
// Cleanup
GL(glDisable(GL_SCISSOR_TEST));
GL(glDisable(GL_BLEND));
}
};
image_kernel::image_kernel(const spl::shared_ptr& ogl)
: impl_(new impl(ogl))
{
}
image_kernel::~image_kernel() {}
void image_kernel::draw(const draw_params& params) { impl_->draw(params); }
} // namespace caspar::accelerator::ogl
================================================
FILE: src/accelerator/ogl/image/image_kernel.h
================================================
/*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include "../util/matrix.h"
#include "../util/transforms.h"
namespace caspar { namespace accelerator { namespace ogl {
enum class keyer
{
linear = 0,
additive,
};
struct draw_params final
{
core::pixel_format_desc pix_desc = core::pixel_format_desc(core::pixel_format::invalid);
std::vector> textures;
draw_transforms transforms;
core::frame_geometry geometry = core::frame_geometry::get_default();
core::blend_mode blend_mode = core::blend_mode::normal;
ogl::keyer keyer = ogl::keyer::linear;
std::shared_ptr background;
std::shared_ptr local_key;
std::shared_ptr layer_key;
double aspect_ratio = 1.0;
int target_width;
int target_height;
};
class image_kernel final
{
image_kernel(const image_kernel&);
image_kernel& operator=(const image_kernel&);
public:
explicit image_kernel(const spl::shared_ptr& ogl);
~image_kernel();
void draw(const draw_params& params);
private:
struct impl;
spl::unique_ptr impl_;
};
}}} // namespace caspar::accelerator::ogl
================================================
FILE: src/accelerator/ogl/image/image_mixer.cpp
================================================
/*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "image_mixer.h"
#include "image_kernel.h"
#include "../util/buffer.h"
#include "../util/device.h"
#include "../util/texture.h"
#ifdef WIN32
#include "../../d3d/d3d_texture2d.h"
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
using future_texture = std::shared_future>;
struct item
{
core::pixel_format_desc pix_desc = core::pixel_format_desc(core::pixel_format::invalid);
std::vector textures;
draw_transforms transforms;
core::frame_geometry geometry = core::frame_geometry::get_default();
};
struct layer
{
std::vector sublayers;
std::vector- items;
core::blend_mode blend_mode;
explicit layer(core::blend_mode blend_mode)
: blend_mode(blend_mode)
{
}
};
class image_renderer
{
spl::shared_ptr ogl_;
image_kernel kernel_;
const size_t max_frame_size_;
common::bit_depth depth_;
public:
explicit image_renderer(const spl::shared_ptr& ogl, const size_t max_frame_size, common::bit_depth depth)
: ogl_(ogl)
, kernel_(ogl_)
, max_frame_size_(max_frame_size)
, depth_(depth)
{
}
std::future, std::shared_ptr>>
operator()(std::vector layers, const core::video_format_desc& format_desc)
{
if (layers.empty()) { // Bypass GPU with empty frame.
static const std::vector> buffer(max_frame_size_,
0);
return make_ready_future, std::shared_ptr>>(
{array(buffer.data(), format_desc.size, true), nullptr});
}
auto f = std::move(
ogl_->dispatch_async([this, format_desc, layers = std::move(layers)]() mutable
-> std::tuple>, std::shared_ptr> {
auto target_texture = ogl_->create_texture(format_desc.width, format_desc.height, 4, depth_);
draw(target_texture, std::move(layers), format_desc);
return {ogl_->copy_async(target_texture), target_texture};
}));
return std::async(
std::launch::deferred,
[f = std::move(f)]() mutable -> std::tuple, std::shared_ptr> {
auto tuple = std::move(f.get());
return {std::move(std::get<0>(tuple).get()), std::move(std::get<1>(tuple))};
});
}
common::bit_depth depth() const { return depth_; }
private:
void draw(std::shared_ptr& target_texture,
std::vector layers,
const core::video_format_desc& format_desc)
{
std::shared_ptr layer_key_texture;
for (auto& layer : layers) {
draw(target_texture, layer.sublayers, format_desc);
draw(target_texture, std::move(layer), layer_key_texture, format_desc);
}
}
void draw(std::shared_ptr& target_texture,
layer layer,
std::shared_ptr& layer_key_texture,
const core::video_format_desc& format_desc)
{
if (layer.items.empty())
return;
std::shared_ptr local_key_texture;
std::shared_ptr local_mix_texture;
if (layer.blend_mode != core::blend_mode::normal) {
auto layer_texture = ogl_->create_texture(target_texture->width(), target_texture->height(), 4, depth_);
for (auto& item : layer.items)
draw(layer_texture,
std::move(item),
layer_key_texture,
local_key_texture,
local_mix_texture,
format_desc);
draw(layer_texture, std::move(local_mix_texture), format_desc, core::blend_mode::normal);
draw(target_texture, std::move(layer_texture), format_desc, layer.blend_mode);
} else // fast path
{
for (auto& item : layer.items)
draw(target_texture,
std::move(item),
layer_key_texture,
local_key_texture,
local_mix_texture,
format_desc);
draw(target_texture, std::move(local_mix_texture), format_desc, core::blend_mode::normal);
}
layer_key_texture = std::move(local_key_texture);
}
void draw(std::shared_ptr& target_texture,
item item,
std::shared_ptr& layer_key_texture,
std::shared_ptr& local_key_texture,
std::shared_ptr& local_mix_texture,
const core::video_format_desc& format_desc)
{
draw_params draw_params;
draw_params.target_width = format_desc.square_width;
draw_params.target_height = format_desc.square_height;
// TODO: Pass the target color_space
draw_params.pix_desc = std::move(item.pix_desc);
draw_params.transforms = std::move(item.transforms);
draw_params.geometry = std::move(item.geometry);
draw_params.aspect_ratio =
static_cast(format_desc.square_width) / static_cast(format_desc.square_height);
for (auto& future_texture : item.textures) {
draw_params.textures.push_back(spl::make_shared_ptr(future_texture.get()));
}
if (draw_params.transforms.image_transform
.is_key) { // A key means we will use it for the next non-key item as a mask
local_key_texture =
local_key_texture ? local_key_texture
: ogl_->create_texture(target_texture->width(), target_texture->height(), 1, depth_);
draw_params.background = local_key_texture;
draw_params.local_key = nullptr;
draw_params.layer_key = nullptr;
kernel_.draw(std::move(draw_params));
} else if (draw_params.transforms.image_transform
.is_mix) { // A mix means precomp the items to a texture, before drawing to the channel
local_mix_texture =
local_mix_texture ? local_mix_texture
: ogl_->create_texture(target_texture->width(), target_texture->height(), 4, depth_);
draw_params.background = local_mix_texture;
draw_params.local_key = std::move(local_key_texture); // Use and reset the key
draw_params.layer_key = layer_key_texture;
draw_params.keyer = keyer::additive;
kernel_.draw(std::move(draw_params));
} else {
// If there is a mix, this is the end so draw it and reset
draw(target_texture, std::move(local_mix_texture), format_desc, core::blend_mode::normal);
draw_params.background = target_texture;
draw_params.local_key = std::move(local_key_texture);
draw_params.layer_key = layer_key_texture;
kernel_.draw(std::move(draw_params));
}
}
void draw(std::shared_ptr& target_texture,
std::shared_ptr&& source_texture,
core::video_format_desc format_desc,
core::blend_mode blend_mode = core::blend_mode::normal)
{
if (!source_texture)
return;
draw_params draw_params;
draw_params.target_width = format_desc.square_width;
draw_params.target_height = format_desc.square_height;
draw_params.pix_desc.format = core::pixel_format::bgra;
draw_params.pix_desc.planes = {core::pixel_format_desc::plane(
source_texture->width(), source_texture->height(), 4, source_texture->depth())};
draw_params.textures = {spl::make_shared_ptr(source_texture)};
draw_params.blend_mode = blend_mode;
draw_params.background = target_texture;
draw_params.geometry = core::frame_geometry::get_default();
kernel_.draw(std::move(draw_params));
}
};
struct image_mixer::impl
: public core::frame_factory
, public std::enable_shared_from_this
{
spl::shared_ptr ogl_;
image_renderer renderer_;
std::vector transform_stack_;
std::vector layers_; // layer/stream/items
std::vector layer_stack_;
double aspect_ratio_ = 1.0;
public:
impl(const spl::shared_ptr& ogl, const int channel_id, const size_t max_frame_size, common::bit_depth depth)
: ogl_(ogl)
, renderer_(ogl, max_frame_size, depth)
, transform_stack_(1)
{
CASPAR_LOG(info) << L"Initialized OpenGL Accelerated GPU Image Mixer for channel " << channel_id;
}
void update_aspect_ratio(double aspect_ratio) { aspect_ratio_ = aspect_ratio; }
void push(const core::frame_transform& transform)
{
auto previous_layer_depth = transform_stack_.back().image_transform.layer_depth;
transform_stack_.push_back(transform_stack_.back().combine_transform(transform.image_transform, aspect_ratio_));
auto new_layer_depth = transform_stack_.back().image_transform.layer_depth;
if (previous_layer_depth < new_layer_depth) {
layer new_layer(transform_stack_.back().image_transform.blend_mode);
if (layer_stack_.empty()) {
layers_.push_back(std::move(new_layer));
layer_stack_.push_back(&layers_.back());
} else {
layer_stack_.back()->sublayers.push_back(std::move(new_layer));
layer_stack_.push_back(&layer_stack_.back()->sublayers.back());
}
}
}
void visit(const core::const_frame& frame)
{
if (frame.pixel_format_desc().format == core::pixel_format::invalid)
return;
if (frame.pixel_format_desc().planes.empty())
return;
item item;
item.pix_desc = frame.pixel_format_desc();
item.transforms = transform_stack_.back();
item.geometry = frame.geometry();
auto textures_ptr = std::any_cast>>(frame.opaque());
if (textures_ptr) {
item.textures = *textures_ptr;
} else {
for (int n = 0; n < static_cast(item.pix_desc.planes.size()); ++n) {
item.textures.emplace_back(ogl_->copy_async(frame.image_data(n),
item.pix_desc.planes[n].width,
item.pix_desc.planes[n].height,
item.pix_desc.planes[n].stride,
item.pix_desc.planes[n].depth));
}
}
layer_stack_.back()->items.push_back(item);
}
void pop()
{
transform_stack_.pop_back();
layer_stack_.resize(transform_stack_.back().image_transform.layer_depth);
}
std::future