2010-12-16, 19:25
the windows support is very straight forward since you are packetizing already. it is a few different calls to set up the audio device with the proper clocking data for hdmi, that is all.
getting the right stream info is a bigger problem. ffmpeg does not have a DTS-HD codec type and doesn't know how to probe. i think patching ffmpeg to cover both of these is probably the right call. otherwise you are always dealing with the wrong data from the demuxer. it also saves you a lot of runtime detection logic down the road (where you have to save off DTS frames for a while until you get a DTS-HD frame so you can decide how to bitstream, etc.)
note that there is no rule that the dts and dts-hd packets come in pairs at the start of the stream (i have seen some where we get 4-5 dts packets before seeing a dts-hd one).
you do need to check for dts-hd streams if you are decoding dts in software, otherwise it's a huge perf penalty of trying to sync dts on every byte of the hd frame. you also need to check if you are bitstreaming just the dts-core track (either over spdif or hdmi) and peel off the hd frames in that scenario too.
parsing the dts-hd frame is pretty simple - 10 lines of code to check the syncword and calculate the frame size.
getting the right stream info is a bigger problem. ffmpeg does not have a DTS-HD codec type and doesn't know how to probe. i think patching ffmpeg to cover both of these is probably the right call. otherwise you are always dealing with the wrong data from the demuxer. it also saves you a lot of runtime detection logic down the road (where you have to save off DTS frames for a while until you get a DTS-HD frame so you can decide how to bitstream, etc.)
note that there is no rule that the dts and dts-hd packets come in pairs at the start of the stream (i have seen some where we get 4-5 dts packets before seeing a dts-hd one).
you do need to check for dts-hd streams if you are decoding dts in software, otherwise it's a huge perf penalty of trying to sync dts on every byte of the hd frame. you also need to check if you are bitstreaming just the dts-core track (either over spdif or hdmi) and peel off the hd frames in that scenario too.
parsing the dts-hd frame is pretty simple - 10 lines of code to check the syncword and calculate the frame size.