From 90dee0924dfd29739dcafa77accf8d382ec114a0 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 15 Apr 2014 14:24:03 +0800 Subject: [PATCH] fix bug of build script --- README.md | 2 +- trunk/auto/options.sh | 10 ++++++--- trunk/src/app/srs_app_flv.cpp | 39 ++++++++++++++++++++++++++++++++ trunk/src/app/srs_app_flv.hpp | 41 ++++++++++++++++++++++++++++++++++ trunk/src/app/srs_app_http.cpp | 4 ++++ trunk/src/app/srs_app_http.hpp | 4 ++++ 6 files changed, 96 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5eaa821f0..23fd0551e 100755 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ Supported operating systems and hardware: 1. Support embeded http server for hls(live/vod) 1. Support stream ingester using ffmpeg. 1. Support ingest RTSP(RTP, SDP) stream to RTMP. +1. [dev] Support dvr(record live to flv file for vod) 1. [plan] Support file to hls vod stream. 1. [plan] Support system full utest on gtest. 1. [plan] Support RTMP edge server, push/pull stream from any RTMP server @@ -162,7 +163,6 @@ Supported operating systems and hardware: 1. [no-plan] Support adobe RTMFP(flash p2p) protocol. 1. [no-plan] Support adobe flash refer/token/swf verification. 1. [no-plan] Support adobe amf3 codec. -1. [no-plan] Support dvr(record live to vod file) 1. [no-plan] Support encryption: RTMPE/RTMPS, HLS DRM 1. [no-plan] Support RTMPT, http to tranverse firewalls 1. [no-plan] Support file source, transcoding file to live stream diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 8a62f847e..7cf26e9c9 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -134,9 +134,12 @@ done # apply the default value when user donot specified. ##################################################################################### # if http-xxxx specified, open the SRS_HTTP_PARSER -if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi -if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi -if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi +__compile_http_parser=NO +if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi +if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi +if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi +# if no http specified, disable http parser +if [ $__compile_http_parser = NO ]; then SRS_HTTP_PARSER=NO; fi # if transcode specified, try ffmpeg if possible. if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi @@ -169,6 +172,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_PI = RESERVED ]; then SRS_PI=NO; fi # for arm, always set to static link. SRS_STATIC=YES +# defaults for x86/x64 else if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi if [ $SRS_DVR = RESERVED ]; then SRS_DVR=YES; fi diff --git a/trunk/src/app/srs_app_flv.cpp b/trunk/src/app/srs_app_flv.cpp index b13e9c88d..3ffb72e9f 100644 --- a/trunk/src/app/srs_app_flv.cpp +++ b/trunk/src/app/srs_app_flv.cpp @@ -25,5 +25,44 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef SRS_AUTO_DVR +#include + +SrsDvr::SrsDvr(SrsSource* source) +{ + _source = source; +} + +SrsDvr::~SrsDvr() +{ +} + +int SrsDvr::on_publish(SrsRequest* req) +{ + int ret = ERROR_SUCCESS; + return ret; +} + +void SrsDvr::on_unpublish() +{ +} + +int SrsDvr::on_meta_data(SrsAmf0Object* metadata) +{ + int ret = ERROR_SUCCESS; + return ret; +} + +int SrsDvr::on_audio(SrsSharedPtrMessage* audio) +{ + int ret = ERROR_SUCCESS; + return ret; +} + +int SrsDvr::on_video(SrsSharedPtrMessage* video) +{ + int ret = ERROR_SUCCESS; + return ret; +} + #endif diff --git a/trunk/src/app/srs_app_flv.hpp b/trunk/src/app/srs_app_flv.hpp index a545f540b..0d70d3c0a 100644 --- a/trunk/src/app/srs_app_flv.hpp +++ b/trunk/src/app/srs_app_flv.hpp @@ -31,6 +31,47 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef SRS_AUTO_DVR +class SrsSource; +class SrsRequest; +class SrsAmf0Object; +class SrsSharedPtrMessage; + +/** +* dvr(digital video recorder) to record RTMP stream to flv file. +* TODO: FIXME: add utest for it. +*/ +class SrsDvr +{ +private: + SrsSource* _source; +public: + SrsDvr(SrsSource* source); + virtual ~SrsDvr(); +public: + /** + * publish stream event, continue to write the m3u8, + * for the muxer object not destroyed. + */ + virtual int on_publish(SrsRequest* req); + /** + * the unpublish event, only close the muxer, donot destroy the + * muxer, for when we continue to publish, the m3u8 will continue. + */ + virtual void on_unpublish(); + /** + * get some information from metadata, it's optinal. + */ + virtual int on_meta_data(SrsAmf0Object* metadata); + /** + * mux the audio packets to ts. + */ + virtual int on_audio(SrsSharedPtrMessage* audio); + /** + * mux the video packets to ts. + */ + virtual int on_video(SrsSharedPtrMessage* video); +}; + #endif #endif \ No newline at end of file diff --git a/trunk/src/app/srs_app_http.cpp b/trunk/src/app/srs_app_http.cpp index 234cba7ea..350ad6e13 100644 --- a/trunk/src/app/srs_app_http.cpp +++ b/trunk/src/app/srs_app_http.cpp @@ -494,15 +494,19 @@ int SrsHttpHandler::res_error(SrsSocket* skt, SrsHttpMessage* req, int code, str return res_flush(skt, ss); } +#ifdef SRS_AUTO_HTTP_API SrsHttpHandler* SrsHttpHandler::create_http_api() { return new SrsApiRoot(); } +#endif +#ifdef SRS_AUTO_HTTP_SERVER SrsHttpHandler* SrsHttpHandler::create_http_stream() { return new SrsHttpRoot(); } +#endif SrsHttpMessage::SrsHttpMessage() { diff --git a/trunk/src/app/srs_app_http.hpp b/trunk/src/app/srs_app_http.hpp index 70927193b..b0806d497 100644 --- a/trunk/src/app/srs_app_http.hpp +++ b/trunk/src/app/srs_app_http.hpp @@ -263,11 +263,15 @@ public: /** * create http api resource handler. */ +#ifdef SRS_AUTO_HTTP_API static SrsHttpHandler* create_http_api(); +#endif /** * create http stream resource handler. */ +#ifdef SRS_AUTO_HTTP_SERVER static SrsHttpHandler* create_http_stream(); +#endif }; /**