Condividi tramite


MediaCodec.ParameterKeyTunnelPeek Field

Definition

Control video peek of the first frame when a codec is configured for tunnel mode with MediaFormat#KEY_AUDIO_SESSION_ID while the AudioTrack is paused.

[Android.Runtime.Register("PARAMETER_KEY_TUNNEL_PEEK", ApiSince=31)]
public const string ParameterKeyTunnelPeek;
[<Android.Runtime.Register("PARAMETER_KEY_TUNNEL_PEEK", ApiSince=31)>]
val mutable ParameterKeyTunnelPeek : string

Field Value

Attributes

Remarks

Control video peek of the first frame when a codec is configured for tunnel mode with MediaFormat#KEY_AUDIO_SESSION_ID while the AudioTrack is paused.

When disabled (1) after a #flush or #start, (2) while the corresponding AudioTrack is paused and (3) before any buffers are queued, the first frame is not to be rendered until either this parameter is enabled or the corresponding AudioTrack has begun playback. Once the frame is decoded and ready to be rendered, OnFirstTunnelFrameReadyListener#onFirstTunnelFrameReady is called but the frame is not rendered. The surface continues to show the previously-rendered content, or black if the surface is new. A subsequent call to AudioTrack#play renders this frame and triggers a callback to OnFrameRenderedListener#onFrameRendered, and video playback begins.

<b>Note</b>: To clear any previously rendered content and show black, configure the MediaCodec with KEY_PUSH_BLANK_BUFFERS_ON_STOP(1), and call #stop before pushing new video frames to the codec.

When enabled (1) after a #flush or #start and (2) while the corresponding AudioTrack is paused, the first frame is rendered as soon as it is decoded, or immediately, if it has already been decoded. If not already decoded, when the frame is decoded and ready to be rendered, OnFirstTunnelFrameReadyListener#onFirstTunnelFrameReady is called. The frame is then immediately rendered and OnFrameRenderedListener#onFrameRendered is subsequently called.

The value is an Integer object containing the value 1 to enable or the value 0 to disable.

The default for this parameter is <b>enabled</b>. Once a frame has been rendered, changing this parameter has no effect until a subsequent #flush or #stop/#start.

Java documentation for android.media.MediaCodec.PARAMETER_KEY_TUNNEL_PEEK.

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