Advertisement
Guest User

AIO RTSP

a guest
Jul 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <rtsp-server-aio.h>
  4.  
  5. using namespace std;
  6.  
  7. int options(void* ptr, rtsp_server_t* rtsp, const char* uri) {
  8.   return rtsp_server_reply_options(rtsp, 200);
  9. }
  10.  
  11. int main() {
  12.   aio_rtsp_handler_t handler;
  13.   void *tcp;
  14.   memset(&handler, 0, sizeof(handler));
  15.   handler.base.onoptions = &options;
  16.   tcp = rtsp_server_listen(NULL, 8000, &handler, NULL);
  17.   if(tcp == nullptr) {
  18.     cerr << "Error!" << endl;
  19.     return 1;
  20.   }
  21.   while(true) {
  22.  
  23.   }
  24.   cout << "Hello world! " << rtsp_server_unlisten(tcp) << endl;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement