write to a UVC device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Working on a custom Xilinx board with Petalinux on it. Have
/dev/video0 node which is UVC. Tested it with vivid driver and know
that it is working. Now I want to stream my own video through it.
Decided to test with a simple buffer. Got the following error:

write to UVC: Invalid argument.

The code is provided below.

Can't understand what is the problem with the invalid argument? Is a
call to write not the correct method to "talk" to the UVC gadget?


#define IMG_SIZE_BYTES 100
int main(int argc, char **argv) {
  char pImg[IMG_SIZE_BYTES] = {0};
  int res;

  uvc_fd = open("/dev/video0", O_RDWR | O_NONBLOCK);
  if (uvc_fd < 0) {
    perror("Open UVC");
    exit(uvc_fd);
  }

  while(1) {
    res = write(uvc_fd, pImg, IMG_SIZE_BYTES);
    if (res < 0) {
      perror("write to UVC");
      close(uvc_fd);
      exit(res);
    }
    sleep(1);
  }

  close(uvc_fd);
  return 0;
}



-- 
Rail Shafigulin
Software Engineer
Esencia Technologies

-- 




*ESENCIA TECHNOLOGIES, INC.*3945 Freedom Circle, Suite #360,
Santa Clara CA 95054
________________________________________________________

Phone: +1 408 736 8284 Fax: +1 408 519 3475 
http://www.esenciatech.com | http://www.lnttechservices.com


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux