Initial commit
This commit is contained in:
1087
sources/com/ubt/jimu/widgets/player/widget/BDCloudVideoView.java
Normal file
1087
sources/com/ubt/jimu/widgets/player/widget/BDCloudVideoView.java
Normal file
File diff suppressed because it is too large
Load Diff
43
sources/com/ubt/jimu/widgets/player/widget/IRenderView.java
Normal file
43
sources/com/ubt/jimu/widgets/player/widget/IRenderView.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.ubt.jimu.widgets.player.widget;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface IRenderView {
|
||||
|
||||
public interface IRenderCallback {
|
||||
void a(ISurfaceHolder iSurfaceHolder);
|
||||
|
||||
void a(ISurfaceHolder iSurfaceHolder, int i, int i2);
|
||||
|
||||
void a(ISurfaceHolder iSurfaceHolder, int i, int i2, int i3);
|
||||
}
|
||||
|
||||
public interface ISurfaceHolder {
|
||||
IRenderView a();
|
||||
|
||||
void a(IMediaPlayer iMediaPlayer);
|
||||
}
|
||||
|
||||
void a(int i, int i2);
|
||||
|
||||
void a(IRenderCallback iRenderCallback);
|
||||
|
||||
boolean a();
|
||||
|
||||
void b(int i, int i2);
|
||||
|
||||
void b(IRenderCallback iRenderCallback);
|
||||
|
||||
Bitmap getBitmap();
|
||||
|
||||
View getView();
|
||||
|
||||
void release();
|
||||
|
||||
void setAspectRatio(int i);
|
||||
|
||||
void setVideoRotation(int i);
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package com.ubt.jimu.widgets.player.widget;
|
||||
|
||||
import android.view.View;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class MeasureHelper {
|
||||
private int a;
|
||||
private int b;
|
||||
private int c;
|
||||
private int d;
|
||||
private int e;
|
||||
private int f;
|
||||
private int g;
|
||||
private int h = 0;
|
||||
|
||||
public MeasureHelper(View view) {
|
||||
new WeakReference(view);
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x00ab, code lost:
|
||||
|
||||
if (r4 != false) goto L52;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x00b0, code lost:
|
||||
|
||||
r12 = (int) (r0 / r1);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x00b4, code lost:
|
||||
|
||||
r11 = (int) (r3 * r1);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:35:0x00ae, code lost:
|
||||
|
||||
if (r4 != false) goto L51;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:64:0x00f4, code lost:
|
||||
|
||||
if (r1 > r11) goto L83;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public void a(int r11, int r12) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 288
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.widgets.player.widget.MeasureHelper.a(int, int):void");
|
||||
}
|
||||
|
||||
public void b(int i, int i2) {
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
}
|
||||
|
||||
public void c(int i, int i2) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
this.e = i;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.h = i;
|
||||
}
|
||||
}
|
@@ -0,0 +1,217 @@
|
||||
package com.ubt.jimu.widgets.player.widget;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
import com.ubt.jimu.widgets.player.widget.IRenderView;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class SurfaceRenderView extends SurfaceView implements IRenderView {
|
||||
private MeasureHelper a;
|
||||
private SurfaceCallback b;
|
||||
|
||||
private static final class InternalSurfaceHolder implements IRenderView.ISurfaceHolder {
|
||||
private SurfaceRenderView a;
|
||||
private SurfaceHolder b;
|
||||
|
||||
public InternalSurfaceHolder(SurfaceRenderView surfaceRenderView, SurfaceHolder surfaceHolder) {
|
||||
this.a = surfaceRenderView;
|
||||
this.b = surfaceHolder;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView.ISurfaceHolder
|
||||
public void a(IMediaPlayer iMediaPlayer) {
|
||||
if (iMediaPlayer != null) {
|
||||
iMediaPlayer.setDisplay(this.b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView.ISurfaceHolder
|
||||
public IRenderView a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class SurfaceCallback implements SurfaceHolder.Callback {
|
||||
private SurfaceHolder a;
|
||||
private boolean b;
|
||||
private int c;
|
||||
private int d;
|
||||
private int e;
|
||||
private WeakReference<SurfaceRenderView> f;
|
||||
private Map<IRenderView.IRenderCallback, Object> g = new ConcurrentHashMap();
|
||||
|
||||
public SurfaceCallback(SurfaceRenderView surfaceRenderView) {
|
||||
this.f = new WeakReference<>(surfaceRenderView);
|
||||
}
|
||||
|
||||
public void a(IRenderView.IRenderCallback iRenderCallback) {
|
||||
InternalSurfaceHolder internalSurfaceHolder;
|
||||
this.g.put(iRenderCallback, iRenderCallback);
|
||||
if (this.a != null) {
|
||||
internalSurfaceHolder = new InternalSurfaceHolder(this.f.get(), this.a);
|
||||
iRenderCallback.a(internalSurfaceHolder, this.d, this.e);
|
||||
} else {
|
||||
internalSurfaceHolder = null;
|
||||
}
|
||||
if (this.b) {
|
||||
if (internalSurfaceHolder == null) {
|
||||
internalSurfaceHolder = new InternalSurfaceHolder(this.f.get(), this.a);
|
||||
}
|
||||
iRenderCallback.a(internalSurfaceHolder, this.c, this.d, this.e);
|
||||
}
|
||||
}
|
||||
|
||||
public void b(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.g.remove(iRenderCallback);
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
|
||||
this.a = surfaceHolder;
|
||||
this.b = true;
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
this.e = i3;
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get(), this.a);
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder, i, i2, i3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceCreated(SurfaceHolder surfaceHolder) {
|
||||
this.a = surfaceHolder;
|
||||
this.b = false;
|
||||
this.c = 0;
|
||||
this.d = 0;
|
||||
this.e = 0;
|
||||
Log.d("SurfaceRenderView", "surfaceCreated: " + surfaceHolder.getSurface());
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get(), this.a);
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
|
||||
this.a = null;
|
||||
this.b = false;
|
||||
this.c = 0;
|
||||
this.d = 0;
|
||||
this.e = 0;
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get(), this.a);
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SurfaceRenderView(Context context) {
|
||||
super(context);
|
||||
a(context);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
this.a = new MeasureHelper(this);
|
||||
this.b = new SurfaceCallback(this);
|
||||
getHolder().addCallback(this.b);
|
||||
getHolder().setType(0);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public boolean a() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void b(int i, int i2) {
|
||||
if (i <= 0 || i2 <= 0) {
|
||||
return;
|
||||
}
|
||||
this.a.b(i, i2);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public Bitmap getBitmap() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public View getView() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
@TargetApi(14)
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
||||
accessibilityEvent.setClassName(SurfaceRenderView.class.getName());
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
@TargetApi(14)
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
||||
if (Build.VERSION.SDK_INT >= 14) {
|
||||
accessibilityNodeInfo.setClassName(SurfaceRenderView.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceView, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
this.a.a(i, i2);
|
||||
setMeasuredDimension(this.a.b(), this.a.a());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void release() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void setAspectRatio(int i) {
|
||||
this.a.a(i);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void setVideoRotation(int i) {
|
||||
Log.e("", "SurfaceView doesn't support rotation (" + i + ")!\n");
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void b(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.b.a(iRenderCallback);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void a(int i, int i2) {
|
||||
if (i <= 0 || i2 <= 0) {
|
||||
return;
|
||||
}
|
||||
this.a.c(i, i2);
|
||||
getHolder().setFixedSize(i, i2);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void a(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.b.b(iRenderCallback);
|
||||
}
|
||||
}
|
@@ -0,0 +1,266 @@
|
||||
package com.ubt.jimu.widgets.player.widget;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.SurfaceTexture;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
import com.ubt.jimu.widgets.player.widget.IRenderView;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@TargetApi(14)
|
||||
/* loaded from: classes2.dex */
|
||||
public class TextureRenderView extends TextureView implements IRenderView {
|
||||
private MeasureHelper a;
|
||||
private int b;
|
||||
private SurfaceTexture c;
|
||||
private SurfaceCallback d;
|
||||
|
||||
private static final class SurfaceCallback implements TextureView.SurfaceTextureListener {
|
||||
private SurfaceTexture a;
|
||||
private boolean b;
|
||||
private int c;
|
||||
private int d;
|
||||
private WeakReference<TextureRenderView> f;
|
||||
private volatile boolean e = false;
|
||||
private Map<IRenderView.IRenderCallback, Object> g = new ConcurrentHashMap();
|
||||
|
||||
public SurfaceCallback(TextureRenderView textureRenderView) {
|
||||
this.f = new WeakReference<>(textureRenderView);
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.e = z;
|
||||
}
|
||||
|
||||
public void b(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.g.remove(iRenderCallback);
|
||||
}
|
||||
|
||||
@Override // android.view.TextureView.SurfaceTextureListener
|
||||
@TargetApi(16)
|
||||
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
|
||||
this.a = surfaceTexture;
|
||||
if (this.f.get() == null) {
|
||||
Log.e("TextureRenderView", "!!!!!Too bad, textureview in callback is released. function will not work normally");
|
||||
} else if (this.f.get().getLastSurfaceTexture() == null) {
|
||||
this.f.get().setLastSurfaceTexture(surfaceTexture);
|
||||
}
|
||||
this.b = false;
|
||||
this.c = 0;
|
||||
this.d = 0;
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get());
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.TextureView.SurfaceTextureListener
|
||||
public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
|
||||
this.a = surfaceTexture;
|
||||
this.b = false;
|
||||
this.c = 0;
|
||||
this.d = 0;
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get());
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder);
|
||||
}
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@Override // android.view.TextureView.SurfaceTextureListener
|
||||
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
|
||||
this.a = surfaceTexture;
|
||||
this.b = true;
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
InternalSurfaceHolder internalSurfaceHolder = new InternalSurfaceHolder(this.f.get());
|
||||
Iterator<IRenderView.IRenderCallback> it = this.g.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(internalSurfaceHolder, 0, i, i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.TextureView.SurfaceTextureListener
|
||||
public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
|
||||
}
|
||||
|
||||
public void a(IRenderView.IRenderCallback iRenderCallback) {
|
||||
InternalSurfaceHolder internalSurfaceHolder;
|
||||
this.g.put(iRenderCallback, iRenderCallback);
|
||||
if (this.a != null) {
|
||||
internalSurfaceHolder = new InternalSurfaceHolder(this.f.get());
|
||||
iRenderCallback.a(internalSurfaceHolder, this.c, this.d);
|
||||
} else {
|
||||
internalSurfaceHolder = null;
|
||||
}
|
||||
if (this.b) {
|
||||
if (internalSurfaceHolder == null) {
|
||||
internalSurfaceHolder = new InternalSurfaceHolder(this.f.get());
|
||||
}
|
||||
iRenderCallback.a(internalSurfaceHolder, 0, this.c, this.d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TextureRenderView(Context context) {
|
||||
super(context);
|
||||
this.b = 0;
|
||||
a(context);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
this.a = new MeasureHelper(this);
|
||||
this.d = new SurfaceCallback(this);
|
||||
setSurfaceTextureListener(this.d);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public boolean a() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void b(int i, int i2) {
|
||||
if (i <= 0 || i2 <= 0) {
|
||||
return;
|
||||
}
|
||||
this.a.b(i, i2);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public int getCurrentMediaPlayerCode() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public SurfaceTexture getLastSurfaceTexture() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public IRenderView.ISurfaceHolder getSurfaceHolder() {
|
||||
return new InternalSurfaceHolder(this);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public View getView() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
Log.d("TextureRenderView", "onDetachedFromWindow");
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
||||
accessibilityEvent.setClassName(TextureRenderView.class.getName());
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
||||
accessibilityNodeInfo.setClassName(TextureRenderView.class.getName());
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
this.a.a(i, i2);
|
||||
setMeasuredDimension(this.a.b(), this.a.a());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
@TargetApi(16)
|
||||
public void release() {
|
||||
if (this.c != null) {
|
||||
if (isAvailable()) {
|
||||
this.d.a(true);
|
||||
} else {
|
||||
this.c.release();
|
||||
this.c = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void setAspectRatio(int i) {
|
||||
this.a.a(i);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setCurrentMediaPlayerCode(int i) {
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
public void setLastSurfaceTexture(SurfaceTexture surfaceTexture) {
|
||||
this.c = surfaceTexture;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void setVideoRotation(int i) {
|
||||
this.a.b(i);
|
||||
setRotation(i);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void b(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.d.a(iRenderCallback);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void a(int i, int i2) {
|
||||
if (i <= 0 || i2 <= 0) {
|
||||
return;
|
||||
}
|
||||
this.a.c(i, i2);
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
private static final class InternalSurfaceHolder implements IRenderView.ISurfaceHolder {
|
||||
private TextureRenderView a;
|
||||
|
||||
public InternalSurfaceHolder(TextureRenderView textureRenderView) {
|
||||
this.a = textureRenderView;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView.ISurfaceHolder
|
||||
@TargetApi(16)
|
||||
public void a(IMediaPlayer iMediaPlayer) {
|
||||
if (iMediaPlayer == null || this.a.getSurfaceTexture() == null) {
|
||||
return;
|
||||
}
|
||||
if (iMediaPlayer.hashCode() != this.a.getCurrentMediaPlayerCode()) {
|
||||
iMediaPlayer.setSurface(b());
|
||||
} else if (!this.a.getLastSurfaceTexture().equals(this.a.getSurfaceTexture())) {
|
||||
TextureRenderView textureRenderView = this.a;
|
||||
textureRenderView.setSurfaceTexture(textureRenderView.getLastSurfaceTexture());
|
||||
}
|
||||
this.a.setCurrentMediaPlayerCode(iMediaPlayer.hashCode());
|
||||
}
|
||||
|
||||
public Surface b() {
|
||||
return new Surface(this.a.getSurfaceTexture());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView.ISurfaceHolder
|
||||
public IRenderView a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.player.widget.IRenderView
|
||||
public void a(IRenderView.IRenderCallback iRenderCallback) {
|
||||
this.d.b(iRenderCallback);
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.ubt.jimu.widgets.player.widget.datasource;
|
||||
|
||||
import android.util.Log;
|
||||
import com.baidu.cloud.media.player.misc.IMediaDataSource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class ExtDataSourceProvider implements IMediaDataSource {
|
||||
private InputStream a;
|
||||
private long b = 0;
|
||||
|
||||
public ExtDataSourceProvider(InputStream inputStream) {
|
||||
this.a = inputStream;
|
||||
}
|
||||
|
||||
@Override // com.baidu.cloud.media.player.misc.IMediaDataSource
|
||||
public void close() throws IOException {
|
||||
InputStream inputStream = this.a;
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
@Override // com.baidu.cloud.media.player.misc.IMediaDataSource
|
||||
public long getSize() throws IOException {
|
||||
Log.w("ExtDataSourceProvider", "data available length: " + this.a.available());
|
||||
return this.a.available();
|
||||
}
|
||||
|
||||
@Override // com.baidu.cloud.media.player.misc.IMediaDataSource
|
||||
public int readAt(long j, byte[] bArr, int i, int i2) throws IOException {
|
||||
if (i2 <= 0) {
|
||||
return i2;
|
||||
}
|
||||
if (this.b != j) {
|
||||
this.a.reset();
|
||||
this.b = this.a.skip(j);
|
||||
Log.w("ExtDataSourceProvider", "Seek pos to " + this.b);
|
||||
}
|
||||
int read = this.a.read(bArr, i, i2);
|
||||
this.b += read;
|
||||
Log.w("ExtDataSourceProvider", "Current Pos " + this.b + " read length: " + read);
|
||||
return read;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user