mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
call http api when dvr got keyframe
This commit is contained in:
parent
36d8fdfc1a
commit
733ca2475d
9 changed files with 179 additions and 58 deletions
|
@ -71,8 +71,9 @@ private:
|
|||
*/
|
||||
class SrsHttpHooks
|
||||
{
|
||||
public:
|
||||
private:
|
||||
SrsHttpHooks();
|
||||
public:
|
||||
virtual ~SrsHttpHooks();
|
||||
public:
|
||||
/**
|
||||
|
@ -82,14 +83,14 @@ public:
|
|||
* ignore if empty.
|
||||
* @return valid failed or connect to the url failed.
|
||||
*/
|
||||
virtual int on_connect(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static int on_connect(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
/**
|
||||
* on_close hook, when client disconnect to srs, where client is valid by on_connect.
|
||||
* @param client_id the id of client on server.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
*/
|
||||
virtual void on_close(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static void on_close(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
/**
|
||||
* on_publish hook, when client(encoder) start to publish stream
|
||||
* @param client_id the id of client on server.
|
||||
|
@ -97,14 +98,14 @@ public:
|
|||
* ignore if empty.
|
||||
* @return valid failed or connect to the url failed.
|
||||
*/
|
||||
virtual int on_publish(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static int on_publish(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
/**
|
||||
* on_unpublish hook, when client(encoder) stop publish stream.
|
||||
* @param client_id the id of client on server.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
*/
|
||||
virtual void on_unpublish(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static void on_unpublish(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
/**
|
||||
* on_play hook, when client start to play stream.
|
||||
* @param client_id the id of client on server.
|
||||
|
@ -112,14 +113,21 @@ public:
|
|||
* ignore if empty.
|
||||
* @return valid failed or connect to the url failed.
|
||||
*/
|
||||
virtual int on_play(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static int on_play(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
/**
|
||||
* on_stop hook, when client stop to play the stream.
|
||||
* @param client_id the id of client on server.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
*/
|
||||
virtual void on_stop(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
static void on_stop(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
public:
|
||||
/**
|
||||
* on_dvr_keyframe hook, when dvr get keyframe.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
*/
|
||||
static void on_dvr_keyframe(std::string url, SrsRequest* req);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue