Skip to content

Commit

Permalink
Created a 90 FPS default RealSense API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vangos committed Nov 21, 2018
1 parent 6bc254a commit b11c94a
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 153 deletions.
Binary file modified Dependencies/Intel.Realsense.dll
Binary file not shown.
Binary file modified Dependencies/realsense2.dll
Binary file not shown.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions LightBuzz.RealSense/LightBuzz.RealSense.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.28307.106
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightBuzz.RealSense", "LightBuzz.RealSense\LightBuzz.RealSense.csproj", "{57B1971A-F1CF-4429-9448-CFD8993D560C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightBuzz.RealSense.Unity", "LightBuzz.RealSense.Unity\LightBuzz.RealSense.Unity.csproj", "{434C8C47-022D-4DDD-8413-14FF2BB0115E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -17,10 +15,6 @@ Global
{57B1971A-F1CF-4429-9448-CFD8993D560C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57B1971A-F1CF-4429-9448-CFD8993D560C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57B1971A-F1CF-4429-9448-CFD8993D560C}.Release|Any CPU.Build.0 = Release|Any CPU
{434C8C47-022D-4DDD-8413-14FF2BB0115E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{434C8C47-022D-4DDD-8413-14FF2BB0115E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{434C8C47-022D-4DDD-8413-14FF2BB0115E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{434C8C47-022D-4DDD-8413-14FF2BB0115E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
81 changes: 68 additions & 13 deletions LightBuzz.RealSense/LightBuzz.RealSense/DeviceConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,60 @@
namespace LightBuzz.RealSense
{
[Serializable]
public struct DeviceConfiguration
public class DeviceConfiguration
{
public enum Mode
public VideoStreamMode Mode { get; set; }

public VideoStreamRequest[] Profiles { get; set; }

public string RequestedSerialNumber { get; set; }

public string PlaybackFile { get; set; }

public string RecordPath { get; set; }

public DeviceConfiguration()
{
Live, Playback, Record
}

public Mode mode;
public VideoStreamRequest[] Profiles;
public string RequestedSerialNumber;
public string PlaybackFile;
public string RecordPath;
public DeviceConfiguration(VideoStreamRequest[] profiles)
{
Mode = VideoStreamMode.Live;
RequestedSerialNumber = string.Empty;
Profiles = profiles;
}

public DeviceConfiguration(VideoStreamRequest[] profiles, VideoStreamMode mode, string id)
{
Mode = mode;
RequestedSerialNumber = id;
Profiles = profiles;
}

public Config ToPipelineConfig()
{
Config cfg = new Config();

switch (mode)
switch (Mode)
{
case Mode.Live:
case VideoStreamMode.Live:
cfg.EnableDevice(RequestedSerialNumber);
foreach (var p in Profiles)
cfg.EnableStream(p.Stream, p.StreamIndex, p.Width, p.Height, p.Format, p.Framerate);
break;

case Mode.Playback:
case VideoStreamMode.Playback:
if (string.IsNullOrEmpty(PlaybackFile))
{
mode = Mode.Live;
Mode = VideoStreamMode.Live;
}
else
{
cfg.EnableDeviceFromFile(PlaybackFile);
}
break;

case Mode.Record:
case VideoStreamMode.Record:
foreach (var p in Profiles)
cfg.EnableStream(p.Stream, p.StreamIndex, p.Width, p.Height, p.Format, p.Framerate);
if (!string.IsNullOrEmpty(RecordPath))
Expand All @@ -52,5 +68,44 @@ public Config ToPipelineConfig()

return cfg;
}

public static DeviceConfiguration Default()
{
return new DeviceConfiguration
{
Mode = VideoStreamMode.Live,
RequestedSerialNumber = string.Empty,
Profiles = new VideoStreamRequest[]
{
new VideoStreamRequest
{
Stream = Stream.Depth,
StreamIndex = -1,
Width = 640,
Height = 480,
Format = Format.Z16,
Framerate = 0
},
new VideoStreamRequest
{
Stream = Stream.Infrared,
StreamIndex = -1,
Width = 640,
Height = 480,
Format = Format.Y8,
Framerate = 0
},
new VideoStreamRequest
{
Stream = Stream.Color,
StreamIndex = -1,
Width = 640,
Height = 480,
Format = Format.Rgb8,
Framerate = 0
}
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<DocumentationFile>bin\Release\LightBuzz.RealSense.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Intel.Realsense">
<Reference Include="Intel.Realsense, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Dependencies\Intel.Realsense.dll</HintPath>
</Reference>
<Reference Include="LightBuzz">
Expand All @@ -46,6 +47,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DeviceConfiguration.cs" />
<Compile Include="RealSenseDevice.cs" />
<Compile Include="VideoStreamMode.cs" />
<Compile Include="VideoStreamRequest.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Loading

0 comments on commit b11c94a

Please sign in to comment.