No bug, fix WebrtcMediaCodecVP8VideoCodec.cpp warnings
authorJames Willcox <snorp@snorp.net>
Wed, 13 May 2015 10:14:56 -0500
changeset 243830 8542b3542d8f1dbfc078b39d5cde444155731e92
parent 243829 560058cbd35525dc52daebd2cdc27ea348b02adc
child 243831 a31da903e8ed509a3dab7c24349fa76d0f3bbf42
push id28753
push userkwierso@gmail.com
push dateThu, 14 May 2015 22:33:43 +0000
treeherdermozilla-central@07e2e15703cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug, fix WebrtcMediaCodecVP8VideoCodec.cpp warnings
media/webrtc/signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.cpp
--- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.cpp
@@ -190,44 +190,44 @@ public:
       MediaFormat::LocalRef format;
 
       res = MediaFormat::CreateVideoFormat(nsCString(mime),
                                      mWidth,
                                      mHeight,
                                      &format);
 
       if (NS_FAILED(res)) {
-        CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateVideoFormat failed err = %d", __FUNCTION__, res);
+        CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateVideoFormat failed err = %d", __FUNCTION__, (int)res);
         return NS_ERROR_FAILURE;
       }
 
       if (encoder) {
         mCoder = CreateEncoder(mime);
 
         if (NS_FAILED(res)) {
-          CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateEncoderByType failed err = %d", __FUNCTION__, res);
+          CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateEncoderByType failed err = %d", __FUNCTION__, (int)res);
           return NS_ERROR_FAILURE;
         }
 
         res = format->SetInteger(nsCString("bitrate"), 1000*300);
         res = format->SetInteger(nsCString("bitrate-mode"), 2);
         res = format->SetInteger(nsCString("color-format"), 21);
         res = format->SetInteger(nsCString("frame-rate"), 30);
         res = format->SetInteger(nsCString("i-frame-interval"), 100);
 
       } else {
         mCoder = CreateDecoder(mime);
         if (NS_FAILED(res)) {
-          CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateDecoderByType failed err = %d", __FUNCTION__, res);
+          CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, CreateDecoderByType failed err = %d", __FUNCTION__, (int)res);
           return NS_ERROR_FAILURE;
         }
       }
       res = mCoder->Configure(format, nullptr, nullptr, flags);
       if (NS_FAILED(res)) {
-        CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, err = %d", __FUNCTION__, res);
+        CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, err = %d", __FUNCTION__, (int)res);
       }
     }
 
     return res;
   }
 
   nsresult Start() {
     CSFLogDebug(logTag,  "%s ", __FUNCTION__);
@@ -237,17 +237,17 @@ public:
     }
 
     mEnding = false;
 
     nsresult res;
     res = mCoder->Start();
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, mCoder->start() return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return res;
     }
     isStarted = true;
     return NS_OK;
   }
 
   nsresult Stop() {
     CSFLogDebug(logTag,  "%s ", __FUNCTION__);
@@ -356,17 +356,17 @@ public:
 #ifdef WEBRTC_MEDIACODEC_DEBUG
     uint32_t time = PR_IntervalNow();
 #endif
     nsresult res;
     BufferInfo::LocalRef bufferInfo;
     res = BufferInfo::New(&bufferInfo);
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, BufferInfo::New return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return res;
     }
     int32_t outputIndex = DequeueOutputBuffer(bufferInfo);
 
     if (outputIndex == MediaCodec::INFO_TRY_AGAIN_LATER) {
       // Not an error: output not available yet. Try later.
       CSFLogDebug(logTag,  "%s dequeue output buffer try again:%d", __FUNCTION__, outputIndex);
     } else if (outputIndex == MediaCodec::INFO_OUTPUT_FORMAT_CHANGED) {
@@ -416,41 +416,41 @@ public:
 
   int32_t DequeueInputBuffer(int64_t time) {
     nsresult res;
     int32_t inputIndex;
     res = mCoder->DequeueInputBuffer(time, &inputIndex);
 
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, mCoder->DequeueInputBuffer() return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return -1;
     }
     return inputIndex;
   }
 
   void QueueInputBuffer(int32_t inputIndex, int32_t offset, size_t size, int64_t renderTimes, int32_t flags) {
     nsresult res = NS_OK;
     res = mCoder->QueueInputBuffer(inputIndex, offset, size, renderTimes, flags);
 
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, mCoder->QueueInputBuffer() return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
     }
   }
 
   int32_t DequeueOutputBuffer(BufferInfo::Param aInfo) {
     nsresult res;
 
     int32_t outputStatus;
     res = mCoder->DequeueOutputBuffer(aInfo, DECODER_TIMEOUT, &outputStatus);
 
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, mCoder->DequeueOutputBuffer() return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return -1;
     }
 
     return outputStatus;
   }
 
   void ReleaseOutputBuffer(int32_t index, bool flag) {
     mCoder->ReleaseOutputBuffer(index, flag);
@@ -464,17 +464,17 @@ public:
     }
 
     nsresult res;
     jni::ObjectArray::LocalRef inputBuffers;
     res = mCoder->GetInputBuffers(&inputBuffers);
     mInputBuffers = (jobjectArray) env->NewGlobalRef(inputBuffers.Get());
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, GetInputBuffers return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return nullptr;
     }
 
     return mInputBuffers;
   }
 
   jobjectArray GetOutputBuffers() {
     JNIEnv* env = jsjni_GetJNIForThread();
@@ -484,17 +484,17 @@ public:
     }
 
     nsresult res;
     jni::ObjectArray::LocalRef outputBuffers;
     res = mCoder->GetOutputBuffers(&outputBuffers);
     mOutputBuffers = (jobjectArray) env->NewGlobalRef(outputBuffers.Get());
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcAndroidMediaCodec::%s, GetOutputBuffers return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return nullptr;
     }
 
     return mOutputBuffers;
   }
 
   void SetDecoderCallback(webrtc::DecodedImageCallback* aCallback) {
     mDecoderCallback = aCallback;
@@ -648,25 +648,25 @@ int32_t WebrtcMediaCodecVP8VideoEncoder:
       mFrameHeight = inputImage.height();
     }
 
     mMediaCodecEncoder->SetEncoderCallback(mCallback);
     nsresult res = mMediaCodecEncoder->Configure(mFrameWidth, mFrameHeight, nullptr, MediaCodec::CONFIGURE_FLAG_ENCODE, MEDIACODEC_VIDEO_MIME_VP8, true /* encoder */);
 
     if (res != NS_OK) {
       CSFLogDebug(logTag,  "%s, encoder configure return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
 
     res = mMediaCodecEncoder->Start();
 
     if (NS_FAILED(res)) {
       mMediaCodecEncoder->isStarted = false;
-      CSFLogDebug(logTag,  "%s start encoder. err = %d", __FUNCTION__, res);
+      CSFLogDebug(logTag,  "%s start encoder. err = %d", __FUNCTION__, (int)res);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
 
     bool retBool = ResetInputBuffers();
     if (!retBool) {
       CSFLogDebug(logTag,  "%s ResetInputBuffers failed.", __FUNCTION__);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
@@ -727,17 +727,17 @@ int32_t WebrtcMediaCodecVP8VideoEncoder:
     mEncodedImage._timeStamp = inputImage.timestamp();
     mEncodedImage.capture_time_ms_ = inputImage.timestamp();
 
     nsresult res;
     BufferInfo::LocalRef bufferInfo;
     res = BufferInfo::New(&bufferInfo);
     if (NS_FAILED(res)) {
       CSFLogDebug(logTag, "WebrtcMediaCodecVP8VideoEncoder::%s, BufferInfo::New return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return -1;
     }
 
     int32_t outputIndex = mMediaCodecEncoder->DequeueOutputBuffer(bufferInfo);
 
     if (outputIndex == MediaCodec::INFO_TRY_AGAIN_LATER) {
       // Not an error: output not available yet. Try later.
       CSFLogDebug(logTag,  "%s dequeue output buffer try again:%d", __FUNCTION__, outputIndex);
@@ -923,25 +923,25 @@ int32_t WebrtcMediaCodecVP8VideoDecoder:
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
 
     mMediaCodecDecoder->SetDecoderCallback(mCallback);
     nsresult res = mMediaCodecDecoder->Configure(mFrameWidth, mFrameHeight, nullptr, 0, MEDIACODEC_VIDEO_MIME_VP8, false /* decoder */);
 
     if (res != NS_OK) {
       CSFLogDebug(logTag,  "%s, decoder configure return err = %d",
-                  __FUNCTION__, res);
+                  __FUNCTION__, (int)res);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
 
     res = mMediaCodecDecoder->Start();
 
     if (NS_FAILED(res)) {
       mMediaCodecDecoder->isStarted = false;
-      CSFLogDebug(logTag,  "%s start decoder. err = %d", __FUNCTION__, res);
+      CSFLogDebug(logTag,  "%s start decoder. err = %d", __FUNCTION__, (int)res);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
 
     bool retBool = ResetInputBuffers();
     if (!retBool) {
       CSFLogDebug(logTag,  "%s ResetInputBuffers failed.", __FUNCTION__);
       return WEBRTC_VIDEO_CODEC_ERROR;
     }