Thanks for the nice welcome, admin!
admin wrote:I'm just getting my feet wet now with DirectShow. I hope it is not as painful as you say!
It probably depends a bit on what you do. Probably writing a decoder is less painful than writing a renderer, because writing decoders is what everbody does, while writing a renderer is not a very common thing to do.
Some things you may want to look out for:
(1) Different splitters may use different FOURCC values, e.g. for h264 IIRC I've seen 2 or 3 different ones...
(2) After a seek, the Haali splitter may silently drop some frames which are not needed for proper decoding of the target frame. Most other splitters feed all frames, beginning from the I frame, up to the target frame, I think.
(3) If there's a format change during playback, you have to handle that properly. This is between the splitter <-> decoder, but also between decoder <-> renderer. E.g. IIRC VRM9 always triggers a dynamic format change, after the media type has already been agreed upon. See more information here:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
One other thing to think about is whether you want to implement chroma upsampling (YCbCr 4:2:0 -> 4:2:2 or 4:2:2) and colorspace conversions (YCbCr 4:4:4 -> RGB) or not. If it was me, I would simply always output native format (almost always YCbCr 4:2:0) and leave all conversions to the renderer. No need to reinvent the wheel inside of the decoder. Would save you some programming time, too.
You know, the h264 spec allows more than 8bit. Not sure if the GPU hardware supports that, though. If you plan to support > 8bit decoding with your decoder, I'd appreciate if you would try to output the video data in its native bitdepth instead of rounding it down to 8bit internally. Here are the FOURCC values defined by Microsoft for > 8bit YCbCr:
http://msdn.microsoft.com/en-us/library ... 420formats
The next question would be 3D support. I think the latest NVidia and ATI GPUs should support 3D decoding in hardware, too, but there's not even a splitter for that available yet. So maybe you should ignore that for now...
neuron2 wrote:I'll probably be in touch with you as I make progress and have questions. Ciao!
You can also directly email me at madshi (at) gmail (dot) com.
neuron2 wrote:BTW, frame accurate means that if the application asks for frame X (or the equivalent time), then the next displayed frame will be exactly X, and not just some frame close to X. Close is considered good enough for a player. My first effort will just be an ES decoder, so the seeking will be controlled by the splitter. We'll have to see if the splitters are doing a good job in that regard.
I see. I don't think DirectShow playback has to be frame accurate, as long as the splitter puts the correct presentation timestamp on each frame.