Jump to content
  • Advertisement


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


Custom Source Filter to import Direct3D scenes

This topic is 5321 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I''ve been looking how to create a custom source filter to use my Direct3D scenes to create a stream of media samples in a DirectShow graph. In particular, I''ve been working on the "PushSource Source Filter" example in Pesce''s book, and on the three PushSource filters examples in the DirectX9 SDK: PushSourceBitmap, PushSourceBitmapSet and PushSourceDesktop. Now I understand the basics to write my custom source filter. I understand more or less every method I''ve to override. The problem comes when I want to override the CSourceStream::FillBuffer method to copy my Direct3D scene to the media sample. All the examples metioned above use "local data": - Pesce''s PushSource Source filter shows just a black sample with the number of the current frame in yellow. - PushSourceBitmap and PushSourceBitmapSet show bitmaps with a known path. - And finally PushSourceDesktop a Desktop capture (doing 5 captures per second). In the other hand, my source filter should work with "external dynamic" data, copying an offscreen rendered surface to the media sample. In my main file I store all my offscreen rendered Direct3D scenes into a surface array: LPDIRECT3DSURFACE9 m_pTextureSurface[NUM_SURFS]; How should I access these surfaces from my source filter''s code? Using extern with a pointer to the current surface this way? extern LPDIRECT3DSURFACE9 currentSurface; And then I''ll have to convert it into a bitmap to fill the media sample, correct? I understand one of my source filters will only create the media stream for one of my offscreen rendered surfaces. Is this a correct approach? Thanks again

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!