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

For #913, http callback use complex error

This commit is contained in:
winlin 2017-09-22 19:54:50 +08:00
parent 59b53dab8b
commit 20a42599f3
22 changed files with 264 additions and 268 deletions

View file

@ -51,7 +51,7 @@ public:
* @param url the api server url, to valid the client.
* ignore if empty.
*/
static int on_connect(std::string url, SrsRequest* req);
static srs_error_t on_connect(std::string url, SrsRequest* req);
/**
* on_close hook, when client disconnect to srs, where client is valid by on_connect.
* @param url the api server url, to process the event.
@ -63,7 +63,7 @@ public:
* @param url the api server url, to valid the client.
* ignore if empty.
*/
static int on_publish(std::string url, SrsRequest* req);
static srs_error_t on_publish(std::string url, SrsRequest* req);
/**
* on_unpublish hook, when client(encoder) stop publish stream.
* @param url the api server url, to process the event.
@ -75,7 +75,7 @@ public:
* @param url the api server url, to valid the client.
* ignore if empty.
*/
static int on_play(std::string url, SrsRequest* req);
static srs_error_t on_play(std::string url, SrsRequest* req);
/**
* on_stop hook, when client stop to play the stream.
* @param url the api server url, to process the event.
@ -89,7 +89,7 @@ public:
* @param file the file path, can be relative or absolute path.
* @param cid the source connection cid, for the on_dvr is async call.
*/
static int on_dvr(int cid, std::string url, SrsRequest* req, std::string file);
static srs_error_t on_dvr(int cid, std::string url, SrsRequest* req, std::string file);
/**
* when hls reap segment, callback.
* @param url the api server url, to process the event.
@ -102,7 +102,7 @@ public:
* @param duration the segment duration in seconds.
* @param cid the source connection cid, for the on_dvr is async call.
*/
static int on_hls(int cid, std::string url, SrsRequest* req, std::string file, std::string ts_url, std::string m3u8, std::string m3u8_url, int sn, double duration);
static srs_error_t on_hls(int cid, std::string url, SrsRequest* req, std::string file, std::string ts_url, std::string m3u8, std::string m3u8_url, int sn, double duration);
/**
* when hls reap segment, callback.
* @param url the api server url, to process the event.
@ -111,9 +111,9 @@ public:
* @param nb_notify the max bytes to read from notify server.
* @param cid the source connection cid, for the on_dvr is async call.
*/
static int on_hls_notify(int cid, std::string url, SrsRequest* req, std::string ts_url, int nb_notify);
static srs_error_t on_hls_notify(int cid, std::string url, SrsRequest* req, std::string ts_url, int nb_notify);
private:
static int do_post(SrsHttpClient* hc, std::string url, std::string req, int& code, std::string& res);
static srs_error_t do_post(SrsHttpClient* hc, std::string url, std::string req, int& code, std::string& res);
};
#endif