am7xxx_device_info device_info;
while ((opt = getopt(argc, argv, "d:f:F:l:p:z:W:H:h")) != -1) {
am7xxx_device_info device_info;
while ((opt = getopt(argc, argv, "d:f:F:l:p:z:W:H:h")) != -1) {
device_index = atoi(optarg);
if (device_index < 0) {
fprintf(stderr, "Unsupported device index\n");
device_index = atoi(optarg);
if (device_index < 0) {
fprintf(stderr, "Unsupported device index\n");
default:
fprintf(stderr, "Invalid power mode value, must be between %d and %d\n",
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
default:
fprintf(stderr, "Invalid power mode value, must be between %d and %d\n",
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
}
}
if (filename[0] == '\0') {
fprintf(stderr, "An image file MUST be specified with the -f option.\n\n");
usage(argv[0]);
}
}
if (filename[0] == '\0') {
fprintf(stderr, "An image file MUST be specified with the -f option.\n\n");
usage(argv[0]);
- ret = fread(image, size, 1, image_fp);
+ ret = (int)fread(image, size, 1, image_fp);
ret = am7xxx_open_device(ctx, &dev, 0);
if (ret < 0) {
perror("am7xxx_open_device");
ret = am7xxx_open_device(ctx, &dev, 0);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_open_device(ctx, &dev, device_index);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_open_device(ctx, &dev, device_index);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_get_device_info(dev, &device_info);
if (ret < 0) {
perror("am7xxx_get_device_info");
goto cleanup;
}
ret = am7xxx_get_device_info(dev, &device_info);
if (ret < 0) {
perror("am7xxx_get_device_info");
ret = am7xxx_set_zoom_mode(dev, zoom);
if (ret < 0) {
perror("am7xxx_set_zoom_mode");
ret = am7xxx_set_zoom_mode(dev, zoom);
if (ret < 0) {
perror("am7xxx_set_zoom_mode");
goto cleanup;
}
ret = am7xxx_set_power_mode(dev, power_mode);
if (ret < 0) {
perror("am7xxx_set_power_mode");
goto cleanup;
}
ret = am7xxx_set_power_mode(dev, power_mode);
if (ret < 0) {
perror("am7xxx_set_power_mode");
if ((unsigned int)width > device_info.native_width ||
(unsigned int)height > device_info.native_height)
fprintf(stderr,
"WARNING: image is %dx%d, not fitting the native resolution, it may be displayed wrongly!\n",
width, height);
if ((unsigned int)width > device_info.native_width ||
(unsigned int)height > device_info.native_height)
fprintf(stderr,
"WARNING: image is %dx%d, not fitting the native resolution, it may be displayed wrongly!\n",
width, height);
- ret = am7xxx_send_image(dev, format, width, height, image, size);
+ ret = am7xxx_send_image(dev, format, width, height, image, (unsigned int)size);