|
Mavis Architecture As shown in Figure 1, the architecture is modular. The end user's application loads mavisclient.dll and communicates through it to mavis using the Mavis API. This dll communicates with mavis using Windows Event objects and shared memory. The details of this exchange are transparent to the user, however. Because communication is through a dll, the user's program (Client App) can be in any language that supports dlls. Additionally, since mavis runs in a separate application space, users never have to worry about freeing resources that mavis uses or about properly terminating mavis. Development is faster and simpler when programmers don't have to worry about resource management. Mavis uses framecap to access live video data. Framecap, like mavis, is a separate module. Mavis communicates with it using fgclient.dll. Because communication details are encapsulated in the dll, mavis can access image data from files as easily as from live video. A separate dll, bmpReader.dll (not shown), allows mavis to use bitmap files as input.
Mavis is a C++ class, not a standalone application. The application that runs mavis is called Mavis Control App (MavisCtl). When MavisCtl starts, it instantiates mavis and calls its run()
method. Mavis then listens for and handles client requests.
MavisCtl does more than just run mavis. It passes mavis a callback function that mavis invokes whenever visual feedback is available. MavisCtl displays this visual feedback as pictures on its GUI. Without these pictures, it would be nearly impossible to develop applications that use mavis, because there would be no way to "see" what mavis is doing. Another nice thing that MavisCtl does is allow users to control mavis manually, through a GUI. This makes it possible to try out mavis without having to write a program first. It can do this, as Figure 2 shows, by loading mavisclient.dll and acting as the mavis client. When mavisclient.dll has been loaded, MavisCtl displays GUI controls for operating the Mavis API. While it's acting as mavis client, MavisCtl displays data and messages from mavis as well updating its visual-feedback pictures.
Mavis could also be run from a simpler, smaller program than MavisCtl. It can run from a command line program as well as from a Windowed App. The visual-display callback is optional. This flexibility to easily produce stripped-down implementations was one reason for making a mavis a C++ class rather than a standalone application.
|