Commit 94784249 by Oliver Woodman

Cleanup

parent b06a38b6
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
* Add uri field to `LoadEventInfo` in `MediaSourceEventListener` or * Add uri field to `LoadEventInfo` in `MediaSourceEventListener` or
`AnalyticsListener` callbacks. This uri is the redirected uri if redirection `AnalyticsListener` callbacks. This uri is the redirected uri if redirection
occurred ([#2054](https://github.com/google/ExoPlayer/issues/2054)). occurred ([#2054](https://github.com/google/ExoPlayer/issues/2054)).
* Improved compatibility with FireOS devices.
### 2.8.2 ### ### 2.8.2 ###
......
...@@ -829,7 +829,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -829,7 +829,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
&& !codecNeedsSetOutputSurfaceWorkaround(codecInfo.name) && !codecNeedsSetOutputSurfaceWorkaround(codecInfo.name)
&& (!codecInfo.secure || DummySurface.isSecureSupported(context)); && (!codecInfo.secure || DummySurface.isSecureSupported(context));
} }
private void setJoiningDeadlineMs() { private void setJoiningDeadlineMs() {
joiningDeadlineMs = allowedJoiningTimeMs > 0 joiningDeadlineMs = allowedJoiningTimeMs > 0
? (SystemClock.elapsedRealtime() + allowedJoiningTimeMs) : C.TIME_UNSET; ? (SystemClock.elapsedRealtime() + allowedJoiningTimeMs) : C.TIME_UNSET;
...@@ -1172,12 +1172,17 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1172,12 +1172,17 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
return Util.SDK_INT <= 22 && "foster".equals(Util.DEVICE) && "NVIDIA".equals(Util.MANUFACTURER); return Util.SDK_INT <= 22 && "foster".equals(Util.DEVICE) && "NVIDIA".equals(Util.MANUFACTURER);
} }
/**
* Returns whether the device is known to handle {@link DummySurface} incorrectly.
*
* <p>If true is returned then use of {@link DummySurface} is disabled.
*/
private static boolean codecNeedsDummySurfaceWorkaround(String name) { private static boolean codecNeedsDummySurfaceWorkaround(String name) {
// Work around https://github.com/google/ExoPlayer/issues/4419. // Work around https://github.com/google/ExoPlayer/issues/4419.
return (("needle".equals(Util.DEVICE)) // 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 device is known to implement {@link MediaCodec#setOutputSurface(Surface)}
* incorrectly. * incorrectly.
......
...@@ -36,7 +36,6 @@ import android.text.style.BackgroundColorSpan; ...@@ -36,7 +36,6 @@ import android.text.style.BackgroundColorSpan;
import android.text.style.RelativeSizeSpan; import android.text.style.RelativeSizeSpan;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
import com.google.android.exoplayer2.text.CaptionStyleCompat; import com.google.android.exoplayer2.text.CaptionStyleCompat;
import com.google.android.exoplayer2.text.Cue; import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
...@@ -257,8 +256,8 @@ import com.google.android.exoplayer2.util.Util; ...@@ -257,8 +256,8 @@ import com.google.android.exoplayer2.util.Util;
if (Color.alpha(backgroundColor) > 0) { if (Color.alpha(backgroundColor) > 0) {
SpannableStringBuilder newCueText = new SpannableStringBuilder(cueText); SpannableStringBuilder newCueText = new SpannableStringBuilder(cueText);
newCueText.setSpan(new BackgroundColorSpan(backgroundColor), 0, newCueText.length(), newCueText.setSpan(
Spanned.SPAN_PRIORITY); new BackgroundColorSpan(backgroundColor), 0, newCueText.length(), Spanned.SPAN_PRIORITY);
cueText = newCueText; cueText = newCueText;
} }
......
...@@ -206,8 +206,10 @@ public final class SubtitleView extends View implements TextOutput { ...@@ -206,8 +206,10 @@ public final class SubtitleView extends View implements TextOutput {
* {@link CaptioningManager#getUserStyle()}, or to a default style before API level 19. * {@link CaptioningManager#getUserStyle()}, or to a default style before API level 19.
*/ */
public void setUserDefaultStyle() { public void setUserDefaultStyle() {
setStyle(Util.SDK_INT >= 19 && isCaptionManagerEnabled() &&!isInEditMode() setStyle(
? getUserCaptionStyleV19() : CaptionStyleCompat.DEFAULT); Util.SDK_INT >= 19 && isCaptionManagerEnabled() && !isInEditMode()
? getUserCaptionStyleV19()
: CaptionStyleCompat.DEFAULT);
} }
/** /**
...@@ -318,7 +320,7 @@ public final class SubtitleView extends View implements TextOutput { ...@@ -318,7 +320,7 @@ public final class SubtitleView extends View implements TextOutput {
@TargetApi(19) @TargetApi(19)
private boolean isCaptionManagerEnabled() { private boolean isCaptionManagerEnabled() {
CaptioningManager captioningManager = CaptioningManager captioningManager =
(CaptioningManager) getContext().getSystemService(Context.CAPTIONING_SERVICE); (CaptioningManager) getContext().getSystemService(Context.CAPTIONING_SERVICE);
return captioningManager.isEnabled(); return captioningManager.isEnabled();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment