Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 731024
Collapse All | Expand All

(-)file_not_specified_in_diff (-2 / +9 lines)
Line  Link Here
0
-- a/dc1394/juju/capture.c
0
++ b/dc1394/juju/capture.c
Lines 321-327 dc1394_juju_capture_dequeue (platform_camera_t * craw, Link Here
321
321
322
    struct {
322
    struct {
323
        struct fw_cdev_event_iso_interrupt i;
323
        struct fw_cdev_event_iso_interrupt i;
324
		__u32 headers[craw->packets_per_frame*2 + 16]; // HPK 20161209
324
        __u32 *headers;
325
    } iso;
325
    } iso;
326
326
327
    if ( (policy<DC1394_CAPTURE_POLICY_MIN) || (policy>DC1394_CAPTURE_POLICY_MAX) )
327
    if ( (policy<DC1394_CAPTURE_POLICY_MIN) || (policy>DC1394_CAPTURE_POLICY_MAX) )
Lines 333-352 dc1394_juju_capture_dequeue (platform_camera_t * craw, Link Here
333
    fds[0].fd = craw->iso_fd;
333
    fds[0].fd = craw->iso_fd;
334
    fds[0].events = POLLIN;
334
    fds[0].events = POLLIN;
335
335
336
    iso.headers = malloc(craw->packets_per_frame*2 + 16); // HPK 20161209
337
336
    while (1) {
338
    while (1) {
337
        err = poll(fds, 1, (policy == DC1394_CAPTURE_POLICY_POLL) ? 0 : -1);
339
        err = poll(fds, 1, (policy == DC1394_CAPTURE_POLICY_POLL) ? 0 : -1);
338
        if (err < 0) {
340
        if (err < 0) {
339
            if (errno == EINTR)
341
            if (errno == EINTR)
340
                continue;
342
                continue;
341
            dc1394_log_error("poll() failed for device %s.", craw->filename);
343
            dc1394_log_error("poll() failed for device %s.", craw->filename);
344
            free(iso.headers);
342
            return DC1394_FAILURE;
345
            return DC1394_FAILURE;
343
        } else if (err == 0) {
346
        } else if (err == 0) {
347
            free(iso.headers);
344
            return DC1394_SUCCESS;
348
            return DC1394_SUCCESS;
345
        }
349
        }
346
350
347
        len = read (craw->iso_fd, &iso, sizeof iso);
351
        len = read (craw->iso_fd, &iso, sizeof iso);
348
        if (len < 0) {
352
        if (len < 0) {
349
            dc1394_log_error("Juju: dequeue failed to read a response: %m");
353
            dc1394_log_error("Juju: dequeue failed to read a response: %m");
354
            free(iso.headers);
350
            return DC1394_FAILURE;
355
            return DC1394_FAILURE;
351
        }
356
        }
352
357
Lines 394-399 dc1394_juju_capture_dequeue (platform_camera_t * craw, Link Here
394
399
395
    *frame_return = &f->frame;
400
    *frame_return = &f->frame;
396
401
402
    free(iso.headers);
403
397
    return DC1394_SUCCESS;
404
    return DC1394_SUCCESS;
398
}
405
}
399
406
(-)a/dc1394/juju/control.c (-1 / +5 lines)
Lines 283-289 juju_handle_event (platform_camera_t * cam) Link Here
283
    union {
283
    union {
284
        struct {
284
        struct {
285
            struct fw_cdev_event_response r;
285
            struct fw_cdev_event_response r;
286
            __u32 buffer[cam->max_response_quads];
286
            __u32 *buffer;
287
        } response;
287
        } response;
288
        struct fw_cdev_event_bus_reset reset;
288
        struct fw_cdev_event_bus_reset reset;
289
        struct fw_cdev_event_iso_resource resource;
289
        struct fw_cdev_event_iso_resource resource;
Lines 292-297 juju_handle_event (platform_camera_t * cam) Link Here
292
    juju_response_info *resp_info;
292
    juju_response_info *resp_info;
293
    juju_iso_info *iso_info;
293
    juju_iso_info *iso_info;
294
294
295
    u.response.buffer = malloc(cam->max_response_quads);
296
295
    len = read (cam->fd, &u, sizeof u);
297
    len = read (cam->fd, &u, sizeof u);
296
    if (len < 0) {
298
    if (len < 0) {
297
        dc1394_log_error("juju: Read failed: %m");
299
        dc1394_log_error("juju: Read failed: %m");
Lines 371-376 juju_handle_event (platform_camera_t * cam) Link Here
371
        break;
373
        break;
372
    }
374
    }
373
375
376
    free(u.response.buffer);
377
374
    return 0;
378
    return 0;
375
}
379
}
376
380

Return to bug 731024