mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Allow overriding of setOutputSurface workarounds
Since this is an ongoing problem, it's reasonable that we allow developers to toggle these workarounds without too much hassle. Issue: #4468 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=203364488
This commit is contained in:
parent
264bed06f2
commit
0ed8e86ba4
1 changed files with 18 additions and 6 deletions
|
|
@ -1180,23 +1180,35 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the device is known to handle {@link DummySurface} incorrectly.
|
* Returns whether the codec is known to handle {@link DummySurface} incorrectly.
|
||||||
*
|
*
|
||||||
* <p>If true is returned then use of {@link DummySurface} is disabled.
|
* <p>If true is returned then use of {@link DummySurface} is disabled.
|
||||||
|
*
|
||||||
|
* @param name The name of the codec.
|
||||||
|
* @return True if the device is known to handle {@link DummySurface} incorrectly.
|
||||||
*/
|
*/
|
||||||
private static boolean codecNeedsDummySurfaceWorkaround(String name) {
|
protected boolean codecNeedsDummySurfaceWorkaround(String name) {
|
||||||
// Work around https://github.com/google/ExoPlayer/issues/4419.
|
// Work around https://github.com/google/ExoPlayer/issues/4419.
|
||||||
return ("Amazon".equals(Util.MANUFACTURER) && "AFTN".equals(Util.MODEL)) // FireTV 4K
|
return ("Amazon".equals(Util.MANUFACTURER) && "AFTN".equals(Util.MODEL)) // FireTV 4K
|
||||||
&& "OMX.amlogic.avc.decoder.awesome".equals(name);
|
&& "OMX.amlogic.avc.decoder.awesome".equals(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the device is known to implement {@link MediaCodec#setOutputSurface(Surface)}
|
* Returns whether the codec is known to implement {@link MediaCodec#setOutputSurface(Surface)}
|
||||||
|
* incorrectly.
|
||||||
|
*
|
||||||
|
* <p>If true is returned then we fall back to releasing and re-instantiating the codec instead.
|
||||||
|
*
|
||||||
|
* <p>Note: This workaround should only be used if {@link MediaCodec#setOutputSurface(Surface)}
|
||||||
|
* doesn't work when transitioning between two real surfaces. If an issue only occurs when
|
||||||
|
* transitioning to or from {@link DummySurface}, then {@link
|
||||||
|
* #codecNeedsDummySurfaceWorkaround(String)} should be used instead.
|
||||||
|
*
|
||||||
|
* @param name The name of the codec.
|
||||||
|
* @return True if the device is known to implement {@link MediaCodec#setOutputSurface(Surface)}
|
||||||
* incorrectly.
|
* incorrectly.
|
||||||
* <p>
|
|
||||||
* If true is returned then we fall back to releasing and re-instantiating the codec instead.
|
|
||||||
*/
|
*/
|
||||||
private static boolean codecNeedsSetOutputSurfaceWorkaround(String name) {
|
protected boolean codecNeedsSetOutputSurfaceWorkaround(String name) {
|
||||||
// Work around https://github.com/google/ExoPlayer/issues/3236,
|
// Work around https://github.com/google/ExoPlayer/issues/3236,
|
||||||
// https://github.com/google/ExoPlayer/issues/3355,
|
// https://github.com/google/ExoPlayer/issues/3355,
|
||||||
// https://github.com/google/ExoPlayer/issues/3439,
|
// https://github.com/google/ExoPlayer/issues/3439,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue