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-26 12:22:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b17c736f3f67ddb0db10d69c7935ec6d35c8c957
b17c736f
1 parent
50cd1d23
fix #124, gop cache support disable video in publishing. 0.9.171.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
34 行增加
和
2 行删除
README.md
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.hpp
trunk/src/core/srs_core.hpp
README.md
查看文件 @
b17c736
...
...
@@ -209,7 +209,8 @@ Supported operating systems and hardware:
*
2013-10-17, Created.
<br/>
## History
*
v1.0, 2014-07-19, fix
[
#121
](
https://github.com/winlinvip/simple-rtmp-server/issues/121
)
, srs_info detail log compile failed. 0.9.168.
*
v1.0, 2014-07-26, fix
[
#124
](
https://github.com/winlinvip/simple-rtmp-server/issues/124
)
, gop cache support disable video in publishing. 0.9.171.
*
v1.0, 2014-07-23, fix
[
#121
](
https://github.com/winlinvip/simple-rtmp-server/issues/121
)
, srs_info detail log compile failed. 0.9.168.
*
v1.0, 2014-07-19, fix
[
#119
](
https://github.com/winlinvip/simple-rtmp-server/issues/119
)
, use iformat and oformat for ffmpeg transcode. 0.9.163.
*
<strong>
v1.0, 2014-07-13,
[
1.0 mainline6(0.9.160)
](
https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.mainline8
)
released. 50029 lines.
</strong>
*
v1.0, 2014-07-13, refine the bandwidth check/test, add as/js library, use srs-librtmp for linux tool. 0.9.159
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
b17c736
...
...
@@ -46,6 +46,10 @@ using namespace std;
#define CONST_MAX_JITTER_MS 500
#define DEFAULT_FRAME_TIME_MS 40
// for 26ms per audio packet,
// 115 packets is 3s.
#define __SRS_PURE_AUDIO_GUESS_COUNT 115
int
_srs_time_jitter_string2int
(
std
::
string
time_jitter
)
{
if
(
time_jitter
==
"full"
)
{
...
...
@@ -351,6 +355,7 @@ SrsGopCache::SrsGopCache()
{
cached_video_count
=
0
;
enable_gop_cache
=
true
;
audio_count_after_last_video
=
0
;
}
SrsGopCache
::~
SrsGopCache
()
...
...
@@ -383,6 +388,7 @@ int SrsGopCache::cache(SrsSharedPtrMessage* msg)
// got video, update the video count if acceptable
if
(
msg
->
header
.
is_video
())
{
cached_video_count
++
;
audio_count_after_last_video
=
0
;
}
// no acceptable video or pure audio, disable the cache.
...
...
@@ -391,6 +397,18 @@ int SrsGopCache::cache(SrsSharedPtrMessage* msg)
return
ret
;
}
// ok, gop cache enabled, and got an audio.
if
(
msg
->
header
.
is_audio
())
{
audio_count_after_last_video
++
;
}
// clear gop cache when pure audio count overflow
if
(
audio_count_after_last_video
>
__SRS_PURE_AUDIO_GUESS_COUNT
)
{
srs_warn
(
"clear gop cache for guess pure audio overflow"
);
clear
();
return
ret
;
}
// clear gop cache when got key frame
if
(
msg
->
header
.
is_video
()
&&
SrsFlvCodec
::
video_is_keyframe
(
msg
->
payload
,
msg
->
size
))
{
srs_info
(
"clear gop cache when got keyframe. vcount=%d, count=%d"
,
...
...
trunk/src/app/srs_app_source.hpp
查看文件 @
b17c736
...
...
@@ -213,6 +213,19 @@ private:
*/
int
cached_video_count
;
/**
* when user disabled video when publishing, and gop cache enalbed,
* we will cache the audio/video for we already got video, but we never
* know when to clear the gop cache, for there is no video in future,
* so we must guess whether user disabled the video.
* when we got some audios after laster video, for instance, 600 audio packets,
* about 3s(26ms per packet) 115 audio packets, clear gop cache.
*
* @remark, it is ok for performance, for when we clear the gop cache,
* gop cache is disabled for pure audio stream.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/124
*/
int
audio_count_after_last_video
;
/**
* cached gop.
*/
std
::
vector
<
SrsSharedPtrMessage
*>
gop_cache
;
...
...
trunk/src/core/srs_core.hpp
查看文件 @
b17c736
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "17
0
"
#define VERSION_REVISION "17
1
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
请
注册
或
登录
后发表评论