From 402d5f83e549d7f79194289bd32e013da11ee7e1 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Thu, 26 Mar 2020 10:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=85=A8=E9=83=A8=E8=BD=AC=E6=8D=A2rt?= =?UTF-8?q?sp=E6=88=96rtmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_pusher.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_pusher.cpp b/tests/test_pusher.cpp index d51aeadb..511f039a 100644 --- a/tests/test_pusher.cpp +++ b/tests/test_pusher.cpp @@ -90,7 +90,15 @@ int domain(const string &playUrl, const string &pushUrl) { //拉一个流,生成一个RtmpMediaSource,源的名称是"app/stream" //你也可以以其他方式生成RtmpMediaSource,比如说MP4文件(请查看test_rtmpPusherMp4.cpp代码) - PlayerProxy::Ptr player(new PlayerProxy(DEFAULT_VHOST, "app", "stream",true,true,false,false,-1 , poller)); + MediaInfo info(pushUrl); + bool enable_rtsp = true; + bool enable_rtmp = true; + if(info._schema == RTSP_SCHEMA){ + enable_rtmp = false; + }else if(info._schema == RTMP_SCHEMA){ + enable_rtsp = false; + } + PlayerProxy::Ptr player(new PlayerProxy(DEFAULT_VHOST, "app", "stream",enable_rtsp,enable_rtmp,false,false,-1 , poller)); //可以指定rtsp拉流方式,支持tcp和udp方式,默认tcp // (*player)[Client::kRtpType] = Rtsp::RTP_UDP; player->play(playUrl.data());