OSDN Git Service

Quiet unnecessary warnings
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 4 May 2017 02:07:45 +0000 (10:07 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 9 May 2017 05:31:32 +0000 (13:31 +0800)
To avoid warnings, both values in CHECK_xx() must be the same type.

common.mk
extractor/FFmpegExtractor.cpp
omx/SoftFFmpegAudio.cpp
omx/SoftFFmpegVideo.cpp
utils/Android.mk
utils/codec_utils.cpp

index 5efb80e..db6610b 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -43,4 +43,8 @@ endif
 
 LOCAL_CFLAGS += -D__STDC_CONSTANT_MACROS=1 -D__STDINT_LIMITS=1
 
+# Quiet some noise
+LOCAL_CFLAGS += -Wno-deprecated-declarations -Wno-unused-parameter
+LOCAL_CLANG_CFLAGS += -Wno-unknown-attributes
+
 LOCAL_MODULE_TAGS := optional
index b06389b..fd38ce1 100644 (file)
@@ -366,7 +366,7 @@ sp<MetaData> FFmpegExtractor::setVideoFormat(AVStream *stream)
     sp<MetaData> meta = NULL;
 
     avctx = stream->codec;
-    CHECK_EQ(avctx->codec_type, AVMEDIA_TYPE_VIDEO);
+    CHECK_EQ((int)avctx->codec_type, (int)AVMEDIA_TYPE_VIDEO);
 
     switch(avctx->codec_id) {
     case AV_CODEC_ID_H264:
@@ -495,7 +495,7 @@ sp<MetaData> FFmpegExtractor::setAudioFormat(AVStream *stream)
     sp<MetaData> meta = NULL;
 
     avctx = stream->codec;
-    CHECK_EQ(avctx->codec_type, AVMEDIA_TYPE_AUDIO);
+    CHECK_EQ((int)avctx->codec_type, (int)AVMEDIA_TYPE_AUDIO);
 
     switch(avctx->codec_id) {
     case AV_CODEC_ID_MP2:
index 43ac9d9..887620f 100644 (file)
@@ -1129,7 +1129,7 @@ int32_t SoftFFmpegAudio::decodeAudio() {
     int len = 0;
     int gotFrm = false;
     int32_t ret = ERR_OK;
-    int32_t inputBufferUsedLength = 0;
+    uint32_t inputBufferUsedLength = 0;
     bool is_flush = (mEOSStatus == OUTPUT_FRAMES_FLUSHED);
     List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
     BufferInfo *inInfo = NULL;
@@ -1425,7 +1425,7 @@ void SoftFFmpegAudio::drainAllOutputBuffers() {
                 drainEOSOutputBuffer();
                 return;
             } else {
-                CHECK_EQ(err, ERR_OK);
+                CHECK_EQ(err, (int32_t)ERR_OK);
             }
         }
 
@@ -1494,7 +1494,7 @@ void SoftFFmpegAudio::onQueueFilled(OMX_U32 /* portIndex */) {
                 CHECK_EQ(mResampledDataSize, 0);
                 continue;
             } else {
-                CHECK_EQ(err, ERR_OK);
+                CHECK_EQ(err, (int32_t)ERR_OK);
             }
         }
 
index 6962ced..f5cfa87 100644 (file)
@@ -619,7 +619,7 @@ void SoftFFmpegVideo::drainAllOutputBuffers() {
         } else if (err == ERR_NO_FRM) {
             continue;
         } else {
-            CHECK_EQ(err, ERR_OK);
+            CHECK_EQ(err, (int32_t)ERR_OK);
         }
         if (drainOneOutputBuffer() != ERR_OK) {
             notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
@@ -712,7 +712,7 @@ void SoftFFmpegVideo::onQueueFilled(OMX_U32 portIndex __unused) {
         } else if (err == ERR_NO_FRM) {
             continue;
         } else {
-            CHECK_EQ(err, ERR_OK);
+            CHECK_EQ(err, (int32_t)ERR_OK);
         }
 
         if (handlePortSettingsChange()) {
index 8db7c8c..bc3a1a8 100644 (file)
@@ -14,7 +14,4 @@ LOCAL_MODULE := libffmpeg_utils
 # Clang when included from C++
 LOCAL_CLANG_CFLAGS += -DAVUTIL_ARM_INTREADWRITE_H
 
-# Quiet some noise from FFMPEG
-LOCAL_CLANG_CFLAGS += -Wno-unknown-attributes -Wno-deprecated-declarations
-
 include $(BUILD_SHARED_LIBRARY)
index 5275b10..a874cab 100644 (file)
@@ -38,7 +38,7 @@ extern "C" {
 namespace android {
 
 static void EncodeSize14(uint8_t **_ptr, size_t size) {
-    CHECK_LE(size, 0x3fff);
+    CHECK_LE(size, 0x3fffu);
 
     uint8_t *ptr = *_ptr;
 
@@ -87,9 +87,8 @@ sp<MetaData> setAVCFormat(AVCodecContext *avctx)
 {
     ALOGV("AVC");
 
-    CHECK_EQ(avctx->codec_id, AV_CODEC_ID_H264);
     CHECK_GT(avctx->extradata_size, 0);
-    CHECK_EQ(avctx->extradata[0], 1); //configurationVersion
+    CHECK_EQ((int)avctx->extradata[0], 1); //configurationVersion
 
     if (avctx->width == 0 || avctx->height == 0) {
          int32_t width, height;
@@ -112,8 +111,7 @@ sp<MetaData> setH264Format(AVCodecContext *avctx)
 {
     ALOGV("H264");
 
-    CHECK_EQ(avctx->codec_id, AV_CODEC_ID_H264);
-    CHECK_NE(avctx->extradata[0], 1); //configurationVersion
+    CHECK_NE((int)avctx->extradata[0], 1); //configurationVersion
 
     sp<ABuffer> buffer = new ABuffer(avctx->extradata_size);
     memcpy(buffer->data(), avctx->extradata, avctx->extradata_size);