2019-12-06 03:29:40 +00:00
|
|
|
.class public Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;
|
2019-07-24 11:27:29 +00:00
|
|
|
.super Ljava/lang/Thread;
|
|
|
|
.source "WebRtcAudioRecord.java"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
|
|
value = Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
2019-12-06 03:29:40 +00:00
|
|
|
accessFlags = 0x1
|
2019-07-24 11:27:29 +00:00
|
|
|
name = "AudioRecordThread"
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public volatile keepAlive:Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final synthetic this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Lorg/webrtc/voiceengine/WebRtcAudioRecord;Ljava/lang/String;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-direct {p0, p2}, Ljava/lang/Thread;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->keepAlive:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public run()V
|
2019-12-06 03:29:40 +00:00
|
|
|
.locals 7
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/16 v0, -0x13
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroid/os/Process;->setThreadPriority(I)V
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
const-string v1, "AudioRecordThread"
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/voiceengine/WebRtcAudioUtils;->getThreadInfo()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "WebRtcAudioRecord"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$000(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Landroid/media/AudioRecord;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/AudioRecord;->getRecordingState()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x3
|
|
|
|
|
|
|
|
if-ne v0, v3, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$100(Z)V
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_1
|
|
|
|
iget-boolean v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->keepAlive:Z
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_5
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$000(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Landroid/media/AudioRecord;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
iget-object v4, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v4}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-virtual {v4}, Ljava/nio/ByteBuffer;->capacity()I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
invoke-virtual {v0, v3, v4}, Landroid/media/AudioRecord;->read(Ljava/nio/ByteBuffer;I)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->capacity()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-ne v0, v3, :cond_4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$300()Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
iget-object v4, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v4}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$400(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)[B
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-virtual {v3, v4}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
iget-boolean v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->keepAlive:Z
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v3, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$500(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)J
|
|
|
|
|
|
|
|
move-result-wide v4
|
|
|
|
|
|
|
|
invoke-static {v3, v0, v4, v5}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$600(Lorg/webrtc/voiceengine/WebRtcAudioRecord;IJ)V
|
|
|
|
|
2019-12-06 01:29:57 +00:00
|
|
|
:cond_3
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$700()Lorg/webrtc/voiceengine/WebRtcAudioRecord$WebRtcAudioRecordSamplesReadyCallback;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->array()[B
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$200(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Ljava/nio/ByteBuffer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->capacity()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v0, v3}, Ljava/util/Arrays;->copyOf([BI)[B
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$700()Lorg/webrtc/voiceengine/WebRtcAudioRecord$WebRtcAudioRecordSamplesReadyCallback;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
new-instance v4, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioSamples;
|
|
|
|
|
|
|
|
iget-object v5, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v5}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$000(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Landroid/media/AudioRecord;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v4, v5, v0, v6}, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioSamples;-><init>(Landroid/media/AudioRecord;[BLorg/webrtc/voiceengine/WebRtcAudioRecord$1;)V
|
|
|
|
|
|
|
|
invoke-interface {v3, v4}, Lorg/webrtc/voiceengine/WebRtcAudioRecord$WebRtcAudioRecordSamplesReadyCallback;->onWebRtcAudioRecordSamplesReady(Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioSamples;)V
|
|
|
|
|
|
|
|
goto/16 :goto_1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
const-string v4, "AudioRecord.read failed: "
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-static {v1, v3}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const/4 v4, -0x3
|
|
|
|
|
|
|
|
if-ne v0, v4, :cond_1
|
|
|
|
|
|
|
|
iput-boolean v2, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->keepAlive:Z
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v0, v3}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$900(Lorg/webrtc/voiceengine/WebRtcAudioRecord;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto/16 :goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_5
|
2019-07-24 11:27:29 +00:00
|
|
|
:try_start_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$000(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Landroid/media/AudioRecord;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_6
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->this$0:Lorg/webrtc/voiceengine/WebRtcAudioRecord;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/voiceengine/WebRtcAudioRecord;->access$000(Lorg/webrtc/voiceengine/WebRtcAudioRecord;)Landroid/media/AudioRecord;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/AudioRecord;->stop()V
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v2, "AudioRecord.stop failed: "
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {v2}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/IllegalStateException;->getMessage()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_6
|
|
|
|
:goto_2
|
2019-07-24 11:27:29 +00:00
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public stopThread()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
const-string v0, "WebRtcAudioRecord"
|
|
|
|
|
|
|
|
const-string v1, "stopThread"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Lorg/webrtc/voiceengine/WebRtcAudioRecord$AudioRecordThread;->keepAlive:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|