winlin

fix bug of build script

@@ -155,6 +155,7 @@ Supported operating systems and hardware: @@ -155,6 +155,7 @@ Supported operating systems and hardware:
155 1. Support embeded http server for hls(live/vod) 155 1. Support embeded http server for hls(live/vod)
156 1. Support stream ingester using ffmpeg. 156 1. Support stream ingester using ffmpeg.
157 1. Support ingest RTSP(RTP, SDP) stream to RTMP. 157 1. Support ingest RTSP(RTP, SDP) stream to RTMP.
  158 +1. [dev] Support dvr(record live to flv file for vod)
158 1. [plan] Support file to hls vod stream. 159 1. [plan] Support file to hls vod stream.
159 1. [plan] Support system full utest on gtest. 160 1. [plan] Support system full utest on gtest.
160 1. [plan] Support RTMP edge server, push/pull stream from any RTMP server 161 1. [plan] Support RTMP edge server, push/pull stream from any RTMP server
@@ -162,7 +163,6 @@ Supported operating systems and hardware: @@ -162,7 +163,6 @@ Supported operating systems and hardware:
162 1. [no-plan] Support adobe RTMFP(flash p2p) protocol. 163 1. [no-plan] Support adobe RTMFP(flash p2p) protocol.
163 1. [no-plan] Support adobe flash refer/token/swf verification. 164 1. [no-plan] Support adobe flash refer/token/swf verification.
164 1. [no-plan] Support adobe amf3 codec. 165 1. [no-plan] Support adobe amf3 codec.
165 -1. [no-plan] Support dvr(record live to vod file)  
166 1. [no-plan] Support encryption: RTMPE/RTMPS, HLS DRM 166 1. [no-plan] Support encryption: RTMPE/RTMPS, HLS DRM
167 1. [no-plan] Support RTMPT, http to tranverse firewalls 167 1. [no-plan] Support RTMPT, http to tranverse firewalls
168 1. [no-plan] Support file source, transcoding file to live stream 168 1. [no-plan] Support file source, transcoding file to live stream
@@ -134,9 +134,12 @@ done @@ -134,9 +134,12 @@ done
134 # apply the default value when user donot specified. 134 # apply the default value when user donot specified.
135 ##################################################################################### 135 #####################################################################################
136 # if http-xxxx specified, open the SRS_HTTP_PARSER 136 # if http-xxxx specified, open the SRS_HTTP_PARSER
137 -if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi  
138 -if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi  
139 -if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi 137 +__compile_http_parser=NO
  138 +if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi
  139 +if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi
  140 +if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES;__compile_http_parser=YES; fi
  141 +# if no http specified, disable http parser
  142 +if [ $__compile_http_parser = NO ]; then SRS_HTTP_PARSER=NO; fi
140 143
141 # if transcode specified, try ffmpeg if possible. 144 # if transcode specified, try ffmpeg if possible.
142 if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi 145 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 @@ -169,6 +172,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then
169 if [ $SRS_PI = RESERVED ]; then SRS_PI=NO; fi 172 if [ $SRS_PI = RESERVED ]; then SRS_PI=NO; fi
170 # for arm, always set to static link. 173 # for arm, always set to static link.
171 SRS_STATIC=YES 174 SRS_STATIC=YES
  175 +# defaults for x86/x64
172 else 176 else
173 if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi 177 if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
174 if [ $SRS_DVR = RESERVED ]; then SRS_DVR=YES; fi 178 if [ $SRS_DVR = RESERVED ]; then SRS_DVR=YES; fi
@@ -25,5 +25,44 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -25,5 +25,44 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 25
26 #ifdef SRS_AUTO_DVR 26 #ifdef SRS_AUTO_DVR
27 27
  28 +#include <srs_kernel_error.hpp>
  29 +
  30 +SrsDvr::SrsDvr(SrsSource* source)
  31 +{
  32 + _source = source;
  33 +}
  34 +
  35 +SrsDvr::~SrsDvr()
  36 +{
  37 +}
  38 +
  39 +int SrsDvr::on_publish(SrsRequest* req)
  40 +{
  41 + int ret = ERROR_SUCCESS;
  42 + return ret;
  43 +}
  44 +
  45 +void SrsDvr::on_unpublish()
  46 +{
  47 +}
  48 +
  49 +int SrsDvr::on_meta_data(SrsAmf0Object* metadata)
  50 +{
  51 + int ret = ERROR_SUCCESS;
  52 + return ret;
  53 +}
  54 +
  55 +int SrsDvr::on_audio(SrsSharedPtrMessage* audio)
  56 +{
  57 + int ret = ERROR_SUCCESS;
  58 + return ret;
  59 +}
  60 +
  61 +int SrsDvr::on_video(SrsSharedPtrMessage* video)
  62 +{
  63 + int ret = ERROR_SUCCESS;
  64 + return ret;
  65 +}
  66 +
