Browse Source

修改下发送频率

master
SmallChi(Koike) 3 years ago
parent
commit
73a6ea599d
4 changed files with 18 additions and 7 deletions
  1. +3
    -0
      src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj
  2. +1
    -1
      src/JT1078.FMp4/JT1078.FMp4.csproj
  3. +11
    -4
      src/JT1078.Hls.Test/M3U8_Test.cs
  4. +3
    -2
      src/JT1078.SignalR.Test/Services/ToWebSocketService.cs

+ 3
- 0
src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj View File

@@ -58,6 +58,9 @@
<None Include="..\..\doc\video\jt1078_1_fragmented.mp4" Link="H264\jt1078_1_fragmented.mp4">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\doc\video\jt1078_5.txt" Link="H264\jt1078_5.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

+ 1
- 1
src/JT1078.FMp4/JT1078.FMp4.csproj View File

@@ -14,7 +14,7 @@
<licenseUrl>https://github.com/SmallChi/JT1078/blob/master/LICENSE</licenseUrl>
<license>https://github.com/SmallChi/JT1078/blob/master/LICENSE</license>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0-preview3</Version>
<Version>1.0.0-preview4</Version>
<SignAssembly>false</SignAssembly>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>


+ 11
- 4
src/JT1078.Hls.Test/M3U8_Test.cs View File

@@ -22,7 +22,7 @@ namespace JT1078.Hls.Test
{
var lines = File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", "jt1078_5.txt"));
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
clientSocket.Connect("127.0.0.1",1078);
clientSocket.Connect("127.0.0.1", 10888);
long lasttime = 0;
foreach (var line in lines)
{
@@ -31,10 +31,17 @@ namespace JT1078.Hls.Test
{
lasttime = long.Parse(temp[0]);
}
else {
else
{
var ts = long.Parse(temp[0]) - lasttime;
if (ts > 3) ts = 3;
Thread.Sleep(TimeSpan.FromSeconds(ts));
if(ts>0)
{
Thread.Sleep(TimeSpan.FromMilliseconds(ts));
}
else if (ts == 0)
{
}
lasttime = long.Parse(temp[0]);
}
var data= temp[1].ToHexBytes();


+ 3
- 2
src/JT1078.SignalR.Test/Services/ToWebSocketService.cs View File

@@ -126,12 +126,13 @@ namespace JT1078.SignalR.Test.Services
if (flag.ContainsKey(session))
{
var len = flag[session];
if (q.Count < len)
if (q.Count <= len)
{
break;
}
await _hubContext.Clients.Client(session).SendAsync("video", q[len], stoppingToken);
flag[session] = ++len;
len++;
flag[session] = len;
}
else
{


Loading…
Cancel
Save