Android9 从32位移植成64位
提示:编译方法以及解决出现的报错问题
项目场景:Amlogic s905x3
一、问题描述
提示:怎么修改文件从32位变成64位编译
在device/amlogic/franklin目录下的franklin.mk增加
+ANDROID_BUILD_TYPE:=64变量
还有注释以下代码
+#ifndef KERNEL_A32_SUPPORT
+#KERNEL_A32_SUPPORT := true
+#endif
就可以对其进行编译ARM64位
server:~/share/workspace/android-s905x3-Amlogic/device/amlogic/franklin$ git diff franklin.mk
diff --git a/franklin/franklin.mk b/franklin/franklin.mk
old mode 100644
new mode 100755
index ac080dd9..9b69fea7
--- a/franklin/franklin.mk
+++ b/franklin/franklin.mk
@@ -18,7 +18,7 @@
#
PRODUCT_DIR := franklin
+ANDROID_BUILD_TYPE:=64
# Dynamic enable start/stop zygote_secondary in 64bits
# and 32bit system, default closed
#TARGET_DYNAMIC_ZYGOTE_SECONDARY_ENABLE := true
+#ifndef KERNEL_A32_SUPPORT
+#KERNEL_A32_SUPPORT := true
+#endif
二、报错问题以及解决方法:
问题①:
vendor/amlogic/common/prebuilt/libmedia/libavenhancements/Android.mk: error: libamffmpegcodec: No source files specified
build/make/core/prebuilt_internal.mk:35: error: done.
14:00:05 ckati failed with: exit status 1
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/prebuilt/libmedia/libavenhancements$ vim Android.mk
LOCAL_MODULE := libamffmpegcodec
-LOCAL_MULTILIB := both
+LOCAL_MULTILIB := 32
LOCAL_MODULE_SUFFIX :=.so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
@@ -57,7 +58,7 @@ include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := libamextractor
-LOCAL_MULTILIB := both
+LOCAL_MULTILIB := 32
LOCAL_MODULE_SUFFIX :=.so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
问题②:
glob vendor/amlogic/common/interfaces/tvserver/1.0/src
ninja: error: ‘vendor/amlogic/common/gpu/lib/dvalin_ion/libGLES_mali_default_8a_64-p-r16p0.so’, needed by ‘out/target/product/franklin/obj/SHARED_LIBRARIES/libGLES_mali_intermediatD/libGLES_mali.so’, missing and no known rule to make it
01:48:44 ninja failed with: exit status 1
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/gpu/lib$ git diff lib.mk
diff --git a/lib/lib.mk b/lib/lib.mk
index 19bf730..65f23a9 100755
--- a/lib/lib.mk
+++ b/lib/lib.mk
@@ -68,7 +68,7 @@ LOCAL_ANDROID_VERSION_NUM:=${LOCAL_ANDROID_VERSION_NUM}-vulkan
endif
LOCAL_MODULE := libGLES_mali
-LOCAL_MULTILIB := both
+LOCAL_MULTILIB := 32
问题③:
vendor/amlogic/common/external/libtiff/tif_unix.c:159:6: error: cast to ‘thandle_t’ (aka ‘void *’) from smaller integer type ‘int’ [-Werror,-Wint-to-void-pointer-cast]
(thandle_t) fd,
^
1 error generated.
[ 2% 2314/100123] target C: libtiff_stati…logic/common/external/libtiff/tif_warning.
ninja: build stopped: subcommand failed.
02:26:53 ninja failed with: exit status 1
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/external/libtiff$ git diff tif_unix.c
diff --git a/tif_unix.c b/tif_unix.c
index 1387558..dc7a2c2 100755
--- a/tif_unix.c
+++ b/tif_unix.c
@@ -54,7 +54,7 @@
#endif
#include "tiffiop.h"
-
+typedef long MyIntPtr;
static tmsize_t
_tiffReadProc(thandle_t fd, void* buf, tmsize_t size)
{
@@ -156,7 +156,7 @@ TIFFFdOpen(int fd, const char* name, const char* mode)
TIFF* tif;
tif = TIFFClientOpen(name, mode,
- (thandle_t) fd,
+ (thandle_t)(MyIntPtr) fd,
_tiffReadProc, _tiffWriteProc,
_tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
_tiffMapProc, _tiffUnmapProc);
问题④:
vendor/amlogic/common/external/ffmpeg/libavformat/cavsvideodec.c:107:13: error: implicitly declaring library function ‘tolower’ with type ‘int (int)’ [-Werror,-Wimplicit-function-declaration]
if (tolower(str[0]) == ‘c’ && tolower(str[1]) == ‘a’ && tolower(str[2]) == ‘v’ &&tolower(str[3]) == ‘s’ && str[4] == ‘2’) {
^
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/external/ffmpeg/libavformat$ git diff cavsvideodec.c
diff --git a/libavformat/cavsvideodec.c b/libavformat/cavsvideodec.c
index 0fade4b..f2aeaee 100644
--- a/libavformat/cavsvideodec.c
+++ b/libavformat/cavsvideodec.c
@@ -18,7 +18,7 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+#include <ctype.h>
#include "avformat.h"
#include "rawdec.h"
#include "libavcodec/internal.h"
@@ -112,4 +112,4 @@ static int cavs2video_probe(AVProbeData *p)
}
问题⑤:
frameworks/av/media/libaudioprocessing/RecordBufferConverter.cpp:122:70: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
server:~/share/workspace/android-s905x3-Amlogic/frameworks/av/media/libaudioprocessing$ git diffdiff --git a/media/libaudioprocessing/RecordBufferConverter.cpp b/media/libaudioprocessing/RecordBufferConverter.cpp
old mode 100644
new mode 100755
index e559c341e..0c4f0ebdf
--- a/media/libaudioprocessing/RecordBufferConverter.cpp
+++ b/media/libaudioprocessing/RecordBufferConverter.cpp
@@ -119,7 +119,7 @@ size_t RecordBufferConverter::convert(void *dst,
free(mBuf);
mBufFrames = frames;
(void)posix_memalign(&mBuf, 32, mBufFrames * mBufFrameSize);
- ALOGI("%s,posix_memalign,mBufFrames = %d", __FUNCTION__, mBufFrames);
+ ALOGI("%s,posix_memalign,mBufFrames = %zu", __FUNCTION__, mBufFrames);
}
// resampler accumulates, but we only have one source track
memset(mBuf, 0, frames * mBufFrameSize);
问题⑥:
hardware/amlogic/hwcomposer/tvp/OmxUtil.cpp:79:68: error: cast from pointer to smaller type ‘unsigned int’ loses information
return ioctl(videosync_handle, VIDEOSYNC_IOC_SET_OMX_VPTS, (unsigned int)omx_info);
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/hwcomposer/tvp$ git diff OmxUtil.cpp
diff --git a/tvp/OmxUtil.cpp b/tvp/OmxUtil.cpp
old mode 100644
new mode 100755
index 72f3440..f8eef7d
--- a/tvp/OmxUtil.cpp
+++ b/tvp/OmxUtil.cpp
@@ -76,7 +76,7 @@ int setomxpts(int time_video) {
int setomxpts(uint32_t* omx_info,bool use_videosync) {
if (use_videosync) {
- return ioctl(videosync_handle, VIDEOSYNC_IOC_SET_OMX_VPTS, (unsigned int)omx_info);
+ return ioctl(videosync_handle, VIDEOSYNC_IOC_SET_OMX_VPTS, (uintptr_t)omx_info);
} else {
return ioctl(amvideo_handle, AMSTREAM_IOC_SET_OMX_VPTS, (unsigned long)omx_info);
}
问题⑦:
frameworks/base/cmds/bootanimation/BootAnimation.cpp:256:83: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
frameworks/base/cmds/bootanimation/BootAnimation.cpp:263:57: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
frameworks/base/cmds/bootanimation/BootAnimation.cpp:275:68: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
server:~/share/workspace/android-s905x3-Amlogic/frameworks/base/cmds/bootanimation$ git diff
index fd81128eeb7..e3de2084c48
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -253,14 +253,14 @@ bool BootAnimation::bootVideoVolumeUI(sp<BootVideoListener> listener) {
int index = mVol;
int64_t hideVolUIStartTime = -1;
- ALOGD("BootAnimation::playAnimation pcount=%d, animationX=%d, animationY=%d", pcount, animationX, animationY);
+ ALOGD("BootAnimation::playAnimation pcount=%zu, animationX=%d, animationY=%d", pcount, animationX, animationY);
ALOGD("BootAnimation::playAnimation mWidth=%d,mHeight=%d,animation->width=%d, animation->height=%d", mWidth, mHeight, animation->width, animation->height);
const Animation::Part& part(animation->parts[0]);
const size_t fcount = part.frames.size();
int displayed[fcount];
memset(displayed, 0, sizeof(displayed));
- ALOGD("%s, fcount=%d, part.count=%d", __FUNCTION__, fcount, part.count);
+ ALOGD("%s, fcount=%zu, part.count=%d", __FUNCTION__, fcount, part.count);
glBindTexture(GL_TEXTURE_2D, 0);
glClearColor(
part.backgroundColor[0],
@@ -272,7 +272,7 @@ bool BootAnimation::bootVideoVolumeUI(sp<BootVideoListener> listener) {
while(!listener->isPlayCompleted) {
if (index != mVol) {
- ALOGD("%s, pcount=%d, mVol=%d, name=%s", __FUNCTION__, pcount, mVol, part.frames[mVol].name.string());
+ ALOGD("%s, pcount=%zu, mVol=%d, name=%s", __FUNCTION__, pcount, mVol, part.frames[mVol].name.string());
问题⑧:
vendor/amlogic/common/frameworks/services/imageplayer/RGBPicture.c:482:5: error: implicitly declaring library function ‘memcpy’ with type ‘void *(void *, const void *, unsigned long)’ [-Werror,-Wimplicit-function-declaration]
memcpy(p_bmp_data, &bmp_file_header, file_header_len);//copy bmp file header
vendor/amlogic/common/frameworks/services/imageplayer/RGBPicture.c:492:15: error: implicitly declaring library function ‘strerror’ with type ‘char *(int)’ [-Werror,-Wimplicit-function-declaration]
strerror(errno), errno);
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/frameworks/services/imageplayer$ git diff RGBPicture.c
diff --git a/services/imageplayer/RGBPicture.c b/services/imageplayer/RGBPicture.c
index d20fbd3..101f72c 100755
--- a/services/imageplayer/RGBPicture.c
+++ b/services/imageplayer/RGBPicture.c
@@ -25,6 +25,7 @@
#include <sys/mman.h>
#include <linux/fb.h>
#include <errno.h>
+#include <string.h>
#include "utils/Log.h"
#include "RGBPicture.h"
问题⑨:
vendor/amlogic/common/apps/SubTitle/jni/subtitle/sub_teletextdec.c:779:5: error: implicit declaration of function ‘getData’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
getData(read_handle, buf, len);
^
vendor/amlogic/common/apps/SubTitle/jni/subtitle/sub_teletextdec.c:787:15: error: implicit declaration of function ‘getSize’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
int ret = getSize(read_handle);
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/apps/SubTitle/jni/subtitle$ git diff sub_teletextdec.c
diff --git a/jni/subtitle/sub_teletextdec.c b/jni/subtitle/sub_teletextdec.c
old mode 100644
new mode 100755
index fd329f8..01a6408
--- a/jni/subtitle/sub_teletextdec.c
+++ b/jni/subtitle/sub_teletextdec.c
@@ -93,6 +93,8 @@ typedef struct TeletextContext
static TeletextContext *g_ctx = NULL;
extern int subtitle_status;
+extern void getData(int read_handle, char* buf, int len);
+extern int getSize();
问题⑩:
hardware/amlogic/media/player/vcodec.c:389:10: error: overflow converting case value to switch condition type (3223344067 to 18446744072637928387) [-Werror,-Wswitch]
case AMSTREAM_IOC_GET_EX:
hardware/amlogic/media/player/vcodec.c:386:10: error: overflow converting case value to switch condition type (3222295489 to 18446744072636879809) [-Werror,-Wswitch]
case AMSTREAM_IOC_GET:
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/media/player$ git diff vcodec.c
diff --git a/player/vcodec.c b/player/vcodec.c
old mode 100644
new mode 100755
index ad53982..cc4bfd7
--- a/player/vcodec.c
+++ b/player/vcodec.c
@@ -41,7 +41,6 @@
#else
#define CODEC_PRINT(f,s...) fprintf(stderr,f,##s)
#endif
-
#define msleep(n) usleep(n*1000)
// ports
@@ -379,14 +378,14 @@ static int vcodec_h_ioctl(int h, int cmd, int subcmd, unsigned long paramter)
return vcodec_h_control(h, old_cmd, paramter);
}
- switch (cmd) {
+ switch ((unsigned long long)cmd) {
case AMSTREAM_IOC_SET:
r = vcodec_h_ioctl_set(h, subcmd, paramter);
break;
- case AMSTREAM_IOC_GET:
+ case (unsigned long long)AMSTREAM_IOC_GET:
r = vcodec_h_ioctl_get(h, subcmd, paramter);
break;
- case AMSTREAM_IOC_GET_EX:
+ case (unsigned long long)AMSTREAM_IOC_GET_EX:
r = vcodec_h_ioctl_get_ex(h, subcmd, paramter);
break;
default:
(END)
问题十一:
hardware/amlogic/audio/audio_hal/aml_resample_wrap.cpp:65:42: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGE(“malloc %d fail\n”,input_size);
~~ ^~~~~~~~~~
%zu
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff aml_resample_wrap.cpp
diff --git a/audio_hal/aml_resample_wrap.cpp b/audio_hal/aml_resample_wrap.cpp
index 79c50bb..af650b2 100755
--- a/audio_hal/aml_resample_wrap.cpp
+++ b/audio_hal/aml_resample_wrap.cpp
@@ -62,7 +62,7 @@ public:
if (input_size > mWorkBufSize) {
mWorkBuf = (unsigned char *)realloc(mWorkBuf, input_size);
if (!mWorkBuf) {
- ALOGE("malloc %d fail\n",input_size);
+ ALOGE("malloc %zu fail\n",input_size);
} else {
mWorkBufSize = input_size;
}
问题十二:
hardware/amlogic/audio/audio_hal/audio_hw.c:2838:35: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
func, cur_pts, out->last_frames_postion);
hardware/amlogic/audio/audio_hal/audio_hw.c:2863:54: error: format specifies type ‘long long’ but the argument has type ‘unsigned long’ [-Werror,-Wformat]
func, apts32/90, pcr/90, latency/90,
hardware/amlogic/audio/audio_hal/audio_hw.c:2971:39: error: format specifies type ‘long long’ but the argument has type ‘unsigned long’ [-Werror,-Wformat]
out->frame_write_sum, spdifenc_get_total() / 16);
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_hw.c
diff --git a/audio_hal/audio_hw.c b/audio_hal/audio_hw.c
old mode 100644
new mode 100755
index f709b41..c4fc0bd
--- a/audio_hal/audio_hw.c
+++ b/audio_hal/audio_hw.c
@@ -2835,7 +2835,7 @@ rewrite:
aml_audio_hwsync_set_first_pts(out->hwsync, cur_pts);
} else {
ALOGI("%s(), first pts not set, cur_pts %lld, last position %lld",
- __func__, cur_pts, out->last_frames_postion);
+ __func__, (long long)cur_pts, (long long)out->last_frames_postion);
}
} else {
uint64_t apts;
@@ -2859,8 +2859,8 @@ rewrite:
apts_gap = get_pts_gap (pcr, apts32);
sync_status = check_hwsync_status (apts_gap);
- ALOGV("%s()audio pts %dms, pcr %dms, latency %lldms, diff %dms",
- __func__, apts32/90, pcr/90, latency/90,
+ ALOGV("%s()audio pts %ums, pcr %ums, latency %lldms, diff %dms",
+ __func__, apts32/90, pcr/90, (long long)latency/90,
(apts32 > pcr) ? (apts32 - pcr)/90 : (pcr - apts32)/90);
// limit the gap handle to 0.5~5 s.
@@ -2968,7 +2968,7 @@ rewrite:
}
//ALOGV ("out %p, after out->frame_write_sum %"PRId64"\n", out, out->frame_write_sum);
ALOGV("---after out->frame_write_sum %"PRId64",spdifenc total %lld\n",
- out->frame_write_sum, spdifenc_get_total() / 16);
+ out->frame_write_sum, (long long)spdifenc_get_total() / 16);
}
goto exit;
}
@@ -3073,7 +3073,7 @@ exit:
}
if (adev->debug_flag)
ALOGD("out %p,out->last_frames_postion %"PRId64", total latency frame = %d, skp sum %lld , tune frames %d,alsa fr
ame %d\n",
- out, out->last_frames_postion, total_latency_frame, out->frame_skip_sum,tuning_latency_frame,latency_frames);
+ out, out->last_frames_postion, total_latency_frame, (long long)out->frame_skip_sum,tuning_latency_frame,laten
cy_frames);
pthread_mutex_unlock (&out->lock);
if (ret != 0) {
usleep (bytes * 1000000 / audio_stream_out_frame_size (stream) /
@@ -7977,7 +7977,7 @@ ssize_t mixer_main_buffer_write (struct audio_stream_out *stream, const void *bu
}
} else if (aml_out->hal_internal_format == AUDIO_FORMAT_DTS){
if (adev->debug_flag) {
- ALOGD("%s:%d non SPDIF/HDMIIN, DTS output bytes:%d", __func__, __LINE__, bytes);
+ ALOGD("%s:%d non SPDIF/HDMIIN, DTS output bytes:%zu", __func__, __LINE__, bytes);
}
aml_audio_spdif_output(stream, (void *)buffer, bytes);
}
@@ -8252,7 +8252,7 @@ re_write:
} else {
if (adev->debug_flag) {
- ALOGD("%s:%d mixing non-hw_sync mode, output_format:0x%x, write_bytes:%d", __func__, __LINE__, output
_format, write_bytes);
+ ALOGD("%s:%d mixing non-hw_sync mode, output_format:0x%x, write_bytes:%zu", __func__, __LINE__, outpu
t_format, write_bytes);
}
if (getprop_bool("media.audiohal.mixer")) {
aml_audio_dump_audio_bitstreams("/data/audio/beforemix.raw",
@@ -8302,7 +8302,7 @@ ssize_t mixer_aux_buffer_write(struct audio_stream_out *stream, const void *buff
bool hw_mix = need_hw_mix(adev->usecase_masks);
if (adev->debug_flag) {
- ALOGD("%s:%d size:%d, dolby_lib_type:0x%x, frame_size:%d", __func__, __LINE__, bytes, adev->dolby_lib_type, frame
_size);
+ ALOGD("%s:%d size:%zu, dolby_lib_type:0x%x, frame_size:%zu", __func__, __LINE__, bytes, adev->dolby_lib_type, fra
me_size);
}
@@ -8417,8 +8417,8 @@ ssize_t mixer_aux_buffer_write(struct audio_stream_out *stream, const void *buff
uint64_t u64BufferDelayUs = ((AML_HW_MIXER_BUF_SIZE * 1000) / ( frame_size * u32SampleRate)) * 1000;
uint64_t u64ConstantDelayUs = bytes * 1000000 / (frame_size * u32SampleRate * 3);
- ALOGV("%s:%d sampleRate:%d, bytes_written:%d, frame_size:%d, u32FreeBuffer:%d, delay:%llums", __func__, __LINE__,
- u32SampleRate, bytes_written, frame_size, u32FreeBuffer, (u64ConstantDelayUs/1000));
+ ALOGV("%s:%d sampleRate:%d, bytes_written:%zu, frame_size:%zu, u32FreeBuffer:%u, delay:%lldms", __func__, __LINE_
_,
+ u32SampleRate, bytes_written, frame_size, u32FreeBuffer, (long long)(u64ConstantDelayUs/1000));
usleep(u64ConstantDelayUs);
// when idle buffer is less than 2/5, sleep 1/5 buffer size time
@@ -8426,7 +8426,7 @@ ssize_t mixer_aux_buffer_write(struct audio_stream_out *stream, const void *buff
// (1/5 * AML_HW_MIXER_BUF_SIZE) / (frame_size * u32SampleRate) * 1000000 us
uint64_t u64DelayTimeUs = ((AML_HW_MIXER_BUF_SIZE * 1000) / u32SampleRate) * (1000 / (5 * frame_size));
usleep(u64DelayTimeUs);
- ALOGI("%s:%d, mixer idle buffer less than 2/5, need usleep:%lldms end ", __func__, __LINE__, u64DelayTimeUs/1
000);
+ ALOGI("%s:%d, mixer idle buffer less than 2/5, need usleep:%lldms end ", __func__, __LINE__,(long long)u64Del
ayTimeUs/1000);
}
if (getprop_bool("media.audiohal.mixer")) {
@@ -8472,7 +8472,7 @@ ssize_t process_buffer_write(struct audio_stream_out *stream,
void *output_buffer = NULL;
size_t output_buffer_bytes = 0;
if (adev->debug_flag) {
- ALOGD("%s:%d size:%d, hal_internal_format:0x%x", __func__, __LINE__, bytes, aml_out->hal_internal_format);
+ ALOGD("%s:%d size:%zu, hal_internal_format:0x%x", __func__, __LINE__, bytes, aml_out->hal_internal_format);
}
if (audio_hal_data_processing(stream, buffer, bytes, &output_buffer, &output_buffer_bytes, aml_out->hal_internal_form
at) == 0) {
@@ -8836,7 +8836,7 @@ void *audio_patch_input_threadloop(void *data)
// buffer size diff from allocation size, need to resize.
if (patch->in_buf_size < (size_t)read_bytes * period_mul) {
- ALOGI("%s: !!realloc in buf size from %zu to %zu", __func__, patch->in_buf_size, read_bytes * period_mul);
+ ALOGI("%s: !!realloc in buf size from %zu to %d", __func__, patch->in_buf_size, read_bytes * period_mul);
patch->in_buf = realloc(patch->in_buf, read_bytes * period_mul);
patch->in_buf_size = read_bytes * period_mul;
}
@@ -9049,7 +9049,7 @@ void *audio_patch_output_threadloop(void *data)
// buffer size diff from allocation size, need to resize.
if (patch->out_buf_size < (size_t)write_bytes * period_mul) {
- ALOGI("%s: !!realloc out buf size from %zu to %zu", __func__, patch->out_buf_size, write_bytes * period_mul);
+ ALOGI("%s: !!realloc out buf size from %zu to %d", __func__, patch->out_buf_size, write_bytes * period_mul);
patch->out_buf = realloc(patch->out_buf, write_bytes * period_mul);
patch->out_buf_size = write_bytes * period_mul;
}
问题十三:
hardware/amlogic/audio/audio_hal/audio_hwsync.c:217:60: error: format specifies type ‘size_t’ (aka ‘unsigned long’) but the argument has type ‘int’ [-Werror,-Wformat]
ALOGI(“invalid hwsync version num %zu”,p_hwsync->version_num);
~~~ ^~~~~~~~~~~~~~~~~~~~~
%d
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_hwsync.c
diff --git a/audio_hal/audio_hwsync.c b/audio_hal/audio_hwsync.c
index 8d14085..3cc1772 100644
--- a/audio_hal/audio_hwsync.c
+++ b/audio_hal/audio_hwsync.c
@@ -214,7 +214,7 @@ int aml_audio_hwsync_find_frame(audio_hwsync_t *p_hwsync,
p_hwsync->version_num = p_hwsync->hw_sync_header[3];
if (p_hwsync->version_num == 1 || p_hwsync->version_num == 2) {
} else {
- ALOGI("invalid hwsync version num %zu",p_hwsync->version_num);
+ ALOGI("invalid hwsync version num %d",p_hwsync->version_num);
}
}
if ((p_hwsync->version_num == 1 && p_hwsync->hw_sync_header_cnt == HW_AVSYNC_HEADER_SIZE_V1 ) ||
问题十四:
hardware/amlogic/audio/audio_hal/alsa_manager.c:539:57: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGV("ret:%d read_bytes:%d, bytes:%d ",ret,read_bytes,bytes);
~~ ^~~~~~~~~~
%zu
hardware/amlogic/audio/audio_hal/alsa_manager.c:539:68: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGV("ret:%d read_bytes:%d, bytes:%d ",ret,read_bytes,bytes);
~~ ^~~~~
%zu
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff alsa_manager.c
diff --git a/audio_hal/alsa_manager.c b/audio_hal/alsa_manager.c
index f461b61..e9d5087 100644
--- a/audio_hal/alsa_manager.c
+++ b/audio_hal/alsa_manager.c
@@ -536,7 +536,7 @@ size_t aml_alsa_input_read(struct audio_stream_in *stream,
return 0;
}
if (ret >= 0) {
- ALOGV("ret:%d read_bytes:%d, bytes:%d ",ret,read_bytes,bytes);
+ ALOGV("ret:%d read_bytes:%zu, bytes:%zu ",ret,read_bytes,bytes);
} else if (ret != -EAGAIN ) {
ALOGE("%s:%d, pcm_read fail, ret:%#x, error info:%s", __func__, __LINE__, ret, strerror(errno));
return ret;
问题十五:
hardware/amlogic/audio/audio_hal/audio_hw_dtv.c:1095:71: error: format specifies type ‘size_t’ (aka ‘unsigned long’) but the argument has type ‘int’ [-Werror,-Wformat]
ALOGI(“%s buffer %p size %zu\n”, FUNCTION, write_buf, write_size); ~~~
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_hw_dtv.c
diff --git a/audio_hal/audio_hw_dtv.c b/audio_hal/audio_hw_dtv.c
index db5bbe3..723f89b 100644
--- a/audio_hal/audio_hw_dtv.c
+++ b/audio_hal/audio_hw_dtv.c
@@ -1092,7 +1092,7 @@ static int dtv_patch_pcm_wirte(unsigned char *pcm_data, int size,
FILE *fp1 = fopen("/data/audio_dtv.pcm", "a+");
if (fp1) {
int flen = fwrite((char *)write_buf, 1, write_size, fp1);
- ALOGI("%s buffer %p size %zu\n", __FUNCTION__, write_buf, write_size);
+ ALOGI("%s buffer %p size %d\n", __FUNCTION__, write_buf, write_size);
fclose(fp1);
}
}
问题十六:
hardware/amlogic/audio/audio_hal/hw_avsync_callbacks.c💯39: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
func, offset, mdata_list->mdata.payload_offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hardware/amlogic/audio/audio_hal/hw_avsync_callbacks.c:116:39: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
func, pts32, latency, out->last_frames_postion);
^~~~~~~~~~~~~~~~~~~~~~~~
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ vim hw_avsync_callbacks.c +100
zhikai.zheng@wutongshan-server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff hw_avsync_callbacks.c
diff --git a/audio_hal/hw_avsync_callbacks.c b/audio_hal/hw_avsync_callbacks.c
index bc5fc30..7146b26 100644
--- a/audio_hal/hw_avsync_callbacks.c
+++ b/audio_hal/hw_avsync_callbacks.c
@@ -91,13 +91,13 @@ int on_meta_data_cbk(void *cookie,
header->pts = mdata_list->mdata.pts;
if (out->debug_stream) {
ALOGV("%s(), offset %lld, checkout payload offset %lld",
- __func__, offset, mdata_list->mdata.payload_offset);
+ __func__, (long long)offset,(long long)mdata_list->mdata.payload_offset);
ALOGV("%s(), frame_size %d, pts %lldms",
- __func__, header->frame_size, header->pts/1000000);
+ __func__, header->frame_size,(long long)header->pts/1000000);
}
if (offset != mdata_list->mdata.payload_offset) {
ALOGV("%s(), offset %lld not equal payload offset %lld, try next time",
- __func__, offset, mdata_list->mdata.payload_offset);
+ __func__,(long long)offset, (long long)mdata_list->mdata.payload_offset);
ret = -EAGAIN;
goto err_lock;
}
@@ -113,7 +113,7 @@ int on_meta_data_cbk(void *cookie,
hwsync_header_construct(header);
pts32 -= latency*90;
ALOGD("%s(), set tsync start pts %d, latency %d, last position %lld",
- __func__, pts32, latency, out->last_frames_postion);
+ __func__, pts32, latency,(long long)out->last_frames_postion);
while (delay_count < 10) {
vframe_ready_cnt = get_sysfs_int("/sys/class/video/vframe_ready_cnt");
ALOGV("/sys/class/video/vframe_ready_cnt is %d", vframe_ready_cnt);
@@ -154,7 +154,7 @@ int on_meta_data_cbk(void *cookie,
}
if (out->debug_stream)
ALOGD("%s(): audio pts %dms, pcr %dms, latency %lldms, pcr leads %dms",
- __func__, pts32/90, pcr/90, latency/90, (int)(pcr - pts32)/90);
+ __func__, pts32/90, pcr/90, (long long)latency/90, (int)(pcr - pts32)/90);
apts_gap = get_pts_gap(pcr, pts32);
//sync_status = pcm_check_hwsync_status(apts_gap);
sync_status = pcm_check_hwsync_status1(pcr, pts32);
(END)
问题十七:
hardware/amlogic/audio/audio_hal/amlAudioMixer.c:136:75: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGI(“++%s port index %d, size %d frames”, func, port_index, buf_frames);
hardware/amlogic/audio/audio_hal/amlAudioMixer.c:150:57: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGI(“%s(), port->initial_frames: %lld”, func, port->initial_frames);
~~~~ ^~~~~~~~~~~~~~~~~~~~
%lu
hardware/amlogic/audio/audio_hal/amlAudioMixer.c:332:51: error: format specifies type ‘unsigned int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGE(“%s(), invalid avail %u”, func, avail);
~~ ^~~~~
%zu
hardware/amlogic/audio/audio_hal/amlAudioMixer.c:437:17: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
in_port->presentation_frames,
amlAudioMixer.c
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff amlAudioMixer.c
diff --git a/audio_hal/amlAudioMixer.c b/audio_hal/amlAudioMixer.c
old mode 100644
new mode 100755
index 40f02af..830a836
--- a/audio_hal/amlAudioMixer.c
+++ b/audio_hal/amlAudioMixer.c
@@ -133,7 +133,7 @@ int init_mixer_input_port(struct amlAudioMixer *audio_mixer,
port = new_input_port(buf_frames, config, flags, volume, direct_on);
port_index = port->port_index;
if (audio_mixer->in_ports[port_index] == NULL) {
- ALOGI("++%s port index %d, size %d frames", __func__, port_index, buf_frames);
+ ALOGI("++%s port index %d, size %zu frames", __func__, port_index, buf_frames);
audio_mixer->in_ports[port_index] = port;
} else {
ALOGE("%s(), fatal error, inport index %d already exists!", __func__, port_index);
@@ -147,7 +147,7 @@ int init_mixer_input_port(struct amlAudioMixer *audio_mixer,
}
port->initial_frames = aml_out->frame_write_sum;
- ALOGI("%s(), port->initial_frames: %lld", __func__, port->initial_frames);
+ ALOGI("%s(), port->initial_frames: %lld", __func__,(long long)port->initial_frames);
return 0;
}
@@ -329,7 +329,7 @@ size_t get_outport_data_avail(struct output_port *outport)
int set_outport_data_avail(struct output_port *outport, size_t avail)
{
if (avail > outport->data_buf_len) {
- ALOGE("%s(), invalid avail %u", __func__, avail);
+ ALOGE("%s(), invalid avail %zu", __func__, avail);
return -EINVAL;
}
outport->bytes_avail = avail;
@@ -434,9 +434,9 @@ static int mixer_update_tstamp(struct amlAudioMixer *audio_mixer)
in_port->presentation_frames = in_port->initial_frames + signed_frames;
ALOGV("%s() present frames:%lld, initial %lld, consumed %lld, sec:%ld, nanosec:%ld",
__func__,
- in_port->presentation_frames,
- in_port->initial_frames,
- in_port->mix_consumed_frames,
+ (long long)in_port->presentation_frames,
+ (long long)in_port->initial_frames,
+ (long long)in_port->mix_consumed_frames,
in_port->timestamp.tv_sec,
in_port->timestamp.tv_nsec);
}
@@ -766,7 +766,7 @@ static int retrieve_hwsync_header(struct amlAudioMixer *audio_mixer,
memset(&header, 0, sizeof(struct hw_avsync_header));
if (1) {
int diff_ms = 0;
- ALOGV("direct out port bytes before cbk %d", get_outport_data_avail(out_port));
+ ALOGV("direct out port bytes before cbk %zu", get_outport_data_avail(out_port));
if (!in_port->meta_data_cbk) {
ALOGE("no meta_data_cbk set!!");
return -EINVAL;
@@ -925,7 +925,7 @@ static int mixer_do_mixing_32bit(struct amlAudioMixer *audio_mixer)
if (sys_only) {
frames = in_port_sys->data_buf_frame_cnt;
- ALOGV("%s() sys_only, frames %d", __func__, frames);
+ ALOGV("%s() sys_only, frames %zu", __func__, frames);
mixing_len_bytes = in_port_sys->data_len_bytes;
data_sys = (int16_t *)in_port_sys->data;
if (DEBUG_DUMP) {
@@ -969,8 +969,8 @@ static int mixer_do_mixing_32bit(struct amlAudioMixer *audio_mixer)
//dirct_vol = get_inport_volume(in_port_drct);
mixing_len_bytes = in_port_drct->data_len_bytes;
data_drct = (int16_t *)in_port_drct->data;
- ALOGV("%s() direct_only, inport consumed %d",
- __func__, get_inport_consumed_size(in_port_drct));
+ ALOGV("%s() direct_only, inport consumed %lld",
+ __func__,(long long)get_inport_consumed_size(in_port_drct));
if (is_inport_hwsync(in_port_drct) && in_port_drct->bytes_to_insert < mixing_len_bytes) {
retrieve_hwsync_header(audio_mixer, in_port_drct, out_port);
@@ -995,7 +995,7 @@ static int mixer_do_mixing_32bit(struct amlAudioMixer *audio_mixer)
frames = mixing_len_bytes / in_port_drct->cfg.frame_size;
//cpy_16bit_data_with_gain(data_mixed, data_drct,
// in_port_drct->data_len_bytes, dirct_vol);
- ALOGV("%s() direct_only, frames %d, bytes %d", __func__, frames, mixing_len_bytes);
+ ALOGV("%s() direct_only, frames %zu, bytes %zu", __func__, frames, mixing_len_bytes);
frames_written = do_mixing_2ch(audio_mixer->tmp_buffer, data_drct,
frames, in_port_drct->cfg, out_port->cfg);
@@ -1141,7 +1141,7 @@ static int mixer_do_mixing_16bit(struct amlAudioMixer *audio_mixer)
if (sys_only) {
frames = in_port_sys->data_buf_frame_cnt;
- ALOGV("%s() sys_only, frames %d", __func__, frames);
+ ALOGV("%s() sys_only, frames %zu", __func__, frames);
mixing_len_bytes = in_port_sys->data_len_bytes;
data_sys = (int16_t *)in_port_sys->data;
if (DEBUG_DUMP) {
@@ -1174,8 +1174,8 @@ static int mixer_do_mixing_16bit(struct amlAudioMixer *audio_mixer)
//dirct_vol = get_inport_volume(in_port_drct);
mixing_len_bytes = in_port_drct->data_len_bytes;
data_drct = (int16_t *)in_port_drct->data;
- ALOGV("%s() direct_only, inport consumed %d",
- __func__, get_inport_consumed_size(in_port_drct));
+ ALOGV("%s() direct_only, inport consumed %lld",
+ __func__,(long long)get_inport_consumed_size(in_port_drct));
if (is_inport_hwsync(in_port_drct) && in_port_drct->bytes_to_insert < mixing_len_bytes) {
retrieve_hwsync_header(audio_mixer, in_port_drct, out_port);
@@ -1195,7 +1195,7 @@ static int mixer_do_mixing_16bit(struct amlAudioMixer *audio_mixer)
} else {
ALOGV("%s() direct_only, vol %f", __func__, dirct_vol);
frames = mixing_len_bytes / in_port_drct->cfg.frame_size;
- ALOGV("%s() direct_only, frames %d, bytes %d", __func__, frames, mixing_len_bytes);
+ ALOGV("%s() direct_only, frames %zu, bytes %zu", __func__, frames, mixing_len_bytes);
frames_written = do_mixing_2ch(audio_mixer->tmp_buffer, data_drct,
frames, in_port_drct->cfg, out_port->cfg);
问题十八:
system/core/include/log/log_main.h:63:34: note: expanded from macro ‘android_printLog’
__android_log_print(prio, tag, VA_ARGS)
^~~~~~~~~~~
hardware/amlogic/audio/audio_hal/hw_avsync.c:174:32: error: format specifies type ‘int’ but the argument has type ‘long long’ [-Werror,-Wformat]
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff hw_avsync.c
diff --git a/audio_hal/hw_avsync.c b/audio_hal/hw_avsync.c
old mode 100644
new mode 100755
index 368c37d..bceef02
--- a/audio_hal/hw_avsync.c
+++ b/audio_hal/hw_avsync.c
@@ -145,7 +145,7 @@ int hwsync_write_header_byte(struct hw_avsync_header *header, uint8_t byte)
ALOGE("%s(), header null or inval written bytes", __func__);
return -EINVAL;
}
- ALOGV("header->bytes_written:%d byte:%0x",header->bytes_written,byte);
+ ALOGV("header->bytes_written:%zu byte:%0x",header->bytes_written,byte);
if (header->bytes_written < (HW_SYNC_VERSION_SIZE - 1) &&
byte == HW_AVSYNC_HEADER_V2[header->bytes_written]) {
header->header[header->bytes_written++] = byte;
@@ -170,8 +170,8 @@ int hwsync_write_header_byte(struct hw_avsync_header *header, uint8_t byte)
hwsync_header_extract(header);
}
} else {
- ALOGE("%s(), invalid data %d, bytes_wrtten %d",
- __func__, byte, header->bytes_written);
+ ALOGE("%s(), invalid data %lld, bytes_wrtten %lld",
+ __func__,(long long)byte,(long long)header->bytes_written);
header->bytes_written = 0;
return -EINVAL;
}
@@ -213,8 +213,8 @@ void extractor_consume_output(struct hw_avsync_header_extractor *header_extracto
header_extractor->cbk_cookie,
header_extractor->data,
header_extractor->data_size_bytes);
- ALOGV("%s, header_extractor->data_size_bytes = %d, written =%d", __func__,
- header_extractor->data_size_bytes, written);
+ ALOGV("%s, header_extractor->data_size_bytes = %d, written =%lld", __func__,
+ header_extractor->data_size_bytes,(long long)written);
if (written <= header_extractor->data_size_bytes) {
header_extractor->sync_frame_written += written;
header_extractor->data_size_bytes -= written;
@@ -226,7 +226,7 @@ void extractor_consume_output(struct hw_avsync_header_extractor *header_extracto
//header_extractor->sync_frame_written += written;
//header_extractor->data_size_bytes -= written;
ALOGV("--%s, data size =%d", __func__, header_extractor->data_size_bytes);
- ALOGV("--%s, sync_frame_written =%d", __func__, header_extractor->sync_frame_written);
+ ALOGV("--%s, sync_frame_written =%zu", __func__, header_extractor->sync_frame_written);
}
}
@@ -251,7 +251,7 @@ ssize_t header_extractor_write(struct hw_avsync_header_extractor *header_extract
ALOGV("--%s() writing header byte val %#x", __func__, *data);
int ret = hwsync_write_header_byte(sync_header, *data);
if (ret < 0) {
- ALOGE("%s(), invalid data!!, bytes_remaining %d", __func__, bytes_remaining);
+ ALOGE("%s(), invalid data!!, bytes_remaining %zu", __func__, bytes_remaining);
extractor_reset(header_extractor);
bytes_remaining--;
data++;
@@ -275,17 +275,17 @@ ssize_t header_extractor_write(struct hw_avsync_header_extractor *header_extract
// accumulate the payload consumed
header_extractor->payload_offset += frame_size;
ALOGV("%s() filling header complete, framesize = %d, payload offset %lld",
- __func__, frame_size, header_extractor->payload_offset);
+ __func__, frame_size,(long long)header_extractor->payload_offset);
}
bytes_remaining--;
data++;
} else {
- ALOGV("start dealing body read, bytes_remaing %d, sync_frame_written %d",
- bytes_remaining, header_extractor->sync_frame_written);
+ ALOGV("start dealing body read, bytes_remaing %lld, sync_frame_written %lld",
+ (long long)bytes_remaining,(long long)header_extractor->sync_frame_written);
size_t bytes_to_copy = min(bytes_remaining,
hwsync_header_get_frame_size(sync_header) - header_extractor->sync_frame_written);
- ALOGV("%s() writing body_bytes= %d,data_size_bytes= %d",
- __func__, bytes_to_copy, header_extractor->data_size_bytes);
+ ALOGV("%s() writing body_bytes= %lld,data_size_bytes= %d",
+ __func__,(long long)bytes_to_copy, header_extractor->data_size_bytes);
memcpy(header_extractor->data + header_extractor->data_size_bytes, data, bytes_to_copy);
header_extractor->data_size_bytes += bytes_to_copy;
@@ -298,8 +298,8 @@ ssize_t header_extractor_write(struct hw_avsync_header_extractor *header_extract
extractor_consume_output(header_extractor);
extractor_reset(header_extractor);
header_extractor->sync_frame_written = 0;
- ALOGV("%s() reading body over, next to reading header, return bytes %d",
- __func__, bytes - bytes_remaining);
+ ALOGV("%s() reading body over, next to reading header, return bytes %lld",
+ __func__,(long long)bytes - bytes_remaining);
continue;
//return bytes - bytes_remaining;
}
(END)
问题十九:
hardware/amlogic/audio/audio_hal/audio_port.c:73:53: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
func, port->port_index, read_avail, port->data_len_bytes);
hardware/amlogic/audio/audio_hal/audio_port.c:627:17: error: incompatible pointer types assigning to ‘int (*)(struct output_port *)’ from ‘ssize_t (struct output_port *)’ (aka ‘long (struct output_port *)’) [-Werror,-Wincompatible-pointer-types]
port->start = output_port_start;
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_port.c
diff --git a/audio_hal/audio_port.c b/audio_hal/audio_port.c
index 8e3a5d9..e6761d4 100644
--- a/audio_hal/audio_port.c
+++ b/audio_hal/audio_port.c
@@ -69,8 +69,8 @@ bool ring_buf_ready(struct input_port *port)
int read_avail = get_buffer_read_space(port->r_buf);
if (0) {
- ALOGI("%s, port index %d, avail %d, chunk len %d",
- __func__, port->port_index, read_avail, port->data_len_bytes);
+ ALOGI("%s, port index %d, avail %d, chunk len %lld",
+ __func__, port->port_index, read_avail,(long long)port->data_len_bytes);
}
return (read_avail >= (int)port->data_len_bytes);
@@ -222,8 +222,8 @@ static int setPortConfig(struct audioCfg *cfg, struct audio_config *config)
static int inport_padding_zero(struct input_port *port, size_t bytes)
{
char *feed_mem = NULL;
- ALOGI("%s(), padding size %d 0s to inport %d",
- __func__, bytes, port->port_index);
+ ALOGI("%s(), padding size %lld 0s to inport %d",
+ __func__,(long long)bytes, port->port_index);
feed_mem = calloc(1, bytes);
if (!feed_mem) {
ALOGE("%s(), no memory", __func__);
@@ -624,7 +624,7 @@ struct output_port *new_output_port(
port->data_buf_frame_cnt = buf_frames;
port->data_buf_len = rbuf_size;
port->data_buf = data;
- port->start = output_port_start;
+ port->start =(int (*)(struct output_port *))output_port_start;
port->standby = output_port_standby;
//port->write = output_port_write;
port->write = output_port_write_alsa;
@@ -670,7 +670,7 @@ int resize_output_port_buffer(struct output_port *port, size_t buf_frames)
if (port->buf_frames == buf_frames) {
return 0;
}
- ALOGI("%s(), new buf_frames %d", __func__, buf_frames);
+ ALOGI("%s(), new buf_frames %zu", __func__, buf_frames);
buf_length = buf_frames * port->cfg.frame_size;
port->data_buf = (char *)realloc(port->data_buf, buf_length);
if (!port->data_buf) {
问题二十:
hardware/amlogic/audio/audio_hal/audio_data_process.c:110:5: error: cast to ‘void *’ from smaller integer type ‘int’ [-Werror,-Wint-to-void-pointer-cast]
(void *)ch_cnt_out;
^
hardware/amlogic/audio/audio_hal/audio_data_process.c:111:5: error: cast to ‘void *’ from smaller integer type ‘int’ [-Werror,-Wint-to-void-pointer-cast]
(void *)ch_cnt_in;
^
hardware/amlogic/audio/audio_hal/audio_data_process.c:131:5: error: cast to ‘void *’ from smaller integer type ‘int’ [-Werror,-Wint-to-void-pointer-cast]
(void *)ch_cnt_out;
^
hardware/amlogic/audio/audio_hal/audio_data_process.c:132:5: error: cast to ‘void *’ from smaller integer type ‘int’ [-Werror,-Wint-to-void-pointer-cast]
(void *)ch_cnt_in;
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_data_process.c
diff --git a/audio_hal/audio_data_process.c b/audio_hal/audio_data_process.c
index 8880273..d4c98ef 100644
--- a/audio_hal/audio_data_process.c
+++ b/audio_hal/audio_data_process.c
@@ -107,8 +107,8 @@ int do_mixing_2ch(void *data_mixed,
int extend_channel_2_8(void *data_out, void *data_in,
size_t frames, int ch_cnt_out, int ch_cnt_in)
{
- (void *)ch_cnt_out;
- (void *)ch_cnt_in;
+ (void *)(intptr_t)ch_cnt_out;
+ (void *)(intptr_t)ch_cnt_in;
int32_t *in = (int32_t *)data_in;
int32_t *out = (int32_t *)data_out;
int32_t Lval = 0, Rval = 0;
@@ -128,8 +128,8 @@ int extend_channel_2_8(void *data_out, void *data_in,
int extend_channel_5_8(void *data_out, void *data_in,
size_t frames, int ch_cnt_out, int ch_cnt_in)
{
- (void *)ch_cnt_out;
- (void *)ch_cnt_in;
+ (void *)(intptr_t)ch_cnt_out;
+ (void *)(intptr_t)ch_cnt_in;
int32_t *out = data_out;
int32_t *in = data_in;
uint i = 0;
(END)
问题二十一:
hardware/amlogic/audio/audio_hal/sub_mixing_factory.c:118:69: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
func, usecase_to_str(out->usecase), written_total, bytes);
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff sub_mixing_factory.c
diff --git a/audio_hal/sub_mixing_factory.c b/audio_hal/sub_mixing_factory.c
index 4de5776..b221bb5 100644
--- a/audio_hal/sub_mixing_factory.c
+++ b/audio_hal/sub_mixing_factory.c
@@ -114,13 +114,13 @@ static ssize_t aml_out_write_to_mixer(struct audio_stream_out *stream, const voi
do {
ssize_t written = 0;
- ALOGV("%s(), stream usecase: %s, written_total %d, bytes %d",
- __func__, usecase_to_str(out->usecase), written_total, bytes);
+ ALOGV("%s(), stream usecase: %s, written_total %lld, bytes %lld",
+ __func__, usecase_to_str(out->usecase),(long long)written_total,(long long)bytes);
written = mixer_write_inport(audio_mixer,
out->port_index, data, bytes - written_total);
if (written < 0) {
- ALOGE("%s(), write failed, errno = %d", __func__, written);
+ ALOGE("%s(), write failed, errno = %zu", __func__, written);
return written;
}
@@ -135,7 +135,7 @@ static ssize_t aml_out_write_to_mixer(struct audio_stream_out *stream, const voi
//pthread_mutex_unlock(&out->lock);
}
ALOGV("%s(), portindex(%d) written(%d), written_total(%d), bytes(%d)",
- __func__, out->port_index, written, written_total, bytes);
+ __func__, out->port_index,(int)written,(int)written_total,(int)bytes);
if (written_total >= bytes) {
ALOGV("%s(), exit", __func__);
@@ -180,7 +180,7 @@ static int consume_meta_data(void *cookie,
if (out->debug_stream) {
ALOGD("%s(), frame_size %d, pts %lldms, payload offset %lld",
- __func__, frame_size, pts/1000000, offset);
+ __func__, frame_size,(long long)pts/1000000,(long long)offset);
}
if (get_mixer_hwsync_frame_size(audio_mixer) != frame_size) {
ALOGI("%s(), resize frame_size %d", __func__, frame_size);
@@ -207,7 +207,7 @@ static int consume_output_data(void *cookie, const void* buffer, size_t bytes)
int64_t throttle_timeus = 0;
int frame_size = 4;
- ALOGV("++%s(), bytes = %d", __func__, bytes);
+ ALOGV("++%s(), bytes = %zu", __func__, bytes);
if (out->pause_status) {
ALOGE("%s(), write in pause status", __func__);
}
@@ -216,7 +216,7 @@ static int consume_output_data(void *cookie, const void* buffer, size_t bytes)
apply_volume(out->volume_l, in_buf_16, sizeof(uint16_t), bytes);
written = aml_out_write_to_mixer(stream, buffer, bytes);
if (written < 0) {
- ALOGE("%s(), written failed, %d", __func__, written);
+ ALOGE("%s(), written failed, %zd", __func__, written);
goto exit;
}
@@ -239,17 +239,17 @@ static int consume_output_data(void *cookie, const void* buffer, size_t bytes)
// out->last_frames_postion = out->frame_write_sum - latency_frames;
//else
// out->last_frames_postion = out->frame_write_sum;
- ALOGV("++%s(), written = %d", __func__, written);
+ ALOGV("++%s(), written = %zd", __func__, written);
if (getprop_bool("media.audiohal.hwsync")) {
aml_audio_dump_audio_bitstreams("/data/audio/consumeout.raw", buffer, written);
}
if (0) {
ALOGD("%s(), last_frames_postion(%lld) latency_frames(%lld)",
- __func__, out->last_frames_postion, latency_frames);
+ __func__, (long long)out->last_frames_postion,(long long)latency_frames);
}
throttle_timeus = target_us - us_since_last_write;
if (throttle_timeus > 0 && throttle_timeus < 200000) {
- ALOGV("throttle time %lld us", throttle_timeus);
+ ALOGV("throttle time %ld us",(long)throttle_timeus);
if (throttle_timeus > 1000)
usleep(throttle_timeus - 1000);
}
@@ -272,7 +272,7 @@ exit:
out->last_frames_postion = 0;//out->frame_write_sum;
}
if (out->debug_stream) {
- ALOGD("%s(), frames sum %lld, last frames %lld", __func__, out->frame_write_sum, out->last_frames_postion);
+ ALOGD("%s(), frames sum %lld, last frames %lld", __func__,(long long)out->frame_write_sum,(long long)out->last_fr
ames_postion);
}
return written;
}
@@ -334,7 +334,7 @@ static ssize_t out_write_hwsync_lpcm(struct audio_stream_out *stream, const void
}
written_total = header_extractor_write(out->hwsync_extractor, buffer, bytes);
ALOGV("%s() bytes %d, out->last_frames_postion %lld frame_sum %lld",
- __func__, bytes, out->last_frames_postion, out->frame_write_sum);
+ __func__,(int)bytes,(long long)out->last_frames_postion,(long long)out->frame_write_sum);
if (getprop_bool("media.audiohal.hwsync")) {
aml_audio_dump_audio_bitstreams("/data/audio/audiomain.raw", buffer, written_total);
@@ -342,9 +342,9 @@ static ssize_t out_write_hwsync_lpcm(struct audio_stream_out *stream, const void
if (written_total > 0) {
ALOGV("--%s(), out(%p)written %d, write_sum after %lld",
- __func__, out, written_total, out->frame_write_sum);
+ __func__, out, written_total,(long long)out->frame_write_sum);
if ((size_t)written_total != bytes)
- ALOGE("--%s(), written %d, but bytes = %d", __func__, written_total, bytes);
+ ALOGE("--%s(), written %d, but bytes = %zu", __func__, written_total, bytes);
return written_total;
} else {
ALOGE("--%s(), written %d, but return bytes", __func__, written_total);
@@ -397,7 +397,7 @@ static ssize_t out_write_system(struct audio_stream_out *stream, const void *buf
clock_gettime(CLOCK_MONOTONIC, &new_tval);
if (tval.tv_sec > new_tval.tv_sec)
ALOGE("%s(), FATAL ERROR", __func__);
- ALOGV("++%s() bytes %d, out->port_index %d", __func__, bytes, out->port_index);
+ ALOGV("++%s() bytes %zu, out->port_index %d", __func__, bytes, out->port_index);
//ALOGD(" %lld us, %lld", new_tval.tv_sec, tval.tv_sec);
us_since_last_write = (new_tval.tv_sec - out->timestamp.tv_sec) * 1000000 +
@@ -408,32 +408,32 @@ static ssize_t out_write_system(struct audio_stream_out *stream, const void *buf
(new_tval.tv_nsec - tval.tv_nsec) / 1000;
int target_us = bytes * 1000 / frame_size / 48;
- ALOGV("time spent on write %lld us, written %d", us_since_last_write, written);
+ ALOGV("time spent on write %lld us, written %zd",(long long)us_since_last_write, written);
ALOGV("used_this_write %d us, target %d us", used_this_write, target_us);
throttle_timeus = target_us - us_since_last_write;
if (throttle_timeus > 0 && throttle_timeus < 200000) {
- ALOGV("throttle time %lld us", throttle_timeus);
+ ALOGV("throttle time %lld us",(long long)throttle_timeus);
if (throttle_timeus > 1800) {
//usleep(throttle_timeus - 1800);
ALOGV("actual throttle %lld us, since last %lld us",
- throttle_timeus, us_since_last_write);
+ (long long)throttle_timeus,(long long)us_since_last_write);
} else {
- ALOGV("%lld us, but un-throttle", throttle_timeus);
+ ALOGV("%lld us, but un-throttle",(long long)throttle_timeus);
}
} else if (throttle_timeus != 0) {
// first time write, sleep
//usleep(target_us - 100);
- ALOGV("invalid throttle time %lld us, us since last %lld us", throttle_timeus, us_since_last_write);
+ ALOGV("invalid throttle time %lld us, us since last %lld us",(long long)throttle_timeus,(long long)us_since_l
ast_write);
ALOGV("\n\n");
}
} else {
- ALOGE("%s(), write fail, err = %d", __func__, written);
+ ALOGE("%s(), write fail, err = %zd", __func__, written);
}
// TODO: means first write, need check this by method
if (us_since_last_write > 500000) {
usleep(bytes * 1000 / 48 / frame_size);
- ALOGV("%s(), invalid duration %llu us", __func__, us_since_last_write);
+ ALOGV("%s(), invalid duration %lld us", __func__,(long long)us_since_last_write);
//ALOGE("last write %ld s, %ld ms", out->timestamp.tv_sec, out->timestamp.tv_nsec/1000000);
//ALOGE("before write %ld s, %ld ms", tval.tv_sec, tval.tv_nsec/1000000);
//ALOGE("after write %ld s, %ld ms", new_tval.tv_sec, new_tval.tv_nsec/1000000);
@@ -453,7 +453,7 @@ exit:
out->last_frames_postion = out->frame_write_sum;
if (0) {
- ALOGI("last position %lld, latency_frames %d", out->last_frames_postion, latency_frames);
+ ALOGI("last position %lld, latency_frames %d",(long long)out->last_frames_postion, latency_frames);
}
}
@@ -505,7 +505,7 @@ static ssize_t out_write_direct_pcm(struct audio_stream_out *stream, const void
clock_gettime(CLOCK_MONOTONIC, &new_tval);
if (tval.tv_sec > new_tval.tv_sec)
ALOGE("%s(), FATAL ERROR", __func__);
- ALOGV("++%s() bytes %d, out->port_index %d", __func__, bytes, out->port_index);
+ ALOGV("++%s() bytes %zu, out->port_index %d", __func__, bytes, out->port_index);
//ALOGD(" %lld us, %lld", new_tval.tv_sec, tval.tv_sec);
us_since_last_write = (new_tval.tv_sec - out->timestamp.tv_sec) * 1000000 +
@@ -516,32 +516,32 @@ static ssize_t out_write_direct_pcm(struct audio_stream_out *stream, const void
(new_tval.tv_nsec - tval.tv_nsec) / 1000;
int target_us = bytes * 1000 / frame_size / 48;
- ALOGV("time spent on write %lld us, written %d", us_since_last_write, written);
+ ALOGV("time spent on write %lld us, written %zd",(long long)us_since_last_write, written);
ALOGV("used_this_write %d us, target %d us", used_this_write, target_us);
throttle_timeus = target_us - us_since_last_write;
if (throttle_timeus > 0 && throttle_timeus < 200000) {
- ALOGV("throttle time %lld us", throttle_timeus);
+ ALOGV("throttle time %lld us", (long long)throttle_timeus);
if (throttle_timeus > 1800) {
usleep(throttle_timeus - 1800);
ALOGV("actual throttle %lld us, since last %lld us",
- throttle_timeus, us_since_last_write);
+ (long long)throttle_timeus,(long long)us_since_last_write);
} else {
- ALOGV("%lld us, but un-throttle", throttle_timeus);
+ ALOGV("%lld us, but un-throttle",(long long)throttle_timeus);
}
} else if (throttle_timeus != 0) {
// first time write, sleep
//usleep(target_us - 100);
- ALOGV("invalid throttle time %lld us, us since last %lld us", throttle_timeus, us_since_last_write);
+ ALOGV("invalid throttle time %lld us, us since last %lld us",(long long)throttle_timeus,(long long)us_since_l
ast_write);
ALOGV("\n\n");
}
} else {
- ALOGE("%s(), write fail, err = %d", __func__, written);
+ ALOGE("%s(), write fail, err = %zd", __func__, written);
}
// TODO: means first write, need check this by method
if (us_since_last_write > 500000) {
usleep(bytes * 1000 / 48 / frame_size);
- ALOGV("%s(), invalid duration %llu us", __func__, us_since_last_write);
+ ALOGV("%s(), invalid duration %lld us", __func__,(long long)us_since_last_write);
//ALOGE("last write %ld s, %ld ms", out->timestamp.tv_sec, out->timestamp.tv_nsec/1000000);
//ALOGE("before write %ld s, %ld ms", tval.tv_sec, tval.tv_nsec/1000000);
//ALOGE("after write %ld s, %ld ms", new_tval.tv_sec, new_tval.tv_nsec/1000000);
@@ -561,7 +561,7 @@ exit:
out->last_frames_postion = out->frame_write_sum;
if (0) {
- ALOGI("last position %lld, latency_frames %d", out->last_frames_postion, latency_frames);
+ ALOGI("last position %lld, latency_frames %d",(long long)out->last_frames_postion, latency_frames);
}
}
@@ -976,7 +976,7 @@ ssize_t mixer_main_buffer_write_sm (struct audio_stream_out *stream, const void
ALOGV("direct %s", __func__);
write_bytes = out_write_direct_pcm(stream, buffer, bytes);
if (write_bytes < 0) {
- ALOGE("%s(), write failed, err = %d", __func__, write_bytes);
+ ALOGE("%s(), write failed, err = %zd", __func__, write_bytes);
}
//write_buf = (void *)buffer;
//write_bytes = bytes;
@@ -1215,7 +1215,7 @@ ssize_t mixer_aux_buffer_write_sm(struct audio_stream_out *stream, const void *b
bytes_written = aml_out_write_to_mixer(stream, buffer, bytes);
if (bytes_written < 0) {
- ALOGE("%s(), write failed, err = %d", __func__, bytes_written);
+ ALOGE("%s(), write failed, err = %zd", __func__, bytes_written);
}
#ifdef DEBUG_TIME
clock_gettime(CLOCK_MONOTONIC, &tval_end);
@@ -1251,7 +1251,7 @@ exit:
aml_out->lasttimestamp.tv_nsec = aml_out->timestamp.tv_nsec;
aml_out->last_frames_postion = aml_out->frame_write_sum;
- ALOGV("%s(), frame write sum %lld", __func__, aml_out->frame_write_sum);
+ ALOGV("%s(), frame write sum %lld", __func__,(long long)aml_out->frame_write_sum);
return bytes;
}
(END)
问题二十二:
hardware/amlogic/audio/audio_hal/aml_audio_resample_manager.c:189:63: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGD(“realloc resample_buffer size from %d to %d\n”, aml_audio_resample->resample_buffer_size, new_buf_size);
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff aml_audio_resample_manager.c
diff --git a/audio_hal/aml_audio_resample_manager.c b/audio_hal/aml_audio_resample_manager.c
index 91ed8b0..4b050d9 100644
--- a/audio_hal/aml_audio_resample_manager.c
+++ b/audio_hal/aml_audio_resample_manager.c
@@ -186,7 +186,7 @@ int aml_audio_resample_process(aml_audio_resample_t * aml_audio_resample, void *
ALOGE("realloc resample_buffer is failed\n");
return -1;
}
- ALOGD("realloc resample_buffer size from %d to %d\n", aml_audio_resample->resample_buffer_size, new_buf_size);
+ ALOGD("realloc resample_buffer size from %zu to %d\n", aml_audio_resample->resample_buffer_size, new_buf_size);
aml_audio_resample->resample_buffer_size = new_buf_size;
}
@@ -207,7 +207,7 @@ int aml_audio_resample_process(aml_audio_resample_t * aml_audio_resample, void *
}
if (out_size > aml_audio_resample->resample_buffer_size) {
- ALOGE("output size=%d , buf size=%d\n", out_size, aml_audio_resample->resample_buffer_size);
+ ALOGE("output size=%zu , buf size=%zu\n", out_size, aml_audio_resample->resample_buffer_size);
return -1;
}
问题二十三:
hardware/amlogic/audio/audio_hal/audio_android_resample_api.c:165:40: error: format specifies type ‘int’ but the argument has type ‘size_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
ALOGE(“Lost data, bytes:%d\n”, bytes);
~~ ^~~~~
%zu
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_android_resample_api.c
diff --git a/audio_hal/audio_android_resample_api.c b/audio_hal/audio_android_resample_api.c
index cd2fab9..f899b68 100644
--- a/audio_hal/audio_android_resample_api.c
+++ b/audio_hal/audio_android_resample_api.c
@@ -162,7 +162,7 @@ int android_resample_process(void *handle, void * in_buffer, size_t bytes, void
if (get_buffer_write_space(&resample->ring_buf) > (int)bytes) {
ring_buffer_write(&resample->ring_buf, in_buffer, bytes, UNCOVER_WRITE);
} else {
- ALOGE("Lost data, bytes:%d\n", bytes);
+ ALOGE("Lost data, bytes:%zu\n", bytes);
}
left_buf_size = * out_size;
问题二十四:
hardware/amlogic/audio/audio_hal/audio_virtual_buf.c:85:11: error: format specifies type ‘long long’ but the argument has type ‘uint64_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
phandle->buf_ns_begin, phandle->buf_ns_target, phandle->ease_time_ns);
^~~~~~~~~~~~~~~~~~~~~
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/audio/audio_hal$ git diff audio_virtual_buf.c
diff --git a/audio_hal/audio_virtual_buf.c b/audio_hal/audio_virtual_buf.c
index 5b25d51..29d04fb 100644
--- a/audio_hal/audio_virtual_buf.c
+++ b/audio_hal/audio_virtual_buf.c
@@ -82,7 +82,7 @@ int audio_virtual_buf_open(void ** pphandle, char * buf_name, uint64_t buf_ns_be
phandle->ease_time_ns = (uint64_t)ease_time_ms * 1000000LL;
ALOGD("%s %s buf_begin=%lld buf_target=%lld time=%lld", __FUNCTION__ , phandle->buf_name,
- phandle->buf_ns_begin, phandle->buf_ns_target, phandle->ease_time_ns);
+ (long long)phandle->buf_ns_begin,(long long)phandle->buf_ns_target,(long long)phandle->ease_time_ns);
* pphandle = (void*)phandle;
return 0;
}
@@ -162,7 +162,7 @@ int audio_virtual_buf_process(void *phandle, uint64_t frame_ns)
if (read_ns > write_ns) {
virtual_handle->state = VIRTUAL_BUF_RESET;
break_while = 0;
- ALOGE("%s underrun happens read=%lld write=%lld diff=%lld", virtual_handle->buf_name, read_ns, write_ns, read_ns - write_ns);
+ ALOGE("%s underrun happens read=%lld write=%lld diff=%lld", virtual_handle->buf_name,(long long)read_ns,(long long)write_ns,(long long)read_ns - write_ns);
}
if (break_while) {
问题二十五:
hardware/amlogic/LibAudio/amadec/adec_read.c:114:16: error: cast to 'volatile unsigned int ’ from smaller integer type ‘unsigned int’ [-Werror,-Wint-to-pointer-cast]
reg_base = (volatile unsigned)((unsigned)memmap + phys_offset);
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/LibAudio/amadec$ git diff adec_read.c
diff --git a/amadec/adec_read.c b/amadec/adec_read.c
index fbcb518..a76f8c6 100644
--- a/amadec/adec_read.c
+++ b/amadec/adec_read.c
@@ -111,7 +111,7 @@ int uio_init(aml_audio_dec_t *audec)
}
if (phys_offset == 0)
phys_offset = ((AIU_AIFIFO_CTRL + addr_offset) << 2) & (pagesize - 1);
- reg_base = (volatile unsigned*)((unsigned)memmap + phys_offset);
+ reg_base = (volatile unsigned*)((uintptr_t)memmap + phys_offset);
pthread_mutex_unlock(&uio_mutex);
return 0;
问题二十六:
hardware/amlogic/hwcomposer/hwc2/VariableModeMgr.cpp:175:57: error: format specifies type ‘int’ but the argument has type ‘std::__1::map<unsigned int, drm_mode_info, std::__1::less, std::__1::allocator<std::__1::pair<const unsigned int, drm_mode_info> > >::size_type’ (aka ‘unsigned long’) [-Werror,-Wformat]
MESON_LOGV(“[%s]: Hwc modes %d.”, func, mHwcActiveModes.size());
~~ ^~~~~~~~~~~~~~~~~~~~~~
%lu
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/hwcomposer/hwc2$ git diff VariableModeMgr.cpp
diff --git a/hwc2/VariableModeMgr.cpp b/hwc2/VariableModeMgr.cpp
index da4017d..d3cd9a9 100644
--- a/hwc2/VariableModeMgr.cpp
+++ b/hwc2/VariableModeMgr.cpp
@@ -172,14 +172,14 @@ int32_t VariableModeMgr::updateHwcDispConfigs() {
mDefaultMode.dpiX = it->second.dpiX;
mDefaultMode.dpiY = it->second.dpiY;
} else {
- MESON_LOGV("[%s]: Hwc modes %d.", __func__, mHwcActiveModes.size());
+ MESON_LOGV("[%s]: Hwc modes %d.", __func__,(int)mHwcActiveModes.size());
mHwcActiveModes.emplace(mHwcActiveModes.size(), it->second);
}
}
// Add default mode as last, unconditionally in all cases. This is to ensure
// availability of 1080p mode always.
- MESON_LOGV("[%s]: Hwc modes %d.", __func__, mHwcActiveModes.size());
+ MESON_LOGV("[%s]: Hwc modes %d.", __func__,(int)mHwcActiveModes.size());
mHwcActiveModes.emplace(mHwcActiveModes.size(), mDefaultMode);
return HWC2_ERROR_NONE;
}
问题二十七:
hardware/amlogic/hwcomposer/hwc2/Hwc2Display.cpp:926:13: error: format specifies type ‘unsigned long long’ but the argument has type ‘hwc2_layer_t’ (aka ‘unsigned long’) [-Werror,-Wformat]
layer->getUniqueId(),
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/hwcomposer/hwc2$ git diff Hwc2Display.cpp
diff --git a/hwc2/Hwc2Display.cpp b/hwc2/Hwc2Display.cpp
index bc75423..98fe28e 100644
--- a/hwc2/Hwc2Display.cpp
+++ b/hwc2/Hwc2Display.cpp
@@ -921,9 +921,9 @@ void Hwc2Display::dumpPresentLayers(String8 & dumpstr) {
Hwc2Layer *layer = (Hwc2Layer*)(it->get());
dumpstr.append("+------+-----+--------+-----+--------+-+--------+"
"-------------------+-------------------+\n");
- dumpstr.appendFormat("|%6llu|%5d|%8s|%5d|%8f|%1d|%8x|%4d %4d %4d %4d"
+ dumpstr.appendFormat("|%6lld|%5d|%8s|%5d|%8f|%1d|%8x|%4d %4d %4d %4d"
"|%4d %4d %4d %4d|\n",
- layer->getUniqueId(),
+ (long long)layer->getUniqueId(),
layer->mZorder,
drmFbTypeToString(layer->mFbType),
layer->mBlendMode,
问题二十八:
hardware/amlogic/hwcomposer/common/hwc/HwcVsync.cpp:98:68: error: format specifies type ‘long long’ but the argument has type ‘nsecs_t’ (aka ‘long’) [-Werror,-Wformat]
MESON_LOGD(“wait for vsync success, peroid: %lld”, period);
~~~~ ^~~~~~
%ld
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/hwcomposer/common/hwc$ git diff HwcVsync.cpp
diff --git a/common/hwc/HwcVsync.cpp b/common/hwc/HwcVsync.cpp
index f18f3be..42eadb2 100644
--- a/common/hwc/HwcVsync.cpp
+++ b/common/hwc/HwcVsync.cpp
@@ -95,7 +95,7 @@ void * HwcVsync::vsyncThread(void * data) {
nsecs_t period = timestamp - pThis->mPreTimeStamp;
UNUSED(period);
if (pThis->mPreTimeStamp != 0)
- MESON_LOGD("wait for vsync success, peroid: %lld", period);
+ MESON_LOGD("wait for vsync success, peroid: %lld",(long long)period);
pThis->mPreTimeStamp = timestamp;
}
问题二十九:
hardware/amlogic/hwcomposer/common/display/HwDisplayManager.cpp:104:49: error: format specifies type ‘int’ but the argument has type ‘std::__1::map<unsigned int, std::__1::shared_ptr, std::__1::less, std::__1::allocator<std::__1::pair<const unsigned int, std::__1::shared_ptr > > >::size_type’ (aka ‘unsigned long’) [-Werror,-Wformat]
MESON_LOGV(“Crtc loaded in loadPlanes: %d”, mCrtcs.size());
~~ ^~~~~~~~~~~~~
%lu
server:~/share/workspace/android-s905x3-Amlogic/hardware/amlogic/hwcomposer/common/display$ git diff HwDisplayManager.cpp
diff --git a/common/display/HwDisplayManager.cpp b/common/display/HwDisplayManager.cpp
index 146131b..d177996 100644
--- a/common/display/HwDisplayManager.cpp
+++ b/common/display/HwDisplayManager.cpp
@@ -101,7 +101,7 @@ int32_t HwDisplayManager::freeDrmResources() {
}
int32_t HwDisplayManager::loadCrtcs() {
- MESON_LOGV("Crtc loaded in loadPlanes: %d", mCrtcs.size());
+ MESON_LOGV("Crtc loaded in loadPlanes: %d",(int)mCrtcs.size());
return 0;
}
问题三十:
vendor/amlogic/common/frameworks/services/miracast_hdcp2/HDCP.cpp:167:91: error: cast to ‘void *’ from smaller integer type ‘uint32_t’ (aka ‘unsigned int’) [-Werror,-Wint-to-void-pointer-cast]
s = (Status)mHDCPModule->decrypt(inData.data(), size, streamCTR, outInputCTR, (void *)outAddr);
server:~/share/workspace/android-s905x3-Amlogic/vendor/amlogic/common/frameworks/services/miracast_hdcp2$ git diff HDCP.cpp
diff --git a/services/miracast_hdcp2/HDCP.cpp b/services/miracast_hdcp2/HDCP.cpp
index 59442f0..1ae9773 100644
--- a/services/miracast_hdcp2/HDCP.cpp
+++ b/services/miracast_hdcp2/HDCP.cpp
@@ -164,7 +164,7 @@ Return<void> HDCP::decrypt(
outData.resize(size);
s = (Status)mHDCPModule->decrypt(inData.data(), size, streamCTR, outInputCTR, outData.data());
} else {
- s = (Status)mHDCPModule->decrypt(inData.data(), size, streamCTR, outInputCTR, (void *)outAddr);
+ s = (Status)mHDCPModule->decrypt(inData.data(), size, streamCTR, outInputCTR, (void *)(uintptr_t)outAddr);
}
}
_hidl_cb(s, outData);