Skip to content

Commit

Permalink
Fixes Enabled pin on Receiver not working
Browse files Browse the repository at this point in the history
  • Loading branch information
azeno committed Nov 26, 2024
1 parent 47d5549 commit 499f347
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deployment/VL.IO.NDI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>VL.IO.NDI</id>
<version>0.5.4-preview</version>
<version>0.5.5-preview</version>
<title>VL.IO.NDI</title>
<authors>vvvv, Matthias Husinsky, sebl, NewTek</authors>
<owners>vvvv, Matthias Husinsky, sebl, NewTek</owners>
Expand Down
7 changes: 2 additions & 5 deletions src/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
8 changes: 8 additions & 0 deletions src/Synchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public unsafe class Synchronizer : NativeObject, IAudioSource, IVideoSource
// our unmanaged NDI sync instance
private IResourceProvider<IntPtr> _syncInstanceProvider;
private IResourceHandle<IntPtr> _syncInstanceHandle;
private Receiver _receiver;

public Receiver Receiver
{
Expand All @@ -20,6 +21,7 @@ public Receiver Receiver
var syncInstance = value?.SyncInstanceProvider;
if (syncInstance != _syncInstanceProvider)
{
_receiver = value;
_syncInstanceProvider = syncInstance;
_syncInstanceHandle?.Dispose();
_syncInstanceHandle = syncInstance?.GetHandle();
Expand All @@ -33,6 +35,9 @@ IResourceProvider<VideoFrame> 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);

Expand Down Expand Up @@ -63,6 +68,9 @@ IResourceProvider<AudioFrame> 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);

Expand Down
2 changes: 1 addition & 1 deletion src/VL.IO.NDI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Startup properties -->
<PackageRepositories>$([System.IO.Path]::GetFullPath('$(MsBuildThisFileDirectory)..\..'))</PackageRepositories>
<VVVVVersion>5.2</VVVVVersion>
<VVVVInstallPath>C:\Program Files\vvvv\vvvv_gamma_6.7-0236-g33a4a9999e-win-x64</VVVVInstallPath>

<Version>0.5.0</Version>
<Authors>NewTek, Motzi, sebl, vvvv group</Authors>
Expand Down
5 changes: 5 additions & 0 deletions src/VL.IO.NDI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 499f347

Please sign in to comment.