Closed techyian closed 5 years ago
Makes more sense for the capture handlers to be at a port level rather than a component level. This means if you're using the splitter component for example, you can potentially use 4 different capture handlers for each output port if you wish.
Makes more sense for the resolution to be queried and assigned at a port level. This also means that components connected to the splitter component can have their own respective resolutions.
This has been added to simplify the port configuration process. Too many overloads were confusing the MMALDownstreamComponent
class, so these have been removed in favour of a single parameter. All previous configuration properties can be assigned via this new class.
This can now be assigned via the MMALPortConfig
class.
Removing Nito.AsyncEx dependency
For some time I've been battling with a blocking issue which was intermittent and struggled to pinpoint what the cause was. I have since found this is happening when the thread running
ProcessAsync
reaches the port disable method while a native background thread is still in operation in one of the buffer callbacks; this in turn was causing MMAL to block indefinitely, essentially causing a deadlock.To remedy this I have removed the
AsyncCountdownEvent
functionality the library relied on to releaseawait
calls whilst MMAL was processing data for us and have replaced it with a manual implementation which periodically checks whether a port has finished processing, and if so, theawait
completes. For some reason,AsyncCountdownEvent
was allowing the thread handlingProcessAsync
to continue at a higher priority than the background thread, whereas the manual implementation does successfully complete the background thread before reaching port disable code.Due to not needing
AsyncCountdownEvent
anymore, and recent efforts to better understand the importance ofConfigureAwait(false)
on awaits in the library, it's no longer necessary to keepNito.AsyncEx
as a dependency in MMALSharp. I will of course be updating the Wiki and any other documentation which references code from that library.