X-Git-Url: https://git.ao2.it/libam7xxx.git/blobdiff_plain/8449872d8590fb63b9ba06aec54aec66782f4dbc..b49f01d360c6ea45998e56b3e9827fc0c7cb26a9:/src/am7xxx.c diff --git a/src/am7xxx.c b/src/am7xxx.c index 4ed7cf9..f04b638 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -445,7 +445,7 @@ typedef enum { * device with index 'open_device_index' and returns the correspondent * am7xxx_device in the 'dev' parameter; the function returns 0 on success, * 1 if the device was already open and a negative value on error. - * + * * NOTES: * if scan_devices() fails when called with 'op' == SCAN_OP_BUILD_DEVLIST, * the caller might want to call am7xxx_shutdown() in order to remove @@ -652,10 +652,7 @@ int am7xxx_close_device(am7xxx_device *dev) } int am7xxx_get_device_info(am7xxx_device *dev, - unsigned int *native_width, - unsigned int *native_height, - unsigned int *unknown0, - unsigned int *unknown1) + am7xxx_device_info *device_info) { int ret; struct am7xxx_header h = { @@ -682,10 +679,13 @@ int am7xxx_get_device_info(am7xxx_device *dev, if (ret < 0) return ret; - *native_width = h.header_data.devinfo.native_width; - *native_height = h.header_data.devinfo.native_height; - *unknown0 = h.header_data.devinfo.unknown0; - *unknown1 = h.header_data.devinfo.unknown1; + device_info->native_width = h.header_data.devinfo.native_width; + device_info->native_height = h.header_data.devinfo.native_height; +#if 0 + /* No reason to expose these in the public API until we know what they mean */ + device_info->unknown0 = h.header_data.devinfo.unknown0; + device_info->unknown1 = h.header_data.devinfo.unknown1; +#endif return 0; } @@ -695,7 +695,7 @@ int am7xxx_send_image(am7xxx_device *dev, unsigned int width, unsigned int height, uint8_t *image, - unsigned int size) + unsigned int image_size) { int ret; struct am7xxx_header h = { @@ -709,7 +709,7 @@ int am7xxx_send_image(am7xxx_device *dev, .format = format, .width = width, .height = height, - .image_size = size, + .image_size = image_size, }, }, }; @@ -718,12 +718,12 @@ int am7xxx_send_image(am7xxx_device *dev, if (ret < 0) return ret; - if (image == NULL || size == 0) { - warning(dev->ctx, "Not sending any data, check the 'data' or 'size' parameters\n"); + if (image == NULL || image_size == 0) { + warning(dev->ctx, "Not sending any data, check the 'image' or 'image_size' parameters\n"); return 0; } - return send_data(dev, image, size); + return send_data(dev, image, image_size); } int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mode)