goata007

I wrote a custom file source filter for my app, it works perfectly fine in graph edit & windows media player but when I try to play my file in wpf app using mediaelement - the app crashes. I've tried playing other video formats in same mediaelement tag and they work perfectly fine. Any idea whats causing the problem

Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

Jeremiah Morrill

There really shouldn't be a specific reason it doesn't work in WPF and it could be just about "anything" causing it to crash. The great thing about Visual Studio is you can debug both projects at the same time, just make sure your filter and WPF application are in the same solution. Start up your WPF app with some breakpoints in the filter code and start steppin.

Good luck,

-Jer





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

goata007

The problem has something to do with my source filter. It works perfectly fine on WMP, but in WPF app as soon as I hit the play button the whole app crashes. I tried debugging it but the exception is being raised in the nvidia driver (nvd3dum.dll) - "Unhandled exception at 0x051c6c96 in WPFVideo.exe: 0xC0000005: Access violation reading location 0x00000000."

My filter actually is the "ball filter" from directshow samples and its working fine in WMP & graph edit. Right now I can't think of any reason why it should cause a driver crash. Any MS guys reading this





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

Jeremiah Morrill

I think the canned response around these parts is "try upgrading you video card drivers".

I don't remember the source of the ball filter that well, but maybe try playing with different color spaces (in MediaType). I'm stabbing in the dark, but maybe the new EVR + nvd3dum.dll doesn't like the pixel format.





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

goata007

I just tried EVR & my filter in Graph edit and it works perfectly fine! but still doesn't work in WPF app

I'm using following media type, MajorType: Video, SubType: RGB32. Not sure if its a driver error, because its working fine outside wpf environment.

Are there any requirements for source filters for wpf With my current filter i've only implemented CSource & IFileSourceFilter...didn't implement any seeking, quality and/or other interfaces.





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

Jeremiah Morrill

There shouldn't be any extra requirements for source filters in WPF. Any source filter (with the IFileSourceFilter) I made had no problem being loaded. Anything that could play in WMP never gave me any grief in WPF.

I made a WPF work-around to get reference to the MediaElement's graph. Part of the code is a generic source filter. Maybe you can play around with it and see if some of the code will work for you. The stock code I made loads a web-cam into WPF. But you can create any graph you like. Heres a link: http://jmorrill.hjtcentral.com/Home/tabid/428/EntryID/15/Default.aspx

I would also try testing on another machine with a different video card. That might be the quickest test.

-Jer





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

goata007

I just ran into an another issue - I can't debug the filter

I tried adding filter & wpf app in same solution, tried to attach VS with running app, tried running filter, tried running wpf app. My filter gets loaded but none of the breakpoints get called, I confirmed that by putting a MessageBox() call in methods, the message boxes are working so the new problem is the breakpoints not being called. I have set DirectX mode to debug...any clue whats wrong





Re: Media Foundation Development Custom DirectShow source filter crashing WPF app??

Becky Weiss - MSFT

Two forums that might be a better place for your questions:

DirectShow: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=129&SiteID=1

WPF: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=119&SiteID=1