Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
libgphoto2
lg-24-branch.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lg-24-branch.patch of Package libgphoto2
Index: camlibs/canon/canon.c =================================================================== --- camlibs/canon/canon.c.orig +++ camlibs/canon/canon.c @@ -1333,8 +1333,7 @@ void canon_int_find_new_image ( Camera * if ( is_image ( new_name ) ) { /* Yup, we'll assume that this is the new image. */ GP_DEBUG ( " Found our new image file" ); - strncpy ( path->name, new_name, - strlen ( new_name ) ); + strcpy ( path->name, new_name ); strcpy ( path->folder, canon2gphotopath ( camera, path->folder ) ); /* FIXME: Marcus: make it less large effort... */ Index: camlibs/ptp2/library.c =================================================================== --- camlibs/ptp2/library.c.orig +++ camlibs/ptp2/library.c @@ -715,7 +715,7 @@ static struct { {"Nikon:Coolpix L110 (PTP mode)", 0x04b0, 0x017e, PTP_CAP}, /* miguel@rozsas.eng.br */ - {"Nikon:Coolpix P500 (PTP mode)", 0x04b0, 0x0184, 0}, + {"Nikon:Coolpix P500 (PTP mode)", 0x04b0, 0x0184, PTP_CAP}, /* Graeme Wyatt <graeme.wyatt@nookawarra.com> */ {"Nikon:Coolpix L120 (PTP mode)", 0x04b0, 0x0185, PTP_CAP}, /* Kévin Ottens <ervin@ipsquad.net> */ @@ -740,6 +740,8 @@ static struct { {"Nikon:Coolpix S8000 (PTP mode)",0x04b0, 0x021f, 0}, /* Aleksej Serdjukov <deletesoftware@yandex.ru> */ {"Nikon:Coolpix S5100 (PTP mode)",0x04b0, 0x0220, 0}, + /* wlady.cs@gmail.com */ + {"Nikon:Coolpix P300 (PTP mode)", 0x04b0, 0x0221, 0}, /* Nikon Coolpix 2000 */ {"Nikon:Coolpix 2000 (PTP mode)", 0x04b0, 0x0302, 0}, /* From IRC reporter. */ @@ -810,6 +812,11 @@ static struct { /* IRC Reporter popolon */ {"Nikon:DSC D5100 (PTP mode)", 0x04b0, 0x0429, PTP_CAP|PTP_CAP_PREVIEW}, + + /* http://sourceforge.net/tracker/?func=detail&aid=3536904&group_id=8874&atid=108874 */ + {"Nikon:V1", 0x04b0, 0x0601, PTP_CAP}, + + #if 0 /* Thomas Luzat <thomas.luzat@gmx.net> */ /* this was reported as not working, mass storage only: @@ -1058,6 +1065,8 @@ static struct { /* Martin Lasarsch at SUSE. MTP_PROPLIST returns just 0 entries */ {"Canon:Digital IXUS 90 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT}, + /* Daniel Moyne <daniel.moyne@free.fr> */ + {"Canon:Powershot SD790 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT}, /* https://sourceforge.net/tracker/?func=detail&aid=2722422&group_id=8874&atid=358874 */ {"Canon:Digital IXUS 85 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT}, @@ -1289,6 +1298,9 @@ static struct { {"Apple:iPod Touch 3rd Gen (PTP mode)", 0x05ac, 0x1299, 0}, {"Apple:iPad (PTP mode)", 0x05ac, 0x129a, 0}, + /* Don Cohen <don-sourceforge-xxzw@isis.cs3-inc.com> */ + {"Apple:iPhone 4S (PTP mode)", 0x05ac, 0x12a0, 0}, + /* https://sourceforge.net/tracker/index.php?func=detail&aid=1869653&group_id=158745&atid=809061 */ {"Pioneer:DVR-LX60D", 0x08e4, 0x0142, 0}, @@ -4555,12 +4567,14 @@ get_file_func (CameraFilesystem *fs, con unsigned char *ximage = NULL; unsigned int xlen = 0; - /* If thumb size is 0 then there is no thumbnail at all... */ - if((size=oi->ThumbCompressedSize)==0) return (GP_ERROR_NOT_SUPPORTED); + size=oi->ThumbCompressedSize; + /* If thumb size is 0 and the OFC is not a image type (0x3800 / 0xb800)... */ + if ((size==0) && ((oi->ObjectFormat & 0x7800) != 0x3800)) + return GP_ERROR_NOT_SUPPORTED; CPR (context, ptp_getthumb(params, params->handles.Handler[object_id], &ximage, &xlen)); - if (xlen != size) + if (size && (xlen != size)) gp_log (GP_LOG_ERROR, "get_file_func/GP_FILE_TYPE_PREVIEW", "size mismatch %d vs %d", size, xlen); set_mimetype (camera, file, params->deviceinfo.VendorExtensionID, oi->ThumbFormat); CR (gp_file_set_data_and_size (file, (char*)ximage, xlen)); Index: libgphoto2_port/libusb1/libusb1.c =================================================================== --- libgphoto2_port/libusb1/libusb1.c.orig +++ libgphoto2_port/libusb1/libusb1.c @@ -71,6 +71,10 @@ struct _GPPortPrivateLibrary { int detached; + time_t devslastchecked; + int nrofdevs; + struct libusb_device_descriptor *descs; + libusb_device **devs; }; GPPortType @@ -79,38 +83,34 @@ gp_port_library_type (void) return (GP_PORT_USB); } -static time_t gp_devslastchecked = 0; -static int gp_nrofdevs = 0; -static struct libusb_device_descriptor *gp_descs; -static libusb_device **gp_devs; static ssize_t -load_devicelist (libusb_context *ctx) { +load_devicelist (GPPortPrivateLibrary *pl) { time_t xtime; time(&xtime); - if (xtime != gp_devslastchecked) { - if (gp_nrofdevs) - libusb_free_device_list (gp_devs, 1); - free (gp_descs); - gp_nrofdevs = 0; - gp_devs = NULL; - gp_descs = NULL; + if (xtime != pl->devslastchecked) { + if (pl->nrofdevs) + libusb_free_device_list (pl->devs, 1); + free (pl->descs); + pl->nrofdevs = 0; + pl->devs = NULL; + pl->descs = NULL; } - if (!gp_nrofdevs) { + if (!pl->nrofdevs) { int i; - gp_nrofdevs = libusb_get_device_list (ctx, &gp_devs); - gp_descs = malloc (sizeof(gp_descs[0])*gp_nrofdevs); - for (i=0;i<gp_nrofdevs;i++) { + pl->nrofdevs = libusb_get_device_list (pl->ctx, &pl->devs); + pl->descs = malloc (sizeof(pl->descs[0])*pl->nrofdevs); + for (i=0;i<pl->nrofdevs;i++) { int ret; - ret = libusb_get_device_descriptor(gp_devs[i], &gp_descs[i]); + ret = libusb_get_device_descriptor(pl->devs[i], &pl->descs[i]); if (ret) gp_log (GP_LOG_ERROR, "libusb1", "libusb_get_device_descriptor(%d) returned %d", i, ret); } } - time (&gp_devslastchecked); - return gp_nrofdevs; + time (&pl->devslastchecked); + return pl->nrofdevs; } int @@ -119,6 +119,10 @@ gp_port_library_list (GPPortInfoList *li GPPortInfo info; int nrofdevices = 0; int d, i, i1, i2, unknownint; + libusb_context *ctx; + libusb_device **devs = NULL; + int nrofdevs = 0; + struct libusb_device_descriptor *descs; /* generic matcher. This will catch passed XXX,YYY entries for instance. */ info.type = GP_PORT_USB; @@ -126,26 +130,33 @@ gp_port_library_list (GPPortInfoList *li strcpy (info.path, "^usb:"); CHECK (gp_port_info_list_append (list, info)); - libusb_init (NULL); - gp_nrofdevs = load_devicelist (NULL); + libusb_init (&ctx); + nrofdevs = libusb_get_device_list (ctx, &devs); + descs = malloc (sizeof(descs[0])*nrofdevs); + for (i=0;i<nrofdevs;i++) { + int ret; + ret = libusb_get_device_descriptor(devs[i], &descs[i]); + if (ret) + gp_log (GP_LOG_ERROR, "libusb1", "libusb_get_device_descriptor(%d) returned %d", i, ret); + } - for (d = 0; d < gp_nrofdevs; d++) { + for (d = 0; d < nrofdevs; d++) { /* Devices which are definitely not cameras. */ - if ( (gp_descs[d].bDeviceClass == LIBUSB_CLASS_HUB) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_HID) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_PRINTER) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_COMM) || - (gp_descs[d].bDeviceClass == 0xe0) /* wireless / bluetooth */ + if ( (descs[d].bDeviceClass == LIBUSB_CLASS_HUB) || + (descs[d].bDeviceClass == LIBUSB_CLASS_HID) || + (descs[d].bDeviceClass == LIBUSB_CLASS_PRINTER) || + (descs[d].bDeviceClass == LIBUSB_CLASS_COMM) || + (descs[d].bDeviceClass == 0xe0) /* wireless / bluetooth */ ) continue; /* excepts HUBs, usually the interfaces have the classes, not * the device */ unknownint = 0; - for (i = 0; i < gp_descs[d].bNumConfigurations; i++) { + for (i = 0; i < descs[d].bNumConfigurations; i++) { struct libusb_config_descriptor *config; int ret; - ret = libusb_get_config_descriptor (gp_devs[d], i, &config); + ret = libusb_get_config_descriptor (devs[d], i, &config); if (ret) { unknownint++; continue; @@ -185,22 +196,22 @@ gp_port_library_list (GPPortInfoList *li /* Redo the same bus/device walk, but now add the ports with usb:x,y notation, * so we can address all USB devices. */ - for (d = 0; d < gp_nrofdevs; d++) { + for (d = 0; d < nrofdevs; d++) { /* Devices which are definitely not cameras. */ - if ( (gp_descs[d].bDeviceClass == LIBUSB_CLASS_HUB) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_HID) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_PRINTER) || - (gp_descs[d].bDeviceClass == LIBUSB_CLASS_COMM) + if ( (descs[d].bDeviceClass == LIBUSB_CLASS_HUB) || + (descs[d].bDeviceClass == LIBUSB_CLASS_HID) || + (descs[d].bDeviceClass == LIBUSB_CLASS_PRINTER) || + (descs[d].bDeviceClass == LIBUSB_CLASS_COMM) ) continue; /* excepts HUBs, usually the interfaces have the classes, not * the device */ unknownint = 0; - for (i = 0; i < gp_descs[d].bNumConfigurations; i++) { + for (i = 0; i < descs[d].bNumConfigurations; i++) { struct libusb_config_descriptor *config; int ret; - ret = libusb_get_config_descriptor (gp_devs[d], i, &config); + ret = libusb_get_config_descriptor (devs[d], i, &config); if (ret) { gp_log (GP_LOG_ERROR, "libusb1", "libusb_get_config_descriptor(%d) returned %d", d, ret); unknownint++; @@ -226,8 +237,8 @@ gp_port_library_list (GPPortInfoList *li info.type = GP_PORT_USB; strcpy (info.name, "Universal Serial Bus"); snprintf (info.path,sizeof(info.path), "usb:%03d,%03d", - libusb_get_bus_number (gp_devs[d]), - libusb_get_device_address (gp_devs[d]) + libusb_get_bus_number (devs[d]), + libusb_get_device_address (devs[d]) ); CHECK (gp_port_info_list_append (list, info)); } @@ -239,7 +250,7 @@ gp_port_library_list (GPPortInfoList *li strcpy (info.path, "usb:"); CHECK (gp_port_info_list_append (list, info)); } - libusb_exit (NULL); + libusb_exit (ctx); /* should free all stuff above */ return (GP_OK); } @@ -269,11 +280,10 @@ gp_port_usb_exit (GPPort *port) { if (port->pl) { libusb_exit (port->pl->ctx); + free (port->pl->descs); free (port->pl); port->pl = NULL; } - if (gp_devs) libusb_free_device_list (gp_devs, 1); - free (gp_descs); return (GP_OK); } @@ -744,6 +754,7 @@ gp_port_usb_find_device_lib(GPPort *port { char *s; int d, busnr = 0, devnr = 0; + GPPortPrivateLibrary *pl = port->pl; if (!port) return (GP_ERROR_BAD_PARAMETERS); @@ -767,23 +778,23 @@ gp_port_usb_find_device_lib(GPPort *port return GP_ERROR_BAD_PARAMETERS; } - gp_nrofdevs = load_devicelist (port->pl->ctx); + pl->nrofdevs = load_devicelist (port->pl); - for (d = 0; d < gp_nrofdevs; d++) { + for (d = 0; d < pl->nrofdevs; d++) { struct libusb_config_descriptor *confdesc; int ret; int config = -1, interface = -1, altsetting = -1; - if ((gp_descs[d].idVendor != idvendor) || - (gp_descs[d].idProduct != idproduct)) + if ((pl->descs[d].idVendor != idvendor) || + (pl->descs[d].idProduct != idproduct)) continue; - if (busnr && (busnr != libusb_get_bus_number (gp_devs[d]))) + if (busnr && (busnr != libusb_get_bus_number (pl->devs[d]))) continue; - if (devnr && (devnr != libusb_get_device_address (gp_devs[d]))) + if (devnr && (devnr != libusb_get_device_address (pl->devs[d]))) continue; - port->pl->d = gp_devs[d]; + port->pl->d = pl->devs[d]; gp_log (GP_LOG_VERBOSE, "libusb1", "Looking for USB device " @@ -791,9 +802,9 @@ gp_port_usb_find_device_lib(GPPort *port idvendor, idproduct); /* Use the first config, interface and altsetting we find */ - gp_port_usb_find_first_altsetting(gp_devs[d], &config, &interface, &altsetting); + gp_port_usb_find_first_altsetting(pl->devs[d], &config, &interface, &altsetting); - ret = libusb_get_config_descriptor (gp_devs[d], config, &confdesc); + ret = libusb_get_config_descriptor (pl->devs[d], config, &confdesc); if (ret) continue; @@ -810,11 +821,11 @@ gp_port_usb_find_device_lib(GPPort *port port->settings.usb.interface = confdesc->interface[interface].altsetting[altsetting].bInterfaceNumber; port->settings.usb.altsetting = confdesc->interface[interface].altsetting[altsetting].bAlternateSetting; - port->settings.usb.inep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_BULK); - port->settings.usb.outep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_OUT, LIBUSB_TRANSFER_TYPE_BULK); - port->settings.usb.intep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); + port->settings.usb.inep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_BULK); + port->settings.usb.outep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_OUT, LIBUSB_TRANSFER_TYPE_BULK); + port->settings.usb.intep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); - port->settings.usb.maxpacketsize = libusb_get_max_packet_size (gp_devs[d], port->settings.usb.inep); + port->settings.usb.maxpacketsize = libusb_get_max_packet_size (pl->devs[d], port->settings.usb.inep); gp_log (GP_LOG_VERBOSE, "libusb1", "Detected defaults: config %d, " "interface %d, altsetting %d, " @@ -998,6 +1009,8 @@ gp_port_usb_match_device_by_class(struct if (class == 666) /* Special hack for MTP devices with MS OS descriptors. */ return gp_port_usb_match_mtp_device (dev, configno, interfaceno, altsettingno); + ret = libusb_get_device_descriptor(dev, &desc); + if (desc.bDeviceClass == class && (subclass == -1 || desc.bDeviceSubClass == subclass) && @@ -1005,7 +1018,6 @@ gp_port_usb_match_device_by_class(struct desc.bDeviceProtocol == protocol)) return 1; - ret = libusb_get_device_descriptor(dev, &desc); for (i = 0; i < desc.bNumConfigurations; i++) { struct libusb_config_descriptor *config; @@ -1045,6 +1057,7 @@ gp_port_usb_find_device_by_class_lib(GPP { char *s; int d, busnr = 0, devnr = 0; + GPPortPrivateLibrary *pl = port->pl; if (!port) return (GP_ERROR_BAD_PARAMETERS); @@ -1065,14 +1078,14 @@ gp_port_usb_find_device_by_class_lib(GPP if (!class) return GP_ERROR_BAD_PARAMETERS; - gp_nrofdevs = load_devicelist (port->pl->ctx); - for (d = 0; d < gp_nrofdevs; d++) { + pl->nrofdevs = load_devicelist (port->pl); + for (d = 0; d < pl->nrofdevs; d++) { struct libusb_config_descriptor *confdesc; int i, ret, config = -1, interface = -1, altsetting = -1; - if (busnr && (busnr != libusb_get_bus_number (gp_devs[d]))) + if (busnr && (busnr != libusb_get_bus_number (pl->devs[d]))) continue; - if (devnr && (devnr != libusb_get_device_address (gp_devs[d]))) + if (devnr && (devnr != libusb_get_device_address (pl->devs[d]))) continue; gp_log (GP_LOG_VERBOSE, "gphoto2-port-usb", @@ -1080,17 +1093,17 @@ gp_port_usb_find_device_by_class_lib(GPP "(class 0x%x, subclass, 0x%x, protocol 0x%x)...", class, subclass, protocol); - ret = gp_port_usb_match_device_by_class(gp_devs[d], class, subclass, protocol, &config, &interface, &altsetting); + ret = gp_port_usb_match_device_by_class(pl->devs[d], class, subclass, protocol, &config, &interface, &altsetting); if (!ret) continue; - port->pl->d = gp_devs[d]; + port->pl->d = pl->devs[d]; gp_log (GP_LOG_VERBOSE, "libusb1", "Found USB class device " "(class 0x%x, subclass, 0x%x, protocol 0x%x)", class, subclass, protocol); - ret = libusb_get_config_descriptor (gp_devs[d], config, &confdesc); + ret = libusb_get_config_descriptor (pl->devs[d], config, &confdesc); if (ret) continue; /* Set the defaults */ @@ -1098,9 +1111,9 @@ gp_port_usb_find_device_by_class_lib(GPP port->settings.usb.interface = confdesc->interface[interface].altsetting[altsetting].bInterfaceNumber; port->settings.usb.altsetting = confdesc->interface[interface].altsetting[altsetting].bAlternateSetting; - port->settings.usb.inep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_BULK); - port->settings.usb.outep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_OUT, LIBUSB_TRANSFER_TYPE_BULK); - port->settings.usb.intep = gp_port_usb_find_ep(gp_devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); + port->settings.usb.inep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_BULK); + port->settings.usb.outep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_OUT, LIBUSB_TRANSFER_TYPE_BULK); + port->settings.usb.intep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); port->settings.usb.maxpacketsize = 0; gp_log (GP_LOG_DEBUG, "libusb1", "inep to look for is %02x", port->settings.usb.inep); for (i=0;i<confdesc->interface[interface].altsetting[altsetting].bNumEndpoints;i++) { @@ -1117,8 +1130,8 @@ gp_port_usb_find_device_by_class_lib(GPP port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, - gp_descs[d].idVendor, - gp_descs[d].idProduct, + pl->descs[d].idVendor, + pl->descs[d].idProduct, port->settings.usb.inep, port->settings.usb.outep, port->settings.usb.intep
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor