Microsoft DirectX 9.0

Overview of the TV Ratings System

This topic applies to Windows XP Service Pack 1 only.

The Microsoft TV Ratings system provides a way for DirectShow programmers to access content ratings from a broadcast stream and use them to make decisions about whether or not to display the content. These ratings are mandatory on all US broadcast streams, and are contained in the extended data services (XDS) channel of line 21.

Microsoft provides the following filters for this system:

These filters host two objects that are provided by third-party developers:

The XDSToRat and EvalRat objects are both standard COM objects. The XDSToRat object exposes the IXDSToRat interface, and the EvalRat object exposes the IEvalRat interface.

Briefly, the TV Ratings system works as follows:

This architecture enables an application to create separate graphs for tuning and rendering, which is required when using the stream buffer engine. The tuning graph will contain the XDS Codec filter and the Encrypter/Tagger filter. The rendering graph will contain the Decrypter/Detagger filter.

Here is how the system works in more detail:

  1. The XDS Codec filter calls IXDSToRat::Init on the XDSToRat object, which sets the object to its initial state.
  2. The application uses the IDTFilter::put_BlockedRatingAttributes method on the Decrypter/Detagger filter to specify which ratings are permitted and which should be blocked. The Decrypter/Detagger filter passes this information to the EvalRat object. (For details, see Setting Allowable Viewing Levels.) This step can occur at any time.
  3. When the filter graph is running, the XDS Codec filter receives XDS packets from the line 21 stream. The XDS Codec filter sends the packets to the XDSRat object for parsing, two bytes at a time, by calling the IXDSToRat::ParseXDSBytePair method.
  4. If the XDSToRat object decodes a new rating, it returns this information and returns S_OK from the ParseXDSBytePair method. The XDS Codec stores the new rating and broadcasts a "new rating" event (EVENTID_XDSCodecNewXDSRating) to the entire filter graph, through the IBroadcastEvent interface.
  5. The Encrypter/Tagger filter listens for new rating events. Whenever it receives one, it gets the new rating from the XDS Codec filter. It uses this rating to tag the samples that it encrypts.
  6. The Decrypter/Detagger filter looks for ratings on the encrypted media samples. Whenever it finds a new rating, it broadcasts a "rating change" event (EVENTID_DTFilterRatingChange).
  7. The Decrypter/Detagger filter tests any new rating by calling IEvalRat::TestRating on the EvalRat object. If that rating is not allowed (by the permissions given in step 2), the Decrypter/Detagger filter blocks the stream and discards all samples, until the rating changes again.
  8. Whenever the Decrypter/Detagger filter blocks the stream, it broadcasts a "ratings block" event (EVENTID_DTFilterRatingsBlock). Whenever it unblocks the stream, it broadcasts a "ratings unblock" event (EVENTID_DTFilterRatingsUnBlock).
  9. If there is a discontinuity in the stream, such as a channel change, the XDS Codec filter calls IXDSToRat::Init again to reset the XDSToRat object. It also sets the current rating to "DontKnow" and broadcasts a "new rating" event (EVENTID_XDSCodecNewXDSRating).

The only actions the hosting application needs to take are: