The death of IMpeg2Data and the false start of IPSITables


In the Windows Vista-era, I wrote a DVB-T program. Apart from letting you view TV, it read and parsed DVB-SI. With the removal of Media Centre in Windows 10, I recently tried to get it working again but quickly hit a fairly major snag.

I was using the IMpeg2Data interface to retrieve DVB-SI. In particular, the IMpeg2Data::GetTable and IMpeg2Data::GetStreamOfSections methods.

However, you'll note that Microsoft state:
[IMpeg2Data is no longer available for use as of Windows 7. Instead, use the IPSITables interface to get program specific information (PSI) tables from an MPEG-2 transport stream.]
Fine, the API has been replaced, it should be straightforward to use the new one. Except, it is very poorly documented, and the documentation that is there does not make sense.

Let's have a look at the documentation for the parameters of the only method that the new interface has, IPSITables::GetTable:
dwTSID [in]
Transport stream identifier (TSID) for the table that is retrieved (bytes 0 - 15) and the original network ID (ONID) for an Event Information Table (EIT) that is retrieved (bytes 16 - 31).
dwTID_PID [in]
Table identifier (TID) or the program ID (PID) that identifies the transport stream packet.
dwHashedVer [in]
Hash value that identifies the table contents.
dwPara4 [in]
PID for a Program Mapping Table or the service ID (SID) for an EIT. Otherwise, not used.
ppIUnknown [out]
Pointer to the IUnknown interface for the table object that is retrieved. The caller is responsible for freeing the memory.
How many things are wrong with it?
  • Can a DWORD store 32 bytes now?
  • Is a PID is a program ID now rather than a packet identifier?
  • What the hell the hash value (or hashed version as suggested by the name of the parameter) – the word hash comes up in neither ISO/IEC 13818-1 nor ETSI EN 300 468. CRC32 does – but how on earth would you know the checksum of the table you are trying to retrieve?
  • When do you put the TID in dwTID_PID and when do you put the PID? If you put the PID there, where do you put the TID?
  • What do you put in bits 16 – 31 of dwTSID when it's not an EIT?
  • What do you do if you don't know the TSID?
  • And even if you manage to work all that out, you get a pointer to an IUnknown interface, with no information on what interfaces it actually implements!
As for IMpeg2Data::GetStreamOfSections, there doesn't appear to even be a replacement.

The old IMpeg2Data method was reasonably well-documented and more importantly the method parameters actually made sense.

I wondered what Microsoft actually meant by IMpeg2Data is no longer available for use as of Windows 7. I noticed that the filter and interface are still present. Alas, my experience of what they mean is that IMpeg2Data::GetTable times out and returns EVENT_E_INTERNALERROR, while IMpeg2Data::GetStreamOfSections returns S_OK but no data ever arrives. It is bizarre as it suggests the method implementations are still in place.

In any case, I'm pretty sure my TV app will never work again. Never mind...