winlin

chunk size default to 60000, high performance. set chunk size when forward

... ... @@ -4,8 +4,8 @@ listen 1935;
# some client does not support chunk size change,
# however, most clients supports it and it can improve
# performance about 10%.
# default: 4096
chunk_size 65000;
# default: 60000
chunk_size 60000;
# the logs dir.
# if enabled ffmpeg, each stracoding stream will create a log file.
# default: ./objs/logs
... ... @@ -26,7 +26,7 @@ vhost __defaultVhost__ {
# for which cannot identify the required vhost.
# for default demo.
vhost demo.srs.com {
chunk_size 4096;
chunk_size 60000;
enabled on;
gop_cache on;
queue_length 30;
... ...
... ... @@ -57,7 +57,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// the interval in seconds for bandwidth check
#define SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS 1000
#define SRS_CONF_DEFAULT_CHUNK_SIZE 4096
// the default chunk size for system.
#define SRS_CONF_DEFAULT_CHUNK_SIZE 60000
#define SRS_STAGE_PLAY_USER_INTERVAL_MS 1300
#define SRS_STAGE_PUBLISH_USER_INTERVAL_MS 1100
... ...
... ... @@ -391,12 +391,44 @@ int SrsRtmpClient::play(string stream, int stream_id)
}
}
// SetChunkSize
if (true) {
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
msg->set_packet(pkt, 0);
if ((ret = protocol->send_message(msg)) != 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);
return ret;
}
}
return ret;
}
int SrsRtmpClient::publish(string stream, int stream_id)
{
int ret = ERROR_SUCCESS;
// SetChunkSize
if (true) {
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
msg->set_packet(pkt, 0);
if ((ret = protocol->send_message(msg)) != 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);
return ret;
}
}
// publish(stream)
if (true) {
... ...