Share via


Surface.SetFrameRate Method

Definition

Overloads

SetFrameRate(Single, Int32)

Sets the intended frame rate for this surface.

SetFrameRate(Single, Int32, Int32)

Sets the intended frame rate for this surface.

SetFrameRate(Single, Int32)

Sets the intended frame rate for this surface.

[Android.Runtime.Register("setFrameRate", "(FI)V", "GetSetFrameRate_FIHandler", ApiSince=30)]
public virtual void SetFrameRate (float frameRate, int compatibility);
[<Android.Runtime.Register("setFrameRate", "(FI)V", "GetSetFrameRate_FIHandler", ApiSince=30)>]
abstract member SetFrameRate : single * int -> unit
override this.SetFrameRate : single * int -> unit

Parameters

frameRate
Single
compatibility
Int32
Attributes

Remarks

Sets the intended frame rate for this surface. Any switching of refresh rates is most probably going to be seamless.

Java documentation for android.view.Surface.setFrameRate(float, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetFrameRate(Single, Int32, Int32)

Sets the intended frame rate for this surface.

[Android.Runtime.Register("setFrameRate", "(FII)V", "GetSetFrameRate_FIIHandler", ApiSince=31)]
public virtual void SetFrameRate (float frameRate, int compatibility, int changeFrameRateStrategy);
[<Android.Runtime.Register("setFrameRate", "(FII)V", "GetSetFrameRate_FIIHandler", ApiSince=31)>]
abstract member SetFrameRate : single * int * int -> unit
override this.SetFrameRate : single * int * int -> unit

Parameters

frameRate
Single

The intended frame rate of this surface, in frames per second. 0 is a special value that indicates the app will accept the system's choice for the display frame rate, which is the default behavior if this function isn't called. The frameRate parameter does <em>not</em> need to be a valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device that can only run the display at 60fps.

compatibility
Int32

The frame rate compatibility of this surface. The compatibility value may influence the system's choice of display frame rate. This parameter is ignored when frameRate is 0.

changeFrameRateStrategy
Int32

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. This parameter is ignored when frameRate is 0.

Attributes

Remarks

Sets the intended frame rate for this surface.

On devices that are capable of running the display at different refresh rates, the system may choose a display refresh rate to better match this surface's frame rate. Usage of this API won't introduce frame rate throttling, or affect other aspects of the application's frame production pipeline. However, because the system may change the display refresh rate, calls to this function may result in changes to Choreographer callback timings, and changes to the time interval at which the system releases buffers back to the application.

Note that this only has an effect for surfaces presented on the display. If this surface is consumed by something other than the system compositor, e.g. a media codec, this call has no effect.

Java documentation for android.view.Surface.setFrameRate(float, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to