From e2e192a23633acd8606748a6e9399d5e20a52ae8 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 8 Jul 2015 11:26:13 +0200 Subject: [PATCH 01/16] am7xxx: put some spaces around operators --- src/am7xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/am7xxx.c b/src/am7xxx.c index 74ae689..b988267 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -341,7 +341,7 @@ static inline unsigned int in_80chars(unsigned int i) { /* The 3 below is the length of "xx " where xx is the hex string * representation of a byte */ - return ((i+1) % (80/3)); + return ((i + 1) % (80 / 3)); } static void trace_dump_buffer(am7xxx_context *ctx, const char *message, -- 2.1.4 From fdb8045c91881d75c68a08e65dc1e00f89bc0497 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Mon, 2 Nov 2015 00:00:00 +0100 Subject: [PATCH 02/16] am7xxx-play: Replace deprecated FFmpeg API symbol PIX_FMT_NV12 PIX_FMT_NV12 is not going to be available in ffmpeg 2.9 so prepare for that by using AV_PIX_FMT_NV12, which BTW has been available for quite some time already. --- examples/am7xxx-play.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index f63fbfd..0fa7c58 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -216,7 +216,7 @@ static int video_output_init(struct video_output_ctx *output_ctx, */ if (image_format == AM7XXX_IMAGE_FORMAT_NV12) { fprintf(stdout, "using raw output format\n"); - output_codec_ctx->pix_fmt = PIX_FMT_NV12; + output_codec_ctx->pix_fmt = AV_PIX_FMT_NV12; output_ctx->codec_ctx = output_codec_ctx; output_ctx->raw_output = 1; ret = 0; -- 2.1.4 From b0731f05fb3ddcbea19c88d628e1b539966c21fd Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 7 Nov 2015 22:33:03 +0100 Subject: [PATCH 03/16] Fix some format string warnings from clang Building with clang gives some format string warnings as below, fix them by using the correct format string when printing out the values. .../libam7xxx/src/am7xxx.c:804:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] (*dev)->desc->configuration, current_configuration); ^~~~~~~~~~~~~~~~~~~~~ .../libam7xxx/src/am7xxx.c:65:85: note: expanded from macro 'debug' #define debug(ctx, ...) log_message(ctx, AM7XXX_LOG_DEBUG, __func__, 0, __VA_ARGS__) ^ 1 warning generated. [...] .../libam7xxx/examples/am7xxx-modeswitch.c:75:5: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] AM7XXX_STORAGE_CONFIGURATION); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../libam7xxx/examples/am7xxx-modeswitch.c:26:38: note: expanded from macro 'AM7XXX_STORAGE_CONFIGURATION' #define AM7XXX_STORAGE_CONFIGURATION 1 ^ .../libam7xxx/examples/am7xxx-modeswitch.c:87:4: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] AM7XXX_STORAGE_INTERFACE); ^~~~~~~~~~~~~~~~~~~~~~~~ .../libam7xxx/examples/am7xxx-modeswitch.c:27:38: note: expanded from macro 'AM7XXX_STORAGE_INTERFACE' #define AM7XXX_STORAGE_INTERFACE 0 ^ .../libam7xxx/examples/am7xxx-modeswitch.c:104:4: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] AM7XXX_STORAGE_CONFIGURATION, current_configuration); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../libam7xxx/examples/am7xxx-modeswitch.c:26:38: note: expanded from macro 'AM7XXX_STORAGE_CONFIGURATION' #define AM7XXX_STORAGE_CONFIGURATION 1 ^ .../libam7xxx/examples/am7xxx-modeswitch.c:104:34: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] AM7XXX_STORAGE_CONFIGURATION, current_configuration); ^~~~~~~~~~~~~~~~~~~~~ 4 warnings generated. --- examples/am7xxx-modeswitch.c | 6 +++--- src/am7xxx.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/am7xxx-modeswitch.c b/examples/am7xxx-modeswitch.c index 62db796..793130e 100644 --- a/examples/am7xxx-modeswitch.c +++ b/examples/am7xxx-modeswitch.c @@ -71,7 +71,7 @@ int main(void) if (ret < 0) { fprintf(stderr, "libusb_set_configuration failed: %s\n", libusb_error_name(ret)); - fprintf(stderr, "Cannot set configuration %hhu\n", + fprintf(stderr, "Cannot set configuration %d\n", AM7XXX_STORAGE_CONFIGURATION); goto out_libusb_close; } @@ -83,7 +83,7 @@ int main(void) if (ret < 0) { fprintf(stderr, "libusb_claim_interface failed: %s\n", libusb_error_name(ret)); - fprintf(stderr, "Cannot claim interface %hhu\n", + fprintf(stderr, "Cannot claim interface %d\n", AM7XXX_STORAGE_INTERFACE); goto out_libusb_close; } @@ -100,7 +100,7 @@ int main(void) } if (current_configuration != AM7XXX_STORAGE_CONFIGURATION) { - fprintf(stderr, "libusb configuration changed (expected: %hhu, current: %hhu\n", + fprintf(stderr, "libusb configuration changed (expected: %d, current: %d\n", AM7XXX_STORAGE_CONFIGURATION, current_configuration); ret = -EINVAL; goto out_libusb_release_interface; diff --git a/src/am7xxx.c b/src/am7xxx.c index b988267..76df87d 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -800,7 +800,7 @@ static int open_device(am7xxx_context *ctx, } if (current_configuration != (*dev)->desc->configuration) { - debug(ctx, "libusb configuration changed (expected: %hhu, current: %hhu\n", + debug(ctx, "libusb configuration changed (expected: %hhu, current: %d\n", (*dev)->desc->configuration, current_configuration); ret = -EINVAL; goto out_libusb_release_interface; -- 2.1.4 From edf253b4b7ceea1aa8a94ad0a69c721a576f63f3 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 10:41:58 +0100 Subject: [PATCH 04/16] am7xxx-play: fix an error message, we now use am7xxx_send_image_async() --- examples/am7xxx-play.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index 0fa7c58..1b06dfa 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -435,7 +435,7 @@ static int am7xxx_play(const char *input_format_string, out_picture, out_picture_size); if (ret < 0) { - perror("am7xxx_send_image"); + perror("am7xxx_send_image_async"); run = 0; goto end_while; } -- 2.1.4 From 81c8bcd5aa0a94b6cc2f429faa61eff6d36049c4 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 10:43:46 +0100 Subject: [PATCH 05/16] TODO: add some ideas for minor enhancements --- TODO | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TODO b/TODO index 4182cfc..46bf8de 100644 --- a/TODO +++ b/TODO @@ -5,3 +5,7 @@ - If there will ever be an API breakage, consider using more portable types (e.g. off_t for file sizes, size_t for counters, etc.) - uniform the style of if() checks in cmake files +- evaluate the use of error() instead of debug() for error paths +- make the switch_command in am7xxx-modeswitch more readable using the + explicit bulk_cb_wrap structure from include/linux/usb/storage.h in the + linux kernel. -- 2.1.4 From c29b6eadb255f5f5f732d0391812d97fe015395f Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 10:47:36 +0100 Subject: [PATCH 06/16] am7xxx-play: fix runtime warnings from ffmpeg ffmpeg emits warnings at runtime about some AVFrame fields not being set: [mjpeg @ 0x669040] AVFrame.format is not set [mjpeg @ 0x669040] AVFrame.width or height is not set This happens in a loop so the message is repeated over and over and becomes annoying, fix this by setting the missing values. --- examples/am7xxx-play.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index 1b06dfa..dedf0de 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -320,6 +320,9 @@ static int am7xxx_play(const char *input_format_string, ret = -ENOMEM; goto cleanup_picture_raw; } + picture_scaled->format = (output_ctx.codec_ctx)->pix_fmt; + picture_scaled->width = (output_ctx.codec_ctx)->width; + picture_scaled->height = (output_ctx.codec_ctx)->height; /* calculate the bytes needed for the output image and create buffer for the output image */ out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt, -- 2.1.4 From 8251ef7208f3c048fab3837d6f729d9ee016f692 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 13:10:40 +0100 Subject: [PATCH 07/16] am7xxx-play: don't dump the last frame unconditionally Stop dumping the last frame unconditionally in DEBUG mode, it's not the expected behavior; instead add an option to explicitly enable dumping the last frame but still leave this active only in DEBUG mode. --- examples/am7xxx-play.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index dedf0de..aaf941b 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -276,7 +276,8 @@ static int am7xxx_play(const char *input_format_string, unsigned int upscale, unsigned int quality, am7xxx_image_format image_format, - am7xxx_device *dev) + am7xxx_device *dev, + int dump_frame) { struct video_input_ctx input_ctx; struct video_output_ctx output_ctx; @@ -420,15 +421,19 @@ static int am7xxx_play(const char *input_format_string, } #ifdef DEBUG - char filename[NAME_MAX]; - FILE *file; - if (!output_ctx.raw_output) - snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality); - else - snprintf(filename, NAME_MAX, "out.raw"); - file = fopen(filename, "wb"); - fwrite(out_picture, 1, out_picture_size, file); - fclose(file); + if (dump_frame) { + char filename[NAME_MAX]; + FILE *file; + if (!output_ctx.raw_output) + snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality); + else + snprintf(filename, NAME_MAX, "out.raw"); + file = fopen(filename, "wb"); + fwrite(out_picture, 1, out_picture_size, file); + fclose(file); + } +#else + (void) dump_frame; #endif ret = am7xxx_send_image_async(dev, @@ -597,6 +602,9 @@ static void usage(char *name) printf("usage: %s [OPTIONS]\n\n", name); printf("OPTIONS:\n"); printf("\t-d \t\tthe device index (default is 0)\n"); +#ifdef DEBUG + printf("\t-D \t\t\tdump the last frame to a file (only active in DEBUG mode)\n"); +#endif printf("\t-f \tthe input device format\n"); printf("\t-i \t\tthe input path\n"); printf("\t-o \t\ta comma separated list of input format options\n"); @@ -644,8 +652,9 @@ int main(int argc, char *argv[]) int format = AM7XXX_IMAGE_FORMAT_JPEG; am7xxx_context *ctx; am7xxx_device *dev; + int dump_frame = 0; - while ((opt = getopt(argc, argv, "d:f:i:o:s:uF:q:l:p:z:h")) != -1) { + while ((opt = getopt(argc, argv, "d:Df:i:o:s:uF:q:l:p:z:h")) != -1) { switch (opt) { case 'd': device_index = atoi(optarg); @@ -655,6 +664,12 @@ int main(int argc, char *argv[]) goto out; } break; + case 'D': + dump_frame = 1; +#ifndef DEBUG + fprintf(stderr, "Warning: the -D option is only active in DEBUG mode.\n"); +#endif + break; case 'f': input_format_string = strdup(optarg); break; @@ -853,7 +868,8 @@ int main(int argc, char *argv[]) upscale, quality, format, - dev); + dev, + dump_frame); if (ret < 0) { fprintf(stderr, "am7xxx_play failed\n"); goto cleanup; -- 2.1.4 From 336853d1eb2a1cb84b7995e579c320f754519602 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 13:21:31 +0100 Subject: [PATCH 08/16] am7xxx-play: fix warning about deprecated fields in the output codec MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit .../examples/am7xxx-play.c:238:2: warning: ‘lmin’ is deprecated [-Wdeprecated-declarations] output_codec_ctx->mb_lmin = output_codec_ctx->lmin = output_codec_ctx->qmin * FF_QP2LAMBDA; ^ .../examples/am7xxx-play.c:239:2: warning: ‘lmax’ is deprecated [-Wdeprecated-declarations] output_codec_ctx->mb_lmax = output_codec_ctx->lmax = output_codec_ctx->qmax * FF_QP2LAMBDA; ^ --- examples/am7xxx-play.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index aaf941b..6b0d206 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -235,8 +235,8 @@ static int video_output_init(struct video_output_ctx *output_ctx, * in particular they won't be 0, this is needed because they are used * as divisor somewhere in the encoding process */ output_codec_ctx->qmin = output_codec_ctx->qmax = ((100 - (quality - 1)) * FF_QUALITY_SCALE) / 100; - output_codec_ctx->mb_lmin = output_codec_ctx->lmin = output_codec_ctx->qmin * FF_QP2LAMBDA; - output_codec_ctx->mb_lmax = output_codec_ctx->lmax = output_codec_ctx->qmax * FF_QP2LAMBDA; + output_codec_ctx->mb_lmin = output_codec_ctx->qmin * FF_QP2LAMBDA; + output_codec_ctx->mb_lmax = output_codec_ctx->qmax * FF_QP2LAMBDA; output_codec_ctx->flags |= CODEC_FLAG_QSCALE; output_codec_ctx->global_quality = output_codec_ctx->qmin * FF_QP2LAMBDA; -- 2.1.4 From e691b17f2c134d1380f3c5d3dc25b3ec1ac9106f Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 15:46:15 +0100 Subject: [PATCH 09/16] Strip trailing spaces here and there --- contrib/am7xxx-play-window.sh | 6 +++--- examples/CMakeLists.txt | 4 ++-- src/am7xxx.h | 2 +- src/portable_endian.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/am7xxx-play-window.sh b/contrib/am7xxx-play-window.sh index 2978ef2..dd8703d 100755 --- a/contrib/am7xxx-play-window.sh +++ b/contrib/am7xxx-play-window.sh @@ -13,13 +13,13 @@ set -e DISPLAY=":0" - + WIN_INFO="$(xwininfo)" - + X=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left X:[[:space:]]*/s///p") Y=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left Y:[[:space:]]*/s///p") WIDTH=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Width:[[:space:]]*/s///p") HEIGHT=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Height:[[:space:]]*/s///p") - + set -x am7xxx-play -f x11grab -i "${DISPLAY}+${X},${Y}" -o video_size="${WIDTH}x${HEIGHT}" diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e4da954..c563f5f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -18,8 +18,8 @@ endif() option(BUILD_AM7XXX-PLAY "Build a more complete example: am7xxx-play" TRUE) if(BUILD_AM7XXX-PLAY) find_package(FFmpeg REQUIRED) - set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}) check_symbol_exists(avformat_open_input "${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat/avformat.h" HAVE_AVFORMAT_OPEN_INPUT) diff --git a/src/am7xxx.h b/src/am7xxx.h index 4a97f69..d103c22 100644 --- a/src/am7xxx.h +++ b/src/am7xxx.h @@ -252,7 +252,7 @@ int am7xxx_send_image(am7xxx_device *dev, * This is the function that actually makes the device display something. * Static pictures can be sent just once and the device will keep showing them * until another image get sent or some command resets or turns off the display. - * + * * @note This _async() variant makes a copy of the image buffer, so the caller * is free to reuse the buffer just after the function returns. * diff --git a/src/portable_endian.h b/src/portable_endian.h index 1741f18..6bc9a73 100644 --- a/src/portable_endian.h +++ b/src/portable_endian.h @@ -1,4 +1,4 @@ -/* +/* * Public domain, stripped down version of: * https://gist.github.com/panzi/6856583 */ -- 2.1.4 From dd0eeed7f0b06ee36297ecbf13292195ef058f96 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 16:30:35 +0100 Subject: [PATCH 10/16] Refresh contrib/performance/0001-Instrument-code-with-fps-meter.patch --- .../0001-Instrument-code-with-fps-meter.patch | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/contrib/performance/0001-Instrument-code-with-fps-meter.patch b/contrib/performance/0001-Instrument-code-with-fps-meter.patch index 5c133ee..ef81acb 100644 --- a/contrib/performance/0001-Instrument-code-with-fps-meter.patch +++ b/contrib/performance/0001-Instrument-code-with-fps-meter.patch @@ -1,6 +1,6 @@ -From dc6b216ffea1e80fd3f43d6144eb679a193f5666 Mon Sep 17 00:00:00 2001 -From: Antonio Ospite -Date: Sun, 28 Jul 2013 01:06:41 +0200 +From ab3f910957638300224f1f114df6e73115ec86b7 Mon Sep 17 00:00:00 2001 +From: Antonio Ospite +Date: Tue, 17 Nov 2015 16:28:03 +0100 Subject: [PATCH] Instrument code with fps-meter X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM/Vb;]yA5 Date: Tue, 17 Nov 2015 16:37:28 +0100 Subject: [PATCH 11/16] Release version 0.1.6 --- NEWS | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/NEWS b/NEWS index e23a882..4b63b2d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,25 @@ +News for v0.1.6: +================ + + * Fix some ffmpeg compile time deprecation warnings in am7xxx-play + * Fix some fmmpeg runtime warnings + * Don't dump the last frame unconditionally in am7xxx-play when in DEBUG + mode, add an option to enable the frame dump, but this is only active in + DEBUG mode + * Fix some compilation warnings from clang + * Replace deprecated FFmpeg API symbol PIX_FMT_NV12 in am7xx-play (Thanks to + Andreas Cadhalpun) + * Fix the Length field in the switch command in am7xxx-modeswitch (Thanks to + Balasubramanian S) + * More robust handling of USB configurations + * More robust handling of kernel driver detachment (Thanks to Andrea + Console) + * Minor documentation cleanups + * Minor build system improvements (am7xxx-play can now build without XCB, + but some functionalities will not be available) + * Misc code cleanups + * Relicense the example under GPL-3+ + News for v0.1.5: ================ -- 2.1.4 From 0fe6736d63a0f869ba3abe509225ffdb044de19d Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 18:41:18 +0100 Subject: [PATCH 12/16] am7xxx: remove a useless empty line --- src/am7xxx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/am7xxx.c b/src/am7xxx.c index 76df87d..5dd6992 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -1261,7 +1261,6 @@ AM7XXX_PUBLIC int am7xxx_calc_scaled_image_dimensions(am7xxx_device *dev, unsigned int *scaled_width, unsigned int *scaled_height) { - am7xxx_device_info device_info; float width_ratio; float height_ratio; -- 2.1.4 From 80f9d332324848b878fca92f7097aa8fb71ec423 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 17 Nov 2015 18:42:39 +0100 Subject: [PATCH 13/16] am7xxx: bump _POSIX_C_SOURCE to 200112L for lroundf() The library code uses lroundf() from math.h but some compilers may warn about an implicit definition of it, so make sure it it actually available by following the requirements from the LROUND(3) man page. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f743b1a..7e914f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ add_definitions("-D_BSD_SOURCE") # for htole32() -add_definitions("-D_POSIX_C_SOURCE=199309L") # for nanosleep() +add_definitions("-D_POSIX_C_SOURCE=200112L") # for nanosleep() and lroundf() # Find packages needed to build library find_package(libusb-1.0 REQUIRED) -- 2.1.4 From 7171c39ad4fa77b1932614b94c3d8eb7fa3527f8 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 18 Nov 2015 16:52:39 +0100 Subject: [PATCH 14/16] NEWS: fix a typo s/am7xx-play/am7xxx-play/ --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 4b63b2d..9aba2e7 100644 --- a/NEWS +++ b/NEWS @@ -7,8 +7,8 @@ News for v0.1.6: mode, add an option to enable the frame dump, but this is only active in DEBUG mode * Fix some compilation warnings from clang - * Replace deprecated FFmpeg API symbol PIX_FMT_NV12 in am7xx-play (Thanks to - Andreas Cadhalpun) + * Replace deprecated FFmpeg API symbol PIX_FMT_NV12 in am7xxx-play (Thanks + to Andreas Cadhalpun) * Fix the Length field in the switch command in am7xxx-modeswitch (Thanks to Balasubramanian S) * More robust handling of USB configurations -- 2.1.4 From 96287291d6d9e1e7a421d4b5663e6e8d32699a6d Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 9 Jan 2016 13:17:49 +0100 Subject: [PATCH 15/16] am7xxx-modeswitch: adjust comment formatting --- examples/am7xxx-modeswitch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/am7xxx-modeswitch.c b/examples/am7xxx-modeswitch.c index 793130e..abc35d3 100644 --- a/examples/am7xxx-modeswitch.c +++ b/examples/am7xxx-modeswitch.c @@ -88,7 +88,8 @@ int main(void) goto out_libusb_close; } - /* Checking that the configuration has not changed, as suggested in + /* + * Checking that the configuration has not changed, as suggested in * http://libusb.sourceforge.net/api-1.0/caveats.html */ current_configuration = -1; -- 2.1.4 From 25e8c0ca3422ca4c678e4ec2f6f10c57037d8163 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 9 Jan 2016 13:18:40 +0100 Subject: [PATCH 16/16] Fix a missing parenthesis in some output strings --- examples/am7xxx-modeswitch.c | 2 +- src/am7xxx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/am7xxx-modeswitch.c b/examples/am7xxx-modeswitch.c index abc35d3..d5bd304 100644 --- a/examples/am7xxx-modeswitch.c +++ b/examples/am7xxx-modeswitch.c @@ -101,7 +101,7 @@ int main(void) } if (current_configuration != AM7XXX_STORAGE_CONFIGURATION) { - fprintf(stderr, "libusb configuration changed (expected: %d, current: %d\n", + fprintf(stderr, "libusb configuration changed (expected: %d, current: %d)\n", AM7XXX_STORAGE_CONFIGURATION, current_configuration); ret = -EINVAL; goto out_libusb_release_interface; diff --git a/src/am7xxx.c b/src/am7xxx.c index 5dd6992..eb715d3 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -800,7 +800,7 @@ static int open_device(am7xxx_context *ctx, } if (current_configuration != (*dev)->desc->configuration) { - debug(ctx, "libusb configuration changed (expected: %hhu, current: %d\n", + debug(ctx, "libusb configuration changed (expected: %hhu, current: %d)\n", (*dev)->desc->configuration, current_configuration); ret = -EINVAL; goto out_libusb_release_interface; -- 2.1.4