mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix reporting of width/height
1. maybeRenotifyVideoSizeChanged should report reported* variables 2. Add check into maybeNotifyVideoSizeChanged to suppress reporting in the case that the width and height are still unknown. Issue: #3007 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=160879625
This commit is contained in:
parent
37faead26e
commit
dda3616f5a
@ -700,9 +700,10 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void maybeNotifyVideoSizeChanged() {
|
private void maybeNotifyVideoSizeChanged() {
|
||||||
if (reportedWidth != currentWidth || reportedHeight != currentHeight
|
if ((currentWidth != Format.NO_VALUE || currentHeight != Format.NO_VALUE)
|
||||||
|
&& (reportedWidth != currentWidth || reportedHeight != currentHeight
|
||||||
|| reportedUnappliedRotationDegrees != currentUnappliedRotationDegrees
|
|| reportedUnappliedRotationDegrees != currentUnappliedRotationDegrees
|
||||||
|| reportedPixelWidthHeightRatio != currentPixelWidthHeightRatio) {
|
|| reportedPixelWidthHeightRatio != currentPixelWidthHeightRatio)) {
|
||||||
eventDispatcher.videoSizeChanged(currentWidth, currentHeight, currentUnappliedRotationDegrees,
|
eventDispatcher.videoSizeChanged(currentWidth, currentHeight, currentUnappliedRotationDegrees,
|
||||||
currentPixelWidthHeightRatio);
|
currentPixelWidthHeightRatio);
|
||||||
reportedWidth = currentWidth;
|
reportedWidth = currentWidth;
|
||||||
@ -714,8 +715,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
|
|
||||||
private void maybeRenotifyVideoSizeChanged() {
|
private void maybeRenotifyVideoSizeChanged() {
|
||||||
if (reportedWidth != Format.NO_VALUE || reportedHeight != Format.NO_VALUE) {
|
if (reportedWidth != Format.NO_VALUE || reportedHeight != Format.NO_VALUE) {
|
||||||
eventDispatcher.videoSizeChanged(currentWidth, currentHeight, currentUnappliedRotationDegrees,
|
eventDispatcher.videoSizeChanged(reportedWidth, reportedHeight,
|
||||||
currentPixelWidthHeightRatio);
|
reportedUnappliedRotationDegrees, reportedPixelWidthHeightRatio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user