ExoCacheIOWrapper.smali

.class public Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;
.super Ljava/lang/Object;
.source "SourceFile"


# static fields
.field private static final TAG:Ljava/lang/String; = "ExoCacheIOWrapper"


# instance fields
.field private cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

.field public volatile closed:Z

.field private errMsg:Ljava/lang/String;

.field private mmsErrCode:I


# direct methods
.method public constructor <init>(J)V
    .registers 3

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

    const/4 p1, 0x1

    .line 2
    iput-boolean p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->closed:Z

    .line 3
    new-instance p1, Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-direct {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;-><init>()V

    iput-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    return-void
.end method

.method private native native_on_open_error(JILjava/lang/String;)V
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation
.end method


# virtual methods
.method public closeIO()I
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-virtual {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->closeIO()I

    move-result v0

    .line 2
    monitor-enter p0

    const/4 v1, 0x1

    .line 3
    :try_start_8
    iput-boolean v1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->closed:Z

    .line 4
    monitor-exit p0

    return v0

    :catchall_c
    move-exception v0

    monitor-exit p0
    :try_end_e
    .catchall {:try_start_8 .. :try_end_e} :catchall_c

    throw v0
.end method

.method public getErrMsg()Ljava/lang/String;
    .registers 2

    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->errMsg:Ljava/lang/String;

    return-object v0
.end method

.method public getFirstByteTime()J
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    if-eqz v0, :cond_9

    .line 2
    invoke-virtual {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->getFirstByteTime()J

    move-result-wide v0

    return-wide v0

    :cond_9
    const-wide/16 v0, -0x1

    return-wide v0
.end method

.method public getMMSErrCode()I
    .registers 2

    iget v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->mmsErrCode:I

    return v0
.end method

.method public getReadErrorMsg()Ljava/lang/String;
    .registers 2

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    if-eqz v0, :cond_9

    .line 2
    invoke-virtual {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->getReadErrorMsg()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_9
    const-string v0, ""

    return-object v0
.end method

.method public getReadMMSErrCode()I
    .registers 2

    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    if-eqz v0, :cond_9

    invoke-virtual {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->getReadMMSErrCode()I

    move-result v0

    goto :goto_a

    :cond_9
    const/4 v0, 0x0

    :goto_a
    return v0
.end method

.method public openIO(Ljava/lang/String;J)I
    .registers 5

    const/4 v0, 0x0

    .line 1
    iput-boolean v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->closed:Z

    .line 2
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-virtual {v0, p1, p2, p3}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->openIO(Ljava/lang/String;J)Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;

    move-result-object p1

    .line 3
    iget-object p2, p1, Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;->errMsg:Ljava/lang/String;

    iput-object p2, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->errMsg:Ljava/lang/String;

    .line 4
    iget p2, p1, Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;->mmsErrCode:I

    iput p2, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->mmsErrCode:I

    .line 5
    iget p1, p1, Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;->ret:I

    return p1
.end method

.method public readIO([BI)I
    .registers 4

    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-virtual {v0, p1, p2}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->readIO([BI)I

    move-result p1

    return p1
.end method

.method public release()V
    .registers 2

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-virtual {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->release()V

    .line 2
    iget-boolean v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->closed:Z

    if-nez v0, :cond_12

    .line 3
    monitor-enter p0

    const/4 v0, 0x1

    .line 4
    :try_start_b
    iput-boolean v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->closed:Z

    .line 5
    monitor-exit p0

    goto :goto_12

    :catchall_f
    move-exception v0

    monitor-exit p0
    :try_end_11
    .catchall {:try_start_b .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    :goto_12
    const/4 v0, 0x0

    .line 6
    iput-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    return-void
.end method

.method public seekIO(JI)J
    .registers 5

    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    invoke-virtual {v0, p1, p2, p3}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->seekIO(JI)J

    move-result-wide p1

    return-wide p1
.end method

.method public setCacheKey(Ljava/lang/String;)V
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    if-eqz v0, :cond_7

    .line 2
    invoke-virtual {v0, p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->setCacheKey(Ljava/lang/String;)V

    :cond_7
    return-void
.end method

.method public setDataSource(Ljava/lang/Object;)V
    .registers 3

    .line 1
    instance-of v0, p1, Lcom/google/android/exoplayer2/upstream/l;

    if-eqz v0, :cond_c

    .line 2
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIOWrapper;->cache:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    check-cast p1, Lcom/google/android/exoplayer2/upstream/l;

    invoke-virtual {v0, p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->setDataSource(Lcom/google/android/exoplayer2/upstream/l;)V

    goto :goto_13

    :cond_c
    const-string p1, "ExoCacheIOWrapper"

    const-string v0, "wrong type object"

    .line 3
    invoke-static {p1, v0}, Lcom/mmc/player/log/MMCLogDelegate;->w(Ljava/lang/String;Ljava/lang/String;)V

    :goto_13
    return-void
.end method