FaceDetector.smali

.class public Lcom/iflytek/cloud/FaceDetector;
.super Lcom/iflytek/thirdparty/v;
.source "SourceFile"


# static fields
.field private static a:Lcom/iflytek/cloud/FaceDetector;


# instance fields
.field private b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/iflytek/cloud/SpeechError;
        }
    .end annotation

    .prologue
    .line 43
    invoke-direct {p0}, Lcom/iflytek/thirdparty/v;-><init>()V

    .line 45
    :try_start_3
    new-instance v0, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    const/4 v1, 0x0

    invoke-direct {v0, p1, v1}, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;
    :try_end_b
    .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_3 .. :try_end_b} :catch_c

    .line 50
    return-void

    .line 46
    :catch_c
    move-exception v0

    .line 47
    new-instance v0, Lcom/iflytek/cloud/SpeechError;

    const/16 v1, 0x4e35

    invoke-direct {v0, v1}, Lcom/iflytek/cloud/SpeechError;-><init>(I)V

    throw v0
.end method

.method public static declared-synchronized createDetector(Landroid/content/Context;Ljava/lang/String;)Lcom/iflytek/cloud/FaceDetector;
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/iflytek/cloud/SpeechError;
        }
    .end annotation

    .prologue
    .line 69
    const-class v1, Lcom/iflytek/cloud/FaceDetector;

    monitor-enter v1

    .line 71
    :try_start_3
    sget-object v2, Lcom/iflytek/cloud/FaceDetector;->sSync:Ljava/lang/Object;

    monitor-enter v2
    :try_end_6
    .catchall {:try_start_3 .. :try_end_6} :catchall_1f

    .line 72
    :try_start_6
    sget-object v0, Lcom/iflytek/cloud/FaceDetector;->a:Lcom/iflytek/cloud/FaceDetector;

    if-nez v0, :cond_17

    invoke-static {}, Lcom/iflytek/cloud/SpeechUtility;->getUtility()Lcom/iflytek/cloud/SpeechUtility;

    move-result-object v0

    if-eqz v0, :cond_17

    .line 73
    new-instance v0, Lcom/iflytek/cloud/FaceDetector;

    invoke-direct {v0, p0}, Lcom/iflytek/cloud/FaceDetector;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/iflytek/cloud/FaceDetector;->a:Lcom/iflytek/cloud/FaceDetector;

    .line 76
    :cond_17
    sget-object v0, Lcom/iflytek/cloud/FaceDetector;->a:Lcom/iflytek/cloud/FaceDetector;

    .line 77
    monitor-exit v2
    :try_end_1a
    .catchall {:try_start_6 .. :try_end_1a} :catchall_1c

    .line 79
    monitor-exit v1

    return-object v0

    .line 77
    :catchall_1c
    move-exception v0

    :try_start_1d
    monitor-exit v2
    :try_end_1e
    .catchall {:try_start_1d .. :try_end_1e} :catchall_1c

    :try_start_1e
    throw v0
    :try_end_1f
    .catchall {:try_start_1e .. :try_end_1f} :catchall_1f

    .line 69
    :catchall_1f
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method public static declared-synchronized getDetector()Lcom/iflytek/cloud/FaceDetector;
    .registers 2

    .prologue
    .line 95
    const-class v0, Lcom/iflytek/cloud/FaceDetector;

    monitor-enter v0

    :try_start_3
    sget-object v1, Lcom/iflytek/cloud/FaceDetector;->a:Lcom/iflytek/cloud/FaceDetector;
    :try_end_5
    .catchall {:try_start_3 .. :try_end_5} :catchall_7

    monitor-exit v0

    return-object v1

    :catchall_7
    move-exception v1

    monitor-exit v0

    throw v1
.end method


# virtual methods
.method public declared-synchronized destroy()Z
    .registers 4

    .prologue
    .line 187
    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    .line 189
    monitor-enter p0
    :try_end_4
    .catchall {:try_start_1 .. :try_end_4} :catchall_1f

    .line 190
    const/4 v1, 0x0

    :try_start_5
    iput-object v1, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    .line 191
    monitor-exit p0
    :try_end_8
    .catchall {:try_start_5 .. :try_end_8} :catchall_1c

    .line 193
    if-eqz v0, :cond_d

    .line 194
    :try_start_a
    invoke-virtual {v0}, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;->destroy()V

    .line 197
    :cond_d
    invoke-super {p0}, Lcom/iflytek/thirdparty/v;->destroy()Z

    move-result v0

    .line 198
    if-eqz v0, :cond_1a

    .line 199
    sget-object v1, Lcom/iflytek/cloud/FaceDetector;->sSync:Ljava/lang/Object;

    monitor-enter v1
    :try_end_16
    .catchall {:try_start_a .. :try_end_16} :catchall_1f

    .line 200
    const/4 v2, 0x0

    :try_start_17
    sput-object v2, Lcom/iflytek/cloud/FaceDetector;->a:Lcom/iflytek/cloud/FaceDetector;

    .line 201
    monitor-exit v1
    :try_end_1a
    .catchall {:try_start_17 .. :try_end_1a} :catchall_22

    .line 204
    :cond_1a
    monitor-exit p0

    return v0

    .line 191
    :catchall_1c
    move-exception v0

    :try_start_1d
    monitor-exit p0
    :try_end_1e
    .catchall {:try_start_1d .. :try_end_1e} :catchall_1c

    :try_start_1e
    throw v0
    :try_end_1f
    .catchall {:try_start_1e .. :try_end_1f} :catchall_1f

    .line 187
    :catchall_1f
    move-exception v0

    monitor-exit p0

    throw v0

    .line 201
    :catchall_22
    move-exception v0

    :try_start_23
    monitor-exit v1
    :try_end_24
    .catchall {:try_start_23 .. :try_end_24} :catchall_22

    :try_start_24
    throw v0
    :try_end_25
    .catchall {:try_start_24 .. :try_end_25} :catchall_1f
