2

I have exactly the same question in the following link, Using DirectShow filters outside DirectShow? I am a fresh to direct show and the two answers in that stack is not clear enough to me. And I can not find a way to contact with the author to ask if he solved his problem. Is there a way to do this?

Or, could some one give more detail explain about these two answers? What does it means about " "by hand" call the various filter " and what does it means about "wrap the entire filter graph"?

Community
  • 1
  • 1
milton
  • 43
  • 1
  • 4
  • 1
    Why do you want to use a directshow filter outside directshow? Maybe it will be easier to use directshow in your situation. For example you can use a samplegrabber filter to send data from a directshow graph to your application. – wimh May 16 '11 at 16:07
  • Can you explain why you want to do this? The asker in the linked question wanted to use a DirectShow decoder in Media Foundation. Is that what you are trying to do? If not, then there are probably easier ways to achieve your goal. – Alan May 16 '11 at 16:08
  • Thanks for your attentions. Yes, I am too trying to use a DShow decoder in Media Foundation and it is better if I don't add complexities of programming in DShow. – milton May 17 '11 at 01:49
  • To make the question more clear, does the "wrap the entire filter graph" means wrap the dshow's graph manager in my code so I can use it to build a graph for my source files at first? Then what should I do with "have a custom source filter to feed samples in"? Should I find the decoder's out pin from that graph I just built then read data from it? – milton May 23 '11 at 07:58

1 Answers1

2

I can't comment on the "by-hand" method (bad idea, IMO), but one option for using DirectShow is to wrap the entire filter graph in your Media Foundation object. So yes, inside the Media Foundation object would be a full directshow graph, along with the filter(s) that you were interested in.

This, of course, is non-trivial--for the directshow graph, you'd need some input filter, and then probably a sample grabber filter to get samples out of the graph. Your graph would look something like:

Source Filter -> Some DMO Decoder -> Sample Grabber -> Null Renderer

...and the sample grabber would call a callback every time a sample passed through.

If your decoder filter is a DMO, then it becomes much easier. I take it you're not using a DMO filter?

kidjan
  • 1,471
  • 14
  • 16