Skip to content

Commit 4156997

Browse files
Paulo Morgadopaulomorgado
authored andcommitted
Enhance audio source interface and project configurations
- Added new using directives and an event for handling encoded audio samples in `MediaEndPoints.cs`. - Updated `SIPSorceryMedia.Abstractions.csproj` to set the language version to 12.0. - Modified `SIPSorceryMedia.Abstractions.UnitTest.csproj` to support multi-targeting for `net462` and `net8.0`, with conditional xUnit runner package references based on the target framework.
1 parent 808d9ce commit 4156997

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/MediaEndPoints.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
2+
using System.Buffers;
23
using System.Collections.Generic;
4+
using System.ComponentModel;
35
using System.Net;
46
using System.Runtime.InteropServices;
57
using System.Threading.Tasks;
@@ -649,6 +651,8 @@ public interface IAudioSource
649651
{
650652
event EncodedSampleDelegate OnAudioSourceEncodedSample;
651653

654+
event Action<uint, ReadOnlyMemory<byte>> OnAudioSourceEncodedSampleEx;
655+
652656
event RawAudioSampleDelegate OnAudioSourceRawSample;
653657

654658
event SourceErrorDelegate OnAudioSourceError;

src/SIPSorceryMedia.Abstractions.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<PackageId>SIPSorceryMedia.Abstractions</PackageId>
55
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net8.0</TargetFrameworks>
6+
<LangVersion>12.0</LangVersion>
67
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
78
<GenerateDocumentationFile>true</GenerateDocumentationFile>
89
<!-- Disable warning for missing XML doc comments. -->

test/SIPSorceryMedia.Abstractions.UnitTest/SIPSorceryMedia.Abstractions.UnitTest.csproj

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8</TargetFramework>
4+
<TargetFrameworks>net462;net8.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
</PropertyGroup>
@@ -11,10 +11,6 @@
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1212
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
1313
<PackageReference Include="xunit" Version="2.9.2" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16-
<PrivateAssets>all</PrivateAssets>
17-
</PackageReference>
1814
<PackageReference Include="coverlet.collector" Version="6.0.3">
1915
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2016
<PrivateAssets>all</PrivateAssets>
@@ -24,6 +20,20 @@
2420
<PackageReference Include="Serilog.Sinks.XUnit" Version="3.0.19" />
2521
</ItemGroup>
2622

23+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
24+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
25+
<PrivateAssets>all</PrivateAssets>
26+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27+
</PackageReference>
28+
</ItemGroup>
29+
30+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
31+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
32+
<PrivateAssets>all</PrivateAssets>
33+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
34+
</PackageReference>
35+
</ItemGroup>
36+
2737
<ItemGroup>
2838
<ProjectReference Include="..\..\src\SIPSorceryMedia.Abstractions.csproj" />
2939
</ItemGroup>

0 commit comments

Comments
 (0)