RtmpClient.smali

.class public Lnet/butterflytv/rtmp_client/RtmpClient;
.super Ljava/lang/Object;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lnet/butterflytv/rtmp_client/RtmpClient$a;
    }
.end annotation


# instance fields
.field private a:J

.field private b:I

.field private c:I


# direct methods
.method static constructor <clinit>()V
    .registers 1

    const-string v0, "rtmp-jni"

    invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V

    return-void
.end method

.method public constructor <init>()V
    .registers 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    const/16 v0, 0x2710

    iput v0, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->b:I

    iput v0, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->c:I

    return-void
.end method

.method private native nativeAlloc()J
.end method

.method private native nativeClose(J)V
.end method

.method private native nativeOpen(Ljava/lang/String;ZJII)I
.end method

.method private native nativeRead([BIIJ)I
.end method


# virtual methods
.method public a()V
    .registers 3

    iget-wide v0, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    invoke-direct {p0, v0, v1}, Lnet/butterflytv/rtmp_client/RtmpClient;->nativeClose(J)V

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    return-void
.end method

.method public b(Ljava/lang/String;Z)V
    .registers 12

    invoke-direct {p0}, Lnet/butterflytv/rtmp_client/RtmpClient;->nativeAlloc()J

    move-result-wide v3

    iput-wide v3, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    const-wide/16 v7, 0x0

    cmp-long v0, v3, v7

    if-eqz v0, :cond_22

    iget v5, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->b:I

    iget v6, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->c:I

    move-object v0, p0

    move-object v1, p1

    move v2, p2

    invoke-direct/range {v0 .. v6}, Lnet/butterflytv/rtmp_client/RtmpClient;->nativeOpen(Ljava/lang/String;ZJII)I

    move-result p1

    if-nez p1, :cond_1a

    return-void

    :cond_1a
    iput-wide v7, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    new-instance p2, Lnet/butterflytv/rtmp_client/RtmpClient$a;

    invoke-direct {p2, p1}, Lnet/butterflytv/rtmp_client/RtmpClient$a;-><init>(I)V

    throw p2

    :cond_22
    new-instance p1, Lnet/butterflytv/rtmp_client/RtmpClient$a;

    const/4 p2, -0x2

    invoke-direct {p1, p2}, Lnet/butterflytv/rtmp_client/RtmpClient$a;-><init>(I)V

    throw p1
.end method

.method public c([BII)I
    .registers 10

    iget-wide v4, p0, Lnet/butterflytv/rtmp_client/RtmpClient;->a:J

    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move v3, p3

    invoke-direct/range {v0 .. v5}, Lnet/butterflytv/rtmp_client/RtmpClient;->nativeRead([BIIJ)I

    move-result p1

    if-gez p1, :cond_16

    const/4 p2, -0x1

    if-ne p1, p2, :cond_10

    goto :goto_16

    :cond_10
    new-instance p2, Lnet/butterflytv/rtmp_client/RtmpClient$a;

    invoke-direct {p2, p1}, Lnet/butterflytv/rtmp_client/RtmpClient$a;-><init>(I)V

    throw p2

    :cond_16
    :goto_16
    return p1
.end method