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-04-07 09:07:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eea2310b073c4d574558050012c4f533cbd8f6f3
eea2310b
1 parent
4a7378b7
refine consts
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
84 行增加
和
41 行删除
trunk/src/app/srs_app_encoder.cpp
trunk/src/app/srs_app_forward.cpp
trunk/src/app/srs_app_ingest.cpp
trunk/src/app/srs_app_ingest.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_server.cpp
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
trunk/src/app/srs_app_encoder.cpp
查看文件 @
eea2310
...
...
@@ -50,6 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// for example, libaacplus, aac, fdkaac
#define SRS_ENCODER_ACODEC "aac"
// when error, encoder sleep for a while and retry.
#define SRS_ENCODER_SLEEP_US (int64_t)(3*1000*1000LL)
// for encoder to detect the dead loop
static
std
::
vector
<
std
::
string
>
_transcoded_url
;
...
...
trunk/src/app/srs_app_forward.cpp
查看文件 @
eea2310
...
...
@@ -40,6 +40,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_protocol_utility.hpp>
#include <srs_protocol_rtmp.hpp>
// when error, forwarder sleep for a while and retry.
#define SRS_FORWARDER_SLEEP_US (int64_t)(3*1000*1000LL)
SrsForwarder
::
SrsForwarder
(
SrsSource
*
_source
)
{
source
=
_source
;
...
...
trunk/src/app/srs_app_ingest.cpp
查看文件 @
eea2310
...
...
@@ -25,4 +25,29 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef SRS_INGEST
#include <srs_kernel_error.hpp>
// when error, ingester sleep for a while and retry.
#define SRS_INGESTER_SLEEP_US (int64_t)(3*1000*1000LL)
SrsIngester
::
SrsIngester
()
{
pthread
=
new
SrsThread
(
this
,
SRS_INGESTER_SLEEP_US
);
}
SrsIngester
::~
SrsIngester
()
{
srs_freep
(
pthread
);
}
int
SrsIngester
::
cycle
()
{
int
ret
=
ERROR_SUCCESS
;
return
ret
;
}
void
SrsIngester
::
on_thread_stop
()
{
}
#endif
...
...
trunk/src/app/srs_app_ingest.hpp
查看文件 @
eea2310
...
...
@@ -31,5 +31,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef SRS_INGEST
#include <srs_app_thread.hpp>
class
SrsIngester
:
public
ISrsThreadHandler
{
private
:
SrsThread
*
pthread
;
public
:
SrsIngester
();
virtual
~
SrsIngester
();
// interface ISrsThreadHandler.
public:
virtual
int
cycle
();
virtual
void
on_thread_stop
();
};
#endif
#endif
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
eea2310
...
...
@@ -43,6 +43,23 @@ using namespace std;
#include <srs_app_socket.hpp>
#include <srs_app_http_hooks.hpp>
// when stream is busy, for example, streaming is already
// publishing, when a new client to request to publish,
// sleep a while and close the connection.
#define SRS_STREAM_BUSY_SLEEP_US (int64_t)(3*1000*1000LL)
// the timeout to wait encoder to republish
// if timeout, close the connection.
#define SRS_REPUBLISH_SEND_TIMEOUT_US (int64_t)(3*60*1000*1000LL)
// if timeout, close the connection.
#define SRS_REPUBLISH_RECV_TIMEOUT_US (int64_t)(3*60*1000*1000LL)
// the timeout to wait client data, when client paused
// if timeout, close the connection.
#define SRS_PAUSED_SEND_TIMEOUT_US (int64_t)(30*60*1000*1000LL)
// if timeout, close the connection.
#define SRS_PAUSED_RECV_TIMEOUT_US (int64_t)(30*60*1000*1000LL)
SrsRtmpConn
::
SrsRtmpConn
(
SrsServer
*
srs_server
,
st_netfd_t
client_stfd
)
:
SrsConnection
(
srs_server
,
client_stfd
)
{
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
eea2310
...
...
@@ -41,6 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_api.hpp>
#include <srs_app_http_conn.hpp>
#include <srs_app_http.hpp>
#ifdef SRS_INGEST
#include <srs_app_ingest.hpp>
#endif
#define SERVER_LISTEN_BACKLOG 512
#define SRS_TIME_RESOLUTION_MS 500
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
查看文件 @
eea2310
...
...
@@ -33,6 +33,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using
namespace
std
;
// when got a messae header, there must be some data,
// increase recv timeout to got an entire message.
#define SRS_MIN_RECV_TIMEOUT_US (int64_t)(60*1000*1000LL)
/****************************************************************************
*****************************************************************************
****************************************************************************/
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
查看文件 @
eea2310
...
...
@@ -35,19 +35,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
class
ISrsProtocolReaderWriter
;
class
SrsBuffer
;
class
SrsPacket
;
class
SrsStream
;
class
SrsCommonMessage
;
class
SrsChunkStream
;
class
SrsAmf0Object
;
class
SrsAmf0Any
;
class
ISrsMessage
;
// the following is the timeout for rtmp protocol,
// to avoid death connection.
// when got a messae header, there must be some data,
// increase recv timeout to got an entire message.
#define SRS_MIN_RECV_TIMEOUT_US (int64_t)(60*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)
// the timeout to wait client data,
// if timeout, close the connection.
#define SRS_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL)
...
...
@@ -56,38 +57,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// if timeout, close the connection.
#define SRS_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL)
// the timeout to wait client data, when client paused
// if timeout, close the connection.
#define SRS_PAUSED_SEND_TIMEOUT_US (int64_t)(30*60*1000*1000LL)
// if timeout, close the connection.
#define SRS_PAUSED_RECV_TIMEOUT_US (int64_t)(30*60*1000*1000LL)
// the timeout to wait encoder to republish
// if timeout, close the connection.
#define SRS_REPUBLISH_SEND_TIMEOUT_US (int64_t)(3*60*1000*1000LL)
// if timeout, close the connection.
#define SRS_REPUBLISH_RECV_TIMEOUT_US (int64_t)(3*60*1000*1000LL)
// when stream is busy, for example, streaming is already
// publishing, when a new client to request to publish,
// sleep a while and close the connection.
#define SRS_STREAM_BUSY_SLEEP_US (int64_t)(3*1000*1000LL)
// when error, forwarder sleep for a while and retry.
#define SRS_FORWARDER_SLEEP_US (int64_t)(3*1000*1000LL)
// when error, encoder sleep for a while and retry.
#define SRS_ENCODER_SLEEP_US (int64_t)(3*1000*1000LL)
class
ISrsProtocolReaderWriter
;
class
SrsBuffer
;
class
SrsPacket
;
class
SrsStream
;
class
SrsCommonMessage
;
class
SrsChunkStream
;
class
SrsAmf0Object
;
class
SrsAmf0Any
;
class
ISrsMessage
;
// 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)
// convert class name to string.
#define CLASS_NAME_STRING(className) #className
...
...
请
注册
或
登录
后发表评论