ffmpeg - Using Live555 HTTP capacities as a server for signaling -


lately managed make (using other libraries) rtsp streaming server live555, webrtc , ffmpeg. rolling great, ultimate goal maximise usage of live555 reduce processing footprint. once rtp stream started use http signaling server keepalives.

my question (as don't seem find answer in live555 code nor documentation) :

is there way build http server using live555 ?

in live555 there embededed http server used streaming rtp on http.

you can use overloading handlehttpcmd_streamingget of rtspserver::rtspclientconnection

in order implement implementation, need :

  • overload rtspserver::rtspclientconnection class implement handlehttpcmd_streamingget
  • overload rtspserver class instanciate overloaded class of rtspserver::rtspclientconnection

putting give simplify sample, without error handling, :

#include "basicusageenvironment.hh" #include "rtspserver.hh"  class httpserver : public rtspserver {     class httpclientconnection : public rtspserver::rtspclientconnection {         public:             httpclientconnection(rtspserver& ourserver, int clientsocket, struct sockaddr_in clientaddr)               : rtspserver::rtspclientconnection(ourserver, clientsocket, clientaddr) {}          private:             virtual void handlehttpcmd_streamingget(char const* urlsuffix, char const* fullrequeststr) {                         // build http answer                 snprintf((char*)fresponsebuffer, sizeof fresponsebuffer,                    "http/1.1 200 ok\r\n"                    "content-length: %zd\r\n"                    "\r\n"                    "%s",                    strlen(fullrequeststr),fullrequeststr);             }     };      public:         static httpserver* createnew(usageenvironment& env, port rtspport) {             return new httpserver(env, setupoursocket(env, rtspport), rtspport);         }          httpserver(usageenvironment& env, int oursocket, port rtspport)             : rtspserver(env, oursocket, rtspport, null, 0) {}          rtspserver::rtspclientconnection* createnewclientconnection(int clientsocket, struct sockaddr_in clientaddr) {             return new httpclientconnection(*this, clientsocket, clientaddr);         } }; 

this httpserver implementation answer http request received, :

get / http/1.1 host: 127.0.0.1:9999 user-agent: curl/7.54.0 accept: */* 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -