Skip to content
Snippets Groups Projects
Commit 72cc47a7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8676880 from 45d7895a to tm-d1-release

Change-Id: I55b3cb470ed680be4f2c596ef0262095cb4b8b1b
parents 75a35169 45d7895a
No related branches found
No related tags found
No related merge requests found
...@@ -756,8 +756,8 @@ bool V4L2EncodeComponent::encode(C2ConstGraphicBlock block, uint64_t index, int6 ...@@ -756,8 +756,8 @@ bool V4L2EncodeComponent::encode(C2ConstGraphicBlock block, uint64_t index, int6
// Dynamically adjust framerate based on the frame's timestamp if required. // Dynamically adjust framerate based on the frame's timestamp if required.
constexpr int64_t kMaxFramerateDiff = 5; constexpr int64_t kMaxFramerateDiff = 5;
if (mLastFrameTime && (timestamp > *mLastFrameTime)) { if (mLastFrameTime && (timestamp > *mLastFrameTime)) {
int64_t newFramerate = int64_t newFramerate = std::max(
static_cast<int64_t>(std::round(1000000.0 / (timestamp - *mLastFrameTime))); static_cast<int64_t>(std::round(1000000.0 / (timestamp - *mLastFrameTime))), 1LL);
if (abs(mFramerate - newFramerate) > kMaxFramerateDiff) { if (abs(mFramerate - newFramerate) > kMaxFramerateDiff) {
ALOGV("Adjusting framerate to %" PRId64 " based on frame timestamps", newFramerate); ALOGV("Adjusting framerate to %" PRId64 " based on frame timestamps", newFramerate);
mInterface->setFramerate(static_cast<uint32_t>(newFramerate)); mInterface->setFramerate(static_cast<uint32_t>(newFramerate));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment