OSDN Git Service

stagefright-plugins: Fix compilation issues with Clang
authorSteve Kondik <steve@cyngn.com>
Sun, 1 Nov 2015 12:04:27 +0000 (04:04 -0800)
committerSteve Kondik <steve@cyngn.com>
Sun, 1 Nov 2015 12:04:27 +0000 (04:04 -0800)
 * We still build the utils library with GCC until FFMPEG is sorted.

Change-Id: I8a5d47a53a03b8b96cb6106b9b65b4b978cbdc2a

extractor/FFmpegExtractor.h
omx/SoftFFmpegAudio.cpp
omx/SoftFFmpegVideo.cpp
utils/Android.mk

index aaec67d..0bbf775 100644 (file)
@@ -30,7 +30,7 @@ namespace android {
 
 struct ABuffer;
 struct AMessage;
-struct String8;
+class String8;
 struct FFmpegSource;
 
 struct FFmpegExtractor : public MediaExtractor {
index ed0862d..3cb6668 100644 (file)
@@ -297,7 +297,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalGetParameter(
             profile->nSamplingRate = mAudioTgtFreq;
 
             //mCtx has been updated(adjustAudioParams)!
-            ALOGV("get pcm params, nChannels:%lu, nSamplingRate:%lu, nBitsPerSample:%lu",
+            ALOGV("get pcm params, nChannels:%u, nSamplingRate:%u, nBitsPerSample:%u",
                    profile->nChannels, profile->nSamplingRate, profile->nBitPerSample);
 
             return OMX_ErrorNone;
@@ -543,15 +543,13 @@ OMX_ERRORTYPE SoftFFmpegAudio::isRoleSupported(
 
 void SoftFFmpegAudio::adjustAudioParams() {
 
-    uint32_t max_rate = 192000;
-
     mReconfiguring = isConfigured();
 
     // let android audio mixer to downmix if there is no multichannel output
     // and use number of channels from the source file, useful for HDMI/offload output
     mAudioTgtChannels = mCtx->channels;
 
-    mAudioTgtFreq = FFMIN(max_rate, FFMAX(8000, mCtx->sample_rate));
+    mAudioTgtFreq = FFMIN(192000, FFMAX(8000, mCtx->sample_rate));
 
     mAudioTgtChannels = mCtx->channels;
     mAudioTgtFreq = mCtx->sample_rate;
@@ -595,8 +593,8 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
             mAudioTgtFreq = profile->nSamplingRate;
             mAudioTgtChannels = profile->nChannels;
 
-            ALOGV("set OMX_IndexParamAudioPcm, nChannels:%lu, "
-                    "nSampleRate:%lu, nBitsPerSample:%lu",
+            ALOGV("set OMX_IndexParamAudioPcm, nChannels:%u, "
+                    "nSampleRate:%u, nBitsPerSample:%u",
                 profile->nChannels, profile->nSamplingRate,
                 profile->nBitPerSample);
 
@@ -617,7 +615,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioAac, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioAac, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSampleRate);
 
             return OMX_ErrorNone;
@@ -637,7 +635,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioMp3, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioMp3, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSampleRate);
 
             return OMX_ErrorNone;
@@ -658,8 +656,8 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
             adjustAudioParams();
 
             ALOGD("set OMX_IndexParamAudioVorbis, "
-                    "nChannels=%lu, nSampleRate=%lu, nBitRate=%lu, "
-                    "nMinBitRate=%lu, nMaxBitRate=%lu",
+                    "nChannels=%u, nSampleRate=%u, nBitRate=%u, "
+                    "nMinBitRate=%u, nMaxBitRate=%u",
                 profile->nChannels, profile->nSampleRate,
                 profile->nBitRate, profile->nMinBitRate,
                 profile->nMaxBitRate);
@@ -697,7 +695,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
             adjustAudioParams();
 
             ALOGV("set OMX_IndexParamAudioWma, nChannels:%u, "
-                    "nSampleRate:%lu, nBitRate:%lu, nBlockAlign:%u",
+                    "nSampleRate:%u, nBitRate:%u, nBlockAlign:%u",
                 profile->nChannels, profile->nSamplingRate,
                 profile->nBitRate, profile->nBlockAlign);
 
@@ -722,8 +720,8 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioRa, nChannels:%lu, "
-                    "nSampleRate:%lu, nBlockAlign:%d",
+            ALOGV("set OMX_IndexParamAudioRa, nChannels:%u, "
+                    "nSampleRate:%u, nBlockAlign:%d",
                 profile->nChannels, profile->nSamplingRate, mCtx->block_align);
 
             return OMX_ErrorNone;
@@ -743,7 +741,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioFlac, nChannels:%lu, nSampleRate:%lu ",
+            ALOGV("set OMX_IndexParamAudioFlac, nChannels:%u, nSampleRate:%u ",
                 profile->nChannels, profile->nSampleRate);
 
             return OMX_ErrorNone;
@@ -763,7 +761,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioMp2, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioMp2, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSampleRate);
 
             return OMX_ErrorNone;
@@ -783,7 +781,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioAc3, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioAc3, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSamplingRate);
 
             return OMX_ErrorNone;
@@ -803,7 +801,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioAndroidAc3, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioAndroidAc3, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSampleRate);
 
             return OMX_ErrorNone;
@@ -825,8 +823,8 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioApe, nChannels:%lu, "
-                    "nSampleRate:%lu, nBitsPerSample:%lu",
+            ALOGV("set OMX_IndexParamAudioApe, nChannels:%u, "
+                    "nSampleRate:%u, nBitsPerSample:%u",
                 profile->nChannels, profile->nSamplingRate,
                 profile->nBitsPerSample);
 
@@ -847,7 +845,7 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
 
             adjustAudioParams();
 
-            ALOGV("set OMX_IndexParamAudioDts, nChannels:%lu, nSampleRate:%lu",
+            ALOGV("set OMX_IndexParamAudioDts, nChannels:%u, nSampleRate:%u",
                 profile->nChannels, profile->nSamplingRate);
 
             return OMX_ErrorNone;
@@ -873,9 +871,9 @@ OMX_ERRORTYPE SoftFFmpegAudio::internalSetParameter(
             adjustAudioParams();
 
             ALOGD("set OMX_IndexParamAudioFFmpeg, "
-                "eCodecId:%ld(%s), nChannels:%lu, nBitRate:%lu, "
-                "nBitsPerSample:%lu, nSampleRate:%lu, "
-                "nBlockAlign:%lu, eSampleFormat:%lu(%s)",
+                "eCodecId:%d(%s), nChannels:%u, nBitRate:%u, "
+                "nBitsPerSample:%u, nSampleRate:%u, "
+                "nBlockAlign:%u, eSampleFormat:%u(%s)",
                 profile->eCodecId, avcodec_get_name(mCtx->codec_id),
                 profile->nChannels, profile->nBitRate,
                 profile->nBitsPerSample, profile->nSampleRate,
@@ -923,12 +921,12 @@ int32_t SoftFFmpegAudio::handleExtradata() {
     BufferInfo *inInfo = *inQueue.begin();
     OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
 
-    ALOGI("got extradata, ignore: %d, size: %lu",
+    ALOGI("got extradata, ignore: %d, size: %u",
             mIgnoreExtradata, inHeader->nFilledLen);
     hexdump(inHeader->pBuffer + inHeader->nOffset, inHeader->nFilledLen);
 
     if (mIgnoreExtradata) {
-        ALOGI("got extradata, size: %lu, but ignore it", inHeader->nFilledLen);
+        ALOGI("got extradata, size: %u, but ignore it", inHeader->nFilledLen);
     } else {
         if (!mExtradataReady) {
             uint32_t ret = ERR_OK;
@@ -1432,7 +1430,7 @@ void SoftFFmpegAudio::onQueueFilled(OMX_U32 /* portIndex */) {
 }
 
 void SoftFFmpegAudio::onPortFlushCompleted(OMX_U32 portIndex) {
-    ALOGV("ffmpeg audio decoder flush port(%lu)", portIndex);
+    ALOGV("ffmpeg audio decoder flush port(%u)", portIndex);
     if (portIndex == kInputPortIndex) {
         if (mCtx && mCtx->codec) {
             //Make sure that the next buffer output does not still
index 80f1df3..c2ae693 100644 (file)
@@ -327,7 +327,7 @@ OMX_ERRORTYPE SoftFFmpegVideo::internalSetParameter(
             mCtx->height   = profile->nHeight;
 
             ALOGD("got OMX_IndexParamVideoFFmpeg, "
-                "eCodecId:%ld(%s), width:%lu, height:%lu",
+                "eCodecId:%d(%s), width:%u, height:%u",
                 profile->eCodecId,
                 avcodec_get_name(mCtx->codec_id),
                 profile->nWidth,
@@ -343,12 +343,12 @@ int32_t SoftFFmpegVideo::handleExtradata() {
     BufferInfo *inInfo = *inQueue.begin();
     OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
 
-    ALOGI("got extradata, ignore: %d, size: %lu",
+    ALOGI("got extradata, ignore: %d, size: %u",
             mIgnoreExtradata, inHeader->nFilledLen);
     hexdump(inHeader->pBuffer + inHeader->nOffset, inHeader->nFilledLen);
 
     if (mIgnoreExtradata) {
-        ALOGI("got extradata, size: %lu, but ignore it", inHeader->nFilledLen);
+        ALOGI("got extradata, size: %u, but ignore it", inHeader->nFilledLen);
     } else {
         if (!mExtradataReady) {
             //if (mMode == MODE_H264)
@@ -529,7 +529,7 @@ int32_t SoftFFmpegVideo::drainOneOutputBuffer() {
             0, height, pict.data, pict.linesize);
 
     outHeader->nOffset = 0;
-    outHeader->nFilledLen = (width * height * 3) / 2;
+    outHeader->nFilledLen = (outputBufferWidth() * outputBufferHeight() * 3) / 2;
     outHeader->nFlags = 0;
     if (mFrame->key_frame) {
         outHeader->nFlags |= OMX_BUFFERFLAG_SYNCFRAME;
@@ -712,7 +712,7 @@ void SoftFFmpegVideo::onQueueFilled(OMX_U32 portIndex __unused) {
 }
 
 void SoftFFmpegVideo::onPortFlushCompleted(OMX_U32 portIndex) {
-    ALOGV("ffmpeg video decoder flush port(%lu)", portIndex);
+    ALOGV("ffmpeg video decoder flush port(%u)", portIndex);
     if (portIndex == kInputPortIndex) {
         if (mCtx) {
             //Make sure that the next buffer output does not still
index 50aef2d..6e18cfc 100644 (file)
@@ -40,4 +40,6 @@ LOCAL_CFLAGS += -D__STDC_CONSTANT_MACROS=1
 #      LOCAL_CFLAGS += -fpermissive
 #endif
 
+LOCAL_CLANG := false
+
 include $(BUILD_SHARED_LIBRARY)