mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix incorrect re-use of non-secure DummySurface with secure decoder
Issue: #8776 PiperOrigin-RevId: 376186877
This commit is contained in:
parent
2938d40bf4
commit
513185b72a
2 changed files with 14 additions and 2 deletions
|
|
@ -47,6 +47,12 @@
|
||||||
* Remove `CastPlayer` specific playlist manipulation methods. Use
|
* Remove `CastPlayer` specific playlist manipulation methods. Use
|
||||||
`setMediaItems`, `addMediaItems`, `removeMediaItem` and `moveMediaItem`
|
`setMediaItems`, `addMediaItems`, `removeMediaItem` and `moveMediaItem`
|
||||||
instead.
|
instead.
|
||||||
|
* Video:
|
||||||
|
* Fix bug that could cause `CodecException: Error 0xffffffff` to be thrown
|
||||||
|
from `MediaCodec.native_setSurface` in use cases that involve both
|
||||||
|
swapping the output `Surface` and a mixture of secure and non-secure
|
||||||
|
content being played
|
||||||
|
([#8776](https://github.com/google/ExoPlayer/issues/8776)).
|
||||||
* Ad playback:
|
* Ad playback:
|
||||||
* Support changing ad break positions in the player logic
|
* Support changing ad break positions in the player logic
|
||||||
([#5067](https://github.com/google/ExoPlayer/issues/5067).
|
([#5067](https://github.com/google/ExoPlayer/issues/5067).
|
||||||
|
|
@ -66,7 +72,6 @@
|
||||||
* Keep subtitle language features embedded (e.g. rubies & tate-chu-yoko)
|
* Keep subtitle language features embedded (e.g. rubies & tate-chu-yoko)
|
||||||
in `Cue.text` even when `SubtitleView#setApplyEmbeddedStyles()` is
|
in `Cue.text` even when `SubtitleView#setApplyEmbeddedStyles()` is
|
||||||
false.
|
false.
|
||||||
* UI
|
|
||||||
* Fix `NullPointerException` in `StyledPlayerView` that could occur after
|
* Fix `NullPointerException` in `StyledPlayerView` that could occur after
|
||||||
calling `StyledPlayerView.setPlayer(null)`
|
calling `StyledPlayerView.setPlayer(null)`
|
||||||
([#8985](https://github.com/google/ExoPlayer/issues/8985)).
|
([#8985](https://github.com/google/ExoPlayer/issues/8985)).
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
private boolean codecHandlesHdr10PlusOutOfBandMetadata;
|
private boolean codecHandlesHdr10PlusOutOfBandMetadata;
|
||||||
|
|
||||||
@Nullable private Surface surface;
|
@Nullable private Surface surface;
|
||||||
@Nullable private Surface dummySurface;
|
@Nullable private DummySurface dummySurface;
|
||||||
private boolean haveReportedFirstFrameRenderedForCurrentSurface;
|
private boolean haveReportedFirstFrameRenderedForCurrentSurface;
|
||||||
@C.VideoScalingMode private int scalingMode;
|
@C.VideoScalingMode private int scalingMode;
|
||||||
private boolean renderedFirstFrameAfterReset;
|
private boolean renderedFirstFrameAfterReset;
|
||||||
|
|
@ -486,6 +486,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(17) // Needed for dummySurface usage. dummySurface is always null on API level 16.
|
||||||
@Override
|
@Override
|
||||||
protected void onReset() {
|
protected void onReset() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -596,12 +597,18 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
return tunneling && Util.SDK_INT < 23;
|
return tunneling && Util.SDK_INT < 23;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(17) // Needed for dummySurface usage. dummySurface is always null on API level 16.
|
||||||
@Override
|
@Override
|
||||||
protected MediaCodecAdapter.Configuration getMediaCodecConfiguration(
|
protected MediaCodecAdapter.Configuration getMediaCodecConfiguration(
|
||||||
MediaCodecInfo codecInfo,
|
MediaCodecInfo codecInfo,
|
||||||
Format format,
|
Format format,
|
||||||
@Nullable MediaCrypto crypto,
|
@Nullable MediaCrypto crypto,
|
||||||
float codecOperatingRate) {
|
float codecOperatingRate) {
|
||||||
|
if (dummySurface != null && dummySurface.secure != codecInfo.secure) {
|
||||||
|
// We can't re-use the current DummySurface instance with the new decoder.
|
||||||
|
dummySurface.release();
|
||||||
|
dummySurface = null;
|
||||||
|
}
|
||||||
String codecMimeType = codecInfo.codecMimeType;
|
String codecMimeType = codecInfo.codecMimeType;
|
||||||
codecMaxValues = getCodecMaxValues(codecInfo, format, getStreamFormats());
|
codecMaxValues = getCodecMaxValues(codecInfo, format, getStreamFormats());
|
||||||
MediaFormat mediaFormat =
|
MediaFormat mediaFormat =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue