CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 t0.java 源代码,内容仅作参考
package i.j.a.b;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.TextureView;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.source.TrackGroupArray;
import i.j.a.b.m0;
import i.j.a.b.q;
import i.j.a.b.r;
import i.j.a.b.s;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CopyOnWriteArraySet;
public class t0 extends s implements m0, m0.c, m0.b {
public List<i.j.a.b.h1.b> A;
public i.j.a.b.m1.n B;
public i.j.a.b.m1.s.a C;
public boolean D;
public boolean E;
public final p0[] b;
public final a0 c;
public final Handler f11856d;
public final b f11857e;
public final CopyOnWriteArraySet<i.j.a.b.m1.q> f11858f;
public final CopyOnWriteArraySet<i.j.a.b.y0.k> f11859g;
public final CopyOnWriteArraySet<i.j.a.b.h1.j> f11860h;
public final CopyOnWriteArraySet<i.j.a.b.d1.e> f11861i;
public final CopyOnWriteArraySet<i.j.a.b.m1.r> f11862j;
public final CopyOnWriteArraySet<i.j.a.b.y0.l> f11863k;
public final i.j.a.b.k1.e f11864l;
public final i.j.a.b.x0.a f11865m;
public final q f11866n;
public final r f11867o;
public final v0 f11868p;
public final w0 f11869q;
public Surface f11870r;
public boolean f11871s;
public SurfaceHolder f11872t;
public TextureView f11873u;
public int f11874v;
public int f11875w;
public int x;
public float y;
public i.j.a.b.g1.s z;
public final class b implements i.j.a.b.m1.r, i.j.a.b.y0.l, i.j.a.b.h1.j, i.j.a.b.d1.e, SurfaceHolder.Callback, TextureView.SurfaceTextureListener, r.b, q.b, m0.a {
public b(a aVar) {
}
@Override
public void A(i.j.a.b.z0.d dVar) {
Objects.requireNonNull(t0.this);
Iterator<i.j.a.b.m1.r> it = t0.this.f11862j.iterator();
while (it.hasNext()) {
it.next().A(dVar);
}
}
@Override
public void C(Format format) {
Objects.requireNonNull(t0.this);
Iterator<i.j.a.b.y0.l> it = t0.this.f11863k.iterator();
while (it.hasNext()) {
it.next().C(format);
}
}
@Override
public void E(int i2, long j2, long j3) {
Iterator<i.j.a.b.y0.l> it = t0.this.f11863k.iterator();
while (it.hasNext()) {
it.next().E(i2, j2, j3);
}
}
@Override
public void F(TrackGroupArray trackGroupArray, i.j.a.b.i1.g gVar) {
l0.l(this, trackGroupArray, gVar);
}
@Override
public void G(i.j.a.b.z0.d dVar) {
Iterator<i.j.a.b.m1.r> it = t0.this.f11862j.iterator();
while (it.hasNext()) {
it.next().G(dVar);
}
Objects.requireNonNull(t0.this);
Objects.requireNonNull(t0.this);
}
@Override
public void I(j0 j0Var) {
l0.c(this, j0Var);
}
@Override
public void K(boolean z) {
l0.a(this, z);
}
@Override
public void a(int i2) {
t0 t0Var = t0.this;
if (t0Var.x == i2) {
return;
}
t0Var.x = i2;
Iterator<i.j.a.b.y0.k> it = t0Var.f11859g.iterator();
while (it.hasNext()) {
i.j.a.b.y0.k next = it.next();
if (!t0.this.f11863k.contains(next)) {
next.a(i2);
}
}
Iterator<i.j.a.b.y0.l> it2 = t0.this.f11863k.iterator();
while (it2.hasNext()) {
it2.next().a(i2);
}
}
@Override
public void b() {
l0.h(this);
}
@Override
public void c(int i2, int i3, int i4, float f2) {
Iterator<i.j.a.b.m1.q> it = t0.this.f11858f.iterator();
while (it.hasNext()) {
i.j.a.b.m1.q next = it.next();
if (!t0.this.f11862j.contains(next)) {
next.c(i2, i3, i4, f2);
}
}
Iterator<i.j.a.b.m1.r> it2 = t0.this.f11862j.iterator();
while (it2.hasNext()) {
it2.next().c(i2, i3, i4, f2);
}
}
@Override
public void e(int i2) {
l0.d(this, i2);
}
@Override
public void f(boolean z) {
Objects.requireNonNull(t0.this);
}
@Override
public void g(int i2) {
l0.f(this, i2);
}
@Override
public void h(i.j.a.b.z0.d dVar) {
Iterator<i.j.a.b.y0.l> it = t0.this.f11863k.iterator();
while (it.hasNext()) {
it.next().h(dVar);
}
Objects.requireNonNull(t0.this);
Objects.requireNonNull(t0.this);
t0.this.x = 0;
}
@Override
public void i(i.j.a.b.z0.d dVar) {
Objects.requireNonNull(t0.this);
Iterator<i.j.a.b.y0.l> it = t0.this.f11863k.iterator();
while (it.hasNext()) {
it.next().i(dVar);
}
}
@Override
public void j(String str, long j2, long j3) {
Iterator<i.j.a.b.m1.r> it = t0.this.f11862j.iterator();
while (it.hasNext()) {
it.next().j(str, j2, j3);
}
}
@Override
public void k(ExoPlaybackException exoPlaybackException) {
l0.e(this, exoPlaybackException);
}
@Override
public void l(List<i.j.a.b.h1.b> list) {
t0 t0Var = t0.this;
t0Var.A = list;
Iterator<i.j.a.b.h1.j> it = t0Var.f11860h.iterator();
while (it.hasNext()) {
it.next().l(list);
}
}
@Override
public void m(u0 u0Var, int i2) {
l0.j(this, u0Var, i2);
}
@Override
public void onRepeatModeChanged(int i2) {
l0.g(this, i2);
}
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i2, int i3) {
t0.this.M(new Surface(surfaceTexture), true);
t0.this.c(i2, i3);
}
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
t0.this.M(null, true);
t0.this.c(0, 0);
return true;
}
@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i2, int i3) {
t0.this.c(i2, i3);
}
@Override
public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
}
@Override
public void q(Surface surface) {
t0 t0Var = t0.this;
if (t0Var.f11870r == surface) {
Iterator<i.j.a.b.m1.q> it = t0Var.f11858f.iterator();
while (it.hasNext()) {
it.next().d();
}
}
Iterator<i.j.a.b.m1.r> it2 = t0.this.f11862j.iterator();
while (it2.hasNext()) {
it2.next().q(surface);
}
}
@Override
public void r(String str, long j2, long j3) {
Iterator<i.j.a.b.y0.l> it = t0.this.f11863k.iterator();
while (it.hasNext()) {
it.next().r(str, j2, j3);
}
}
@Override
public void s(boolean z) {
l0.i(this, z);
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i2, int i3, int i4) {
t0.this.c(i3, i4);
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
t0.this.M(surfaceHolder.getSurface(), false);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
t0.this.M(null, false);
t0.this.c(0, 0);
}
@Override
public void t(Metadata metadata) {
Iterator<i.j.a.b.d1.e> it = t0.this.f11861i.iterator();
while (it.hasNext()) {
it.next().t(metadata);
}
}
@Override
public void u(int i2, long j2) {
Iterator<i.j.a.b.m1.r> it = t0.this.f11862j.iterator();
while (it.hasNext()) {
it.next().u(i2, j2);
}
}
@Override
public void v(boolean z, int i2) {
t0 t0Var = t0.this;
int playbackState = t0Var.getPlaybackState();
if (playbackState != 1) {
if (playbackState == 2 || playbackState == 3) {
t0Var.f11868p.a = t0Var.h();
t0Var.f11869q.a = t0Var.h();
return;
} else if (playbackState != 4) {
throw new IllegalStateException();
}
}
t0Var.f11868p.a = false;
t0Var.f11869q.a = false;
}
@Override
public void y(u0 u0Var, Object obj, int i2) {
l0.k(this, u0Var, obj, i2);
}
@Override
public void z(Format format) {
Objects.requireNonNull(t0.this);
Iterator<i.j.a.b.m1.r> it = t0.this.f11862j.iterator();
while (it.hasNext()) {
it.next().z(format);
}
}
}
@Deprecated
public t0(Context context, r0 r0Var, i.j.a.b.i1.h hVar, e0 e0Var, i.j.a.b.a1.c<i.j.a.b.a1.f> cVar, i.j.a.b.k1.e eVar, i.j.a.b.x0.a aVar, i.j.a.b.l1.e eVar2, Looper looper) {
this.f11864l = eVar;
this.f11865m = aVar;
b bVar = new b(null);
this.f11857e = bVar;
CopyOnWriteArraySet<i.j.a.b.m1.q> copyOnWriteArraySet = new CopyOnWriteArraySet<>();
this.f11858f = copyOnWriteArraySet;
CopyOnWriteArraySet<i.j.a.b.y0.k> copyOnWriteArraySet2 = new CopyOnWriteArraySet<>();
this.f11859g = copyOnWriteArraySet2;
this.f11860h = new CopyOnWriteArraySet<>();
CopyOnWriteArraySet<i.j.a.b.d1.e> copyOnWriteArraySet3 = new CopyOnWriteArraySet<>();
this.f11861i = copyOnWriteArraySet3;
CopyOnWriteArraySet<i.j.a.b.m1.r> copyOnWriteArraySet4 = new CopyOnWriteArraySet<>();
this.f11862j = copyOnWriteArraySet4;
CopyOnWriteArraySet<i.j.a.b.y0.l> copyOnWriteArraySet5 = new CopyOnWriteArraySet<>();
this.f11863k = copyOnWriteArraySet5;
Handler handler = new Handler(looper);
this.f11856d = handler;
p0[] a2 = r0Var.a(handler, bVar, bVar, bVar, bVar, cVar);
this.b = a2;
this.y = 1.0f;
this.x = 0;
this.A = Collections.emptyList();
a0 a0Var = new a0(a2, hVar, e0Var, eVar, eVar2, looper);
this.c = a0Var;
i.c.a.c.y.j(aVar.f11906m == null || aVar.f11905l.a.isEmpty());
aVar.f11906m = a0Var;
a0Var.f10620h.addIfAbsent(new s.a(aVar));
a0Var.f10620h.addIfAbsent(new s.a(bVar));
copyOnWriteArraySet4.add(aVar);
copyOnWriteArraySet.add(aVar);
copyOnWriteArraySet5.add(aVar);
copyOnWriteArraySet2.add(aVar);
copyOnWriteArraySet3.add(aVar);
eVar.f(handler, aVar);
if (!(cVar instanceof DefaultDrmSessionManager)) {
this.f11866n = new q(context, handler, bVar);
this.f11867o = new r(context, handler, bVar);
this.f11868p = new v0(context);
this.f11869q = new w0(context);
return;
}
Objects.requireNonNull((DefaultDrmSessionManager) cVar);
throw null;
}
@Override
public Looper A() {
return this.c.A();
}
@Override
public boolean B() {
P();
return this.c.f10626n;
}
@Override
public long C() {
P();
return this.c.C();
}
@Override
public i.j.a.b.i1.g D() {
P();
return this.c.f10632t.f11579i.c;
}
@Override
public int E(int i2) {
P();
return this.c.c[i2].t();
}
@Override
public long F() {
P();
return this.c.F();
}
@Override
public m0.b G() {
return this;
}
public final void H() {
TextureView textureView = this.f11873u;
if (textureView != null) {
if (textureView.getSurfaceTextureListener() != this.f11857e) {
Log.w("SimpleExoPlayer", "SurfaceTextureListener already unset or replaced.");
} else {
this.f11873u.setSurfaceTextureListener(null);
}
this.f11873u = null;
}
SurfaceHolder surfaceHolder = this.f11872t;
if (surfaceHolder != null) {
surfaceHolder.removeCallback(this.f11857e);
this.f11872t = null;
}
}
public final void I() {
p0[] p0VarArr;
float f2 = this.y * this.f11867o.f11843e;
for (p0 p0Var : this.b) {
if (p0Var.t() == 1) {
n0 a2 = this.c.a(p0Var);
a2.e(2);
a2.d(Float.valueOf(f2));
a2.c();
}
}
}
public final void J(i.j.a.b.m1.l lVar) {
p0[] p0VarArr;
for (p0 p0Var : this.b) {
if (p0Var.t() == 2) {
n0 a2 = this.c.a(p0Var);
a2.e(8);
i.c.a.c.y.j(!a2.f11834h);
a2.f11831e = lVar;
a2.c();
}
}
}
public void K(Surface surface) {
P();
H();
if (surface != null) {
a();
}
M(surface, false);
int i2 = surface != null ? -1 : 0;
c(i2, i2);
}
public void L(SurfaceHolder surfaceHolder) {
P();
H();
if (surfaceHolder != null) {
a();
}
this.f11872t = surfaceHolder;
if (surfaceHolder == null) {
M(null, false);
c(0, 0);
return;
}
surfaceHolder.addCallback(this.f11857e);
Surface surface = surfaceHolder.getSurface();
if (surface != null && surface.isValid()) {
M(surface, false);
Rect surfaceFrame = surfaceHolder.getSurfaceFrame();
c(surfaceFrame.width(), surfaceFrame.height());
return;
}
M(null, false);
c(0, 0);
}
public final void M(Surface surface, boolean z) {
p0[] p0VarArr;
ArrayList arrayList = new ArrayList();
for (p0 p0Var : this.b) {
if (p0Var.t() == 2) {
n0 a2 = this.c.a(p0Var);
a2.e(1);
i.c.a.c.y.j(true ^ a2.f11834h);
a2.f11831e = surface;
a2.c();
arrayList.add(a2);
}
}
Surface surface2 = this.f11870r;
if (surface2 != null && surface2 != surface) {
try {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
n0 n0Var = (n0) it.next();
synchronized (n0Var) {
i.c.a.c.y.j(n0Var.f11834h);
i.c.a.c.y.j(n0Var.f11832f.getLooper().getThread() != Thread.currentThread());
while (!n0Var.f11836j) {
n0Var.wait();
}
}
}
} catch (InterruptedException unused) {
Thread.currentThread().interrupt();
}
if (this.f11871s) {
this.f11870r.release();
}
}
this.f11870r = surface;
this.f11871s = z;
}
public void N(TextureView textureView) {
P();
H();
if (textureView != null) {
a();
}
this.f11873u = textureView;
if (textureView == null) {
M(null, true);
c(0, 0);
return;
}
if (textureView.getSurfaceTextureListener() != null) {
Log.w("SimpleExoPlayer", "Replacing existing SurfaceTextureListener.");
}
textureView.setSurfaceTextureListener(this.f11857e);
SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture() : null;
if (surfaceTexture == null) {
M(null, true);
c(0, 0);
return;
}
M(new Surface(surfaceTexture), true);
c(textureView.getWidth(), textureView.getHeight());
}
public final void O(boolean z, int i2) {
int i3 = 0;
boolean z2 = z && i2 != -1;
if (z2 && i2 != 1) {
i3 = 1;
}
this.c.K(z2, i3);
}
public final void P() {
if (Looper.myLooper() != A()) {
i.j.a.b.l1.l.c("SimpleExoPlayer", "Player is accessed on the wrong thread. See https://exoplayer.dev/issues/player-accessed-on-wrong-thread", this.D ? null : new IllegalStateException());
this.D = true;
}
}
public void a() {
P();
J(null);
}
public void b(Surface surface) {
P();
if (surface == null || surface != this.f11870r) {
return;
}
P();
H();
M(null, false);
c(0, 0);
}
public final void c(int i2, int i3) {
if (i2 == this.f11874v && i3 == this.f11875w) {
return;
}
this.f11874v = i2;
this.f11875w = i3;
Iterator<i.j.a.b.m1.q> it = this.f11858f.iterator();
while (it.hasNext()) {
it.next().H(i2, i3);
}
}
@Override
public j0 d() {
P();
return this.c.f10631s;
}
@Override
public boolean e() {
P();
return this.c.e();
}
@Override
public long f() {
P();
return u.b(this.c.f10632t.f11582l);
}
@Override
public void g(int i2, long j2) {
P();
i.j.a.b.x0.a aVar = this.f11865m;
if (!aVar.f11905l.f11911h) {
aVar.P();
aVar.f11905l.f11911h = true;
Iterator<i.j.a.b.x0.b> it = aVar.f11902i.iterator();
while (it.hasNext()) {
it.next().E();
}
}
this.c.g(i2, j2);
}
@Override
public int getPlaybackState() {
P();
return this.c.f10632t.f11575e;
}
@Override
public int getRepeatMode() {
P();
return this.c.f10625m;
}
@Override
public boolean h() {
P();
return this.c.f10623k;
}
@Override
public void i(boolean z) {
P();
this.c.i(z);
}
@Override
public ExoPlaybackException j() {
P();
return this.c.f10632t.f11576f;
}
@Override
public void l(m0.a aVar) {
P();
this.c.f10620h.addIfAbsent(new s.a(aVar));
}
@Override
public int m() {
P();
a0 a0Var = this.c;
if (a0Var.e()) {
return a0Var.f10632t.b.c;
}
return -1;
}
@Override
public void n(m0.a aVar) {
P();
this.c.n(aVar);
}
@Override
public int o() {
P();
return this.c.o();
}
@Override
public void p(boolean z) {
P();
r rVar = this.f11867o;
getPlaybackState();
rVar.a();
O(z, z ? 1 : -1);
}
@Override
public m0.c q() {
return this;
}
@Override
public long r() {
P();
return this.c.r();
}
@Override
public void setRepeatMode(int i2) {
P();
this.c.setRepeatMode(i2);
}
@Override
public int u() {
P();
a0 a0Var = this.c;
if (a0Var.e()) {
return a0Var.f10632t.b.b;
}
return -1;
}
@Override
public int w() {
P();
return this.c.f10624l;
}
@Override
public TrackGroupArray x() {
P();
return this.c.f10632t.f11578h;
}
@Override
public long y() {
P();
return this.c.y();
}
@Override
public u0 z() {
P();
return this.c.f10632t.a;
}
}