Surface.FrameRateParams.Builder
public
static
final
class
Surface.FrameRateParams.Builder
extends Object
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
Builder
public Builder ()
Public methods
setChangeFrameRateStrategy
public Surface.FrameRateParams.Builder setChangeFrameRateStrategy (int changeFrameRateStrategy)
Whether display refresh rate transitions caused by this surface should be seamless. A
seamless transition is one that doesn't have any visual interruptions, such as a
black screen for a second or two. Value is
Surface.CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS, or Surface.CHANGE_FRAME_RATE_ALWAYS
setDesiredRateRange
public Surface.FrameRateParams.Builder setDesiredRateRange (float desiredMinRate,
float desiredMaxRate)
Sets the desired frame rate range (inclusive) values for the surface, specifying that
the surface prefers the device render rate to be in the range [desiredMinRate,
desiredMaxRate].
Set desiredMaxRate to FLOAT.MAX_VALUE to indicate the surface prefers any value
greater than or equal to desiredMinRate.
Set desiredMinRate = desiredMaxRate to indicate the surface prefers an exact frame
rate. Note that this is different than specifying the fixed source frame rate with
setFixedSourceRate(float)
. To reiterate, this call is used
to specify the surface's frame rate preference to be within the desired range.
desiredMaxRate must be greater than or equal to desiredMinRate.
The values should be greater than or equal to 0.
If the surface has no preference and any frame rate is acceptable, use the constant
ERROR(/FrameRateParams.IGNORE)
in Surface.setFrameRate(android.view.Surface.FrameRateParams)
instead of
building FrameRateParams.Builder
.
Parameters |
desiredMinRate |
float : Value is 0.0 or greater |
desiredMaxRate |
float : Value is 0.0 or greater |
setFixedSourceRate
public Surface.FrameRateParams.Builder setFixedSourceRate (float fixedSourceRate)
Sets the fixed frame rate of the surface when its content has a fixed frame rate,
e.g. a video with a fixed frame rate.
When the frame rate chosen for the surface is the fixedSourceRate
or a
multiple, the surface can render without frame pulldown, for optimal smoothness. For
example, a 30 fps video (fixedSourceRate=30
) renders just as well on 30 fps,
60 fps, 90 fps, 120 fps, and so on.
This method to set the fixed source rate can also be used together with a desired
frame rate range via setDesiredRateRange(float, float)
. This still
means the surface's content has a fixed frame rate of the provided fixedSourceRate
, as well as it preferring to be within the desired frame rate range.
For example, a 30 fps video fixedSourceRate=30
and desired frame rate range
[60,90] means the surface ideally prefers 60 fps (which is 30 fps * 2) or 90 fps (30
fps * 3).
Parameters |
fixedSourceRate |
float : Value is 0.0 or greater |