107 lines
2.9 KiB
Java
107 lines
2.9 KiB
Java
package c.i.a.c.j2.x;
|
|
|
|
import androidx.annotation.Nullable;
|
|
import c.i.a.c.g0;
|
|
import c.i.a.c.i2.f0;
|
|
import c.i.a.c.i2.w;
|
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
import com.google.android.exoplayer2.Format;
|
|
import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
|
|
import java.nio.ByteBuffer;
|
|
/* compiled from: CameraMotionRenderer */
|
|
public final class b extends g0 {
|
|
public final DecoderInputBuffer t = new DecoderInputBuffer(1);
|
|
public final w u = new w();
|
|
public long v;
|
|
@Nullable
|
|
public a w;
|
|
|
|
/* renamed from: x reason: collision with root package name */
|
|
public long f925x;
|
|
|
|
public b() {
|
|
super(6);
|
|
}
|
|
|
|
@Override // c.i.a.c.g0
|
|
public void B() {
|
|
a aVar = this.w;
|
|
if (aVar != null) {
|
|
aVar.b();
|
|
}
|
|
}
|
|
|
|
@Override // c.i.a.c.g0
|
|
public void D(long j, boolean z2) {
|
|
this.f925x = Long.MIN_VALUE;
|
|
a aVar = this.w;
|
|
if (aVar != null) {
|
|
aVar.b();
|
|
}
|
|
}
|
|
|
|
@Override // c.i.a.c.g0
|
|
public void H(Format[] formatArr, long j, long j2) {
|
|
this.v = j2;
|
|
}
|
|
|
|
@Override // c.i.a.c.l1
|
|
public int a(Format format) {
|
|
return "application/x-camera-motion".equals(format.t) ? 4 : 0;
|
|
}
|
|
|
|
@Override // c.i.a.c.k1
|
|
public boolean b() {
|
|
return i();
|
|
}
|
|
|
|
@Override // c.i.a.c.k1
|
|
public boolean d() {
|
|
return true;
|
|
}
|
|
|
|
@Override // c.i.a.c.k1, c.i.a.c.l1
|
|
public String getName() {
|
|
return "CameraMotionRenderer";
|
|
}
|
|
|
|
@Override // c.i.a.c.k1
|
|
public void q(long j, long j2) {
|
|
float[] fArr;
|
|
while (!i() && this.f925x < 100000 + j) {
|
|
this.t.p();
|
|
if (I(A(), this.t, false) == -4 && !this.t.n()) {
|
|
DecoderInputBuffer decoderInputBuffer = this.t;
|
|
this.f925x = decoderInputBuffer.m;
|
|
if (this.w != null && !decoderInputBuffer.m()) {
|
|
this.t.s();
|
|
ByteBuffer byteBuffer = this.t.k;
|
|
int i = f0.a;
|
|
if (byteBuffer.remaining() != 16) {
|
|
fArr = null;
|
|
} else {
|
|
this.u.B(byteBuffer.array(), byteBuffer.limit());
|
|
this.u.D(byteBuffer.arrayOffset() + 4);
|
|
float[] fArr2 = new float[3];
|
|
for (int i2 = 0; i2 < 3; i2++) {
|
|
fArr2[i2] = Float.intBitsToFloat(this.u.h());
|
|
}
|
|
fArr = fArr2;
|
|
}
|
|
if (fArr != null) {
|
|
this.w.a(this.f925x - this.v, fArr);
|
|
}
|
|
}
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // c.i.a.c.g0, c.i.a.c.h1.b
|
|
public void r(int i, @Nullable Object obj) throws ExoPlaybackException {
|
|
if (i == 7) {
|
|
this.w = (a) obj;
|
|
}
|
|
}
|
|
}
|