jacobbo / WebEye

WebEye is a collection of .NET controls.
190 stars 132 forks source link

Added PlayAndAwaitStream method to avoid crashes when stopping before first frames received #1

Closed Peuczynski closed 9 years ago

Peuczynski commented 9 years ago

While testing an app using this component came across two problems.

  1. Stop method. Application crashed with exception that couldn't be caught when method was called right after Start method.This whas discovered while swithing on/off on a slow computer.
  2. GetCurrentFrame method. Exception was thrown when we tried to get frame right after calling Start.

This was caused by using delegates to native code methods that were not synchronized with the managed code. This is why I decided to use GetCurrentFrame exception to create this crude fix. I've created new method to maintain backward compatibility

jacobbo commented 9 years ago

I am going to reimplement the start logic using an event based approach.