Microsoft DirectX 9.0

Ball Filter Sample


The Ball Filter is a video source filter that produces an image of a bouncing ball. This sample illustrates format negotiation and the use of the source filter base classes CSource and CSourceStream.


Source: (SDK root)\Samples\C++\DirectShow\Filters\Ball

User's Guide

The code in Fball.h and Fball.cpp manages the filter interfaces. Those two files contain approximately the minimum code required for a source filter. The Ball.h and Ball.cpp files contain the code that bounces the ball.

This filter has a single output pin, which provides a video stream that shows a ball bouncing around in the frame. The Ball filter also accepts quality management requests from the downstream filter, which illustrates a simple quality management strategy. This filter implements the IQualityControl interface for that purpose.