Writing a Direct Show Source Filter
Asked Answered
B

2

2

I should have to write a Direct Show Filter which

  • takes input(video,audio) from live source.

  • And it should give the data(video,audio : which are encoded) to a decoder Filter

MyCustomDirectShowSourceFilter ---> Decoder

Any real working examples which i can build my own source filter and any suggestion for implementation?

Best Wishes

Update:

Basically i want a source filter which takes streams from network and let to handle the parsing and decoding of video stream by another filter.

So when i modify Microsoft sample Push Source Filter and connect to a decoder it does not call FilllBuffer method. The graph simply does not work. I need a source filter example which the output is connected to a decoder not a video renderer or Mux.

Brandwein answered 20/6, 2011 at 15:35 Comment(1)
See also #4215286Mcwhirter
G
3

The Windows SDK (7.1) contains DirectShow sample filter code, including a source filter, which I've successfully used to build source filters for live devices.

If you have the latest Windows SDK installed, it should be here:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\filters\pushsource

Also, MSDN has great reference material on this topic:

http://msdn.microsoft.com/en-us/library/dd757807(v=vs.85).aspx

If you are still stuck, the March Hare also provides great samples to get peopel started:

http://tmhare.mvps.org/downloads.htm

Grantgranta answered 20/6, 2011 at 18:7 Comment(2)
Hi, Morgan. The problem with sample Push Source Filter is that its output directly connect to video renderer. When i modify this push filter for my purposes-to give it video decoder- it does not work.Brandwein
Gets complex quickly. FillBuffer is called by the source filter's output pin's ThreadProc (streaming thread). Several reason's while FillBuffer not be called, including no clock in the graph, no filter downstream "pulling" samples (such as a renderer). You might look at your custom output pin class and break inside FillBuffer there. Also ensure graph play state transistion succeeds. Also you could try adding the Null renderer filter just provide a sink for pulling samples through the graph. Timestamps you generate in FillBuffer can also cause blocking. Little too complex for a comment ;-)Grantgranta

© 2022 - 2024 — McMap. All rights reserved.