Skip to content

Commit 261bebc

Browse files
committed
Support the publishing of RTP plaintext packets using WHIP. v5.0.155
1 parent a570169 commit 261bebc

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

trunk/doc/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The changelog for SRS.
88

99
## SRS 5.0 Changelog
1010

11+
* v5.0, 2023-05-14, Support the publishing of RTP plaintext packets using WHIP. v5.0.155
1112
* v5.0, 2023-05-13, Merge [#3541](https://github.com/ossrs/srs/pull/3541): asan: Fix memory leak in asan by releasing global IPs when run_directly_or_daemon fails. v5.0.154 (#3541)
1213
* v5.0, 2023-05-12, Merge [#3539](https://github.com/ossrs/srs/pull/3539): WHIP: Improve HTTP DELETE for notifying server unpublish event. v5.0.153 (#3539)
1314
* v5.0, 2023-03-27, Merge [#3450](https://github.com/ossrs/srs/pull/3450): WebRTC: Error message carries the SDP when failed. v5.0.151 (#3450)

trunk/research/players/js/srs.page.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function user_extra_params(query, params, rtc) {
3535
|| key === 'http_port' || key === 'pathname' || key === 'port'
3636
|| key === 'server' || key === 'stream' || key === 'buffer'
3737
|| key === 'schema' || key === 'vhost' || key === 'api'
38+
|| key === 'path'
3839
) {
3940
continue;
4041
}
@@ -123,12 +124,14 @@ function build_default_whip_whep_url(query, apiPath) {
123124
console.log('?eip=x.x.x.x to overwrite candidate. 覆盖服务器candidate(外网IP)配置');
124125
console.log('?api=x to overwrite WebRTC API(1985).');
125126
console.log('?schema=http|https to overwrite WebRTC API protocol.');
127+
console.log(`?path=xxx to overwrite default ${apiPath}`);
126128

127129
var server = (!query.server)? window.location.hostname:query.server;
128130
var vhost = (!query.vhost)? window.location.hostname:query.vhost;
129131
var app = (!query.app)? "live":query.app;
130132
var stream = (!query.stream)? "livestream":query.stream;
131133
var api = ':' + (query.api || (window.location.protocol === 'http:' ? '1985' : '1990'));
134+
const realApiPath = query.path || apiPath;
132135

133136
var queries = [];
134137
if (server !== vhost && vhost !== "__defaultVhost__") {
@@ -139,7 +142,7 @@ function build_default_whip_whep_url(query, apiPath) {
139142
}
140143
queries = user_extra_params(query, queries, true);
141144

142-
var uri = window.location.protocol + "//" + server + api + apiPath + "?app=" + app + "&stream=" + stream + "&" + queries.join('&');
145+
var uri = window.location.protocol + "//" + server + api + realApiPath + "?app=" + app + "&stream=" + stream + "&" + queries.join('&');
143146
while (uri.lastIndexOf("?") === uri.length - 1) {
144147
uri = uri.slice(0, uri.length - 1);
145148
}

trunk/src/app/srs_app_rtc_conn.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ srs_error_t SrsSemiSecurityTransport::protect_rtcp(void* packet, int* nb_cipher)
217217
return srs_success;
218218
}
219219

220+
srs_error_t SrsSemiSecurityTransport::unprotect_rtp(void* packet, int* nb_plaintext)
221+
{
222+
return srs_success;
223+
}
224+
225+
srs_error_t SrsSemiSecurityTransport::unprotect_rtcp(void* packet, int* nb_plaintext)
226+
{
227+
return srs_success;
228+
}
229+
220230
SrsPlaintextTransport::SrsPlaintextTransport(ISrsRtcNetwork* s)
221231
{
222232
network_ = s;

trunk/src/app/srs_app_rtc_conn.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class SrsSemiSecurityTransport : public SrsSecurityTransport
134134
public:
135135
srs_error_t protect_rtp(void* packet, int* nb_cipher);
136136
srs_error_t protect_rtcp(void* packet, int* nb_cipher);
137+
srs_error_t unprotect_rtp(void* packet, int* nb_plaintext);
138+
srs_error_t unprotect_rtcp(void* packet, int* nb_plaintext);
137139
};
138140

139141
// Plaintext transport, without DTLS or SRTP.

trunk/src/core/srs_core_version5.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 5
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 154
12+
#define VERSION_REVISION 155
1313

1414
#endif

0 commit comments

Comments
 (0)