├── .gitattributes ├── .gitignore ├── .gitmodules ├── AtemProxy.sln ├── AtemProxy ├── AtemProxy.csproj ├── AtemProxyUtil.cs ├── AtemServer.cs ├── AtemServerConnection.cs ├── ClientConnectionList.cs ├── CommandQueue.cs ├── Program.cs ├── UpstreamConnection.cs └── log4net.config ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | 263 | build 264 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "LibAtem"] 2 | path = LibAtem 3 | url = https://github.com/LibAtem/LibAtem.git 4 | -------------------------------------------------------------------------------- /AtemProxy.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtemProxy", "AtemProxy\AtemProxy.csproj", "{00C82FAB-C255-4F6B-BC7E-6E0F798DCBF0}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibAtem", "LibAtem\LibAtem\LibAtem.csproj", "{41BB562D-9C43-4A2A-8117-18DC4CDD4C7C}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibAtem.Discovery", "LibAtem\LibAtem.Discovery\LibAtem.Discovery.csproj", "{EE6D9FE0-E821-460B-8E40-682075E32F39}" 8 | EndProject 9 | Global 10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 11 | Debug|Any CPU = Debug|Any CPU 12 | Release|Any CPU = Release|Any CPU 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {00C82FAB-C255-4F6B-BC7E-6E0F798DCBF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {00C82FAB-C255-4F6B-BC7E-6E0F798DCBF0}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {00C82FAB-C255-4F6B-BC7E-6E0F798DCBF0}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {00C82FAB-C255-4F6B-BC7E-6E0F798DCBF0}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {41BB562D-9C43-4A2A-8117-18DC4CDD4C7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {41BB562D-9C43-4A2A-8117-18DC4CDD4C7C}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {41BB562D-9C43-4A2A-8117-18DC4CDD4C7C}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {41BB562D-9C43-4A2A-8117-18DC4CDD4C7C}.Release|Any CPU.Build.0 = Release|Any CPU 23 | {EE6D9FE0-E821-460B-8E40-682075E32F39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {EE6D9FE0-E821-460B-8E40-682075E32F39}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {EE6D9FE0-E821-460B-8E40-682075E32F39}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {EE6D9FE0-E821-460B-8E40-682075E32F39}.Release|Any CPU.Build.0 = Release|Any CPU 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /AtemProxy/AtemProxy.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | PreserveNewest 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /AtemProxy/AtemProxyUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using LibAtem; 4 | using LibAtem.Commands.Audio; 5 | using LibAtem.Commands.Audio.Fairlight; 6 | using LibAtem.Commands.DataTransfer; 7 | using LibAtem.Net; 8 | 9 | namespace AtemProxy 10 | { 11 | public static class AtemProxyUtil 12 | { 13 | 14 | public static readonly Type[] AudioLevelCommands = new[] 15 | { 16 | typeof(FairlightMixerMasterLevelsCommand), typeof(FairlightMixerSourceLevelsCommand), 17 | typeof(FairlightMixerSendLevelsCommand), typeof(AudioMixerLevelsCommand), 18 | typeof(AudioMixerSendLevelsCommand) 19 | }; 20 | 21 | public static readonly Type[] TransferCommands = new[] 22 | { 23 | typeof(DataTransferAbortCommand), typeof(DataTransferAckCommand), 24 | typeof(DataTransferCompleteCommand), typeof(DataTransferDataCommand), typeof(DataTransferErrorCommand), 25 | typeof(DataTransferDownloadRequestCommand), typeof(DataTransferUploadContinueCommand), 26 | typeof(DataTransferUploadRequestCommand) 27 | }; 28 | 29 | public static readonly Type[] LockCommands = new[] {typeof(LockObtainedCommand), typeof(LockStateSetCommand)}; 30 | 31 | public static byte[] ParsedCommandToBytes(ParsedCommandSpec cmd) 32 | { 33 | var build = new CommandBuilder(cmd.Name); 34 | build.AddByte(cmd.Body); 35 | return build.ToByteArray(); 36 | } 37 | 38 | public static List CommandsToMessages(List commands) 39 | { 40 | var messages = new List(); 41 | while (commands.Count > 0) 42 | { 43 | var builder = new OutboundMessageBuilder(); 44 | 45 | int removeCount = 0; 46 | foreach (byte[] data in commands) 47 | { 48 | if (!builder.TryAddData(data)) 49 | break; 50 | 51 | removeCount++; 52 | } 53 | 54 | if (removeCount == 0) 55 | { 56 | throw new Exception("Failed to build message!"); 57 | } 58 | 59 | commands.RemoveRange(0, removeCount); 60 | messages.Add(builder.Create()); 61 | // Log.InfoFormat("Length {0} {1}", builder.currentLength , removeCount); 62 | } 63 | 64 | return messages; 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /AtemProxy/AtemServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.Specialized; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.Sockets; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | using LibAtem.Commands; 10 | using LibAtem.Discovery; 11 | using LibAtem.Net; 12 | using log4net; 13 | using Makaretu.Dns; 14 | 15 | namespace AtemProxy 16 | { 17 | public class AtemServer 18 | { 19 | private static readonly ILog Log = LogManager.GetLogger(typeof(AtemServer)); 20 | 21 | public ClientConnectionList Connections { get; } = new ClientConnectionList(); 22 | 23 | private CommandQueue _state; 24 | private bool _accept = false; 25 | 26 | private Socket _socket; 27 | private readonly MulticastService _mdns = new MulticastService(); 28 | 29 | // TODO - remove this list, and replace with something more sensible... 30 | private readonly List timers = new List(); 31 | 32 | public AtemServer(CommandQueue state) 33 | { 34 | _state = state; 35 | } 36 | 37 | public void RejectConnections() 38 | { 39 | _accept = false; 40 | Connections.ClearAll(); 41 | } 42 | 43 | public void AcceptConnections() 44 | { 45 | _accept = true; 46 | } 47 | 48 | public void StartAnnounce(string modelName, string deviceId) 49 | { 50 | _mdns.UseIpv4 = true; 51 | _mdns.UseIpv6 = false; 52 | var safeModelName = modelName.Replace(' ', '-').ToUpper(); 53 | var domain = new DomainName($"Mock {modelName}.{AtemDeviceInfo.ServiceName}"); 54 | var deviceDomain = new DomainName($"MOCK-{safeModelName}-{deviceId}.local"); 55 | 56 | timers.Add(new Timer(o => 57 | { 58 | Log.Info("MDNS announce"); 59 | DoAnnounce(deviceId, modelName, domain, deviceDomain); 60 | }, null, 0, 10000)); 61 | _mdns.QueryReceived += (s, e) => 62 | { 63 | var msg = e.Message; 64 | if (msg.Questions.Any(q => q.Name == AtemDeviceInfo.ServiceName)) 65 | { 66 | Log.Debug("MDNS query"); 67 | DoAnnounce(deviceId, modelName, domain, deviceDomain); 68 | } 69 | }; 70 | _mdns.Start(); 71 | } 72 | private void DoAnnounce(string deviceId, string modelName, DomainName domain, DomainName deviceDomain) 73 | { 74 | var res = new Message(); 75 | var addresses = MulticastService.GetIPAddresses() 76 | .Where(ip => ip.AddressFamily == AddressFamily.InterNetwork); 77 | foreach (var address in addresses) 78 | { 79 | res.Answers.Add(new PTRRecord 80 | { 81 | Name = AtemDeviceInfo.ServiceName, 82 | DomainName = domain 83 | }); 84 | res.AdditionalRecords.Add(new TXTRecord 85 | { 86 | Name = domain, 87 | Strings = new List 88 | { 89 | "txtvers=1", 90 | $"name=Blackmagic {modelName}", 91 | "class=AtemSwitcher", 92 | "protocol version=0.0", 93 | "internal version=FAKE", 94 | $"unique id={deviceId}" 95 | } 96 | }); 97 | res.AdditionalRecords.Add(new ARecord 98 | { 99 | Address = address, 100 | Name = deviceDomain, 101 | }); 102 | res.AdditionalRecords.Add(new SRVRecord 103 | { 104 | Name = domain, 105 | Port = 9910, 106 | Priority = 0, 107 | Target = deviceDomain, 108 | Weight = 0 109 | }); 110 | /* 111 | res.AdditionalRecords.Add(new NSECRecord 112 | { 113 | Name = domain 114 | });*/ 115 | } 116 | _mdns.SendAnswer(res); 117 | } 118 | 119 | public void StartPingTimer() 120 | { 121 | timers.Add(new Timer(o => 122 | { 123 | Connections.QueuePings(); 124 | }, null, 0, AtemConstants.PingInterval)); 125 | } 126 | 127 | private static Socket CreateSocket() 128 | { 129 | Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 130 | IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 9910); 131 | serverSocket.Bind(ipEndPoint); 132 | 133 | return serverSocket; 134 | } 135 | 136 | public void StartReceive() 137 | { 138 | _socket = CreateSocket(); 139 | 140 | var thread = new Thread(async () => 141 | { 142 | while (true) 143 | { 144 | try 145 | { 146 | //Start receiving data 147 | ArraySegment buff = new ArraySegment(new byte[2500]); 148 | var end = new IPEndPoint(IPAddress.Any, 0); 149 | SocketReceiveFromResult v = await _socket.ReceiveFromAsync(buff, SocketFlags.None, end); 150 | 151 | // Check if we can accept it 152 | if (!_accept) continue; 153 | 154 | AtemServerConnection conn = Connections.FindOrCreateConnection(v.RemoteEndPoint, out _); 155 | if (conn == null) 156 | continue; 157 | 158 | byte[] buffer = buff.Array; 159 | var packet = new ReceivedPacket(buffer); 160 | 161 | if (packet.CommandCode.HasFlag(ReceivedPacket.CommandCodeFlags.Handshake)) 162 | { 163 | conn.ResetConnStatsInfo(); 164 | // send handshake back 165 | byte[] test = 166 | { 167 | buffer[0], buffer[1], // flags + length 168 | buffer[2], buffer[3], // session id 169 | 0x00, 0x00, // acked pkt id 170 | 0x00, 0x00, // retransmit request 171 | buffer[8], buffer[9], // unknown2 172 | 0x00, 0x00, // server pkt id 173 | 0x02, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 174 | }; 175 | 176 | var sendThread = new Thread(o => 177 | { 178 | while (!conn.HasTimedOut) 179 | { 180 | conn.TrySendQueued(_socket); 181 | Task.Delay(1).Wait(); 182 | } 183 | Console.WriteLine("send finished"); 184 | }); 185 | sendThread.Name = $"To {conn.Endpoint}"; 186 | sendThread.Start(); 187 | 188 | await _socket.SendToAsync(new ArraySegment(test, 0, 20), SocketFlags.None, v.RemoteEndPoint); 189 | 190 | continue; 191 | } 192 | 193 | if (!conn.IsOpened) 194 | { 195 | var recvThread = new Thread(o => 196 | { 197 | while (!conn.HasTimedOut || conn.HasCommandsToProcess) 198 | { 199 | List cmds = conn.GetNextCommands(); 200 | 201 | Log.DebugFormat("Recieved {0} commands", cmds.Count); 202 | //conn.HandleInner(_state, connection, cmds); 203 | } 204 | }); 205 | recvThread.Name = $"Receive {conn.Endpoint}"; 206 | recvThread.Start(); 207 | } 208 | conn.Receive(_socket, packet); 209 | 210 | if (conn.ReadyForData) 211 | QueueDataDumps(conn); 212 | } 213 | catch (SocketException) 214 | { 215 | // Reinit the socket as it is now unavailable 216 | //_socket = CreateSocket(); 217 | } 218 | } 219 | }); 220 | thread.Name = "AtemServer"; 221 | thread.Start(); 222 | } 223 | 224 | private void QueueDataDumps(AtemConnection conn) 225 | { 226 | try 227 | { 228 | var messages = AtemProxyUtil.CommandsToMessages(_state.Values()); 229 | foreach (var msg in messages) 230 | { 231 | conn.QueueMessage(msg); 232 | } 233 | } 234 | catch (Exception e) 235 | { 236 | Console.WriteLine(e.Message); 237 | } 238 | } 239 | } 240 | } -------------------------------------------------------------------------------- /AtemProxy/AtemServerConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using LibAtem.Commands; 4 | using LibAtem.Net; 5 | 6 | namespace AtemProxy 7 | { 8 | public class AtemServerConnection : AtemConnection 9 | { 10 | public AtemServerConnection(EndPoint endpoint, int sessionId) : base(endpoint, sessionId) 11 | { 12 | } 13 | 14 | private bool _sentDataDump; 15 | 16 | public bool ReadyForData 17 | { 18 | get 19 | { 20 | if (_sentDataDump) 21 | return false; 22 | 23 | if (!IsOpened) 24 | return false; 25 | 26 | return _sentDataDump = true; 27 | } 28 | } 29 | 30 | protected override OutboundMessage CompileNextMessage() 31 | { 32 | // TODO 33 | return null; 34 | } 35 | 36 | public override void QueueCommand(ICommand command) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /AtemProxy/ClientConnectionList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using LibAtem.Net; 5 | using log4net; 6 | 7 | namespace AtemProxy 8 | { 9 | public class ClientConnectionList 10 | { 11 | private static readonly ILog Log = LogManager.GetLogger(typeof(ClientConnectionList)); 12 | 13 | private readonly Dictionary _connections = 14 | new Dictionary(); 15 | private readonly HashSet _subscribedToAudio = new HashSet(); 16 | 17 | public event AtemConnection.PacketHandler OnReceive; 18 | 19 | public ClientConnectionList() 20 | { 21 | } 22 | 23 | public AtemServerConnection FindOrCreateConnection(EndPoint ep, out bool isNew) 24 | { 25 | lock (_connections) 26 | { 27 | AtemServerConnection val; 28 | if (_connections.TryGetValue(ep, out val)) 29 | { 30 | isNew = false; 31 | return val; 32 | } 33 | 34 | val = new AtemServerConnection(ep, 0x8008);// 0x8008 or 0x26B6? TODO - make dynamic 35 | _connections[ep] = val; 36 | val.OnDisconnect += RemoveTimedOut; 37 | 38 | val.OnReceivePacket += OnReceive; 39 | 40 | Log.InfoFormat("New connection from {0}", ep); 41 | 42 | isNew = true; 43 | return val; 44 | } 45 | } 46 | 47 | public void ClearAll() 48 | { 49 | lock (_connections) 50 | { 51 | _connections.Clear(); 52 | } 53 | 54 | lock (_subscribedToAudio) 55 | { 56 | _subscribedToAudio.Clear(); 57 | } 58 | } 59 | 60 | private void RemoveTimedOut(object sender) 61 | { 62 | var conn = sender as AtemServerConnection; 63 | if (conn == null) 64 | return; 65 | 66 | Log.InfoFormat("Lost connection to {0}", conn.Endpoint); 67 | 68 | lock (_connections) 69 | { 70 | _connections.Remove(conn.Endpoint); 71 | } 72 | 73 | lock (_subscribedToAudio) 74 | { 75 | // var initSize = _subscribedToAudio.Count; 76 | _subscribedToAudio.Remove(conn); 77 | } 78 | } 79 | 80 | internal void QueuePings() 81 | { 82 | lock (_connections) 83 | { 84 | var toRemove = new List(); 85 | foreach (KeyValuePair conn in _connections) 86 | { 87 | if (conn.Value.HasTimedOut) 88 | { 89 | toRemove.Add(conn.Key); 90 | continue; 91 | } 92 | 93 | if (conn.Value.IsOpened) 94 | { 95 | conn.Value.QueuePing(); 96 | } 97 | } 98 | 99 | foreach (var ep in toRemove) 100 | { 101 | Log.InfoFormat("Lost connection to {0}", ep); 102 | _connections.Remove(ep); 103 | } 104 | } 105 | } 106 | 107 | public void Broadcast(IReadOnlyList messages) 108 | { 109 | lock (_connections) 110 | { 111 | foreach (var conn in _connections) 112 | { 113 | if (!conn.Value.HasTimedOut) 114 | { 115 | foreach (var msg in messages) 116 | { 117 | conn.Value.QueueMessage(msg); 118 | } 119 | } 120 | } 121 | } 122 | } 123 | 124 | public void BroadcastAudioLevels(IReadOnlyList messages) 125 | { 126 | lock (_subscribedToAudio) 127 | { 128 | foreach (var conn in _subscribedToAudio) 129 | { 130 | if (!conn.HasTimedOut) 131 | { 132 | foreach (var msg in messages) 133 | { 134 | conn.QueueMessage(msg); 135 | } 136 | } 137 | } 138 | } 139 | } 140 | 141 | public bool SubscribeAudio(object sender, bool subscribed) 142 | { 143 | if (sender is AtemServerConnection {HasTimedOut: false} sender2) 144 | { 145 | lock (_subscribedToAudio) 146 | { 147 | if (subscribed) 148 | { 149 | var before = _subscribedToAudio.Count; 150 | _subscribedToAudio.Add(sender2); 151 | return before == 0; 152 | } 153 | else 154 | { 155 | var before = _subscribedToAudio.Count; 156 | _subscribedToAudio.Remove(sender2); 157 | return before != 0 && _subscribedToAudio.Count == 0; 158 | } 159 | } 160 | } 161 | else 162 | { 163 | return false; 164 | } 165 | } 166 | 167 | } 168 | } -------------------------------------------------------------------------------- /AtemProxy/CommandQueue.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace AtemProxy 5 | { 6 | public class CommandQueue 7 | { 8 | private readonly Dictionary _dict = new Dictionary(); 9 | private readonly List _keys = new List(); 10 | 11 | public void Clear() 12 | { 13 | lock (_dict) 14 | { 15 | _dict.Clear(); 16 | _keys.Clear(); 17 | } 18 | } 19 | 20 | public List Values() 21 | { 22 | lock (_dict) 23 | { 24 | return _keys.Select(k => _dict[k]).ToList(); 25 | } 26 | } 27 | 28 | public void Set(object key, byte[] value) 29 | { 30 | lock (_dict) 31 | { 32 | if (_dict.TryGetValue(key, out var tmpval)) 33 | { 34 | _dict[key] = value; 35 | } 36 | else 37 | { 38 | _dict.Add(key, value); 39 | _keys.Add(key); 40 | } 41 | } 42 | } 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /AtemProxy/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Threading; 7 | using LibAtem; 8 | using LibAtem.Commands; 9 | using LibAtem.Commands.Audio; 10 | using LibAtem.Commands.Audio.Fairlight; 11 | using log4net; 12 | using log4net.Config; 13 | 14 | namespace AtemProxy 15 | { 16 | public class Program 17 | { 18 | public static void Main(string[] args) 19 | { 20 | if (args.Length == 0) 21 | { 22 | Console.WriteLine("Please include IP address for ATEM."); 23 | return; 24 | } 25 | 26 | string ipAddress = args[0]; 27 | var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly()); 28 | XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config")); 29 | 30 | var log = LogManager.GetLogger(typeof(Program)); 31 | log.Info("Starting"); 32 | 33 | var currentStateCommands = new CommandQueue(); 34 | var unknownCommandId = 1; 35 | 36 | var upstream = new UpstreamConnection(ipAddress); 37 | 38 | var server = new AtemServer(currentStateCommands); 39 | server.Connections.OnReceive += (sender, pkt) => 40 | { 41 | log.InfoFormat("Got packet from {0}", sender); 42 | 43 | var acceptedCommands = new List>(); 44 | foreach (ParsedCommandSpec rawCmd in pkt.Commands) 45 | { 46 | var cmd = CommandParser.Parse(upstream.Version, rawCmd); 47 | if (cmd != null) 48 | { 49 | if (AtemProxyUtil.AudioLevelCommands.Contains(cmd.GetType())) 50 | { 51 | if (cmd is AudioMixerSendLevelsCommand sendLevels && server.Connections.SubscribeAudio(sender, sendLevels.SendLevels)) 52 | { 53 | log.InfoFormat("Changing legacy levels subscription: {0}", sendLevels.SendLevels); 54 | acceptedCommands.Add(Tuple.Create(cmd, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 55 | } else if (cmd is FairlightMixerSendLevelsCommand sendLevels2 && server.Connections.SubscribeAudio(sender, sendLevels2.SendLevels)) 56 | { 57 | log.InfoFormat("Changing fairlight levels subscription: {0}", sendLevels2.SendLevels); 58 | acceptedCommands.Add(Tuple.Create(cmd, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 59 | } 60 | } 61 | else if (AtemProxyUtil.LockCommands.Contains(cmd.GetType())) 62 | { 63 | } 64 | else if (AtemProxyUtil.TransferCommands.Contains(cmd.GetType())) 65 | { 66 | 67 | } 68 | else 69 | { 70 | acceptedCommands.Add(Tuple.Create(cmd, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 71 | } 72 | } 73 | else 74 | { 75 | // Unknown command, so forward it and hope! 76 | // It is unlikely to break anything, but command-id logic wont handle it well 77 | log.WarnFormat("Atem gave unknown command {0} {1}", rawCmd.Name, 78 | BitConverter.ToString(rawCmd.Body)); 79 | 80 | acceptedCommands.Add(Tuple.Create(null, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 81 | } 82 | } 83 | 84 | if (acceptedCommands.Count > 0) 85 | { 86 | upstream.ForwardCommands(acceptedCommands); 87 | } 88 | }; 89 | 90 | string deviceName = "Test Proxy"; 91 | server.StartAnnounce(deviceName, deviceName.GetHashCode().ToString()); 92 | 93 | upstream.OnConnection += (sender) => 94 | { 95 | log.DebugFormat("Connected to atem"); 96 | // TODO - state 97 | server.AcceptConnections(); 98 | }; 99 | upstream.OnDisconnection += (sender) => 100 | { 101 | log.DebugFormat("Lost connection to atem"); 102 | server.RejectConnections(); 103 | currentStateCommands.Clear(); 104 | }; 105 | upstream.OnReceive += (sender, commands) => 106 | { 107 | foreach (var cmd in commands) 108 | { 109 | if (cmd.Item1 != null) 110 | { 111 | currentStateCommands.Set(new CommandQueueKey(cmd.Item1), cmd.Item2); 112 | } 113 | else 114 | { 115 | currentStateCommands.Set(unknownCommandId++, cmd.Item2); 116 | } 117 | } 118 | 119 | var messages = AtemProxyUtil.CommandsToMessages(commands.Select(c => c.Item2).ToList()); 120 | server.Connections.Broadcast(messages); 121 | }; 122 | upstream.OnAudioLevels += (sender, commands) => 123 | { 124 | var messages = AtemProxyUtil.CommandsToMessages(commands); 125 | server.Connections.BroadcastAudioLevels(messages); 126 | }; 127 | 128 | upstream.Start(); 129 | server.StartReceive(); 130 | server.StartPingTimer(); 131 | 132 | Console.WriteLine("Press Ctrl+C to terminate..."); 133 | 134 | AutoResetEvent waitHandle = new AutoResetEvent(false); 135 | // Handle Control+C or Control+Break 136 | Console.CancelKeyPress += (o, e) => 137 | { 138 | Console.WriteLine("Exit"); 139 | 140 | // Allow the manin thread to continue and exit... 141 | waitHandle.Set(); 142 | }; 143 | 144 | // Wait 145 | waitHandle.WaitOne(); 146 | 147 | // Force the exit 148 | System.Environment.Exit(0); 149 | } 150 | } 151 | } -------------------------------------------------------------------------------- /AtemProxy/UpstreamConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading; 6 | using LibAtem; 7 | using LibAtem.Commands; 8 | using LibAtem.Commands.Audio.Fairlight; 9 | using LibAtem.Commands.DataTransfer; 10 | using LibAtem.Commands.DeviceProfile; 11 | using LibAtem.Net; 12 | using log4net; 13 | 14 | namespace AtemProxy 15 | { 16 | public class UpstreamConnection 17 | { 18 | private static readonly ILog Log = LogManager.GetLogger(typeof(UpstreamConnection)); 19 | 20 | private readonly AtemClient _atem; 21 | private readonly Thread _thread; 22 | private readonly ConcurrentQueue _pktQueue = new ConcurrentQueue(); 23 | 24 | public ProtocolVersion Version { get; private set; } = ProtocolVersion.Minimum; 25 | 26 | public event AtemClient.ConnectedHandler OnConnection 27 | { 28 | add => _atem.OnConnection += value; 29 | remove => _atem.OnConnection -= value; 30 | } 31 | public event AtemClient.DisconnectedHandler OnDisconnection 32 | { 33 | add => _atem.OnDisconnect += value; 34 | remove => _atem.OnDisconnect -= value; 35 | } 36 | 37 | public delegate void CommandHandler(object sender, List> commands); 38 | public delegate void AudioLevelsHandler(object sender, List levels); 39 | 40 | public event CommandHandler OnReceive; 41 | public event AudioLevelsHandler OnAudioLevels; 42 | 43 | 44 | public UpstreamConnection(string address) 45 | { 46 | _atem = new AtemClient(address); 47 | 48 | _atem.OnDisconnect += (sender) => 49 | { 50 | // Discard any pending packets 51 | _pktQueue.Clear(); 52 | }; 53 | 54 | _atem.OnReceivePacket += (sender, pkt) => 55 | { 56 | _pktQueue.Enqueue(pkt); 57 | }; 58 | 59 | _thread = new Thread(() => 60 | { 61 | while (true) 62 | { 63 | if (!_pktQueue.TryDequeue(out ReceivedPacket pkt)) 64 | { 65 | Thread.Sleep(5); 66 | continue; 67 | } 68 | 69 | var acceptedCommands = new List>(); 70 | var audioLevels = new List(); 71 | foreach (ParsedCommandSpec rawCmd in pkt.Commands) 72 | { 73 | var cmd = CommandParser.Parse(Version, rawCmd); 74 | if (cmd != null) 75 | { 76 | // Ensure we know what version to parse with 77 | if (cmd is VersionCommand vcmd) 78 | Version = vcmd.ProtocolVersion; 79 | 80 | if (AtemProxyUtil.AudioLevelCommands.Contains(cmd.GetType())) 81 | { 82 | audioLevels.Add(AtemProxyUtil.ParsedCommandToBytes(rawCmd)); 83 | } 84 | else if (AtemProxyUtil.LockCommands.Contains(cmd.GetType())) 85 | { 86 | } 87 | else if (AtemProxyUtil.TransferCommands.Contains(cmd.GetType())) 88 | { 89 | 90 | } 91 | else 92 | { 93 | acceptedCommands.Add(Tuple.Create(cmd, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 94 | } 95 | } 96 | else 97 | { 98 | // Unknown command, so forward it and hope! 99 | // It is unlikely to break anything, but command-id logic wont handle it well 100 | Log.WarnFormat("Atem gave unknown command {0} {1}", rawCmd.Name, BitConverter.ToString(rawCmd.Body)); 101 | 102 | acceptedCommands.Add(Tuple.Create(null, AtemProxyUtil.ParsedCommandToBytes(rawCmd))); 103 | } 104 | } 105 | 106 | if (pkt.Commands.Count > 0) 107 | { 108 | Log.InfoFormat("Atem gave {0} forwardable commands of {1}", acceptedCommands.Count, 109 | pkt.Commands.Count); 110 | } 111 | 112 | if (acceptedCommands.Count > 0) 113 | { 114 | // Forward if anything was left 115 | OnReceive?.Invoke(this, acceptedCommands); 116 | } 117 | 118 | if (audioLevels.Count > 0) 119 | { 120 | // Forward audio levels commands to subscribed clients 121 | OnAudioLevels?.Invoke(this, audioLevels); 122 | } 123 | } 124 | }); 125 | _thread.Name = "UpstreamConnection"; 126 | } 127 | 128 | public void Start() 129 | { 130 | _atem.Connect(); 131 | _thread.Start(); 132 | } 133 | 134 | public void ForwardCommands(List> commands) 135 | { 136 | var messages = AtemProxyUtil.CommandsToMessages(commands.Select(c => c.Item2).ToList()); 137 | foreach (var msg in messages) 138 | { 139 | _atem.DirectQueueMessage(msg); 140 | } 141 | } 142 | } 143 | } -------------------------------------------------------------------------------- /AtemProxy/log4net.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AtemProxy 2 | 3 | ### Warning 4 | 5 | This is an early prototype currently. It has not been tested beyond my sofa, so could freeze up, kill connections or other bad things. Please wait a bit before trying to use it in production as it could go very very badly. 6 | 7 | ### Introduction 8 | 9 | This is a small tool designed to help workaround the connection limit of Blackmagic ATEM mixers. 10 | 11 | Most models of the mixers have a maximum of 5 connections. This can often not be enough when adding in control clients, automation software and tally software. 12 | 13 | The basic principle is that this bit of software will connect to the ATEM once, and will then be the device that some of your clients connect to. 14 | 15 | Note: It is recommended to connect directly to the atem for clients which are important to work 100% of the time, or those which do large amounts of media uploads. 16 | 17 | ### Device support 18 | The primary focus is to support 8.0+ fully. Older versions may work, but are no longer recommended. 19 | 7.2 should work pretty well, but is not feature complete. 20 | 21 | Currently, 8.0.0 - 8.6.4 should work fully. Newer firmware may work, but could have issues with clients connecting after it has been running for a while. 22 | 23 | ### Download 24 | 25 | Check the releases tab 26 | 27 | Or you can build manually for another runtime with a command like `dotnet publish -o "$(pwd)/dist" -c Release -r linux-arm`, replacing `linux-arm` with the runtime you need (see https://docs.microsoft.com/en-us/dotnet/core/rid-catalog as a reference) 28 | You will need to install https://dotnet.microsoft.com/en-us/download first, and have a fresh git clone of the repository 29 | 30 | ### Usage 31 | Coming soon 32 | 33 | 34 | ### Related Projects 35 | Uses LibATEM for connection management and command parsing [LibAtem](https://github.com/LibAtem/LibAtem) 36 | 37 | ### License 38 | 39 | LibAtem and AtemProxy are distributed under the GNU Lesser General Public License LGPLv3 or higher, see the file LICENSE for details. 40 | 41 | 42 | --------------------------------------------------------------------------------