public static interface MediaCodecVideoTrackRenderer.EventListener extends MediaCodecTrackRenderer.EventListener
MediaCodecVideoTrackRenderer
events.Modifier and Type | Method and Description |
---|---|
void |
onDrawnToSurface(Surface surface)
Invoked when a frame is rendered to a surface for the first time following that surface
having been set as the target for the renderer.
|
void |
onDroppedFrames(int count,
long elapsed)
Invoked to report the number of frames dropped by the renderer.
|
void |
onVideoSizeChanged(int width,
int height,
int unappliedRotationDegrees,
float pixelWidthHeightRatio)
Invoked each time there's a change in the size of the video being rendered.
|
onCryptoError, onDecoderInitializationError, onDecoderInitialized
void onDroppedFrames(int count, long elapsed)
count
- The number of dropped frames.elapsed
- The duration in milliseconds over which the frames were dropped. This
duration is timed from when the renderer was started or from when dropped frames were
last reported (whichever was more recent), and not from when the first of the reported
drops occurred.void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio)
width
- The video width in pixels.height
- The video height in pixels.unappliedRotationDegrees
- For videos that require a rotation, this is the clockwise
rotation in degrees that the application should apply for the video for it to be rendered
in the correct orientation. This value will always be zero on API levels 21 and above,
since the renderer will apply all necessary rotations internally. On earlier API levels
this is not possible. Applications that use TextureView
can apply the rotation by
calling TextureView.setTransform(android.graphics.Matrix)
. Applications that do not expect to encounter
rotated videos can safely ignore this parameter.pixelWidthHeightRatio
- The width to height ratio of each pixel. For the normal case
of square pixels this will be equal to 1.0. Different values are indicative of anamorphic
content.void onDrawnToSurface(Surface surface)
surface
- The surface to which a first frame has been rendered.