621 lines
17 KiB
Smali
621 lines
17 KiB
Smali
.class public Lorg/webrtc/VideoFileRenderer;
|
|
.super Ljava/lang/Object;
|
|
.source "VideoFileRenderer.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/VideoSink;
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "VideoFileRenderer"
|
|
|
|
|
|
# instance fields
|
|
.field public eglBase:Lorg/webrtc/EglBase;
|
|
|
|
.field public final fileThread:Landroid/os/HandlerThread;
|
|
|
|
.field public final fileThreadHandler:Landroid/os/Handler;
|
|
|
|
.field public frameCount:I
|
|
|
|
.field public final outputFileHeight:I
|
|
|
|
.field public final outputFileName:Ljava/lang/String;
|
|
|
|
.field public final outputFileWidth:I
|
|
|
|
.field public final outputFrameBuffer:Ljava/nio/ByteBuffer;
|
|
|
|
.field public final outputFrameSize:I
|
|
|
|
.field public final renderThread:Landroid/os/HandlerThread;
|
|
|
|
.field public final renderThreadHandler:Landroid/os/Handler;
|
|
|
|
.field public final videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
.field public yuvConverter:Lorg/webrtc/YuvConverter;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/lang/String;IILorg/webrtc/EglBase$Context;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
rem-int/lit8 v0, p2, 0x2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
rem-int/lit8 v0, p3, 0x2
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->outputFileName:Ljava/lang/String;
|
|
|
|
iput p2, p0, Lorg/webrtc/VideoFileRenderer;->outputFileWidth:I
|
|
|
|
iput p3, p0, Lorg/webrtc/VideoFileRenderer;->outputFileHeight:I
|
|
|
|
mul-int v0, p2, p3
|
|
|
|
mul-int/lit8 v0, v0, 0x3
|
|
|
|
div-int/lit8 v0, v0, 0x2
|
|
|
|
iput v0, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameSize:I
|
|
|
|
iget v0, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameSize:I
|
|
|
|
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameBuffer:Ljava/nio/ByteBuffer;
|
|
|
|
new-instance v0, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/VideoFileRenderer;->videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
const-string v0, "YUV4MPEG2 C420 W"
|
|
|
|
const-string v1, " H"
|
|
|
|
const-string v2, " Ip F30:1 A1:1\n"
|
|
|
|
invoke-static {v0, p2, v1, p3, v2}, Le/e/b/a/a;->a(Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p3, "US-ASCII"
|
|
|
|
invoke-static {p3}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/io/FileOutputStream;->write([B)V
|
|
|
|
new-instance p1, Landroid/os/HandlerThread;
|
|
|
|
const-string p2, "VideoFileRendererRenderThread"
|
|
|
|
invoke-direct {p1, p2}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->renderThread:Landroid/os/HandlerThread;
|
|
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->renderThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {p1}, Landroid/os/HandlerThread;->start()V
|
|
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/VideoFileRenderer;->renderThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {p2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->renderThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance p1, Landroid/os/HandlerThread;
|
|
|
|
const-string p2, "VideoFileRendererFileThread"
|
|
|
|
invoke-direct {p1, p2}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->fileThread:Landroid/os/HandlerThread;
|
|
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->fileThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {p1}, Landroid/os/HandlerThread;->start()V
|
|
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/VideoFileRenderer;->fileThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {p2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->fileThreadHandler:Landroid/os/Handler;
|
|
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->renderThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance p2, Lorg/webrtc/VideoFileRenderer$1;
|
|
|
|
invoke-direct {p2, p0, p4}, Lorg/webrtc/VideoFileRenderer$1;-><init>(Lorg/webrtc/VideoFileRenderer;Lorg/webrtc/EglBase$Context;)V
|
|
|
|
invoke-static {p1, p2}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/lang/Runnable;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Does not support uneven width or height"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static synthetic access$000(Lorg/webrtc/VideoFileRenderer;)Lorg/webrtc/EglBase;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lorg/webrtc/VideoFileRenderer;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static synthetic access$002(Lorg/webrtc/VideoFileRenderer;Lorg/webrtc/EglBase;)Lorg/webrtc/EglBase;
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static synthetic access$102(Lorg/webrtc/VideoFileRenderer;Lorg/webrtc/YuvConverter;)Lorg/webrtc/YuvConverter;
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lorg/webrtc/VideoFileRenderer;->yuvConverter:Lorg/webrtc/YuvConverter;
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private renderFrameOnRenderThread(Lorg/webrtc/VideoFrame;)V
|
|
.locals 8
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getBuffer()Lorg/webrtc/VideoFrame$Buffer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getRotation()I
|
|
|
|
move-result v1
|
|
|
|
rem-int/lit16 v1, v1, 0xb4
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
iget v1, p0, Lorg/webrtc/VideoFileRenderer;->outputFileWidth:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v1, p0, Lorg/webrtc/VideoFileRenderer;->outputFileHeight:I
|
|
|
|
:goto_0
|
|
move v5, v1
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getRotation()I
|
|
|
|
move-result v1
|
|
|
|
rem-int/lit16 v1, v1, 0xb4
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
iget v1, p0, Lorg/webrtc/VideoFileRenderer;->outputFileHeight:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget v1, p0, Lorg/webrtc/VideoFileRenderer;->outputFileWidth:I
|
|
|
|
:goto_1
|
|
move v6, v1
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getWidth()I
|
|
|
|
move-result v1
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getHeight()I
|
|
|
|
move-result v2
|
|
|
|
int-to-float v2, v2
|
|
|
|
div-float/2addr v1, v2
|
|
|
|
int-to-float v2, v5
|
|
|
|
int-to-float v3, v6
|
|
|
|
div-float/2addr v2, v3
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getWidth()I
|
|
|
|
move-result v3
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getHeight()I
|
|
|
|
move-result v4
|
|
|
|
cmpl-float v7, v2, v1
|
|
|
|
if-lez v7, :cond_2
|
|
|
|
int-to-float v4, v4
|
|
|
|
div-float/2addr v1, v2
|
|
|
|
mul-float v1, v1, v4
|
|
|
|
float-to-int v1, v1
|
|
|
|
move v4, v1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
int-to-float v3, v3
|
|
|
|
div-float/2addr v2, v1
|
|
|
|
mul-float v2, v2, v3
|
|
|
|
float-to-int v1, v2
|
|
|
|
move v3, v1
|
|
|
|
:goto_2
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getWidth()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v1, v3
|
|
|
|
div-int/lit8 v1, v1, 0x2
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->getHeight()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v2, v4
|
|
|
|
div-int/lit8 v2, v2, 0x2
|
|
|
|
invoke-interface/range {v0 .. v6}, Lorg/webrtc/VideoFrame$Buffer;->cropAndScale(IIIIII)Lorg/webrtc/VideoFrame$Buffer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->release()V
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->toI420()Lorg/webrtc/VideoFrame$I420Buffer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoFrame$Buffer;->release()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->fileThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance v2, Ls/d/d0;
|
|
|
|
invoke-direct {v2, p0, v1, p1}, Ls/d/d0;-><init>(Lorg/webrtc/VideoFileRenderer;Lorg/webrtc/VideoFrame$I420Buffer;Lorg/webrtc/VideoFrame;)V
|
|
|
|
invoke-virtual {v0, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public synthetic a()V
|
|
.locals 3
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
const-string v0, "VideoFileRenderer"
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Video written to disk as "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/VideoFileRenderer;->outputFileName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ". The number of frames is "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v2, p0, Lorg/webrtc/VideoFileRenderer;->frameCount:I
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, " and the dimensions of the frames are "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v2, p0, Lorg/webrtc/VideoFileRenderer;->outputFileWidth:I
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "x"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v2, p0, Lorg/webrtc/VideoFileRenderer;->outputFileHeight:I
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "."
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->fileThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {v0}, Landroid/os/HandlerThread;->quit()Z
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v2, "Error closing output file"
|
|
|
|
invoke-direct {v1, v2, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public synthetic a(Ljava/util/concurrent/CountDownLatch;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->yuvConverter:Lorg/webrtc/YuvConverter;
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/YuvConverter;->release()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/EglBase;->release()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->renderThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {v0}, Landroid/os/HandlerThread;->quit()Z
|
|
|
|
invoke-virtual {p1}, Ljava/util/concurrent/CountDownLatch;->countDown()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic a(Lorg/webrtc/VideoFrame$I420Buffer;Lorg/webrtc/VideoFrame;)V
|
|
.locals 10
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getDataY()Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getStrideY()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getDataU()Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getStrideU()I
|
|
|
|
move-result v3
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getDataV()Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$I420Buffer;->getStrideV()I
|
|
|
|
move-result v5
|
|
|
|
iget-object v6, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameBuffer:Ljava/nio/ByteBuffer;
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$Buffer;->getWidth()I
|
|
|
|
move-result v7
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$Buffer;->getHeight()I
|
|
|
|
move-result v8
|
|
|
|
invoke-virtual {p2}, Lorg/webrtc/VideoFrame;->getRotation()I
|
|
|
|
move-result v9
|
|
|
|
invoke-static/range {v0 .. v9}, Lorg/webrtc/YuvHelper;->I420Rotate(Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;III)V
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$Buffer;->release()V
|
|
|
|
:try_start_0
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
const-string p2, "FRAME\n"
|
|
|
|
const-string v0, "US-ASCII"
|
|
|
|
invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/io/FileOutputStream;->write([B)V
|
|
|
|
iget-object p1, p0, Lorg/webrtc/VideoFileRenderer;->videoOutFile:Ljava/io/FileOutputStream;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameBuffer:Ljava/nio/ByteBuffer;
|
|
|
|
invoke-virtual {p2}, Ljava/nio/ByteBuffer;->array()[B
|
|
|
|
move-result-object p2
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameBuffer:Ljava/nio/ByteBuffer;
|
|
|
|
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->arrayOffset()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lorg/webrtc/VideoFileRenderer;->outputFrameSize:I
|
|
|
|
invoke-virtual {p1, p2, v0, v1}, Ljava/io/FileOutputStream;->write([BII)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
iget p1, p0, Lorg/webrtc/VideoFileRenderer;->frameCount:I
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
iput p1, p0, Lorg/webrtc/VideoFileRenderer;->frameCount:I
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
new-instance p2, Ljava/lang/RuntimeException;
|
|
|
|
const-string v0, "Error writing video to disk"
|
|
|
|
invoke-direct {p2, v0, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
.end method
|
|
|
|
.method public synthetic a(Lorg/webrtc/VideoFrame;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lorg/webrtc/VideoFileRenderer;->renderFrameOnRenderThread(Lorg/webrtc/VideoFrame;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onFrame(Lorg/webrtc/VideoFrame;)V
|
|
.locals 2
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->retain()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->renderThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance v1, Ls/d/c0;
|
|
|
|
invoke-direct {v1, p0, p1}, Ls/d/c0;-><init>(Lorg/webrtc/VideoFileRenderer;Lorg/webrtc/VideoFrame;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public release()V
|
|
.locals 3
|
|
|
|
new-instance v0, Ljava/util/concurrent/CountDownLatch;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
|
|
|
|
iget-object v1, p0, Lorg/webrtc/VideoFileRenderer;->renderThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance v2, Ls/d/b0;
|
|
|
|
invoke-direct {v2, p0, v0}, Ls/d/b0;-><init>(Lorg/webrtc/VideoFileRenderer;Ljava/util/concurrent/CountDownLatch;)V
|
|
|
|
invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
invoke-static {v0}, Lorg/webrtc/ThreadUtils;->awaitUninterruptibly(Ljava/util/concurrent/CountDownLatch;)V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->fileThreadHandler:Landroid/os/Handler;
|
|
|
|
new-instance v1, Ls/d/a0;
|
|
|
|
invoke-direct {v1, p0}, Ls/d/a0;-><init>(Lorg/webrtc/VideoFileRenderer;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lorg/webrtc/VideoFileRenderer;->fileThread:Landroid/os/HandlerThread;
|
|
|
|
invoke-virtual {v0}, Landroid/os/HandlerThread;->join()V
|
|
:try_end_0
|
|
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Thread;->interrupt()V
|
|
|
|
const-string v1, "VideoFileRenderer"
|
|
|
|
const-string v2, "Interrupted while waiting for the write to disk to complete."
|
|
|
|
invoke-static {v1, v2, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|