The subscriber sends a SUBSCRIBE_TRACKS control message on a new bidirectional stream to a publisher to request PUBLISH messages for all tracks within matching namespaces, as well as future track publications within those namespaces.
SUBSCRIBE_TRACKS Message {
Type (vi64) = 0x51,
Length (16),
Request ID (vi64),
Track Namespace Prefix (..),
Number of Parameters (vi64),
Parameters (..) ...
}
-
Request ID: See Section 10.1.
-
Track Namespace Prefix: A Track Namespace structure as described in Section 2.4.1 with between 0 and 32 Track Namespace Fields. This prefix is matched against track namespaces known to the publisher. If an endpoint receives a Track Namespace Prefix consisting of greater than 32 Track Namespace Fields, it MUST close the session with a
PROTOCOL_VIOLATION. -
Parameters: The parameters are defined in Section 10.2.
The publisher will respond with REQUEST_OK or REQUEST_ERROR on the response half of the stream. If the subscriber receives any message other than a REQUEST_OK or a REQUEST_ERROR as the first message on the response half of the stream, then it MUST close the session with a PROTOCOL_VIOLATION. If the SUBSCRIBE_TRACKS is successful, the publisher will send PUBLISH messages on new bidirectional streams for tracks within matching namespaces. If it is an error, the stream will be closed via FIN after REQUEST_ERROR is sent.
Within a session, if a publisher receives a SUBSCRIBE_TRACKS with a
Track Namespace Prefix that shares a common prefix with an established
SUBSCRIBE_TRACKS, it MUST respond with REQUEST_ERROR with error code
PREFIX_OVERLAP. SUBSCRIBE_TRACKS and SUBSCRIBE_NAMESPACE have independent
overlap spaces (see Section 10.18).
The publisher MUST ensure the subscriber is authorized to perform this namespace subscription.
SUBSCRIBE_TRACKS is not required for a publisher to send PUBLISH messages to a subscriber. It is useful for subscribers that are only interested in or authorized to access a subset of available tracks.
If the FORWARD parameter (Section 10.2.12) is present in this message and equal to 0, PUBLISH messages resulting from this SUBSCRIBE_TRACKS will set the FORWARD parameter to 0. If the FORWARD parameter is equal to 1 or omitted from this message, PUBLISH messages resulting from this SUBSCRIBE_TRACKS will set the FORWARD parameter to 1, or indicate that value by omitting the parameter (see Section 5.1).