[This is preliminary documentation and subject to change.]
RTP Receive Payload Handler exposes a single input pin and a single output pin. The input pin of this filter is of type MEDIATYPE_RTP_Single_Stream/MEDIASUBTYPE_RTP_Payload_XXXX. The output pin of this filter is the corresponding DirectShow media type. Thus, this filter could expose an input pin of major type MEDIATYPE_RTP_Single_Stream, minor type MEDIASUBTYPE_RTP_Payload_H261, while its output pin would be MEDIATYPE_Video, MEDIASUBTYPE_H261. This filter is responsible for reordering and reassembling RTP packets into multimedia buffers.
The RTP RPH filter also places a valid DirectShow timestamp on the buffers based on the RTP and NTP timestamps for this stream. In the absence of sufficient information to generate a valid timestamp (for example., prior to receiving an RTCP sender report (SR) for the stream in question), the samples timestamp is the current value of the DirectShow clock, resulting in immediate rendering.
This filter also may be used to maintain an application-controlled queue of packets, which can buffer for network jitter.
To support hierarchical encodings, the output of the RPH filter must be modified. In particular, band merging cannot be accomplished without proper synchronization of samples from different bands. After a sender report (SR) has been received for any particular band, the corresponding unique DirectShow time can be determined from the RTP timestamp and the NTP time in the report. However, sender reports are carried through unreliable means (typically UDP) and typically arrive several seconds after reception of a stream commences. Rather than wait for SR arrival to occur for all bands in a hierarchically encoded stream, the RPH filter passes RTP timestamp data to the band merging filter. This information is delivered in the DirectShow start timestamp of the associated media sample. After NTP timestamps are received through a RTCP sender report, the associated NTP value is placed in the end timestamp of the media sample. The band merging filter uses the RTP timestamp information to synchronize samples and then timestamps them for immediate playback. When NTP information is available, timestamps are done according to wall clock time, allowing audio/video synchronization. Activating delivery of RTP and NTP timestamps rather than DirectShow timestamps is done with an application interface into the RPH. This interface is intended to be used by a hierarchical encoding manager component, which would also be responsible for connecting the correct PPM to the correct band input pin of a merger filter.