【发布时间】:2014-05-08 13:31:23
【问题描述】:
这与我之前问过的this question 有关。
我正在尝试使用WCF Duplex service 来控制(启动、停止、启用功能)许多 Kinect 设备。除此之外,我还想将从 Windows 服务接收到的视频源流式传输到客户端 WPF 应用程序。我这样做是因为我需要 Windows 服务的属性,例如应用程序的自动启动。
已尝试使用 Duplex 服务回调来流式传输数据并遇到其他问题中所述的一些问题。我开始怀疑Memory-Mapped File 是否是更好的方法。
设备大约每秒发出 30 次以下调用。
private byte[] _ColorPixels;
private void Sensor_AllFramesReady(object sender, Microsoft.Kinect.AllFramesReadyEventArgs e)
{
using (ColorImageFrame frame = e.OpenColorImageFrame())
{
frame.CopyPixelDataTo(_ColorPixels);
//_ColorPixels will now have a large array which is the video stream
}
}
此时我有一个包含至少 1,228,800 个元素的数组。我现在想将此数据转发给另一个进程。
那么在 C# 中,在进程之间流式传输实时视频数据的最佳方式是什么?
【问题讨论】: