summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
48fdccc)
This is in order to abstract the properties of an am7xxx device, for now
only native_width and native_height are supported.
}
int am7xxx_get_device_info(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 = {
{
int ret;
struct am7xxx_header h = {
- *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
struct _am7xxx_device;
typedef struct _am7xxx_device am7xxx_device;
struct _am7xxx_device;
typedef struct _am7xxx_device am7xxx_device;
+typedef struct {
+ unsigned int native_width;
+ unsigned int native_height;
+} am7xxx_device_info;
+
typedef enum {
AM7XXX_LOG_FATAL = 0,
AM7XXX_LOG_ERROR = 1,
typedef enum {
AM7XXX_LOG_FATAL = 0,
AM7XXX_LOG_ERROR = 1,
int am7xxx_close_device(am7xxx_device *dev);
int am7xxx_get_device_info(am7xxx_device *dev,
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 am7xxx_send_image(am7xxx_device *dev,
am7xxx_image_format format,
int am7xxx_send_image(am7xxx_device *dev,
am7xxx_image_format format,
int height = 480;
unsigned char *image;
unsigned int size;
int height = 480;
unsigned char *image;
unsigned int size;
- unsigned int native_width;
- unsigned int native_height;
- unsigned int unknown0;
- unsigned int unknown1;
+ am7xxx_device_info device_info;
while ((opt = getopt(argc, argv, "f:F:l:W:H:h")) != -1) {
switch (opt) {
while ((opt = getopt(argc, argv, "f:F:l:W:H:h")) != -1) {
switch (opt) {
- ret = am7xxx_get_device_info(dev, &native_width, &native_height, &unknown0, &unknown1);
+ ret = am7xxx_get_device_info(dev, &device_info);
if (ret < 0) {
perror("am7xxx_get_info");
exit_code = EXIT_FAILURE;
goto cleanup;
}
if (ret < 0) {
perror("am7xxx_get_info");
exit_code = EXIT_FAILURE;
goto cleanup;
}
- printf("Native resolution: %dx%d\n", native_width, native_height);
- printf("Unknown0: %d\n", unknown0);
- printf("Unknown1: %d\n", unknown1);
+ printf("Native resolution: %dx%d\n",
+ device_info.native_width, device_info.native_height);
ret = am7xxx_set_power_mode(dev, AM7XXX_POWER_LOW);
if (ret < 0) {
ret = am7xxx_set_power_mode(dev, AM7XXX_POWER_LOW);
if (ret < 0) {