.end method

.method public declared-synchronized detectARGB(Landroid/graphics/Bitmap;)Ljava/lang/String;
    .registers 4

    .prologue
    .line 111
    monitor-enter p0

    const/4 v0, 0x0

    .line 113
    :try_start_2
    monitor-enter p0
    :try_end_3
    .catchall {:try_start_2 .. :try_end_3} :catchall_13

    .line 114
    :try_start_3
    iget-object v1, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    if-eqz v1, :cond_d

    .line 115
    iget-object v0, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    invoke-virtual {v0, p1}, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;->detectARGB(Landroid/graphics/Bitmap;)Ljava/lang/String;

    move-result-object v0

    .line 117
    :cond_d
    monitor-exit p0
    :try_end_e
    .catchall {:try_start_3 .. :try_end_e} :catchall_10

    .line 119
    monitor-exit p0

    return-object v0

    .line 117
    :catchall_10
    move-exception v0

    :try_start_11
    monitor-exit p0
    :try_end_12
    .catchall {:try_start_11 .. :try_end_12} :catchall_10

    :try_start_12
    throw v0
    :try_end_13
    .catchall {:try_start_12 .. :try_end_13} :catchall_13

    .line 111
    :catchall_13
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized detectGray(Landroid/graphics/Bitmap;)Ljava/lang/String;
    .registers 4

    .prologue
    .line 135
    monitor-enter p0

    const/4 v0, 0x0

    .line 137
    :try_start_2
    monitor-enter p0
    :try_end_3
    .catchall {:try_start_2 .. :try_end_3} :catchall_13

    .line 138
    :try_start_3
    iget-object v1, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    if-eqz v1, :cond_d

    .line 139
    iget-object v0, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    invoke-virtual {v0, p1}, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;->detectGray(Landroid/graphics/Bitmap;)Ljava/lang/String;

    move-result-object v0

    .line 141
    :cond_d
    monitor-exit p0
    :try_end_e
    .catchall {:try_start_3 .. :try_end_e} :catchall_10

    .line 143
    monitor-exit p0

    return-object v0

    .line 141
    :catchall_10
    move-exception v0

    :try_start_11
    monitor-exit p0
    :try_end_12
    .catchall {:try_start_11 .. :try_end_12} :catchall_10

    :try_start_12
    throw v0
    :try_end_13
    .catchall {:try_start_12 .. :try_end_13} :catchall_13

    .line 135
    :catchall_13
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized trackNV21([BIIII)Ljava/lang/String;
    .registers 12

    .prologue
    .line 165
    monitor-enter p0

    const/4 v0, 0x0

    .line 167
    :try_start_2
    monitor-enter p0
    :try_end_3
    .catchall {:try_start_2 .. :try_end_3} :catchall_18

    .line 168
    :try_start_3
    iget-object v1, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    if-eqz v1, :cond_12

    .line 169
    iget-object v0, p0, Lcom/iflytek/cloud/FaceDetector;->b:Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move v5, p5

    invoke-virtual/range {v0 .. v5}, Lcom/iflytek/cloud/speech/impl/FaceDetectorImpl;->trackNV21([BIIII)Ljava/lang/String;

    move-result-object v0

    .line 171
    :cond_12
    monitor-exit p0
    :try_end_13
    .catchall {:try_start_3 .. :try_end_13} :catchall_15

    .line 173
    monitor-exit p0

    return-object v0

    .line 171
    :catchall_15
    move-exception v0

    :try_start_16
    monitor-exit p0
    :try_end_17
    .catchall {:try_start_16 .. :try_end_17} :catchall_15

    :try_start_17
    throw v0
    :try_end_18
    .catchall {:try_start_17 .. :try_end_18} :catchall_18

    .line 165
    :catchall_18
    move-exception v0

    monitor-exit p0

    throw v0
.end method