mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
move some consts to kernel consts
This commit is contained in:
parent
073d900674
commit
736ec48c71
13 changed files with 46 additions and 35 deletions
|
@ -605,11 +605,11 @@ int SrsRtmpClient::play(string stream, int stream_id)
|
|||
// SetChunkSize
|
||||
if (true) {
|
||||
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
|
||||
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
|
||||
pkt->chunk_size = SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
|
||||
if ((ret = protocol->send_and_free_packet(pkt, 0)) != ERROR_SUCCESS) {
|
||||
srs_error("send set chunk size failed. "
|
||||
"stream=%s, chunk_size=%d, ret=%d",
|
||||
stream.c_str(), SRS_CONF_DEFAULT_CHUNK_SIZE, ret);
|
||||
stream.c_str(), SRS_CONSTS_RTMP_SRS_CHUNK_SIZE, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -624,11 +624,11 @@ int SrsRtmpClient::publish(string stream, int stream_id)
|
|||
// SetChunkSize
|
||||
if (true) {
|
||||
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
|
||||
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
|
||||
pkt->chunk_size = SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
|
||||
if ((ret = protocol->send_and_free_packet(pkt, 0)) != ERROR_SUCCESS) {
|
||||
srs_error("send set chunk size failed. "
|
||||
"stream=%s, chunk_size=%d, ret=%d",
|
||||
stream.c_str(), SRS_CONF_DEFAULT_CHUNK_SIZE, ret);
|
||||
stream.c_str(), SRS_CONSTS_RTMP_SRS_CHUNK_SIZE, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_kernel_stream.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_kernel_consts.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -177,7 +178,6 @@ messages.
|
|||
* good for high-bit rate streaming. Chunk size is maintained
|
||||
* independently for each direction.
|
||||
*/
|
||||
#define RTMP_DEFAULT_CHUNK_SIZE 128
|
||||
#define RTMP_MIN_CHUNK_SIZE 128
|
||||
#define RTMP_MAX_CHUNK_SIZE 65536
|
||||
|
||||
|
@ -299,7 +299,7 @@ SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
|||
in_buffer = new SrsBuffer();
|
||||
skt = io;
|
||||
|
||||
in_chunk_size = out_chunk_size = RTMP_DEFAULT_CHUNK_SIZE;
|
||||
in_chunk_size = out_chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
SrsProtocol::~SrsProtocol()
|
||||
|
@ -3704,7 +3704,7 @@ int SrsAcknowledgementPacket::encode_packet(SrsStream* stream)
|
|||
|
||||
SrsSetChunkSizePacket::SrsSetChunkSizePacket()
|
||||
{
|
||||
chunk_size = RTMP_DEFAULT_CHUNK_SIZE;
|
||||
chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
SrsSetChunkSizePacket::~SrsSetChunkSizePacket()
|
||||
|
|
|
@ -49,7 +49,7 @@ void srs_discovery_tc_url(
|
|||
srs_info("discovery host=%s", host.c_str());
|
||||
}
|
||||
|
||||
port = RTMP_DEFAULT_PORT;
|
||||
port = SRS_CONSTS_RTMP_DEFAULT_PORT;
|
||||
if ((pos = host.find(":")) != std::string::npos) {
|
||||
port = host.substr(pos + 1);
|
||||
host = host.substr(0, pos);
|
||||
|
@ -117,13 +117,13 @@ string srs_generate_tc_url(string ip, string vhost, string app, string port, str
|
|||
{
|
||||
string tcUrl = "rtmp://";
|
||||
|
||||
if (vhost == RTMP_VHOST_DEFAULT) {
|
||||
if (vhost == SRS_CONSTS_RTMP_DEFAULT_VHOST) {
|
||||
tcUrl += ip;
|
||||
} else {
|
||||
tcUrl += vhost;
|
||||
}
|
||||
|
||||
if (port != RTMP_DEFAULT_PORT) {
|
||||
if (port != SRS_CONSTS_RTMP_DEFAULT_PORT) {
|
||||
tcUrl += ":";
|
||||
tcUrl += port;
|
||||
}
|
||||
|
|
|
@ -31,13 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <string>
|
||||
|
||||
// default vhost of rtmp
|
||||
#define RTMP_VHOST_DEFAULT "__defaultVhost__"
|
||||
// default port of rtmp
|
||||
#define RTMP_DEFAULT_PORT "1935"
|
||||
|
||||
// the default chunk size for system.
|
||||
#define SRS_CONF_DEFAULT_CHUNK_SIZE 60000
|
||||
#include <srs_kernel_consts.hpp>
|
||||
|
||||
/**
|
||||
* parse the tcUrl, output the schema, host, vhost, app and port.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue