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

Snap for 8677827 from 798c0e23 to udc-release

Change-Id: If6c2491130de4e90337fa382a21d80ab1d91b297
parents 40597744 798c0e23
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