2.1.1.5.6 Terminating a Session

When the receiver determines that it no longer requires an open media session for the current content selection, it can terminate the session. During session termination, the receiver notifies the transmitter that the content is no longer needed and that the transmitter SHOULD free any resources associated with the media session. After a media session is closed, any further AAVT extension MTP operation requests that use the SessionID corresponding to the closed session will return an error within the range of errors defined for MTP operation responses in [MTP].

Session Termination (CloseMediaSession - operation 0x9171)

To terminate a session, the receiver issues a CloseMediaSession operation request (as defined by the AAVT extension to MTP), passing the MediaSessionID returned during the OpenMediaSession operation as the first parameter. The following diagram illustrates the sequence of operations for terminating a session.

Terminating a Session Operation Sequence

Figure 2: Terminating a Session Operation Sequence

When the transmitter receives the CloseMediaSession operation request, it can free any resources allocated for the media session. The transmitter SHOULD then return the result of the operation in the response message.