stream pushing ok without access permission of /dev/video0
[rtmpclient.git] / app / src / main / jni / libusb-1.0.22 / libusb / core.c
index 50f92f6..ab4b699 100644 (file)
@@ -1211,6 +1211,21 @@ int usbi_clear_event(struct libusb_context *ctx)
        return 0;
 }
 
+libusb_device * LIBUSB_CALL libusb_get_device_with_fd(libusb_context *ctx,
+       int vid, int pid, const char *serial, int fd, int busnum, int devaddr) {
+       usbi_dbg("libusb_get_device_with_fd, fd:%d, serial:%s", fd, serial);
+
+       struct libusb_device *device = NULL;
+       // android_generate_device内でusbi_alloc_deviceが呼ばれた時に参照カウンタは1
+       int ret = linux_generate_device(ctx, &device, vid, pid, serial, fd, busnum, devaddr);
+       if (ret) {
+               usbi_err(ctx, "libusb_get_device_with_fd");
+               device = NULL;
+       }
+       return device;
+}
+
+
 /** \ingroup libusb_dev
  * Open a device and obtain a device handle. A handle allows you to perform
  * I/O on the device in question.
@@ -1238,6 +1253,7 @@ int API_EXPORTED libusb_open(libusb_device *dev,
        size_t priv_size = usbi_backend.device_handle_priv_size;
        int r;
        usbi_dbg("open %d.%d", dev->bus_number, dev->device_address);
+       __android_log_write(ANDROID_LOG_ERROR, "libusb", "haha");
 
        if (!dev->attached) {
                return LIBUSB_ERROR_NO_DEVICE;