@@ -158,19 +158,25 @@ srs_error_t SrsGoApiRtcPlay::do_serve_http(ISrsHttpResponseWriter *w, ISrsHttpMe
158158 if (eip.empty ()) {
159159 eip = r->query_get (" candidate" );
160160 }
161- string codec = r->query_get (" codec" );
161+ // Support vcodec/codec (alias for vcodec) and acodec parameters
162+ string vcodec = r->query_get (" vcodec" );
163+ if (vcodec.empty ()) {
164+ vcodec = r->query_get (" codec" );
165+ }
166+ string acodec = r->query_get (" acodec" );
162167 // For client to specifies whether encrypt by SRTP.
163168 string srtp = r->query_get (" encrypt" );
164169 string dtls = r->query_get (" dtls" );
165170
166171 srs_trace (
167- " RTC play %s, api=%s, tid=%s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec =%s, srtp=%s, dtls=%s" ,
172+ " RTC play %s, api=%s, tid=%s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, vcodec=%s, acodec =%s, srtp=%s, dtls=%s" ,
168173 streamurl.c_str (), api.c_str (), tid.c_str (), clientip.c_str (), ruc.req_ ->app_ .c_str (),
169174 ruc.req_ ->stream_ .c_str (), remote_sdp_str.length (),
170- eip.c_str (), codec .c_str (), srtp.c_str (), dtls.c_str ());
175+ eip.c_str (), vcodec. c_str (), acodec .c_str (), srtp.c_str (), dtls.c_str ());
171176
172177 ruc.eip_ = eip;
173- ruc.codec_ = codec;
178+ ruc.vcodec_ = vcodec;
179+ ruc.acodec_ = acodec;
174180 ruc.publish_ = false ;
175181 ruc.dtls_ = (dtls != " false" );
176182
@@ -479,14 +485,20 @@ srs_error_t SrsGoApiRtcPublish::do_serve_http(ISrsHttpResponseWriter *w, ISrsHtt
479485 if (eip.empty ()) {
480486 eip = r->query_get (" candidate" );
481487 }
482- string codec = r->query_get (" codec" );
488+ // Support vcodec/codec (alias for vcodec) and acodec parameters
489+ string vcodec = r->query_get (" vcodec" );
490+ if (vcodec.empty ()) {
491+ vcodec = r->query_get (" codec" );
492+ }
493+ string acodec = r->query_get (" acodec" );
483494
484- srs_trace (" RTC publish %s, api=%s, tid=%s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec =%s" ,
495+ srs_trace (" RTC publish %s, api=%s, tid=%s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, vcodec=%s, acodec =%s" ,
485496 streamurl.c_str (), api.c_str (), tid.c_str (), clientip.c_str (), ruc.req_ ->app_ .c_str (), ruc.req_ ->stream_ .c_str (),
486- remote_sdp_str.length (), eip.c_str (), codec .c_str ());
497+ remote_sdp_str.length (), eip.c_str (), vcodec. c_str (), acodec .c_str ());
487498
488499 ruc.eip_ = eip;
489- ruc.codec_ = codec;
500+ ruc.vcodec_ = vcodec;
501+ ruc.acodec_ = acodec;
490502 ruc.publish_ = true ;
491503 ruc.dtls_ = ruc.srtp_ = true ;
492504
@@ -776,7 +788,12 @@ srs_error_t SrsGoApiRtcWhip::do_serve_http_with(ISrsHttpResponseWriter *w, ISrsH
776788 if (eip.empty ()) {
777789 eip = r->query_get (" candidate" );
778790 }
779- string codec = r->query_get (" codec" );
791+ // Support vcodec/codec (alias for vcodec) and acodec parameters
792+ string vcodec = r->query_get (" vcodec" );
793+ if (vcodec.empty ()) {
794+ vcodec = r->query_get (" codec" );
795+ }
796+ string acodec = r->query_get (" acodec" );
780797 string app = r->query_get (" app" );
781798 string stream = r->query_get (" stream" );
782799 string action = r->query_get (" action" );
@@ -815,13 +832,14 @@ srs_error_t SrsGoApiRtcWhip::do_serve_http_with(ISrsHttpResponseWriter *w, ISrsH
815832 string srtp = r->query_get (" encrypt" );
816833 string dtls = r->query_get (" dtls" );
817834
818- srs_trace (" RTC whip %s %s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec =%s, srtp=%s, dtls=%s, ufrag=%s, pwd=%s, param=%s" ,
835+ srs_trace (" RTC whip %s %s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, vcodec=%s, acodec =%s, srtp=%s, dtls=%s, ufrag=%s, pwd=%s, param=%s" ,
819836 action.c_str (), ruc->req_ ->get_stream_url ().c_str (), clientip.c_str (), ruc->req_ ->app_ .c_str (), ruc->req_ ->stream_ .c_str (),
820- remote_sdp_str.length (), eip.c_str (), codec .c_str (), srtp.c_str (), dtls.c_str (), ruc->req_ ->ice_ufrag_ .c_str (),
837+ remote_sdp_str.length (), eip.c_str (), vcodec. c_str (), acodec .c_str (), srtp.c_str (), dtls.c_str (), ruc->req_ ->ice_ufrag_ .c_str (),
821838 ruc->req_ ->ice_pwd_ .c_str (), ruc->req_ ->param_ .c_str ());
822839
823840 ruc->eip_ = eip;
824- ruc->codec_ = codec;
841+ ruc->vcodec_ = vcodec;
842+ ruc->acodec_ = acodec;
825843 ruc->publish_ = (action == " publish" );
826844
827845 // For client to specifies whether encrypt by SRTP.
0 commit comments