Search code examples
videodirectshowdirectshow.net

Are there any filters or sample code that actually fully use rcSource and rcTarget in VIDEOINFOHEADER?


The MSDN documentation for DirectShow documents an elaborate scheme for the rcSource and rcTarget members of VIDEOINFOHEADER and VIDEOINFOHEADER2 where portions of an input frame can be stretched or shrunk onto portions of an output frame.

Source and Target Rectangles in Video Renderers

However I haven't found any filters or sample code that actually use rcSource and rcTarget in this way. In the sample code I've found rcSource and rcTarget are either set to (0,0,0,0) or (0,0,width,height).

Is full support for rcSource and rcTarget so rare that it's not even worth implementing? Should I explicitly reject rcSource or rcTarget values that are not zero or default? At the moment I don't even have a reference implementation to test general values of rcSource and rcTarget against.


Solution

  • What kind of filter you are developing? Although while this may have some influence on the answer, you already answered your question - it is indeed very rare. It is typical for the filters to negotiate media types individually and they don't have any crop information to choose extent other than full video frame. As a result, you are having hard time finding filters that support or even care for those rectangles.