Read resolution for debug text view from VideoSize object to reflect changes from video effects

This commit is contained in:
Daniele Sparano 2024-01-17 17:50:23 +00:00 committed by Luyuan Chen
parent bcfad4b3b4
commit 0cdae9af20

View file

@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
import androidx.media3.common.ColorInfo;
import androidx.media3.common.Format;
import androidx.media3.common.Player;
import androidx.media3.common.VideoSize;
import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.exoplayer.DecoderCounters;
@ -127,6 +128,7 @@ public class DebugTextViewHelper {
@UnstableApi
protected String getVideoString() {
Format format = player.getVideoFormat();
VideoSize videoSize = player.getVideoSize();
DecoderCounters decoderCounters = player.getVideoDecoderCounters();
if (format == null || decoderCounters == null) {
return "";
@ -136,11 +138,11 @@ public class DebugTextViewHelper {
+ "(id:"
+ format.id
+ " r:"
+ format.width
+ videoSize.width
+ "x"
+ format.height
+ videoSize.height
+ getColorInfoString(format.colorInfo)
+ getPixelAspectRatioString(format.pixelWidthHeightRatio)
+ getPixelAspectRatioString(videoSize.pixelWidthHeightRatio)
+ getDecoderCountersBufferCountString(decoderCounters)
+ " vfpo: "
+ getVideoFrameProcessingOffsetAverageString(