Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit aadccc3

Browse files
authored
Added the ability to ghenerate proper xml doc for Visual Studio and c… (#149)
* Added the ability to ghenerate proper xml doc for Visual Studio and clean some missing comments * Fixed typo
1 parent ad58071 commit aadccc3

File tree

14 files changed

+65
-8
lines changed

14 files changed

+65
-8
lines changed

cmake/dotnet/library.csproj.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<PropertyGroup>
2525
<OutputPath>${CMAKE_LIBRARY_OUTPUT_DIRECTORY}</OutputPath>
2626
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
27+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2728
</PropertyGroup>
2829

2930
${_DOTNET_SOURCES}

cmake/unity.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if (BUILD_UNITY)
1919
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:dnr> "${UNITY_RUNTIME_DIRECTORY}/$<TARGET_FILE_NAME:dnr>"
2020
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:DolbyIO.Comms.Native> "${UNITY_RUNTIME_DIRECTORY}/$<TARGET_FILE_NAME:DolbyIO.Comms.Native>"
2121
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolbyIO.Comms.Sdk.dll "${UNITY_ASSEMBLY_DIRECTORY}/DolbyIO.Comms.Sdk.dll"
22+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolbyIO.Comms.Sdk.xml "${UNITY_ASSEMBLY_DIRECTORY}/DolbyIO.Comms.Sdk.xml"
2223

2324
DEPENDS DolbyIO.Comms.Native DolbyIO.Comms.Sdk
2425
)

src/DolbyIO.Comms.Native/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace dolbyio::comms::native {
1515

1616
// No op deleter
1717
struct null_deleter {
18-
template<typename T> void operator()(T *t) {};
18+
template<typename T> void operator()(T *t) { };
1919
};
2020

2121
template<typename Exception = std::exception>

src/DolbyIO.Comms.Native/video.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@ extern "C" {
1313

1414
auto shared = std::shared_ptr<dolbyio::comms::native::video_sink>(sink, null_deleter{});
1515
wait(sdk->video().remote().set_video_sink(cpp_track, shared));
16+
1617
}}.result();
1718
}
1819

20+
EXPORT_API int SetNullVideoSink(video_track track) {
21+
return call { [&]() {
22+
dolbyio::comms::video_track cpp_track;
23+
no_alloc_to_cpp(cpp_track, &track);
24+
//auto shared = std::shared_ptr<dolbyio::comms::native::video_sink>(nullptr);
25+
//wait(sdk->video().remote().set_video_sink(cpp_track, shared));
26+
27+
}}.result();
28+
}
29+
1930
EXPORT_API int StartVideo(video_device device, dolbyio::comms::native::video_frame_handler* handler) {
2031
return call { [&]() {
2132
camera_device input;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
namespace DolbyIO.Comms
22
{
3+
/// <summary>
4+
/// The component name.
5+
/// </summary>
36
public static class ComponentName
47
{
8+
/// <summary>
9+
/// The Unity component name.
10+
/// </summary>
511
public const string Unity = "unity-sdk";
12+
13+
/// <summary>
14+
/// The dotnet componenet name.
15+
/// </summary>
616
public const string Dotnet = "dotnet-sdk";
717
}
818
}

src/DolbyIO.Comms.Sdk/DolbyIOSDK.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public AudioService Audio
137137

138138
private VideoService _video = new VideoService();
139139

140+
/// <summary>
141+
/// Gets the video service.
142+
/// </summary>
143+
/// <exception cref="DolbyIOException">Is thrown when <see cref="InitAsync(string, RefreshTokenCallBack)"/> has not yet been called.</exception>
140144
public VideoService Video
141145
{
142146
get
@@ -157,7 +161,11 @@ public VideoService Video
157161
/// </summary>
158162
/// <value><c>true</c> if the SDK is initialized; otherwise, <c>false</c>.</value>
159163
public bool IsInitialized { get => _initialized; }
160-
164+
165+
/// <summary>
166+
/// Create a new DolbyIOSDK
167+
/// </summary>
168+
/// <param name="componentName">The component used.</param>
161169
public DolbyIOSDK(string componentName = ComponentName.Dotnet)
162170
{
163171
_componentName = componentName;
@@ -194,7 +202,10 @@ public async Task SetLogLevelAsync(LogLevel logLevel)
194202
{
195203
await Task.Run(() => Native.CheckException(Native.SetLogLevel(logLevel))).ConfigureAwait(false);
196204
}
197-
205+
206+
/// <summary>
207+
/// Class finalizer.
208+
/// </summary>
198209
~DolbyIOSDK()
199210
{
200211
Dispose(false);

src/DolbyIO.Comms.Sdk/Native/Handlers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace DolbyIO.Comms
100100
/// <summary>
101101
/// The <see cref="DolbyIO.Comms.Services.MediaDeviceService.AudioDeviceRemoved">MediaDevice.AudioRemoved</see> event handler.
102102
/// </summary>
103-
/// <param name="uid">A unique device identifier of the removed audio device.</param>
103+
/// <param name="id">A unique device identifier of the removed audio device.</param>
104104
public delegate void AudioDeviceRemovedEventHandler(DeviceIdentity id);
105105

106106
/// <summary>

src/DolbyIO.Comms.Sdk/Native/Native.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ internal static extern int SetSpatialEnvironment(float scaleX, float scaleY, flo
131131

132132
[DllImport (Native.LibName, CharSet = CharSet.Ansi)]
133133
internal static extern int SetVideoSink(VideoTrack track, VideoSinkHandle handle);
134+
135+
[DllImport (Native.LibName, CharSet = CharSet.Ansi)]
136+
internal static extern int SetNullVideoSink(VideoTrack track);
134137

135138
[DllImport (Native.LibName, CharSet = CharSet.Ansi)]
136139
internal static extern int StartVideo(VideoDevice device, VideoFrameHandlerHandle handler);

src/DolbyIO.Comms.Sdk/Native/Structs/AudioDevice.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ public struct AudioDevice : IEquatable<DeviceIdentity>,
3333
[MarshalAs(UnmanagedType.I4)]
3434
public readonly DeviceDirection Direction;
3535

36+
/// <inheritdoc/>
3637
public bool Equals(AudioDevice obj)
3738
{
3839
return Native.AudioDeviceEquals(Identity.Value, obj.Identity.Value);
3940
}
4041

42+
/// <inheritdoc/>
4143
public bool Equals(DeviceIdentity id)
4244
{
4345
return Native.AudioDeviceEquals(Identity.Value, id.Value);

src/DolbyIO.Comms.Sdk/Native/Structs/Handles/VideoFrame.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ internal VideoFrame(int width, int height, IntPtr buffer)
2525
Height = height;
2626
SetHandle(buffer);
2727
}
28-
28+
29+
/// <inheritdoc/>
2930
public override bool IsInvalid => handle == IntPtr.Zero || handle == new IntPtr(-1);
3031

32+
/// <inheritdoc/>
3133
protected override bool ReleaseHandle()
3234
{
3335
return Native.DeleteVideoFrameBuffer(handle);

0 commit comments

Comments
 (0)