package p138.p176.p177.p190.p195.p197;

import android.net.Uri;
import net.butterflytv.rtmp_client.RtmpClient;
import p138.p176.p177.p190.C3430;
import p138.p176.p177.p190.p238.AbstractC4092;
import p138.p176.p177.p190.p238.C4098;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೱ.ؠ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3547 extends AbstractC4092 {

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public RtmpClient f10523;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public Uri f10524;

    static {
        C3430.m5578("goog.exo.rtmp");
    }

    public C3547() {
        super(true);
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    public void close() {
        if (this.f10524 != null) {
            this.f10524 = null;
            m6581();
        }
        RtmpClient rtmpClient = this.f10523;
        if (rtmpClient != null) {
            rtmpClient.nativeClose(rtmpClient.f2182);
            rtmpClient.f2182 = 0L;
            this.f10523 = null;
        }
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏ */
    public int mo1282(byte[] bArr, int i, int i2) throws RtmpClient.RtmpIOException {
        RtmpClient rtmpClient = this.f10523;
        C4150.m6755(rtmpClient);
        RtmpClient rtmpClient2 = rtmpClient;
        int iNativeRead = rtmpClient2.nativeRead(bArr, i, i2, rtmpClient2.f2182);
        if (iNativeRead < 0 && iNativeRead != -1) {
            throw new RtmpClient.RtmpIOException(iNativeRead);
        }
        if (iNativeRead == -1) {
            return -1;
        }
        m6579(iNativeRead);
        return iNativeRead;
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏ */
    public long mo1283(C4098 c4098) throws RtmpClient.RtmpIOException {
        m6580(c4098);
        RtmpClient rtmpClient = new RtmpClient();
        this.f10523 = rtmpClient;
        String string = c4098.f13076.toString();
        long jNativeAlloc = rtmpClient.nativeAlloc();
        rtmpClient.f2182 = jNativeAlloc;
        if (jNativeAlloc == 0) {
            throw new RtmpClient.RtmpIOException(-2);
        }
        int iNativeOpen = rtmpClient.nativeOpen(string, false, jNativeAlloc, rtmpClient.f2183, rtmpClient.f2184);
        if (iNativeOpen != 0) {
            rtmpClient.f2182 = 0L;
            throw new RtmpClient.RtmpIOException(iNativeOpen);
        }
        this.f10524 = c4098.f13076;
        m6582(c4098);
        return -1L;
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ؠ */
    public Uri mo1284() {
        return this.f10524;
    }
}
