Merge "Add setFrameRate() api"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8c9f31b8b0
@@ -240,6 +240,7 @@ LIBANDROID {
|
||||
ASurfaceTransaction_setColor; # introduced=29
|
||||
ASurfaceTransaction_setDamageRegion; # introduced=29
|
||||
ASurfaceTransaction_setDesiredPresentTime; # introduced=29
|
||||
ASurfaceTransaction_setFrameRate; # introduced=30
|
||||
ASurfaceTransaction_setGeometry; # introduced=29
|
||||
ASurfaceTransaction_setHdrMetadata_cta861_3; # introduced=29
|
||||
ASurfaceTransaction_setHdrMetadata_smpte2086; # introduced=29
|
||||
|
||||
@@ -545,3 +545,18 @@ void ASurfaceTransaction_setColor(ASurfaceTransaction* aSurfaceTransaction,
|
||||
|
||||
transaction->setBackgroundColor(surfaceControl, color, alpha, static_cast<ui::Dataspace>(dataspace));
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, float frameRate) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
if (frameRate < 0) {
|
||||
ALOGE("Failed to set frame ate - invalid frame rate");
|
||||
return;
|
||||
}
|
||||
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
transaction->setFrameRate(surfaceControl, frameRate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user