今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

298 lines
8.1 KiB

.class Lcom/via/gpuimage/GPUImageView$SaveTask;
.super Landroid/os/AsyncTask;
.source "GPUImageView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/via/gpuimage/GPUImageView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "SaveTask"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/os/AsyncTask",
"<",
"Ljava/lang/Void;",
"Ljava/lang/Void;",
"Ljava/lang/Void;",
">;"
}
.end annotation
# instance fields
.field private final mFileName:Ljava/lang/String;
.field private final mFolderName:Ljava/lang/String;
.field private final mHandler:Landroid/os/Handler;
.field private final mHeight:I
.field private final mListener:Lcom/via/gpuimage/GPUImageView$OnPictureSavedListener;
.field private final mWidth:I
.field final synthetic this$0:Lcom/via/gpuimage/GPUImageView;
# direct methods
.method public constructor <init>(Lcom/via/gpuimage/GPUImageView;Ljava/lang/String;Ljava/lang/String;IILcom/via/gpuimage/GPUImageView$OnPictureSavedListener;)V
.locals 1
.prologue
.line 399
iput-object p1, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->this$0:Lcom/via/gpuimage/GPUImageView;
invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V
.line 400
iput-object p2, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mFolderName:Ljava/lang/String;
.line 401
iput-object p3, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mFileName:Ljava/lang/String;
.line 402
iput p4, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mWidth:I
.line 403
iput p5, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mHeight:I
.line 404
iput-object p6, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mListener:Lcom/via/gpuimage/GPUImageView$OnPictureSavedListener;
.line 405
new-instance v0, Landroid/os/Handler;
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
iput-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mHandler:Landroid/os/Handler;
.line 406
return-void
.end method
.method public constructor <init>(Lcom/via/gpuimage/GPUImageView;Ljava/lang/String;Ljava/lang/String;Lcom/via/gpuimage/GPUImageView$OnPictureSavedListener;)V
.locals 7
.prologue
const/4 v4, 0x0
.line 395
move-object v0, p0
move-object v1, p1
move-object v2, p2
move-object v3, p3
move v5, v4
move-object v6, p4
invoke-direct/range {v0 .. v6}, Lcom/via/gpuimage/GPUImageView$SaveTask;-><init>(Lcom/via/gpuimage/GPUImageView;Ljava/lang/String;Ljava/lang/String;IILcom/via/gpuimage/GPUImageView$OnPictureSavedListener;)V
.line 396
return-void
.end method
.method static synthetic access$100(Lcom/via/gpuimage/GPUImageView$SaveTask;)Lcom/via/gpuimage/GPUImageView$OnPictureSavedListener;
.locals 1
.prologue
.line 385
iget-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mListener:Lcom/via/gpuimage/GPUImageView$OnPictureSavedListener;
return-object v0
.end method
.method static synthetic access$200(Lcom/via/gpuimage/GPUImageView$SaveTask;)Landroid/os/Handler;
.locals 1
.prologue
.line 385
iget-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mHandler:Landroid/os/Handler;
return-object v0
.end method
.method private saveImage(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)V
.locals 4
.prologue
.line 420
sget-object v0, Landroid/os/Environment;->DIRECTORY_PICTURES:Ljava/lang/String;
.line 421
invoke-static {v0}, Landroid/os/Environment;->getExternalStoragePublicDirectory(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
.line 422
new-instance v1, Ljava/io/File;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, "/"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-direct {v1, v0, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
.line 424
:try_start_0
invoke-virtual {v1}, Ljava/io/File;->getParentFile()Ljava/io/File;
move-result-object v0
invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z
.line 425
sget-object v0, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;
const/16 v2, 0x50
new-instance v3, Ljava/io/FileOutputStream;
invoke-direct {v3, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
invoke-virtual {p3, v0, v2, v3}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
.line 426
iget-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->this$0:Lcom/via/gpuimage/GPUImageView;
invoke-virtual {v0}, Lcom/via/gpuimage/GPUImageView;->getContext()Landroid/content/Context;
move-result-object v0
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/String;
const/4 v3, 0x0
.line 428
invoke-virtual {v1}, Ljava/io/File;->toString()Ljava/lang/String;
move-result-object v1
aput-object v1, v2, v3
const/4 v1, 0x0
new-instance v3, Lcom/via/gpuimage/GPUImageView$SaveTask$1;
invoke-direct {v3, p0}, Lcom/via/gpuimage/GPUImageView$SaveTask$1;-><init>(Lcom/via/gpuimage/GPUImageView$SaveTask;)V
.line 426
invoke-static {v0, v2, v1, v3}, Landroid/media/MediaScannerConnection;->scanFile(Landroid/content/Context;[Ljava/lang/String;[Ljava/lang/String;Landroid/media/MediaScannerConnection$OnScanCompletedListener;)V
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 447
:goto_0
return-void
.line 444
:catch_0
move-exception v0
.line 445
invoke-virtual {v0}, Ljava/io/FileNotFoundException;->printStackTrace()V
goto :goto_0
.end method
# virtual methods
.method protected bridge synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
.prologue
.line 385
check-cast p1, [Ljava/lang/Void;
invoke-virtual {p0, p1}, Lcom/via/gpuimage/GPUImageView$SaveTask;->doInBackground([Ljava/lang/Void;)Ljava/lang/Void;
move-result-object v0
return-object v0
.end method
.method protected varargs doInBackground([Ljava/lang/Void;)Ljava/lang/Void;
.locals 3
.prologue
.line 411
:try_start_0
iget v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mWidth:I
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->this$0:Lcom/via/gpuimage/GPUImageView;
iget v1, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mWidth:I
iget v2, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mHeight:I
invoke-virtual {v0, v1, v2}, Lcom/via/gpuimage/GPUImageView;->capture(II)Landroid/graphics/Bitmap;
move-result-object v0
.line 412
:goto_0
iget-object v1, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mFolderName:Ljava/lang/String;
iget-object v2, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->mFileName:Ljava/lang/String;
invoke-direct {p0, v1, v2, v0}, Lcom/via/gpuimage/GPUImageView$SaveTask;->saveImage(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)V
.line 416
:goto_1
const/4 v0, 0x0
return-object v0
.line 411
:cond_0
iget-object v0, p0, Lcom/via/gpuimage/GPUImageView$SaveTask;->this$0:Lcom/via/gpuimage/GPUImageView;
invoke-virtual {v0}, Lcom/via/gpuimage/GPUImageView;->capture()Landroid/graphics/Bitmap;
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
goto :goto_0
.line 413
:catch_0
move-exception v0
.line 414
invoke-virtual {v0}, Ljava/lang/InterruptedException;->printStackTrace()V
goto :goto_1
.end method