mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Exclude Xiaomi and OPPO devices from detached surface mode
Ideally, we'd find a more targeted exclusion as it may depend on specific codecs. The current workaround should help with the reported issues that are limited to Xiaomi and OPPO. Issue: androidx/media#2059 #cherrypick PiperOrigin-RevId: 738017969 (cherry picked from commit 06c0f5549e366071ad98050e85ed0e8f1cd36fdf)
This commit is contained in:
parent
bd104b1cc4
commit
8212b964d1
@ -18,6 +18,9 @@ This release includes the following changes since
|
||||
* Fix issue where a player without a surface was ready immediately and
|
||||
very slow decoding any pending frames
|
||||
([#1973](https://github.com/androidx/media/issues/1973)).
|
||||
* Exclude Xiaomi and OPPO devices from detached surface mode to avoid
|
||||
screen flickering
|
||||
([#2059](https://github.com/androidx/media/issues/2059)).
|
||||
* Session:
|
||||
* Fix bug where a stale notification stays visible when the playlist is
|
||||
cleared ([#2211](https://github.com/androidx/media/issues/2211)).
|
||||
|
@ -710,7 +710,8 @@ public final class MediaCodecInfo {
|
||||
private static boolean isDetachedSurfaceSupported(@Nullable CodecCapabilities capabilities) {
|
||||
return Util.SDK_INT >= 35
|
||||
&& capabilities != null
|
||||
&& capabilities.isFeatureSupported(CodecCapabilities.FEATURE_DetachedSurface);
|
||||
&& capabilities.isFeatureSupported(CodecCapabilities.FEATURE_DetachedSurface)
|
||||
&& !needsDetachedSurfaceUnsupportedWorkaround();
|
||||
}
|
||||
|
||||
private static boolean areSizeAndRateSupported(
|
||||
@ -858,8 +859,8 @@ public final class MediaCodecInfo {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a profile is excluded from the list of supported profiles. This may happen when a
|
||||
* device declares support for a profile it doesn't actually support.
|
||||
* Returns whether a profile is excluded from the list of supported profiles. This may happen when
|
||||
* a device declares support for a profile it doesn't actually support.
|
||||
*/
|
||||
private static boolean needsProfileExcludedWorkaround(String mimeType, int profile) {
|
||||
// See https://github.com/google/ExoPlayer/issues/3537
|
||||
@ -867,4 +868,9 @@ public final class MediaCodecInfo {
|
||||
&& CodecProfileLevel.HEVCProfileMain10 == profile
|
||||
&& ("sailfish".equals(Build.DEVICE) || "marlin".equals(Build.DEVICE));
|
||||
}
|
||||
|
||||
/** Returns whether the device is known to have issues with the detached surface mode. */
|
||||
private static boolean needsDetachedSurfaceUnsupportedWorkaround() {
|
||||
return Build.MANUFACTURER.equals("Xiaomi") || Build.MANUFACTURER.equals("OPPO");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user