在应答中, 我们重点关注SDP字段.在SDP中,我们看到了流媒体包含了2个资源(m行):audio和video,其中a行是m(media)的属性描述.在m行中,中间的数字为服务端推荐客户端接收的端口,如果服务端不想这样做,可以将port置为0.在sdp中,还有a=control字段,在rfc2326中,对其的解释如下:
The "a=control:" attribute is used to convey the control URL. This
attribute is used both for the session and media descriptions. If
used for individual media, it indicates the URL to be used for
controlling that particular media stream. If found at the session
level, the attribute indicates the URL for aggregate control.
Example:
a=control:rtsp://example.com/foo
This attribute may contain either relative and absolute URLs,
following the rules and conventions set out in RFC 1808 [25].
Implementations should look for a base URL in the following order:
1. The RTSP Content-Base field
2. The RTSP Content-Location field
3. The RTSP request URL
If this attribute contains only an asterisk (*), then the URL is
treated as if it were an empty embedded URL, and thus inherits the
entire base URL.
这里我们对集合控制(aggregate control)进行说明.当服务端支持集合控制,比如对一个音频视频流,它就不需要建立2个session,集合成一个session就ok,如果不支持就得分别建立2个session.我的理解a=control即是对媒体的标识:比如track1表示视频,track2表示音频.在后续的setup中可以看到这点.
通过SDP这些参数我们就可以知道流媒体的编码格式.