Example #1
0
 /// <summary>
 /// Dispose method.
 /// </summary>
 public void Dispose()
 {
     if (this.device != null)
     {
         ((IDisposable)this.device).Dispose();
         this.device = null;
     }
 }
Example #2
0
 /// <summary>
 /// Dispose method.
 /// </summary>
 public void Dispose()
 {
     if (this.device != null)
     {
         this.device.Dispose();
         this.device = null;
     }
 }
Example #3
0
        /// <inheritdoc/>
        public void Start(Action <DateTime> notifyCompletionTime)
        {
            // notify that this is an infinite source component
            notifyCompletionTime(DateTime.MaxValue);

            this.device = new RealSenseDevice();
            this.thread = new Thread(new ThreadStart(this.ThreadProc));
            this.thread.Start();
        }
Example #4
0
    private void Start()
    {
        device = new RealSenseDevice();
        device.OnFrameDataArrived += Device_OnFrameDataArrived;
        device.Open();

        texture       = new Texture2D(device.DeviceConfiguration.ColorProfile.Width, device.DeviceConfiguration.ColorProfile.Height, TextureFormat.RGB24, false);
        image.texture = texture;
    }
Example #5
0
 /// <inheritdoc/>
 public void Stop()
 {
     if (this.thread != null)
     {
         this.shutdown = true;
         TimeSpan waitTime = new TimeSpan(0, 0, 1);
         if (this.thread.Join(waitTime) != true)
         {
             this.thread.Abort();
         }
     }
     if (this.device != null)
     {
         this.device = null;
     }
 }
Example #6
0
        /// <inheritdoc/>
        public void Stop(DateTime finalOriginatingTime, Action notifyCompleted)
        {
            if (this.thread != null)
            {
                this.shutdown = true;
                TimeSpan waitTime = new TimeSpan(0, 0, 1);
                if (this.thread.Join(waitTime) != true)
                {
                    this.thread.Abort();
                }
            }

            if (this.device != null)
            {
                this.device = null;
            }

            notifyCompleted();
        }
Example #7
0
 /// <summary>
 /// Called once all the subscriptions are established.
 /// </summary>
 private void OnPipelineStart()
 {
     this.device = new RealSenseDevice();
     this.thread = new Thread(new ThreadStart(ThreadProc));
     this.thread.Start();
 }
Example #8
0
 /// <summary>
 /// Dispose method
 /// </summary>
 public void Dispose()
 {
     this.device?.Dispose();
     this.device = null;
 }