28 #endif 67 #endif
29 68
@@ -31,6 +31,47 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,6 +31,47 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 31
32 #ifdef SRS_AUTO_DVR 32 #ifdef SRS_AUTO_DVR
33 33
  34 +class SrsSource;
  35 +class SrsRequest;
  36 +class SrsAmf0Object;
  37 +class SrsSharedPtrMessage;
  38 +
  39 +/**
  40 +* dvr(digital video recorder) to record RTMP stream to flv file.
  41 +* TODO: FIXME: add utest for it.
  42 +*/
  43 +class SrsDvr
  44 +{
  45 +private:
  46 + SrsSource* _source;
  47 +public:
  48 + SrsDvr(SrsSource* source);
  49 + virtual ~SrsDvr();
  50 +public:
  51 + /**
  52 + * publish stream event, continue to write the m3u8,
  53 + * for the muxer object not destroyed.
  54 + */
  55 + virtual int on_publish(SrsRequest* req);
  56 + /**
  57 + * the unpublish event, only close the muxer, donot destroy the
  58 + * muxer, for when we continue to publish, the m3u8 will continue.
  59 + */
  60 + virtual void on_unpublish();
  61 + /**
  62 + * get some information from metadata, it's optinal.
  63 + */
  64 + virtual int on_meta_data(SrsAmf0Object* metadata);
  65 + /**
  66 + * mux the audio packets to ts.
  67 + */
  68 + virtual int on_audio(SrsSharedPtrMessage* audio);
  69 + /**
  70 + * mux the video packets to ts.
  71 + */
  72 + virtual int on_video(SrsSharedPtrMessage* video);
  73 +};
  74 +
34 #endif 75 #endif
35 76
36 #endif 77 #endif
@@ -494,15 +494,19 @@ int SrsHttpHandler::res_error(SrsSocket* skt, SrsHttpMessage* req, int code, str @@ -494,15 +494,19 @@ int SrsHttpHandler::res_error(SrsSocket* skt, SrsHttpMessage* req, int code, str
494 return res_flush(skt, ss); 494 return res_flush(skt, ss);
495 } 495 }
496 496
  497 +#ifdef SRS_AUTO_HTTP_API
497 SrsHttpHandler* SrsHttpHandler::create_http_api() 498 SrsHttpHandler* SrsHttpHandler::create_http_api()
498 { 499 {
499 return new SrsApiRoot(); 500 return new SrsApiRoot();
500 } 501 }
  502 +#endif
501 503
  504 +#ifdef SRS_AUTO_HTTP_SERVER
502 SrsHttpHandler* SrsHttpHandler::create_http_stream() 505 SrsHttpHandler* SrsHttpHandler::create_http_stream()
503 { 506 {
504 return new SrsHttpRoot(); 507 return new SrsHttpRoot();
505 } 508 }
  509 +#endif
506 510
507 SrsHttpMessage::SrsHttpMessage() 511 SrsHttpMessage::SrsHttpMessage()
508 { 512 {
@@ -263,11 +263,15 @@ public: @@ -263,11 +263,15 @@ public:
263 /** 263 /**
264 * create http api resource handler. 264 * create http api resource handler.
265 */ 265 */
  266 +#ifdef SRS_AUTO_HTTP_API
266 static SrsHttpHandler* create_http_api(); 267 static SrsHttpHandler* create_http_api();
  268 +#endif
267 /** 269 /**
268 * create http stream resource handler. 270 * create http stream resource handler.
269 */ 271 */
  272 +#ifdef SRS_AUTO_HTTP_SERVER
270 static SrsHttpHandler* create_http_stream(); 273 static SrsHttpHandler* create_http_stream();
  274 +#endif
271 }; 275 };
272 276
273 /** 277 /**