This topic is now archived and is closed to further replies.


How to pass data to a Source Filter

Recommended Posts

crypting    122
I have created my custom Push Source Filter based on the PushSourceDesktop filter in the SDK. This example provides an image of the user''s desktop as a continuously updating stream. My filter should provide an image of a Direct3D surface. So, I want to tell my CPushPinD3D::FillBuffer(IMediaSample *pSample) function to copy the data pointed by a LPDIRECT3DSURFACE9. Therefore, instead of calling the CopyScreenToBitmap(...) function, I call my own CopySurfaceToBitmap(...), which makes the same thing but using an LPDIRECT3DSURFACE9 as source. The problem is, in the desktop sample it just takes the data from the context device "DISPLAY" (so they don''t need to pass any arguments to the filter). But the surface I want to convert into a video stream is rendered by my main application and I don''t know how to pass my filter a pointer to the D3D surface I want to copy How can I tell my custom filter where should it get the data from? Thanks!

Share this post

Link to post
Share on other sites