diff --git a/deployment/VL.IO.NDI.nuspec b/deployment/VL.IO.NDI.nuspec index 167b361..d64af35 100644 --- a/deployment/VL.IO.NDI.nuspec +++ b/deployment/VL.IO.NDI.nuspec @@ -2,7 +2,7 @@ VL.IO.NDI - 0.5.4-preview + 0.5.5-preview VL.IO.NDI vvvv, Matthias Husinsky, sebl, NewTek vvvv, Matthias Husinsky, sebl, NewTek diff --git a/src/Properties/launchSettings.json b/src/Properties/launchSettings.json index d937f5c..de0bcce 100644 --- a/src/Properties/launchSettings.json +++ b/src/Properties/launchSettings.json @@ -2,11 +2,8 @@ "profiles": { "VL.IO.NDI": { "commandName": "Executable", - "executablePath": "$(ProgramFiles)\\vvvv\\vvvv_gamma_$(VVVVVersion)\\vvvv.exe", - "commandLineArgs": "--package-repositories $(PackageRepositories) --debug --editable-packages VL.IO.NDI;VL.Audio" - }, - "Profile 1": { - "commandName": "Project" + "executablePath": "$(VVVVInstallPath)\\vvvv.exe", + "commandLineArgs": "--package-repositories $(PackageRepositories) --editable-packages VL.IO.NDI;VL.Audio" } } } \ No newline at end of file diff --git a/src/Synchronizer.cs b/src/Synchronizer.cs index 07ae382..91728b8 100644 --- a/src/Synchronizer.cs +++ b/src/Synchronizer.cs @@ -12,6 +12,7 @@ public unsafe class Synchronizer : NativeObject, IAudioSource, IVideoSource // our unmanaged NDI sync instance private IResourceProvider _syncInstanceProvider; private IResourceHandle _syncInstanceHandle; + private Receiver _receiver; public Receiver Receiver { @@ -20,6 +21,7 @@ public Receiver Receiver var syncInstance = value?.SyncInstanceProvider; if (syncInstance != _syncInstanceProvider) { + _receiver = value; _syncInstanceProvider = syncInstance; _syncInstanceHandle?.Dispose(); _syncInstanceHandle = syncInstance?.GetHandle(); @@ -33,6 +35,9 @@ IResourceProvider IVideoSource.GrabVideoFrame() if (syncInstanceHandle is null) return null; + if (_receiver is null || !_receiver.Enabled) + return null; + var nativeVideoFrame = new NDIlib.video_frame_v2_t(); NDIlib.framesync_capture_video(syncInstanceHandle.Resource, ref nativeVideoFrame, NDIlib.frame_format_type_e.frame_format_type_interleaved); @@ -63,6 +68,9 @@ IResourceProvider IAudioSource.GrabAudioFrame(int sampleCount, Optio if (syncInstanceHandle is null) return null; + if (_receiver is null || !_receiver.Enabled) + return null; + var nativeAudioFrame = new NDIlib.audio_frame_v2_t(); NDIlib.framesync_capture_audio(syncInstanceHandle.Resource, ref nativeAudioFrame, sampleRate.Value, channelCount.Value, sampleCount); diff --git a/src/VL.IO.NDI.csproj b/src/VL.IO.NDI.csproj index dd8a51c..3b16405 100644 --- a/src/VL.IO.NDI.csproj +++ b/src/VL.IO.NDI.csproj @@ -10,7 +10,7 @@ $([System.IO.Path]::GetFullPath('$(MsBuildThisFileDirectory)..\..')) - 5.2 + C:\Program Files\vvvv\vvvv_gamma_6.7-0236-g33a4a9999e-win-x64 0.5.0 NewTek, Motzi, sebl, vvvv group diff --git a/src/VL.IO.NDI.sln b/src/VL.IO.NDI.sln index d33894c..6a01bdd 100644 --- a/src/VL.IO.NDI.sln +++ b/src/VL.IO.NDI.sln @@ -5,6 +5,11 @@ VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VL.IO.NDI", "VL.IO.NDI.csproj", "{8B771692-F865-494F-9F0D-638DFFCB7D89}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deployment", "Deployment", "{47A09AC7-FD75-4976-9B99-EEA0968D7C2F}" + ProjectSection(SolutionItems) = preProject + ..\deployment\VL.IO.NDI.nuspec = ..\deployment\VL.IO.NDI.nuspec + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU