我正在尝试使用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#进程之间传输实时视频数据的最佳方法是什么?