public void Connect(ImageDescriptor imageDescriptor, IFrameProducer producer, ConsumerDisplay consumerDisplay, ConsumerMJPEGRecorder consumerRecord) { // At that point the consumer threads are already started. // But only the display thread (actually the UI main thread) should be "active". // The producer thread is not started yet, it will be started outside the pipeline manager. this.producer = producer; this.consumerDisplay = consumerDisplay; this.consumerRecord = consumerRecord; consumerDisplay.SetImageDescriptor(imageDescriptor); consumerRecord.SetImageDescriptor(imageDescriptor); consumers.Clear(); consumers.Add(consumerDisplay as IFrameConsumer); consumers.Add(consumerRecord as IFrameConsumer); int buffers = 8; pipeline = new FramePipeline(producer, consumers, buffers, imageDescriptor.BufferSize); pipeline.SetBenchmarkMode(BenchmarkMode.None); if (pipeline.Allocated) { producer.FrameProduced += producer_FrameProduced; connected = true; } }
public void Connect(ImageDescriptor imageDescriptor, IFrameProducer producer, ConsumerDisplay consumerDisplay, ConsumerDelayer consumerDelayer) { // Same as above but for the recording mode "delay" case. this.producer = producer; this.consumerRealtime = null; this.consumerDelayer = consumerDelayer; consumerDisplay.SetImageDescriptor(imageDescriptor); consumerDelayer.SetImageDescriptor(imageDescriptor); consumers.Clear(); consumers.Add(consumerDisplay as IFrameConsumer); consumers.Add(consumerDelayer as IFrameConsumer); CreatePipeline(imageDescriptor); }
public void Connect(ImageDescriptor imageDescriptor, IFrameProducer producer, ConsumerDisplay consumerDisplay, ConsumerRealtime consumerRealtime) { // At that point the consumer threads are already started. // But only the display thread (actually the UI main thread) should be "active". // The producer thread is not started yet, it will be started outside the pipeline manager. this.producer = producer; this.consumerRealtime = consumerRealtime; this.consumerDelayer = null; consumerDisplay.SetImageDescriptor(imageDescriptor); consumerRealtime.SetImageDescriptor(imageDescriptor); consumers.Clear(); consumers.Add(consumerDisplay as IFrameConsumer); consumers.Add(consumerRealtime as IFrameConsumer); CreatePipeline(imageDescriptor); }