The Buffer Access sample application demonstrates a way to directly access the video frame buffer from within an application by using the MV Buffer Access filter. The application implements a callback interface which is accessed by the MV Buffer Access filter. The filter calls a method on that interface for every video frame passing through. The method contains pointers to the input and output buffers as well as information about the video frame dimension (Width, Height, Row Size in Byte).
This and other sample applications can be found in the MV Development Kit installation directory.
Filter Graph Summary
The sample application uses a simple filter graph containing a video source filter, the MV Buffer Access filter and a Video Renderer.
The Application
This sample application uses the MV Buffer Access filter to give the application direct access to the video frame buffer. Therefore the application implements a callback interface and passes an interface pointer to the buffer access filter. The filter calls the a method on this for every video frame. The method implemented in the application modifies the video data, in this case inverts a rectangle in the middle of the video. The application uses a MontiVision Smart Control to display the modified live video stream. The Contrast and Brightness sliders control the video source through the Smart Controls IMVSCCameraControl interface.