1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #299, srs http server support dash vod stream over mp4 range. 2.0.103

This commit is contained in:
winlin 2015-01-23 13:45:59 +08:00
parent e0ee8de2fb
commit 73cfdea332
5 changed files with 64 additions and 50 deletions

View file

@ -149,6 +149,7 @@ public:
// will trigger an implicit WriteHeader(http.StatusOK).
// Thus explicit calls to WriteHeader are mainly used to
// send error codes.
// @remark, user must set header then write or write_header.
virtual void write_header(int code) = 0;
};
@ -211,11 +212,14 @@ public:
virtual ~SrsGoHttpFileServer();
public:
virtual int serve_http(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r);
protected:
private:
/**
* serve the file by specified path
*/
virtual int serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath);
virtual int serve_flv_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath);
virtual int serve_mp4_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath);
protected:
/**
* when access flv file with x.flv?start=xxx
*/
@ -226,7 +230,7 @@ protected:
* @param end the end offset in bytes. -1 to end of file.
* @remark response data in [start, end].
*/
virtual int serve_mp4_range(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath, int start, int end);
virtual int serve_mp4_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath, int start, int end);
protected:
/**
* copy the fs to response writer in size bytes.