Bug 1073003 - Fix warnings about macro redefinitions. r=ehsan
authorBotond Ballo <botond@mozilla.com>
Tue, 23 Dec 2014 03:16:33 -0500
changeset 239297 c717d72546c79708d90f22a9d352fc0cfc4bda86
parent 239296 b022fa348b73871d462fc6779ca23a2af648a03b
child 239298 0340001fb80a110b70d8a4fd0ea1f6b5cca51d1a
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1073003
milestone37.0a1
Bug 1073003 - Fix warnings about macro redefinitions. r=ehsan
dom/media/omx/AudioOutput.h
dom/media/omx/MediaCodecProxy.cpp
dom/media/omx/OmxDecoder.cpp
dom/media/webrtc/MediaEngineGonkVideoSource.cpp
--- a/dom/media/omx/AudioOutput.h
+++ b/dom/media/omx/AudioOutput.h
@@ -21,18 +21,16 @@
 #define AUDIOOUTPUT_H_
 
 #include <stagefright/foundation/ABase.h>
 #include <utils/Mutex.h>
 #include <AudioTrack.h>
 
 #include "AudioSink.h"
 
-#define LOG_TAG "AudioOffloadPlayer"
-
 namespace mozilla {
 
 /**
  * Stripped version of Android KK MediaPlayerService::AudioOutput class
  * Android MediaPlayer uses AudioOutput as a wrapper to handle
  * Android::AudioTrack
  * Similarly to ease handling offloaded tracks, part of AudioOutput is used here
  */
--- a/dom/media/omx/MediaCodecProxy.cpp
+++ b/dom/media/omx/MediaCodecProxy.cpp
@@ -7,19 +7,18 @@
 #include "MediaCodecProxy.h"
 #include <string.h>
 #include <binder/IPCThreadState.h>
 #include <stagefright/foundation/ABuffer.h>
 #include <stagefright/foundation/ADebug.h>
 #include <stagefright/MetaData.h>
 #include "stagefright/MediaErrors.h"
 
-#define LOG_TAG "MediaCodecProxy"
 #include <android/log.h>
-#define ALOG(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define MCP_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "MediaCodecProxy", __VA_ARGS__)
 #define TIMEOUT_DEQUEUE_INPUTBUFFER_MS 1000000ll
 
 namespace android {
 
 // General Template: MediaCodec::getOutputGraphicBufferFromIndex(...)
 template <typename T, bool InterfaceSupported>
 struct OutputGraphicBufferStub
 {
@@ -491,84 +490,84 @@ MediaCodecProxy::resourceCanceled()
   }
 }
 
 bool MediaCodecProxy::Prepare()
 {
 
   status_t err;
   if (start() != OK) {
-    ALOG("Couldn't start MediaCodec");
+    MCP_LOG("Couldn't start MediaCodec");
     return false;
   }
   if (getInputBuffers(&mInputBuffers) != OK) {
-    ALOG("Couldn't get input buffers from MediaCodec");
+    MCP_LOG("Couldn't get input buffers from MediaCodec");
     return false;
   }
   if (getOutputBuffers(&mOutputBuffers) != OK) {
-    ALOG("Couldn't get output buffers from MediaCodec");
+    MCP_LOG("Couldn't get output buffers from MediaCodec");
     return false;
   }
 
   return true;
 }
 
 bool MediaCodecProxy::UpdateOutputBuffers()
 {
   if (mCodec == nullptr) {
-    ALOG("MediaCodec has not been inited from input!");
+    MCP_LOG("MediaCodec has not been inited from input!");
     return false;
   }
 
   status_t err = getOutputBuffers(&mOutputBuffers);
   if (err != OK){
-    ALOG("Couldn't update output buffers from MediaCodec");
+    MCP_LOG("Couldn't update output buffers from MediaCodec");
     return false;
   }
   return true;
 }
 
 status_t MediaCodecProxy::Input(const uint8_t* aData, uint32_t aDataSize,
                                 int64_t aTimestampUsecs, uint64_t aflags)
 {
   if (mCodec == nullptr) {
-    ALOG("MediaCodec has not been inited from input!");
+    MCP_LOG("MediaCodec has not been inited from input!");
     return NO_INIT;
   }
 
   size_t index;
   status_t err = dequeueInputBuffer(&index, TIMEOUT_DEQUEUE_INPUTBUFFER_MS);
   if (err != OK) {
-    ALOG("dequeueInputBuffer returned %d", err);
+    MCP_LOG("dequeueInputBuffer returned %d", err);
     return err;
   }
 
   if (aData) {
     const sp<ABuffer> &dstBuffer = mInputBuffers.itemAt(index);
 
     CHECK_LE(aDataSize, dstBuffer->capacity());
     dstBuffer->setRange(0, aDataSize);
 
     memcpy(dstBuffer->data(), aData, aDataSize);
     err = queueInputBuffer(index, 0, dstBuffer->size(), aTimestampUsecs, aflags);
   } else {
     err = queueInputBuffer(index, 0, 0, 0ll, MediaCodec::BUFFER_FLAG_EOS);
   }
 
   if (err != OK) {
-    ALOG("queueInputBuffer returned %d", err);
+    MCP_LOG("queueInputBuffer returned %d", err);
     return err;
   }
   return err;
 }
 
 status_t MediaCodecProxy::Output(MediaBuffer** aBuffer, int64_t aTimeoutUs)
 {
   if (mCodec == nullptr) {
-    ALOG("MediaCodec has not been inited from output!");
+    MCP_LOG("MediaCodec has not been inited from output!");
     return NO_INIT;
   }
 
   size_t index = 0;
   size_t offset = 0;
   size_t size = 0;
   int64_t timeUs = 0;
   uint32_t flags = 0;
--- a/dom/media/omx/OmxDecoder.cpp
+++ b/dom/media/omx/OmxDecoder.cpp
@@ -28,19 +28,18 @@
 #include "MPAPI.h"
 #include "prlog.h"
 
 #include "GonkNativeWindow.h"
 #include "GonkNativeWindowClient.h"
 #include "OMXCodecProxy.h"
 #include "OmxDecoder.h"
 
-#define LOG_TAG "OmxDecoder"
 #include <android/log.h>
-#define ALOG(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define OD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "OmxDecoder", __VA_ARGS__)
 
 #ifdef PR_LOGGING
 PRLogModuleInfo *gOmxDecoderLog;
 #define LOG(type, msg...) PR_LOG(gOmxDecoderLog, type, (msg))
 #else
 #define LOG(x...)
 #endif
 
@@ -599,17 +598,17 @@ bool OmxDecoder::ReadVideo(VideoFrame *a
         seekMode = MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC;
         findNextBuffer = true;
         {
           Mutex::Autolock autoLock(mSeekLock);
           mIsVideoSeeking = true;
         }
         continue;
       } else if (err != OK) {
-        ALOG("Unexpected error when seeking to %lld", aTimeUs);
+        OD_LOG("Unexpected error when seeking to %lld", aTimeUs);
         break;
       }
       // For some codecs, the length of first decoded frame after seek is 0.
       // Need to ignore it and continue to find the next one
       if (mVideoBuffer->range_length() == 0) {
         ReleaseVideoBuffer();
         findNextBuffer = true;
       }
--- a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "MediaEngineGonkVideoSource.h"
 
+#undef LOG_TAG
 #define LOG_TAG "MediaEngineGonkVideoSource"
 
 #include <utils/Log.h>
 
 #include "GrallocImages.h"
 #include "mozilla/layers/GrallocTextureClient.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "VideoUtils.h"