SHARE
TWEET

RTSP Test Server

a guest Jul 20th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. extern "C" {
  5.   #include <rtsp-server.h>
  6. }
  7.  
  8. using namespace std;
  9.  
  10. int options(void* ptr, rtsp_server_t* rtsp, const char* uri) {
  11.   return rtsp_server_reply_options(rtsp, 200);
  12. }
  13.  
  14. int main() {
  15.   char buf1[1024], buf2[1024];
  16.   rtsp_handler_t handler;
  17.   rtsp_server_t* rtsp;
  18.   memset(&handler, 0, sizeof(handler));
  19.   handler.onoptions = &options;
  20.   rtsp = rtsp_server_create("localhost", 8000, &handler, (void*)buf1, (void*)buf2);
  21.   if(rtsp == nullptr) {
  22.     cerr << "Error!" << endl;
  23.     return 1;
  24.   }
  25.   cout << "Hello world! " << rtsp_server_destroy(rtsp) << endl;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top