summaryrefslogtreecommitdiffstats
path: root/server/mjpeg_encoder.c
diff options
context:
space:
mode:
author소병철 <byungchul.so@samsung.com>2014-04-24 12:26:32 +0000
committerChristophe Fergeau <cfergeau@redhat.com>2014-05-15 14:45:58 +0200
commit3cb746329ea4846bd9c65e0198e69423379b6f62 (patch)
treedb65ca4553bd75833c7187dcdb0ff85286cf51a1 /server/mjpeg_encoder.c
parente3da0c4f01f16e504d48793bb9a5b37b65fa345e (diff)
downloadspice-3cb746329ea4846bd9c65e0198e69423379b6f62.tar.gz
spice-3cb746329ea4846bd9c65e0198e69423379b6f62.tar.xz
spice-3cb746329ea4846bd9c65e0198e69423379b6f62.zip
Use PRI macros in printf to keep compatibility between 32/64bit system
gcc's some integer type definitions are different between 32/64bit system. This causes platform dependency problem with printf function. However, we can avoid this problem by using PRI macros that supports platform independent printf.
Diffstat (limited to 'server/mjpeg_encoder.c')
-rw-r--r--server/mjpeg_encoder.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index aea49646..f465d881 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -23,6 +23,7 @@
#include "mjpeg_encoder.h"
#include <jerror.h>
#include <jpeglib.h>
+#include <inttypes.h>
#define MJPEG_MAX_FPS 25
#define MJPEG_MIN_FPS 1
@@ -66,7 +67,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40,
* are not necessarily related to mis-estimation of the bit rate, and we would
* like to wait till the stream stabilizes.
*/
-#define MJPEG_WARMUP_TIME 3000L // 3 sec
+#define MJPEG_WARMUP_TIME 3000LL // 3 sec
enum {
MJPEG_QUALITY_EVAL_TYPE_SET,
@@ -638,7 +639,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder)
spice_debug("cur-fps=%u new-fps=%u (new/old=%.2f) |"
"bit-rate=%.2f (Mbps) latency=%u (ms) quality=%d |"
- " new-size-avg %lu , base-size %lu, (new/old=%.2f) ",
+ " new-size-avg %"PRIu64" , base-size %"PRIu64", (new/old=%.2f) ",
rate_control->fps, new_fps, ((double)new_fps)/rate_control->fps,
((double)rate_control->byte_rate*8)/1024/1024,
latency,
@@ -703,7 +704,7 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder *encoder, uint64_t now)
avg_fps = ((double)rate_control->adjusted_fps_num_frames*1000) /
adjusted_fps_time_passed;
- spice_debug("#frames-adjust=%lu #adjust-time=%lu avg-fps=%.2f",
+ spice_debug("#frames-adjust=%"PRIu64" #adjust-time=%"PRIu64" avg-fps=%.2f",
rate_control->adjusted_fps_num_frames, adjusted_fps_time_passed, avg_fps);
spice_debug("defined=%u old-adjusted=%.2f", rate_control->fps, rate_control->adjusted_fps);
fps_ratio = avg_fps / rate_control->fps;