Gluber2006

Hi there,

I have the following problem:

I am developing an application that basically renders some 2D Screens using Direct3D ( XNA ) and now i need to display the image from a TV capture card on this screen too.

The application has to be WindowsXP/VISTA compatible.

So for TV Input normally i would use DirectShow, but here is the problem for using the VMR i would need pointers to the unmanaged COM Objects of XNA to implement the allocator.

This seems unsupported, although i might be able to get those pointers via reflection ( as they are defined for example in GraphicsDevice pComPtr )

The other solution would be to just decode the video to a memory buffer and copy that to a texture lateron.

The third option would be to go back and rewrite the whole graphics engine in unmanaged C++, but for obvious reasons like productivity i don't really want to do that ( note that the overall 3D Performance requirements are low for this application, so C++ is unneccessary for performance )

Anyone have some suggestions on this one



Re: XNA Framework DirectShow & XNA

Laurent

I did that a little while ago. I used reflection to get the unmanaged com device pointer and implemented an XNA compatible VMR9 allocator/presenter. I also used DirectShowLib for all the enum's and interface definitions. Painful job indeed... but doable.




Re: XNA Framework DirectShow & XNA

Gluber2006

Ok that is a good assurance as someone else has done it.

How good is the stability of your solution My Application needs to run 24/7 with the occasional reboot ( its a kiosk installation ) in your opinion is this achievable with your setup





Re: XNA Framework DirectShow & XNA

Laurent

My implementation renders videos on textures for special effects in a couple of games. A P4 at 3GHz is able to render four video streams simultaneously. I tested with various movies of different formats. It works and I dont see why the kiosk should not :)

Let me know if you need some code snippets.





Re: XNA Framework DirectShow & XNA

Gluber2006

Thanks for your help again!

That reasures me that we can do the same thing :-) Since we only ever have 1 TV input stream and 1 video stream playing and our minimum kiosk spec is a P4 3 GHZ Single Core, this should really work well :-)

I might take you up on that offer for code lateron maybe !





Re: XNA Framework DirectShow & XNA

HKaze

The only thing that has stopped me from moving to XNA has been videos on textures. I'm having my own issues using VMR9 (DirectShowLib) with MDX 1.1. I would love to move to XNA and be done with it, but I have no idea how. Laurent if you could give some more insight (code examples are always welcome), I can finally let MDX 1.1 R.I.P and move to XNA.



Re: XNA Framework DirectShow & XNA

Laurent

We were using MDX 2.0 and then moved to XNA. XNA brought us a massive improvement in performance because of its decent Math lib - compared to the ridiculous idiotic *** we had in MDX 1 and 2.

On the other hand, there is no support in XNA many many things and especially for old stuff (such as the FFP) and we had to create our own MDX 2 style helpers to be able to do what was possible with MDX 2. We worked around XNA limitations with ugly code (reflection based) digging into private data of XNA.

Back to the subject... My video allocator presenter uses that *** to handle texture levels, surfaces, internal COM pointers, etc. That's about
- 400 lines for the AP
- 1500 lines for the interop layers

Therefore I cannot post the everything here... Send me an email if you really want to see this code.

End of the XNA story: We ended up with the following conclusions:

- XNA is a toy for hobbyists.
- XNA is for the XBOX. The PC stuff is only there for cross-dev.
- MS is not going to release anything equivalent to MDX 2 in a reasonable time frame - or ever.
- We will have to code our own MDX 2.1 and get rid of this XNA ***.

So when you say "Move to XNA", my advice is "Think twice"...







Re: XNA Framework DirectShow & XNA

Jim Perry

Laurent wrote:
End of the XNA story: We ended up with the following conclusions:

- XNA is a toy for hobbyists.
- XNA is for the XBOX. The PC stuff is only there for cross-dev.
- MS is not going to release anything equivalent to MDX 2 in a reasonable time frame - or ever.
- We will have to code our own MDX 2.1 and get rid of this XNA ***.

So when you say "Move to XNA", my advice is "Think twice"...

Your first and second points are incorrect. You're basing XNA on Game Studio Express which is just wrong. You seem to be doing what others are doing with assuming XNA == GSE (and I've been guilty of in the past admittedly).

See this blog entry and this blog entry. Development on the XNA brand is far from complete. GSE has been out less than 4 months and was basically developed in 6. Judging a product based on those numbers, I'd consider GSE pretty incredible.

Take a look at what the teams did in the 4 days with GSE (not XNA!) and see if you can do the same thing without it. Take a look at the videos on Ben's site of what he's accomplished using GSE. A cut above hobbyist I'd say.

Your 3rd point is another assumption and your 4th point is your choice. Sure you can choose to reinvent the wheel and create MDX 2.1, MDX's successor already exists, it's called XNA. Give it some time to mature. If you can't wait, feel free to use native DX or stick with MDX.






Re: XNA Framework DirectShow & XNA

Laurent

Sure, Replace "XNA" with "GSE"...

So where is the "pro" stuff

What is just needed is a decently written .Net 2.0 interop layer for DX9. No more, no less. That MDX 2 was, except for the Math stuff, of course. MS bombed it... So lame.

And same in the future for DX10, when there will be more than one or two video boards supporting it.





Re: XNA Framework DirectShow & XNA

Jim Perry

Laurent wrote:
So where is the "pro" stuff

There was an interview with one (or more, can't remember) of the Torpex guys where they mentioned it. Patience.

Laurent wrote:
What is just needed is a decently written .Net 2.0 interop layer for DX9.

Which won't let you run on the 360 though.






Re: XNA Framework DirectShow & XNA

HKaze

Laurent wrote:

Therefore I cannot post the everything here... Send me an email if you really want to see this code.

Thanks I'll shoot you off an e-mail, although I don't know how to PM here or get your e-mail address.





Re: XNA Framework DirectShow & XNA

Laurent

HKaze: Can't find any PM on these forums... Send me a note at: Laurent (Underscore) Laurent (At) hotmail (Dot) com and I will get back to you