/// <summary> /// Utility method/callback which initialises a new sensor stream. /// </summary> private void StartNewSensorStream() { if (CurrentSensorStream == null) { CurrentSensorStream = new SensorStream(SensorStreamSessionID); } else { CurrentSensorStream.SessionID = SensorStreamSessionID; CurrentSensorStream.Clear(); } IsSensorStreamActive = true; SensorStreamSessionID++; }
private static void ReadFreame(SensorStream stream) { using (var frame = stream.ReadFrame()) { Console.WriteLine("Video frame acquired:"); DescribeFrame(frame); // write frame using (Stream fileStream = File.Open("sensor.frame", FileMode.Create)) using (var writer = new BinaryWriter(fileStream)) { // stream properties //writer.Write(hFov); //writer.Write(vFov); //writer.Write(minValue); //writer.Write(maxValue); //writer.Write(videoMode.PixelFormat.BytesPerPixel()); //// frame properties //writer.Write(frame.CroppingEnabled); //writer.Write(frame.CropOriginX); //writer.Write(frame.CropOriginY); //writer.Write(frame.Width); //writer.Write(frame.Height); //writer.Write(frame.Stride); writer.Write(frame.Data.Size); // data using (var dataStream = frame.Data.CreateStream()) { dataStream.CopyTo(fileStream); } fileStream.Flush(); } } }
internal ReadingLength(SensorStream output) { this.output = output; }
internal ReadingPayload(SensorStream output) { this.output = output; }
/// <summary> /// Check if the device stream is operating at an acceptable rate. /// </summary> /// <param name="streamIdentifier">The identifier of the stream to check.</param> /// <returns>whether the stream identified by the identifier is OK</returns> public bool IsStreamHealthy(SensorStream streamIdentifier) { return((_streamingStatus & (int)streamIdentifier) > 0); }
internal AwaitingStart(SensorStream output) { this.output = output; }