News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

DirectShow transform

Started by jj2007, June 21, 2017, 05:01:24 AM

Previous topic - Next topic

adeyblue

You can setup a callback so you don't have to poll for when the data is available (ISampleGrabberCB). You can also (if supported) step the graph one video frame at a time which can help if you just want to process without necessarily displaying the video (IVideoFrameStep).

There's an example here that uses both with code (C++), video & exe that rotates each frame of the video 90 degrees with both GDI & GDI+ and writes them out (it'll create 92 bmp files), or just the code here.

It works here but as this thread's proved, with this stuff YMMV.

Siekmanski

Nice example. I'll have a closer look at the source code.

There are many ways in directshow to accomplish the same goal.
I'm trying to get a direct pointer to the bitmap data, the SampleGrabber needs an extra copy of the frame data and is just a waste of time.

The TextureRenderer filter seems to be what I'm looking for....
Creative coders use backward thinking techniques as a strategy.

jj2007

Quote from: adeyblue on July 05, 2017, 08:27:18 AM
You can setup a callback

That was our intention in the end - in windowless mode, get a pointer to the pixels, rotate as necessary, pass the pointer back to COM.

Do you have an idea if that is possible speed-wise? At 20 fps for example, only 50ms are available for the whole display, of which x may be needed for doing rotation, flipping etc.

Another option to investigate: grab the sample (which seems to be kind of a DIB ?), then BitBlt or stretchblt or whatever to the DC, and instead of letting the COM interface continue, discard the sample by passing it to the null renderer. Afterwards, Gdi+ can also do the rotation and other transformations. We could even add subtitles etc :P