From 506bc3cf12f28cc19f9260075a852f0e780d9ac6 Mon Sep 17 00:00:00 2001 From: "mikhal@google.com" Date: Fri, 29 Jul 2011 20:23:18 +0000 Subject: [PATCH] video_coding: Removing compiler warnings Review URL: http://webrtc-codereview.appspot.com/88010 git-svn-id: http://webrtc.googlecode.com/svn/trunk@274 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../codecs/vp8/main/interface/vp8.h | 2 +- .../video_coding/codecs/vp8/main/source/vp8.cc | 17 +++++++++-------- .../video_coding/main/source/receiver.cc | 1 - .../video_coding/main/source/session_info.cc | 1 - .../main/source/video_coding_impl.cc | 2 -- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h index ab82f3495..444015565 100644 --- a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h +++ b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h @@ -152,7 +152,7 @@ private: WebRtc_Word32 _width; WebRtc_Word32 _height; WebRtc_Word32 _maxBitRateKbit; - int _maxFrameRate; + WebRtc_UWord32 _maxFrameRate; bool _inited; WebRtc_UWord32 _timeStamp; WebRtc_UWord16 _pictureID; diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc index c9403ab9e..2c7a16520 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -167,7 +167,7 @@ VP8Encoder::SetRates(WebRtc_UWord32 newBitRateKbit, WebRtc_UWord32 newFrameRate) // update frame rate if (newFrameRate != _maxFrameRate) { - _maxFrameRate = static_cast(newFrameRate); + _maxFrameRate = newFrameRate; _cfg->g_timebase.num = 1; _cfg->g_timebase.den = _maxFrameRate; } @@ -656,7 +656,7 @@ VP8Decoder::InitDecode(const VideoCodec* inst, cfg.threads = numberOfCores; cfg.h = cfg.w = 0; // set after decode - if(vpx_codec_dec_init(_decoder, vpx_codec_vp8_dx(), NULL, 0)) + if (vpx_codec_dec_init(_decoder, vpx_codec_vp8_dx(), NULL, 0)) { return WEBRTC_VIDEO_CODEC_MEMORY; } @@ -669,7 +669,7 @@ VP8Decoder::InitDecode(const VideoCodec* inst, // ppcfg.NoiseLevel = 1; //Noise intensity. Valid range: [0,7] vpx_codec_control(_decoder, VP8_SET_POSTPROC, &ppcfg); - // Save the VideoCodec instance for later; mainly for duplicating the decoder. + // Save VideoCodec instance for later; mainly for duplicating the decoder. if (inst) { if (!_inst) @@ -686,9 +686,9 @@ VP8Decoder::InitDecode(const VideoCodec* inst, WebRtc_Word32 VP8Decoder::Decode(const EncodedImage& inputImage, - bool missingFrames, - const void* /*codecSpecificInfo*/, - WebRtc_Word64 /*renderTimeMs*/) + bool missingFrames, + const void* /*codecSpecificInfo*/, + WebRtc_Word64 /*renderTimeMs*/) { if (!_inited) { @@ -756,7 +756,7 @@ VP8Decoder::Decode(const EncodedImage& inputImage, if (inputImage._frameType == kKeyFrame) { // Reduce size due to PictureID that we won't copy. - const int bytesToCopy = inputImage._length - numberOfBytes; + const WebRtc_UWord32 bytesToCopy = inputImage._length - numberOfBytes; if (_lastKeyFrame._size < bytesToCopy) { delete [] _lastKeyFrame._buffer; @@ -981,7 +981,8 @@ VP8Decoder::Copy() const vpx_ref_frame_type_t typeVec[] = { VP8_LAST_FRAME, VP8_GOLD_FRAME, VP8_ALTR_FRAME }; - for (int ix = 0; ix < sizeof(typeVec) / sizeof(vpx_ref_frame_type_t); ++ix) + for (WebRtc_UWord32 ix = 0; + ix < sizeof(typeVec) / sizeof(vpx_ref_frame_type_t); ++ix) { _refFrame->frame_type = typeVec[ix]; if (CopyReference(copyTo) < 0) diff --git a/src/modules/video_coding/main/source/receiver.cc b/src/modules/video_coding/main/source/receiver.cc index 676bab88a..2e78aebf3 100644 --- a/src/modules/video_coding/main/source/receiver.cc +++ b/src/modules/video_coding/main/source/receiver.cc @@ -108,7 +108,6 @@ VCMReceiver::InsertPacket(const VCMPacket& packet, MaskWord64ToUWord32(VCMTickTime::MillisecondTimestamp())); } - const bool emptyFrame = (buffer->Length() == 0); const WebRtc_Word64 nowMs = VCMTickTime::MillisecondTimestamp(); WebRtc_Word64 renderTimeMs = _timing.RenderTimeMs(packet.timestamp, nowMs); diff --git a/src/modules/video_coding/main/source/session_info.cc b/src/modules/video_coding/main/source/session_info.cc index 298aa6306..cdad5f981 100644 --- a/src/modules/video_coding/main/source/session_info.cc +++ b/src/modules/video_coding/main/source/session_info.cc @@ -760,7 +760,6 @@ VCMSessionInfo::PrepareForDecode(WebRtc_UWord8* ptrStartOfLayer, { WebRtc_UWord32 currentPacketOffset = 0; WebRtc_UWord32 length = GetSessionLength(); - WebRtc_UWord32 idSum = 0; WebRtc_UWord32 realDataBytes = 0; if (length == 0) { diff --git a/src/modules/video_coding/main/source/video_coding_impl.cc b/src/modules/video_coding/main/source/video_coding_impl.cc index 48d2947af..8b4a8256e 100644 --- a/src/modules/video_coding/main/source/video_coding_impl.cc +++ b/src/modules/video_coding/main/source/video_coding_impl.cc @@ -955,8 +955,6 @@ VideoCodingModuleImpl::Decode(WebRtc_UWord16 maxWaitTimeMs) { CriticalSectionScoped cs(_receiveCritSect); - const WebRtc_UWord32 timestamp = frame->TimeStamp(); - // If this frame was too late, we should adjust the delay accordingly _timing.UpdateCurrentDelay(frame->RenderTimeMs(), VCMTickTime::MillisecondTimestamp());