Squirrowse/squirrowse.web/ClientHub.cs

26 lines
567 B
C#
Raw Normal View History

2020-06-19 18:39:08 +02:00
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR;
using squirrowse.web.Data;
namespace squirrowse.web
{
public class ClientHub : Hub
{
private readonly VideoQ q;
public ClientHub(VideoQ q)
{
this.q = q;
}
public async Task UploadStream(IAsyncEnumerable<byte[]> stream)
{
await foreach (var frame in stream)
{
q._framebuffer.Enqueue(frame);
}
}
}
}