266 lines
8.1 KiB
Smali
266 lines
8.1 KiB
Smali
|
.class public Lorg/webrtc/audio/JavaAudioDeviceModule;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "JavaAudioDeviceModule.java"
|
||
|
|
||
|
# interfaces
|
||
|
.implements Lorg/webrtc/audio/AudioDeviceModule;
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$AudioTrackErrorCallback;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$AudioTrackStartErrorCode;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$SamplesReadyCallback;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$AudioSamples;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$AudioRecordErrorCallback;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$AudioRecordStartErrorCode;,
|
||
|
Lorg/webrtc/audio/JavaAudioDeviceModule$Builder;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final TAG:Ljava/lang/String; = "JavaAudioDeviceModule"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final audioInput:Lorg/webrtc/audio/WebRtcAudioRecord;
|
||
|
|
||
|
.field public final audioManager:Landroid/media/AudioManager;
|
||
|
|
||
|
.field public final audioOutput:Lorg/webrtc/audio/WebRtcAudioTrack;
|
||
|
|
||
|
.field public final context:Landroid/content/Context;
|
||
|
|
||
|
.field public nativeAudioDeviceModule:J
|
||
|
|
||
|
.field public final nativeLock:Ljava/lang/Object;
|
||
|
|
||
|
.field public final sampleRate:I
|
||
|
|
||
|
.field public final useStereoInput:Z
|
||
|
|
||
|
.field public final useStereoOutput:Z
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Landroid/content/Context;Landroid/media/AudioManager;Lorg/webrtc/audio/WebRtcAudioRecord;Lorg/webrtc/audio/WebRtcAudioTrack;IZZ)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
new-instance v0, Ljava/lang/Object;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeLock:Ljava/lang/Object;
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->context:Landroid/content/Context;
|
||
|
|
||
|
iput-object p2, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioManager:Landroid/media/AudioManager;
|
||
|
|
||
|
iput-object p3, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioInput:Lorg/webrtc/audio/WebRtcAudioRecord;
|
||
|
|
||
|
iput-object p4, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioOutput:Lorg/webrtc/audio/WebRtcAudioTrack;
|
||
|
|
||
|
iput p5, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->sampleRate:I
|
||
|
|
||
|
iput-boolean p6, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->useStereoInput:Z
|
||
|
|
||
|
iput-boolean p7, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->useStereoOutput:Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic constructor <init>(Landroid/content/Context;Landroid/media/AudioManager;Lorg/webrtc/audio/WebRtcAudioRecord;Lorg/webrtc/audio/WebRtcAudioTrack;IZZLorg/webrtc/audio/JavaAudioDeviceModule$1;)V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct/range {p0 .. p7}, Lorg/webrtc/audio/JavaAudioDeviceModule;-><init>(Landroid/content/Context;Landroid/media/AudioManager;Lorg/webrtc/audio/WebRtcAudioRecord;Lorg/webrtc/audio/WebRtcAudioTrack;IZZ)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static builder(Landroid/content/Context;)Lorg/webrtc/audio/JavaAudioDeviceModule$Builder;
|
||
|
.locals 2
|
||
|
|
||
|
new-instance v0, Lorg/webrtc/audio/JavaAudioDeviceModule$Builder;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-direct {v0, p0, v1}, Lorg/webrtc/audio/JavaAudioDeviceModule$Builder;-><init>(Landroid/content/Context;Lorg/webrtc/audio/JavaAudioDeviceModule$1;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static isBuiltInAcousticEchoCancelerSupported()Z
|
||
|
.locals 1
|
||
|
|
||
|
invoke-static {}, Lorg/webrtc/audio/WebRtcAudioEffects;->isAcousticEchoCancelerSupported()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public static isBuiltInNoiseSuppressorSupported()Z
|
||
|
.locals 1
|
||
|
|
||
|
invoke-static {}, Lorg/webrtc/audio/WebRtcAudioEffects;->isNoiseSuppressorSupported()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public static native nativeCreateAudioDeviceModule(Landroid/content/Context;Landroid/media/AudioManager;Lorg/webrtc/audio/WebRtcAudioRecord;Lorg/webrtc/audio/WebRtcAudioTrack;IZZ)J
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public getNativeAudioDeviceModulePointer()J
|
||
|
.locals 13
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeLock:Ljava/lang/Object;
|
||
|
|
||
|
monitor-enter v0
|
||
|
|
||
|
:try_start_0
|
||
|
iget-wide v1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
const-wide/16 v3, 0x0
|
||
|
|
||
|
cmp-long v5, v1, v3
|
||
|
|
||
|
if-nez v5, :cond_0
|
||
|
|
||
|
iget-object v6, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->context:Landroid/content/Context;
|
||
|
|
||
|
iget-object v7, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioManager:Landroid/media/AudioManager;
|
||
|
|
||
|
iget-object v8, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioInput:Lorg/webrtc/audio/WebRtcAudioRecord;
|
||
|
|
||
|
iget-object v9, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioOutput:Lorg/webrtc/audio/WebRtcAudioTrack;
|
||
|
|
||
|
iget v10, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->sampleRate:I
|
||
|
|
||
|
iget-boolean v11, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->useStereoInput:Z
|
||
|
|
||
|
iget-boolean v12, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->useStereoOutput:Z
|
||
|
|
||
|
invoke-static/range {v6 .. v12}, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeCreateAudioDeviceModule(Landroid/content/Context;Landroid/media/AudioManager;Lorg/webrtc/audio/WebRtcAudioRecord;Lorg/webrtc/audio/WebRtcAudioTrack;IZZ)J
|
||
|
|
||
|
move-result-wide v1
|
||
|
|
||
|
iput-wide v1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
:cond_0
|
||
|
iget-wide v1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
monitor-exit v0
|
||
|
|
||
|
return-wide v1
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception v1
|
||
|
|
||
|
monitor-exit v0
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
throw v1
|
||
|
.end method
|
||
|
|
||
|
.method public release()V
|
||
|
.locals 6
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeLock:Ljava/lang/Object;
|
||
|
|
||
|
monitor-enter v0
|
||
|
|
||
|
:try_start_0
|
||
|
iget-wide v1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
const-wide/16 v3, 0x0
|
||
|
|
||
|
cmp-long v5, v1, v3
|
||
|
|
||
|
if-eqz v5, :cond_0
|
||
|
|
||
|
iget-wide v1, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
invoke-static {v1, v2}, Lorg/webrtc/JniCommon;->nativeReleaseRef(J)V
|
||
|
|
||
|
iput-wide v3, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->nativeAudioDeviceModule:J
|
||
|
|
||
|
:cond_0
|
||
|
monitor-exit v0
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception v1
|
||
|
|
||
|
monitor-exit v0
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
throw v1
|
||
|
.end method
|
||
|
|
||
|
.method public setMicrophoneMute(Z)V
|
||
|
.locals 2
|
||
|
|
||
|
new-instance v0, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v1, "setMicrophoneMute: "
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "JavaAudioDeviceModule"
|
||
|
|
||
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioInput:Lorg/webrtc/audio/WebRtcAudioRecord;
|
||
|
|
||
|
invoke-virtual {v0, p1}, Lorg/webrtc/audio/WebRtcAudioRecord;->setMicrophoneMute(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setSpeakerMute(Z)V
|
||
|
.locals 2
|
||
|
|
||
|
new-instance v0, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v1, "setSpeakerMute: "
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "JavaAudioDeviceModule"
|
||
|
|
||
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/audio/JavaAudioDeviceModule;->audioOutput:Lorg/webrtc/audio/WebRtcAudioTrack;
|
||
|
|
||
|
invoke-virtual {v0, p1}, Lorg/webrtc/audio/WebRtcAudioTrack;->setSpeakerMute(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|