diff options
| author | He Zhe <zhe.he@windriver.com> | 2017-07-24 11:27:17 +0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-07-25 09:09:12 -0400 |
| commit | 2d28f71f9e8d3ad573ee92365de4e8a4df8a9b06 (patch) | |
| tree | e213f7b79151b4f17fcb64f205baea6719bf6d19 /recipes-support | |
| parent | d95b0b5d0de99c3d40f164eb5953efae3df3e5f8 (diff) | |
| download | meta-cloud-services-2d28f71f9e8d3ad573ee92365de4e8a4df8a9b06.tar.gz | |
spice: Fix build failures
Backport 3cb746329ea4846bd9c65e0198e69423379b6f62 "Use PRI macros in printf to
keep compatibility between 32/64bit system" from upstream to fix the following
errors:
server/jpeg_encoder.c:639:17: error: format '%lu' expects argument of type 'long
unsigned int', but argument 12 has type 'uint64_t {aka long long unsigned int}'
[-Werror=format=]
server/mjpeg_encoder.c:639:17: error: format '%lu' expects argument of type
'long unsigned int', but argument 13 has type 'uint64_t {aka long long unsigned
int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type
'long unsigned int', but argument 6 has type 'uint64_t {aka long long unsigned
int}' [-Werror=format=]
server/mjpeg_encoder.c:706:21: error: format '%lu' expects argument of type
'long unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned
int}' [-Werror=format=]
server/mjpeg_encoder.c:936:75: error: integer overflow in expression
[-Werror=overflow]
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-support')
| -rw-r--r-- | recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch | 72 | ||||
| -rw-r--r-- | recipes-support/spice/spice_git.bb | 1 |
2 files changed, 73 insertions, 0 deletions
diff --git a/recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch b/recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch new file mode 100644 index 0000000..18fa8fa --- /dev/null +++ b/recipes-support/spice/files/0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | From 3cb746329ea4846bd9c65e0198e69423379b6f62 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?=EC=86=8C=EB=B3=91=EC=B2=A0?= <byungchul.so@samsung.com> | ||
| 3 | Date: Thu, 24 Apr 2014 12:26:32 +0000 | ||
| 4 | Subject: [PATCH] Use PRI macros in printf to keep compatibility between | ||
| 5 | 32/64bit system | ||
| 6 | |||
| 7 | gcc's some integer type definitions are different between 32/64bit system. | ||
| 8 | This causes platform dependency problem with printf function. However, | ||
| 9 | we can avoid this problem by using PRI macros that supports platform | ||
| 10 | independent printf. | ||
| 11 | --- | ||
| 12 | server/mjpeg_encoder.c | 7 ++++--- | ||
| 13 | server/red_worker.c | 4 ++-- | ||
| 14 | 2 files changed, 6 insertions(+), 5 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c | ||
| 17 | index aea4964..f465d88 100644 | ||
| 18 | --- a/server/mjpeg_encoder.c | ||
| 19 | +++ b/server/mjpeg_encoder.c | ||
| 20 | @@ -23,6 +23,7 @@ | ||
| 21 | #include "mjpeg_encoder.h" | ||
| 22 | #include <jerror.h> | ||
| 23 | #include <jpeglib.h> | ||
| 24 | +#include <inttypes.h> | ||
| 25 | |||
| 26 | #define MJPEG_MAX_FPS 25 | ||
| 27 | #define MJPEG_MIN_FPS 1 | ||
| 28 | @@ -66,7 +67,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40, | ||
| 29 | * are not necessarily related to mis-estimation of the bit rate, and we would | ||
| 30 | * like to wait till the stream stabilizes. | ||
| 31 | */ | ||
| 32 | -#define MJPEG_WARMUP_TIME 3000L // 3 sec | ||
| 33 | +#define MJPEG_WARMUP_TIME 3000LL // 3 sec | ||
| 34 | |||
| 35 | enum { | ||
| 36 | MJPEG_QUALITY_EVAL_TYPE_SET, | ||
| 37 | @@ -638,7 +639,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder) | ||
| 38 | |||
| 39 | spice_debug("cur-fps=%u new-fps=%u (new/old=%.2f) |" | ||
| 40 | "bit-rate=%.2f (Mbps) latency=%u (ms) quality=%d |" | ||
| 41 | - " new-size-avg %lu , base-size %lu, (new/old=%.2f) ", | ||
| 42 | + " new-size-avg %"PRIu64" , base-size %"PRIu64", (new/old=%.2f) ", | ||
| 43 | rate_control->fps, new_fps, ((double)new_fps)/rate_control->fps, | ||
| 44 | ((double)rate_control->byte_rate*8)/1024/1024, | ||
| 45 | latency, | ||
| 46 | @@ -703,7 +704,7 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder *encoder, uint64_t now) | ||
| 47 | |||
| 48 | avg_fps = ((double)rate_control->adjusted_fps_num_frames*1000) / | ||
| 49 | adjusted_fps_time_passed; | ||
| 50 | - spice_debug("#frames-adjust=%lu #adjust-time=%lu avg-fps=%.2f", | ||
| 51 | + spice_debug("#frames-adjust=%"PRIu64" #adjust-time=%"PRIu64" avg-fps=%.2f", | ||
| 52 | rate_control->adjusted_fps_num_frames, adjusted_fps_time_passed, avg_fps); | ||
| 53 | spice_debug("defined=%u old-adjusted=%.2f", rate_control->fps, rate_control->adjusted_fps); | ||
| 54 | fps_ratio = avg_fps / rate_control->fps; | ||
| 55 | diff --git a/server/red_worker.c b/server/red_worker.c | ||
| 56 | index 619f7bc..1871e13 100644 | ||
| 57 | --- a/server/red_worker.c | ||
| 58 | +++ b/server/red_worker.c | ||
| 59 | @@ -2594,8 +2594,8 @@ static void red_print_stream_stats(DisplayChannelClient *dcc, StreamAgent *agent | ||
| 60 | mjpeg_encoder_get_stats(agent->mjpeg_encoder, &encoder_stats); | ||
| 61 | } | ||
| 62 | |||
| 63 | - spice_debug("stream=%ld dim=(%dx%d) #in-frames=%lu #in-avg-fps=%.2f #out-frames=%lu " | ||
| 64 | - "out/in=%.2f #drops=%lu (#pipe=%lu #fps=%lu) out-avg-fps=%.2f " | ||
| 65 | + spice_debug("stream=%"PRIdPTR" dim=(%dx%d) #in-frames=%"PRIu64" #in-avg-fps=%.2f #out-frames=%"PRIu64" " | ||
| 66 | + "out/in=%.2f #drops=%"PRIu64" (#pipe=%"PRIu64" #fps=%"PRIu64") out-avg-fps=%.2f " | ||
| 67 | "passed-mm-time(sec)=%.2f size-total(MB)=%.2f size-per-sec(Mbps)=%.2f " | ||
| 68 | "size-per-frame(KBpf)=%.2f avg-quality=%.2f " | ||
| 69 | "start-bit-rate(Mbps)=%.2f end-bit-rate(Mbps)=%.2f", | ||
| 70 | -- | ||
| 71 | 2.10.2 | ||
| 72 | |||
diff --git a/recipes-support/spice/spice_git.bb b/recipes-support/spice/spice_git.bb index 6f1be3a..cf5c569 100644 --- a/recipes-support/spice/spice_git.bb +++ b/recipes-support/spice/spice_git.bb | |||
| @@ -36,6 +36,7 @@ SRC_URI += " \ | |||
| 36 | file://configure.ac-add-subdir-objects-to-AM_INIT_AUTOMAKE.patch \ | 36 | file://configure.ac-add-subdir-objects-to-AM_INIT_AUTOMAKE.patch \ |
| 37 | file://build-allow-separated-src-and-build-dirs.patch \ | 37 | file://build-allow-separated-src-and-build-dirs.patch \ |
| 38 | file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ | 38 | file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ |
| 39 | file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ | ||
| 39 | " | 40 | " |
| 40 | 41 | ||
| 41 | S = "${WORKDIR}/git" | 42 | S = "${WORKDIR}/git" |
