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-16 09:28:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fd0002e49925dc2c48c5912fb1bf603f8558b76e
fd0002e4
1 parent
96115ac4
add dvr framework
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
63 行增加
和
8 行删除
trunk/configure
trunk/src/app/srs_app_flv.cpp → trunk/src/app/srs_app_dvr.cpp
trunk/src/app/srs_app_flv.hpp → trunk/src/app/srs_app_dvr.hpp
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.hpp
trunk/src/srs/srs.upp
trunk/configure
查看文件 @
fd0002e
...
...
@@ -440,7 +440,7 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_socke
"srs_app_http"
"srs_app_thread"
"srs_app_bandwidth"
"srs_app_st"
"srs_app_log"
"srs_app_config"
"srs_app_pithy_print"
"srs_app_reload"
"srs_app_http_api"
"srs_app_http_conn"
"srs_app_http_hooks"
"srs_app_json"
"srs_app_ingest"
"srs_app_ffmpeg"
"srs_app_utility"
"srs_app_
flv
"
)
"srs_app_ffmpeg"
"srs_app_utility"
"srs_app_
dvr
"
)
APP_INCS
=
"src/app"
;
MODULE_DIR
=
${
APP_INCS
}
. auto/modules.sh
APP_OBJS
=
"
${
MODULE_OBJS
[@]
}
"
#
...
...
trunk/src/app/srs_app_
flv
.cpp → trunk/src/app/srs_app_
dvr
.cpp
查看文件 @
fd0002e
...
...
@@ -21,7 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_app_
flv
.hpp>
#include <srs_app_
dvr
.hpp>
#ifdef SRS_AUTO_DVR
...
...
trunk/src/app/srs_app_
flv
.hpp → trunk/src/app/srs_app_
dvr
.hpp
查看文件 @
fd0002e
...
...
@@ -21,11 +21,11 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SRS_APP_FLV_HPP
#define SRS_APP_FLV_HPP
#ifndef SRS_APP_DVR_HPP
#define SRS_APP_DVR_HPP
/*
#include <srs_app_
flv
.hpp>
#include <srs_app_
dvr
.hpp>
*/
#include <srs_core.hpp>
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
fd0002e
...
...
@@ -36,6 +36,7 @@ using namespace std;
#include <srs_app_config.hpp>
#include <srs_app_encoder.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_app_dvr.hpp>
#define CONST_MAX_JITTER_MS 500
#define DEFAULT_FRAME_TIME_MS 40
...
...
@@ -431,6 +432,9 @@ SrsSource::SrsSource(SrsRequest* _req)
#ifdef SRS_AUTO_HLS
hls
=
new
SrsHls
(
this
);
#endif
#ifdef SRS_AUTO_DVR
dvr
=
new
SrsDvr
(
this
);
#endif
#ifdef SRS_AUTO_TRANSCODE
encoder
=
new
SrsEncoder
();
#endif
...
...
@@ -477,6 +481,9 @@ SrsSource::~SrsSource()
#ifdef SRS_AUTO_HLS
srs_freep
(
hls
);
#endif
#ifdef SRS_AUTO_DVR
srs_freep
(
dvr
);
#endif
#ifdef SRS_AUTO_TRANSCODE
srs_freep
(
encoder
);
#endif
...
...
@@ -678,6 +685,13 @@ int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata
}
#endif
#ifdef SRS_AUTO_DVR
if
(
metadata
&&
(
ret
=
dvr
->
on_meta_data
(
metadata
->
metadata
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"dvr process onMetaData message failed. ret=%d"
,
ret
);
return
ret
;
}
#endif
metadata
->
metadata
->
set
(
"server"
,
SrsAmf0Any
::
str
(
RTMP_SIG_SRS_KEY
" "
RTMP_SIG_SRS_VERSION
" ("
RTMP_SIG_SRS_URL_SHORT
")"
));
metadata
->
metadata
->
set
(
"contributor"
,
SrsAmf0Any
::
str
(
RTMP_SIG_SRS_PRIMARY_AUTHROS
));
...
...
@@ -772,6 +786,18 @@ int SrsSource::on_audio(SrsCommonMessage* audio)
}
#endif
#ifdef SRS_AUTO_DVR
if
((
ret
=
dvr
->
on_audio
(
msg
->
copy
()))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"dvr process audio message failed, ignore and disable dvr. ret=%d"
,
ret
);
// unpublish, ignore ret.
dvr
->
on_unpublish
();
// ignore.
ret
=
ERROR_SUCCESS
;
}
#endif
// copy to all consumer
if
(
true
)
{
std
::
vector
<
SrsConsumer
*>::
iterator
it
;
...
...
@@ -849,6 +875,18 @@ int SrsSource::on_video(SrsCommonMessage* video)
}
#endif
#ifdef SRS_AUTO_DVR
if
((
ret
=
dvr
->
on_video
(
msg
->
copy
()))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"dvr process video message failed, ignore and disable dvr. ret=%d"
,
ret
);
// unpublish, ignore ret.
dvr
->
on_unpublish
();
// ignore.
ret
=
ERROR_SUCCESS
;
}
#endif
// copy to all consumer
if
(
true
)
{
std
::
vector
<
SrsConsumer
*>::
iterator
it
;
...
...
@@ -932,6 +970,13 @@ int SrsSource::on_publish(SrsRequest* _req)
return
ret
;
}
#endif
#ifdef SRS_AUTO_DVR
if
((
ret
=
dvr
->
on_publish
(
req
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"start dvr failed. ret=%d"
,
ret
);
return
ret
;
}
#endif
return
ret
;
}
...
...
@@ -945,10 +990,13 @@ void SrsSource::on_unpublish()
encoder
->
on_unpublish
();
#endif
// TODO: HLS should continue previous sequence and stream.
#ifdef SRS_AUTO_HLS
hls
->
on_unpublish
();
#endif
#ifdef SRS_AUTO_DVR
dvr
->
on_unpublish
();
#endif
gop_cache
->
clear
();
...
...
trunk/src/app/srs_app_source.hpp
查看文件 @
fd0002e
...
...
@@ -46,6 +46,9 @@ class SrsRequest;
#ifdef SRS_AUTO_HLS
class
SrsHls
;
#endif
#ifdef SRS_AUTO_DVR
class
SrsDvr
;
#endif
#ifdef SRS_AUTO_TRANSCODE
class
SrsEncoder
;
#endif
...
...
@@ -223,6 +226,10 @@ private:
#ifdef SRS_AUTO_HLS
SrsHls
*
hls
;
#endif
// dvr handler.
#ifdef SRS_AUTO_DVR
SrsDvr
*
dvr
;
#endif
// transcoding handler.
#ifdef SRS_AUTO_TRANSCODE
SrsEncoder
*
encoder
;
...
...
trunk/src/srs/srs.upp
查看文件 @
fd0002e
...
...
@@ -47,12 +47,12 @@ file
..\app\srs_app_conn.cpp,
..\app\srs_app_config.hpp,
..\app\srs_app_config.cpp,
..\app\srs_app_dvr.hpp,
..\app\srs_app_dvr.cpp,
..\app\srs_app_encoder.hpp,
..\app\srs_app_encoder.cpp,
..\app\srs_app_ffmpeg.hpp,
..\app\srs_app_ffmpeg.cpp,
..\app\srs_app_flv.hpp,
..\app\srs_app_flv.cpp,
..\app\srs_app_forward.hpp,
..\app\srs_app_forward.cpp,
..\app\srs_app_hls.hpp,
...
...
请
注册
或
登录
后发表评论