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-24 14:26:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b2767145735f2f65d1178d3e2002d0917f979fdc
b2767145
1 parent
35f3a932
support chnvideo hss streaming
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
13 行增加
和
4 行删除
trunk/src/app/srs_app_dvr.cpp
trunk/src/app/srs_app_http_hooks.cpp
trunk/src/app/srs_app_json.hpp
trunk/src/app/srs_app_dvr.cpp
查看文件 @
b276714
...
...
@@ -783,7 +783,7 @@ int SrsDvrHssPlan::update_duration(SrsSharedPtrMessage* msg)
// reap if exceed atc expect time.
if
(
segment
->
stream_starttime
+
segment
->
stream_duration
>
expect_reap_time
)
{
srs_
warn
(
"hss reap start=%"
PRId64
", duration=%"
PRId64
", expect=%"
PRId64
srs_
verbose
(
"hss reap start=%"
PRId64
", duration=%"
PRId64
", expect=%"
PRId64
", segment(start=%"
PRId64
", adjust=%"
PRId64
", duration=%"
PRId64
", file=%s"
,
segment
->
stream_starttime
,
segment
->
stream_duration
,
expect_reap_time
,
segment
->
stream_starttime
+
segment
->
starttime
,
...
...
trunk/src/app/srs_app_http_hooks.cpp
查看文件 @
b276714
...
...
@@ -37,6 +37,7 @@ using namespace std;
#include <srs_app_http.hpp>
#include <srs_app_json.hpp>
#include <srs_app_dvr.hpp>
#include <srs_app_config.hpp>
#define SRS_HTTP_RESPONSE_OK "0"
...
...
@@ -463,7 +464,7 @@ void SrsHttpHooks::on_dvr_keyframe(string url, SrsRequest* req, SrsFlvSegment* s
int
ret
=
ERROR_SUCCESS
;
srs_assert
(
segment
);
srs_
trac
e
(
"flv segment %s, atc_start=%"
PRId64
", "
srs_
verbos
e
(
"flv segment %s, atc_start=%"
PRId64
", "
"has_key=%d, starttime=%"
PRId64
", duration=%d"
,
segment
->
path
.
c_str
(),
segment
->
stream_starttime
,
segment
->
has_keyframe
,
segment
->
starttime
,
(
int
)
segment
->
duration
);
...
...
@@ -480,7 +481,14 @@ void SrsHttpHooks::on_dvr_keyframe(string url, SrsRequest* req, SrsFlvSegment* s
<<
JFIELD_STR
(
"action"
,
"on_dvr_keyframe"
)
<<
JFIELD_CONT
<<
JFIELD_STR
(
"vhost"
,
req
->
vhost
)
<<
JFIELD_CONT
<<
JFIELD_STR
(
"app"
,
req
->
app
)
<<
JFIELD_CONT
<<
JFIELD_STR
(
"stream"
,
req
->
stream
)
<<
JFIELD_STR
(
"stream"
,
req
->
stream
)
<<
JFIELD_CONT
<<
JFIELD_NAME
(
"segment"
)
<<
JOBJECT_START
<<
JFIELD_STR
(
"cwd"
,
_srs_config
->
get_cwd
())
<<
JFIELD_CONT
<<
JFIELD_STR
(
"path"
,
segment
->
path
)
<<
JFIELD_CONT
<<
JFIELD_ORG
(
"pts"
,
segment
->
stream_starttime
+
segment
->
starttime
)
<<
JFIELD_CONT
<<
JFIELD_ORG
(
"duration"
,
segment
->
duration
)
<<
JFIELD_CONT
<<
JFIELD_ORG
(
"offset"
,
0
)
<<
JOBJECT_END
<<
JOBJECT_END
;
std
::
string
data
=
ss
.
str
();
std
::
string
res
;
...
...
@@ -500,7 +508,7 @@ void SrsHttpHooks::on_dvr_keyframe(string url, SrsRequest* req, SrsFlvSegment* s
return
;
}
srs_
trace
(
"http hook on_dvr_keyframe success. "
srs_
info
(
"http hook on_dvr_keyframe success. "
"url=%s, request=%s, response=%s, ret=%d"
,
url
.
c_str
(),
data
.
c_str
(),
res
.
c_str
(),
ret
);
...
...
trunk/src/app/srs_app_json.hpp
查看文件 @
b276714
...
...
@@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// json encode macros
#define JOBJECT_START "{"
#define JFIELD_NAME(k) "\"" << k << "\":"
#define JFIELD_STR(k, v) "\"" << k << "\":\"" << v << "\""
#define JFIELD_ORG(k, v) "\"" << k << "\":" << std::dec << v
#define JFIELD_ERROR(ret) "\"" << "code" << "\":" << ret
...
...
请
注册
或
登录
后发表评论