您的位置:首页 > 其它

Miracast/RTSP

2016-12-25 13:49 357 查看
Miracast的WIFI-DIRECT,P2P阶段之后就开始进行RTSP阶段。
RTSP(Real Time Streaming Protocol)实时流传输协议,RTSP在体系结构上位于RTP和RTCP之上,它使用
          TCP或UDP完成数据传输。

总共有M1~M16共16个信令交互,我们常用用到其中的7个协商。

WFD设备应该发送并响应OPTIONS,SET_PARAMETER,GET_PARAMETER以及org.wfa.wfd1.0。
WFD sink应该能够发送SETUP,PLAY,PAUSE,TEARDOWN。
WFD source应该能够响应SETUP,PLAY,PAUSE,TEARDOWN。

WFD source利用“rtsp://localhost/wfd1.0”作为URI向WFD
sink发送request。
WFD sink用wfd-presentation-url值作为URI向WFD
source发送request。



RTSP流中WFD Capability协商



触发sink端发送RTSP request请求
下面是M1~M7的数据格式模板。

M1
request

(src->snk)

OPTIONS * RTSP/1.0
Date: Tue, 29 Fri 2014 02:41:24 +0000
Server: stagefright/1.2 (Linux;Android 4.4)
CSeq: 1
Require: org.wfa.wfd1.0

response

(snk->src)

RTSP/1.0 200 OK
CSeq: 1
Date: Fri, Jan 01 2014 09:02:37 GMT
Public: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER

M2
request

(snk->src)

OPTIONS * RTSP/1.0
CSeq: 2
Require: org.wfa.wfd1.0

response

(src->src)

RTSP/1.0 200 OK
Date: Tue, 29 Fri 2014 02:41:25 +0000
Server: stagefright/1.2 (Linux;Android 4.3)
CSeq: 2
Public: org.wfa.wfd1.0, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

M3
request

(src->snk)

GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Tue, 29 Fri 2014 02:41:25 +0000
Server: stagefright/1.2 (Linux;Android 4.3)
CSeq: 2
Content-Type: text/parameters
Content-Length: 83

wfd_content_protection
wfd_video_formats
wfd_audio_codecs
wfd_client_rtp_ports

response

(snk->src)

RTSP/1.0 200 OK
CSeq: 2
Content-Length: 124
Content-Type: text/parameters

wfd_audio_codecs: LPCM 00000003 00, AAC 00000007 00
wfd_video_formats: 00 00 02 02 0000FFFF 0FFFFFFF 00000FFF 00 0000 0000 01 none none
wfd_content_protection: none
wfd_client_rtp_ports: RTP/AVP/UDP;unicast 19990 0 mode=play

M4
request

(src->snk)

SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Tue, 29 Fri 2014 02:41:25 +0000
Server: stagefright/1.2 (Linux;Android 4.3)
CSeq: 3
Content-Type: text/parameters
Content-Length: 247
wfd_video_formats: 00 00 02 02 00000020 00000000 00000000 00 0000 0000 00 none none
wfd_audio_codecs: AAC 00000001 00
wfd_presentation_URL: rtsp://192.168.5.200/wfd1.0/streamid=0 none
wfd_client_rtp_ports: RTP/AVP/UDP;unicast 19990 0 mode=play

response

(snk->src)

RTSP/1.0 200 OK
CSeq: 3

M5
request

(src->snk)

SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Tue, 29 Fri 2014 02:41:25 +0000
Server: stagefright/1.2 (Linux;Android 4.3)
CSeq: 4
Content-Type: text/parameters
Content-Length: 27
wfd_trigger_method: SETUP

response

(snk->src)

RTSP/1.0 200 OK
CSeq: 4

M6
request

(snk->src)

SETUP rtsp://192.168.5.200/wfd1.0/streamid=0 RTSP/1.0
CSeq: 3
Transport: RTP/AVP/UDP;unicast;client_port=19990

response

(src->snk)

RTSP/1.0 200 OK
Date: Tue, 29 Fri 2014 02:41:25 +0000
Server: stagefright/1.2 (Linux;Android 4.3)
CSeq: 3
Session: 988982966;timeout=30
Transport: RTP/AVP/UDP;unicast;client_port=19990;server_port=22220

M7
request

(snk->src)

PLAY rtsp://10.82.24.140/wfd1.0/streamid=0 RTSP/1.0

CSeq: j+2

Session: 6B8B4567

RTSP/1.0 200 OK

response

(src->snk)

Date: Sun, Aug 21 2011 04:20:53 GMT

CSeq: j+2

这些只考虑了正常流程,并没有考虑到异常流程,以及一些的特殊的流程,对于这部分大家可以自己详读下Miracast的相关协议。

Microsoft Cursor,Intel Fast Cursor,UIBC这些流程暂时也没有在本文中提及,后面我们会以专题的形式来详细讲解。

     技术交流有兴趣请加:
     音视频技术交流群:308601278
     无线投屏技术交流群:582349005
     
     我司有成熟的视频会议/视频监控/视频调度/无线投屏盒子销售,也可做音视频及无线投屏相关产品和技术的定制化开发
     有需要可发邮件marketing@bijienetworks.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  miracst widi RTSP