Advertisement
Guest User

mpa

a guest
Jan 9th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | Source Code | 0 0
  1. int subscribe(char * sub_name, char * client_name)
  2. {
  3.     printf("connecting to camera pipe %s\r\n",sub_name);
  4.  
  5.     if(pipe_expand_location_string(sub_name, pipe_name)<0){
  6.         fprintf(stderr, "ERROR: Invalid pipe name: %s\n", sub_name);
  7.         exit(-1);
  8.     }
  9.  
  10.     int ch      = pipe_client_get_next_available_channel();
  11.     int buf_len = 0;
  12.     pipe_client_set_camera_helper_cb(ch, _helper_cb, NULL);
  13.     pipe_client_open(ch, pipe_name, client_name, EN_PIPE_CLIENT_CAMERA_HELPER, buf_len);
  14.    
  15.     printf("subscribed to camera pipe %s, channel %d\r\n",pipe_name, ch);
  16.    
  17.     sub_ch = ch;
  18.    
  19.     return ch;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement