Has anybody had any luck in developing a DirectShow source push filter in C#?
We have raw bitmaps and pcm audio in a shared memory and want to feed the Expression Encoder with it. For various (good) reasons we don't want to use DirectShow.Net.
Also, we want to avoid C++.
The filter is likely to eventually be made in C++. If you are trying to avoid this as much as possible, you want to have the C++ as thin as possible and actually forward the calls into managed domain for the real action. This is what DirectShowLib's GSSF Filter
does and this is what you otherwise would likely have to implement.
I assume you already have read C# version of the PushSource example.
Here is an example how to create virtual video capture source in C# http://www.codeproject.com/Articles/437617/DirectShow-Virtual-Video-Capture-Source-Filter-in
Here is BaseClasses.NET and filters examples in C# http://www.codeproject.com/Articles/421167/Pure-NET-DirectShow-Filters-in-Csharp
I just started working on it feverishly lately (sorry! I'm sure it's a little late for you, but hopefully others will find this useful) ...
fortunately - there are a couple good starts: This pushsource works in graphedt.exe, (but doesn't in a capturegraph) Sourceforge has most of directshow converted to c# here
unfortunately - Due to marshaling, those two projects are incompatible as they stand - I currently have them merged, but I'm largely green when it comes to directshow, so it'll be a bit before I have anything good to post. The author in the first link above wanted to get his first version out and is also working on it. I'm not sure how dedicated his time is to that particular task, but his is a guru - which will help the timeline immensely...
I'll send a version to him if and when I get it going, so keep an eye there. That's the only hope I've been able to find for creating a push source in c#. If you've since come across anything, please tack it on to this thread since MS is sitting this one out
来源:https://stackoverflow.com/questions/8934343/directshow-push-source-filter-in-c