From 198a7f1e9d9de23b4aeadd4fb232664cb716c461 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 20 Jul 2014 13:25:25 +0800 Subject: [PATCH] refine the rtmp consts name --- trunk/src/app/srs_app_edge.cpp | 10 +++++----- trunk/src/app/srs_app_forward.cpp | 6 +++--- trunk/src/app/srs_app_rtmp_conn.cpp | 14 +++++++------- trunk/src/kernel/srs_kernel_consts.hpp | 10 +++++----- trunk/src/rtmp/srs_protocol_stack.hpp | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 85f691367..311886c1a 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -122,8 +122,8 @@ int SrsEdgeIngester::cycle() } srs_assert(client); - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); - client->set_send_timeout(SRS_SEND_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); SrsRequest* req = _req; @@ -368,8 +368,8 @@ int SrsEdgeForwarder::start() } srs_assert(client); - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); - client->set_send_timeout(SRS_SEND_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); SrsRequest* req = _req; @@ -411,7 +411,7 @@ int SrsEdgeForwarder::cycle() { int ret = ERROR_SUCCESS; - client->set_recv_timeout(SRS_PULSE_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); SrsPithyPrint pithy_print(SRS_STAGE_EDGE); diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index ea59888b3..006c59714 100644 --- a/trunk/src/app/srs_app_forward.cpp +++ b/trunk/src/app/srs_app_forward.cpp @@ -208,8 +208,8 @@ int SrsForwarder::cycle() } srs_assert(client); - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); - client->set_send_timeout(SRS_SEND_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); if ((ret = client->handshake()) != ERROR_SUCCESS) { srs_error("handshake with server failed. ret=%d", ret); @@ -282,7 +282,7 @@ int SrsForwarder::forward() { int ret = ERROR_SUCCESS; - client->set_recv_timeout(SRS_PULSE_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); SrsPithyPrint pithy_print(SRS_STAGE_FORWARDER); diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 5119e83ad..bd5b3e017 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -115,8 +115,8 @@ int SrsRtmpConn::do_cycle() srs_trace("RTMP client ip=%s", ip.c_str()); - rtmp->set_recv_timeout(SRS_RECV_TIMEOUT_US); - rtmp->set_send_timeout(SRS_SEND_TIMEOUT_US); + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + rtmp->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); if ((ret = rtmp->handshake()) != ERROR_SUCCESS) { srs_error("rtmp handshake failed. ret=%d", ret); @@ -290,8 +290,8 @@ int SrsRtmpConn::stream_service_cycle() srs_client_type_string(type).c_str(), req->stream.c_str(), req->duration); // client is identified, set the timeout to service timeout. - rtmp->set_recv_timeout(SRS_RECV_TIMEOUT_US); - rtmp->set_send_timeout(SRS_SEND_TIMEOUT_US); + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + rtmp->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); // set chunk size to larger. int chunk_size = _srs_config->get_chunk_size(req->vhost); @@ -501,7 +501,7 @@ int SrsRtmpConn::playing(SrsSource* source) SrsAutoFree(SrsConsumer, consumer); srs_verbose("consumer created success."); - rtmp->set_recv_timeout(SRS_PULSE_TIMEOUT_US); + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); SrsPithyPrint pithy_print(SRS_STAGE_PLAY_USER); @@ -962,8 +962,8 @@ int SrsRtmpConn::do_token_traverse_auth(SrsSocket* io, SrsRtmpClient* client) srs_assert(client); - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); - client->set_send_timeout(SRS_SEND_TIMEOUT_US); + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); if ((ret = client->handshake()) != ERROR_SUCCESS) { srs_error("handshake with server failed. ret=%d", ret); diff --git a/trunk/src/kernel/srs_kernel_consts.hpp b/trunk/src/kernel/srs_kernel_consts.hpp index 62f2acf12..8136daa13 100644 --- a/trunk/src/kernel/srs_kernel_consts.hpp +++ b/trunk/src/kernel/srs_kernel_consts.hpp @@ -55,16 +55,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // the timeout to wait client data, // if timeout, close the connection. -#define SRS_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL) +#define SRS_CONSTS_RTMP_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL) // the timeout to send data to client, // if timeout, close the connection. -#define SRS_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) +#define SRS_CONSTS_RTMP_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) // the timeout to wait for client control message, // if timeout, we generally ignore and send the data to client, // generally, it's the pulse time for data seding. -#define SRS_PULSE_TIMEOUT_US (int64_t)(200*1000LL) +#define SRS_CONSTS_RTMP_PULSE_TIMEOUT_US (int64_t)(200*1000LL) /** * max rtmp header size: @@ -73,7 +73,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 4bytes timestamp header, * that is, 1+11+4=16bytes. */ -#define RTMP_MAX_FMT0_HEADER_SIZE 16 +#define SRS_CONSTS_RTMP_MAX_FMT0_HEADER_SIZE 16 /** * max rtmp header size: * 1bytes basic header, @@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * that is, 1+4=5bytes. */ // always use fmt0 as cache. -//#define RTMP_MAX_FMT3_HEADER_SIZE 5 +//#define SRS_CONSTS_RTMP_MAX_FMT3_HEADER_SIZE 5 /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// diff --git a/trunk/src/rtmp/srs_protocol_stack.hpp b/trunk/src/rtmp/srs_protocol_stack.hpp index 5271ea1b7..1edd551f9 100644 --- a/trunk/src/rtmp/srs_protocol_stack.hpp +++ b/trunk/src/rtmp/srs_protocol_stack.hpp @@ -100,7 +100,7 @@ private: * used for type0, 11bytes(or 15bytes with extended timestamp) header. * or for type3, 1bytes(or 5bytes with extended timestamp) header. */ - char out_header_cache[RTMP_MAX_FMT0_HEADER_SIZE]; + char out_header_cache[SRS_CONSTS_RTMP_MAX_FMT0_HEADER_SIZE]; /** * output chunk size, default to 128, set by config. */