Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-07-20 13:23:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9f7f1ecfeba730899c61d5ccef63d2dd92c6aa1
a9f7f1ec
1 parent
baa20b2f
refine the consts to kernel consts
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
88 行增加
和
61 行删除
trunk/src/app/srs_app_edge.cpp
trunk/src/app/srs_app_encoder.cpp
trunk/src/app/srs_app_forward.cpp
trunk/src/app/srs_app_hls.cpp
trunk/src/app/srs_app_ingest.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/kernel/srs_kernel_consts.hpp
trunk/src/kernel/srs_kernel_log.hpp
trunk/src/rtmp/srs_protocol_stack.hpp
trunk/src/app/srs_app_edge.cpp
查看文件 @
a9f7f1e
...
...
@@ -181,7 +181,7 @@ int SrsEdgeIngester::ingest()
// pithy print
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"<- "
SRS_
LOG_ID
_EDGE_PLAY
srs_trace
(
"<- "
SRS_
CONSTS_LOG
_EDGE_PLAY
" time=%"
PRId64
", okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
...
...
@@ -453,7 +453,7 @@ int SrsEdgeForwarder::cycle()
// pithy print
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"-> "
SRS_
LOG_ID
_EDGE_PUBLISH
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_EDGE_PUBLISH
" time=%"
PRId64
", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
count
,
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
...
...
trunk/src/app/srs_app_encoder.cpp
查看文件 @
a9f7f1e
...
...
@@ -331,7 +331,7 @@ void SrsEncoder::encoder()
// reportable
if
(
pithy_print
->
can_print
())
{
// TODO: FIXME: show more info.
srs_trace
(
"-> "
SRS_
LOG_ID
_ENCODER
" time=%"
PRId64
", encoders=%d, input=%s"
,
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_ENCODER
" time=%"
PRId64
", encoders=%d, input=%s"
,
pithy_print
->
age
(),
(
int
)
ffmpegs
.
size
(),
input_stream_name
.
c_str
());
}
}
...
...
trunk/src/app/srs_app_forward.cpp
查看文件 @
a9f7f1e
...
...
@@ -318,7 +318,7 @@ int SrsForwarder::forward()
// pithy print
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"-> "
SRS_
LOG_ID
_FOWARDER
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_FOWARDER
" time=%"
PRId64
", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
count
,
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
...
...
trunk/src/app/srs_app_hls.cpp
查看文件 @
a9f7f1e
...
...
@@ -1521,7 +1521,7 @@ void SrsHls::hls_mux()
// the run time is not equals to stream time,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/81#issuecomment-48100994
// it's ok.
srs_trace
(
"-> "
SRS_
LOG_ID
_HLS
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_HLS
" time=%"
PRId64
", stream dts=%"
PRId64
"(%"
PRId64
"ms), sequence_no=%d"
,
pithy_print
->
age
(),
stream_dts
,
stream_dts
/
90
,
muxer
->
sequence_no
());
}
...
...
trunk/src/app/srs_app_ingest.cpp
查看文件 @
a9f7f1e
...
...
@@ -350,7 +350,7 @@ void SrsIngester::ingester()
// reportable
if
(
pithy_print
->
can_print
())
{
// TODO: FIXME: show more info.
srs_trace
(
"-> "
SRS_
LOG_ID
_INGESTER
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_INGESTER
" time=%"
PRId64
", ingesters=%d"
,
pithy_print
->
age
(),
(
int
)
ingesters
.
size
());
}
}
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
a9f7f1e
...
...
@@ -548,7 +548,7 @@ int SrsRtmpConn::playing(SrsSource* source)
// reportable
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"-> "
SRS_
LOG_ID
_PLAY
srs_trace
(
"-> "
SRS_
CONSTS_LOG
_PLAY
" time=%"
PRId64
", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
count
,
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
...
...
@@ -642,7 +642,7 @@ int SrsRtmpConn::fmle_publishing(SrsSource* source)
// reportable
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"<- "
SRS_
LOG_ID
_CLIENT_PUBLISH
srs_trace
(
"<- "
SRS_
CONSTS_LOG
_CLIENT_PUBLISH
" time=%"
PRId64
", okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
kbps
->
get_recv_kbps
(),
kbps
->
get_recv_kbps_30s
(),
kbps
->
get_recv_kbps_5m
());
...
...
@@ -723,7 +723,7 @@ int SrsRtmpConn::flash_publishing(SrsSource* source)
// reportable
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"<- "
SRS_
LOG_ID
_WEB_PUBLISH
srs_trace
(
"<- "
SRS_
CONSTS_LOG
_WEB_PUBLISH
" time=%"
PRId64
", okbps=%d,%d,%d, ikbps=%d,%d,%d"
,
pithy_print
.
age
(),
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
...
...
trunk/src/kernel/srs_kernel_consts.hpp
查看文件 @
a9f7f1e
...
...
@@ -31,6 +31,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// RTMP consts values
///////////////////////////////////////////////////////////
// default vhost of rtmp
...
...
@@ -42,6 +49,46 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_CONSTS_RTMP_SRS_CHUNK_SIZE 60000
// 6. Chunking, RTMP protocol default chunk size.
#define SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE 128
// the following is the timeout for rtmp protocol,
// to avoid death connection.
// the timeout to wait client data,
// if timeout, close the connection.
#define SRS_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)
// 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)
/**
* max rtmp header size:
* 1bytes basic header,
* 11bytes message header,
* 4bytes timestamp header,
* that is, 1+11+4=16bytes.
*/
#define RTMP_MAX_FMT0_HEADER_SIZE 16
/**
* max rtmp header size:
* 1bytes basic header,
* 4bytes timestamp header,
* that is, 1+4=5bytes.
*/
// always use fmt0 as cache.
//#define RTMP_MAX_FMT3_HEADER_SIZE 5
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// SRS consts values
...
...
@@ -49,5 +96,34 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_CONSTS_NULL_FILE "/dev/null"
#define SRS_CONSTS_LOCALHOST "127.0.0.1"
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// log consts values
///////////////////////////////////////////////////////////
// downloading speed-up, play to edge, ingest from origin
#define SRS_CONSTS_LOG_EDGE_PLAY "EIG"
// uploading speed-up, publish to edge, foward to origin
#define SRS_CONSTS_LOG_EDGE_PUBLISH "EFW"
// edge/origin forwarder.
#define SRS_CONSTS_LOG_FOWARDER "FWR"
// play stream on edge/origin.
#define SRS_CONSTS_LOG_PLAY "PLA"
// client publish to edge/origin
#define SRS_CONSTS_LOG_CLIENT_PUBLISH "CPB"
// web/flash publish to edge/origin
#define SRS_CONSTS_LOG_WEB_PUBLISH "WPB"
// ingester for edge(play)/origin
#define SRS_CONSTS_LOG_INGESTER "IGS"
// hls log id.
#define SRS_CONSTS_LOG_HLS "HLS"
// encoder log id.
#define SRS_CONSTS_LOG_ENCODER "ENC"
#endif
...
...
trunk/src/kernel/srs_kernel_log.hpp
查看文件 @
a9f7f1e
...
...
@@ -35,6 +35,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include <string.h>
#include <srs_kernel_consts.hpp>
/**
* the log level, for example:
* if specified Debug level, all level messages will be logged.
...
...
@@ -144,23 +146,4 @@ extern ISrsThreadContext* _srs_context;
#define srs_trace(msg, ...) (void)0
#endif
// downloading speed-up, play to edge, ingest from origin
#define SRS_LOG_ID_EDGE_PLAY "EIG"
// uploading speed-up, publish to edge, foward to origin
#define SRS_LOG_ID_EDGE_PUBLISH "EFW"
// edge/origin forwarder.
#define SRS_LOG_ID_FOWARDER "FWR"
// play stream on edge/origin.
#define SRS_LOG_ID_PLAY "PLA"
// client publish to edge/origin
#define SRS_LOG_ID_CLIENT_PUBLISH "CPB"
// web/flash publish to edge/origin
#define SRS_LOG_ID_WEB_PUBLISH "WPB"
// ingester for edge(play)/origin
#define SRS_LOG_ID_INGESTER "IGS"
// hls log id.
#define SRS_LOG_ID_HLS "HLS"
// encoder log id.
#define SRS_LOG_ID_ENCODER "ENC"
#endif
...
...
trunk/src/rtmp/srs_protocol_stack.hpp
查看文件 @
a9f7f1e
...
...
@@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_consts.hpp>
class
ISrsProtocolReaderWriter
;
class
SrsBuffer
;
...
...
@@ -45,39 +46,6 @@ class SrsAmf0Any;
class
SrsMessageHeader
;
class
SrsMessage
;
class
SrsChunkStream
;
// the following is the timeout for rtmp protocol,
// to avoid death connection.
// the timeout to wait client data,
// if timeout, close the connection.
#define SRS_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)
// 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)
/**
* max rtmp header size:
* 1bytes basic header,
* 11bytes message header,
* 4bytes timestamp header,
* that is, 1+11+4=16bytes.
*/
#define RTMP_MAX_FMT0_HEADER_SIZE 16
/**
* max rtmp header size:
* 1bytes basic header,
* 4bytes timestamp header,
* that is, 1+4=5bytes.
*/
// always use fmt0 as cache.
//#define RTMP_MAX_FMT3_HEADER_SIZE 5
/**
* the protocol provides the rtmp-message-protocol services,
...
...
请
注册
或
登录
后发表评论