summaryrefslogtreecommitdiff
path: root/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video
diff options
context:
space:
mode:
authorRakesh Raghava <rakeshraghava@google.com>2022-12-26 13:58:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-12-26 13:58:54 +0000
commit49a3278d0d9ef8aefb1f734ac70dd8e7f7520554 (patch)
tree2559baa7333913bf3189af8377cb19d309631d55 /service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video
parentcb4fd2f28029447febfb95f55c7d3b24fe4500c9 (diff)
parent2e8baa2fc1d55e499f209e88c1a0242bfd8a3817 (diff)
downloadImsMedia-49a3278d0d9ef8aefb1f734ac70dd8e7f7520554.tar.gz
Merge "Fix cppcheck static analysis warnings"
Diffstat (limited to 'service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video')
-rw-r--r--service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaCamera.cpp16
-rw-r--r--service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaPauseImageSource.cpp3
-rw-r--r--service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaVideoSource.cpp3
3 files changed, 13 insertions, 9 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaCamera.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaCamera.cpp
index 4ab7e364..355ae4d5 100644
--- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaCamera.cpp
+++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaCamera.cpp
@@ -846,9 +846,15 @@ public:
return (*this);
}
- bool IsSameRatio(const DisplayDimension& other) { return (w_ * other.h_ == h_ * other.w_); }
- bool operator>(const DisplayDimension& other) { return (w_ >= other.w_ && h_ >= other.h_); }
- bool operator==(const DisplayDimension& other)
+ bool IsSameRatio(const DisplayDimension& other) const
+ {
+ return (w_ * other.h_ == h_ * other.w_);
+ }
+ bool operator>(const DisplayDimension& other) const
+ {
+ return (w_ >= other.w_ && h_ >= other.h_);
+ }
+ bool operator==(const DisplayDimension& other) const
{
return (w_ == other.w_ && h_ == other.h_ && portrait_ == other.portrait_);
}
@@ -858,8 +864,8 @@ public:
return delta;
}
void Flip(void) { portrait_ = !portrait_; }
- int32_t width(void) { return w_; }
- int32_t height(void) { return h_; }
+ int32_t width(void) const { return w_; }
+ int32_t height(void) const { return h_; }
private:
int32_t w_, h_;
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaPauseImageSource.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaPauseImageSource.cpp
index 2a49245c..1d91a426 100644
--- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaPauseImageSource.cpp
+++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaPauseImageSource.cpp
@@ -206,7 +206,6 @@ int8_t* ImsMediaPauseImageSource::ConvertRgbaToYuv(int8_t* pixels, int width, in
int32_t* pSrcArray = reinterpret_cast<int32_t*>(pixels);
mBufferSize = width * height * 1.5;
int8_t* pDstArray = reinterpret_cast<int8_t*>(malloc(mBufferSize));
- int32_t nIndex = 0;
int32_t nYIndex = 0;
int32_t nUVIndex = width * height;
int32_t r, g, b;
@@ -216,7 +215,7 @@ int8_t* ImsMediaPauseImageSource::ConvertRgbaToYuv(int8_t* pixels, int width, in
{
for (int32_t i = 0; i < width; i++)
{
- nIndex = width * j + i;
+ int32_t nIndex = width * j + i;
/*
* TODO: Decode alpha
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaVideoSource.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaVideoSource.cpp
index 33333310..8bda9434 100644
--- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaVideoSource.cpp
+++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/video/android/ImsMediaVideoSource.cpp
@@ -505,7 +505,6 @@ void ImsMediaVideoSource::processOutputBuffer()
{
uint32_t nextTime = ImsMediaTimer::GetTimeInMilliSeconds();
uint32_t timeInterval = 66;
- uint32_t timeDiff = 0;
if (mFramerate != 0)
{
@@ -590,7 +589,7 @@ void ImsMediaVideoSource::processOutputBuffer()
if (nextTime > nCurrTime)
{
- timeDiff = nextTime - nCurrTime;
+ uint32_t timeDiff = nextTime - nCurrTime;
IMLOGD_PACKET1(IM_PACKET_LOG_VIDEO, "[processOutputBuffer] timeDiff[%u]", timeDiff);
ImsMediaTimer::Sleep(timeDiff);
}