1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge develop

This commit is contained in:
winlin 2020-02-16 13:32:46 +08:00
commit 4e995a85d0
7 changed files with 43 additions and 13 deletions

View file

@ -262,6 +262,13 @@ srt_server {
enabled on;
# The UDP listen port for SRT.
listen 10080;
# For detail parameters, please read wiki:
# https://github.com/ossrs/srs/wiki/v4_CN_SRTParams
# https://github.com/ossrs/srs/wiki/v4_EN_SRTParams
maxbw 1000000000;
connect_timeout 4000;
peerlatency 300;
recvlatency 300;
}
#############################################################################################

View file

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION3_HPP
#define SRS_CORE_VERSION3_HPP
#define SRS_VERSION3_REVISION 116
#define SRS_VERSION3_REVISION 117
#endif

View file

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION4_HPP
#define SRS_CORE_VERSION4_HPP
#define SRS_VERSION4_REVISION 3
#define SRS_VERSION4_REVISION 4
#endif

View file

@ -1105,6 +1105,7 @@ extern void srs_hijack_io_destroy(srs_hijack_io_t ctx);
* create socket, not connect yet.
* @param owner, the rtmp context which create this socket.
* @return 0, success; otherswise, failed.
* TODO: FIXME: Incompatible API for https://github.com/ossrs/srs/blob/2.0release/trunk/src/libs/srs_librtmp.hpp#L989
*/
extern int srs_hijack_io_create_socket(srs_hijack_io_t ctx, srs_rtmp_t owner);
/**
@ -1156,6 +1157,7 @@ extern int srs_hijack_io_writev(srs_hijack_io_t ctx, const iovec *iov, int iov_s
/**
* whether the timeout is never timeout in ms.
* @return 0, with timeout specified; otherwise, never timeout.
* TODO: FIXME: Incompatible API for https://github.com/ossrs/srs/blob/2.0release/trunk/src/libs/srs_librtmp.hpp#L1039
*/
extern int srs_hijack_io_is_never_timeout(srs_hijack_io_t ctx, int64_t tm);
/**

View file

@ -4,6 +4,7 @@
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_buffer.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_app_rtmp_conn.hpp>
#include <srs_app_config.hpp>
#include <srs_kernel_stream.hpp>
@ -207,11 +208,22 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
}
char url_sz[128];
std::vector<std::string> ip_ports = _srs_config->get_listens();
int port = 0;
std::string ip;
for (auto item : ip_ports) {
srs_parse_endpoint(item, ip, port);
if (port != 0) {
break;
}
}
port = (port == 0) ? 1935 : port;
if (_vhost == DEF_VHOST) {
sprintf(url_sz, "rtmp://127.0.0.1/%s/%s",
sprintf(url_sz, "rtmp://127.0.0.1:%d/%s/%s", port,
_appname.c_str(), _streamname.c_str());
} else {
sprintf(url_sz, "rtmp://127.0.0.1/%s?vhost=%s/%s",
sprintf(url_sz, "rtmp://127.0.0.1:%d/%s?vhost=%s/%s", port,
_appname.c_str(), _vhost.c_str(), _streamname.c_str());
}