387 lines
9.9 KiB
Smali
387 lines
9.9 KiB
Smali
.class public final Lco/discord/media_engine/VoiceQuality$update$2;
|
|
.super Ljava/lang/Object;
|
|
.source "VoiceQuality.kt"
|
|
|
|
# interfaces
|
|
.implements Ljava/util/function/BiConsumer;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingMethod;
|
|
value = Lco/discord/media_engine/VoiceQuality;->update(Lco/discord/media_engine/Stats;)V
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = null
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
"U:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;",
|
|
"Ljava/util/function/BiConsumer<",
|
|
"Ljava/lang/String;",
|
|
"Lco/discord/media_engine/InboundRtpAudio;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final synthetic $stats:Lco/discord/media_engine/Stats;
|
|
|
|
.field public final synthetic this$0:Lco/discord/media_engine/VoiceQuality;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lco/discord/media_engine/VoiceQuality;Lco/discord/media_engine/Stats;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lco/discord/media_engine/VoiceQuality$update$2;->this$0:Lco/discord/media_engine/VoiceQuality;
|
|
|
|
iput-object p2, p0, Lco/discord/media_engine/VoiceQuality$update$2;->$stats:Lco/discord/media_engine/Stats;
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public bridge synthetic accept(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
check-cast p2, Lco/discord/media_engine/InboundRtpAudio;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lco/discord/media_engine/VoiceQuality$update$2;->accept(Ljava/lang/String;Lco/discord/media_engine/InboundRtpAudio;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final accept(Ljava/lang/String;Lco/discord/media_engine/InboundRtpAudio;)V
|
|
.locals 23
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-object/from16 v1, p1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
iget-object v2, v0, Lco/discord/media_engine/VoiceQuality$update$2;->$stats:Lco/discord/media_engine/Stats;
|
|
|
|
invoke-virtual {v2}, Lco/discord/media_engine/Stats;->getTransport()Lco/discord/media_engine/Transport;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-virtual {v2}, Lco/discord/media_engine/Transport;->getPing()I
|
|
|
|
move-result v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getPacketsReceived()I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getPacketsLost()I
|
|
|
|
move-result v6
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getJitterBuffer()I
|
|
|
|
move-result v4
|
|
|
|
new-instance v13, Lco/discord/media_engine/InboundBufferStats;
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getAudioJitterBuffer()Lco/discord/media_engine/PlayoutMetric;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getAudioJitterTarget()Lco/discord/media_engine/PlayoutMetric;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getAudioJitterDelay()Lco/discord/media_engine/PlayoutMetric;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getRelativeReceptionDelay()Lco/discord/media_engine/PlayoutMetric;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getRelativePlayoutDelay()Lco/discord/media_engine/PlayoutMetric;
|
|
|
|
move-result-object v12
|
|
|
|
move-object v7, v13
|
|
|
|
invoke-direct/range {v7 .. v12}, Lco/discord/media_engine/InboundBufferStats;-><init>(Lco/discord/media_engine/PlayoutMetric;Lco/discord/media_engine/PlayoutMetric;Lco/discord/media_engine/PlayoutMetric;Lco/discord/media_engine/PlayoutMetric;Lco/discord/media_engine/PlayoutMetric;)V
|
|
|
|
new-instance v22, Lco/discord/media_engine/InboundFrameOpStats;
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpSilence()Ljava/lang/Integer;
|
|
|
|
move-result-object v15
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpNormal()Ljava/lang/Integer;
|
|
|
|
move-result-object v16
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpMerge()Ljava/lang/Integer;
|
|
|
|
move-result-object v17
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpExpand()Ljava/lang/Integer;
|
|
|
|
move-result-object v18
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpAccelerate()Ljava/lang/Integer;
|
|
|
|
move-result-object v19
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpPreemptiveExpand()Ljava/lang/Integer;
|
|
|
|
move-result-object v20
|
|
|
|
invoke-virtual/range {p2 .. p2}, Lco/discord/media_engine/InboundRtpAudio;->getOpCNG()Ljava/lang/Integer;
|
|
|
|
move-result-object v21
|
|
|
|
move-object/from16 v14, v22
|
|
|
|
invoke-direct/range {v14 .. v21}, Lco/discord/media_engine/InboundFrameOpStats;-><init>(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
iget-object v7, v0, Lco/discord/media_engine/VoiceQuality$update$2;->this$0:Lco/discord/media_engine/VoiceQuality;
|
|
|
|
invoke-static {v7}, Lco/discord/media_engine/VoiceQuality;->access$get_inboundStats$p(Lco/discord/media_engine/VoiceQuality;)Ljava/util/Map;
|
|
|
|
move-result-object v15
|
|
|
|
iget-object v7, v0, Lco/discord/media_engine/VoiceQuality$update$2;->this$0:Lco/discord/media_engine/VoiceQuality;
|
|
|
|
invoke-static {v7}, Lco/discord/media_engine/VoiceQuality;->access$get_inboundStats$p(Lco/discord/media_engine/VoiceQuality;)Ljava/util/Map;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-interface {v7, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Lco/discord/media_engine/InboundAudio;
|
|
|
|
const/4 v8, 0x1
|
|
|
|
if-eqz v7, :cond_3
|
|
|
|
invoke-virtual {v7}, Lco/discord/media_engine/InboundAudio;->getPacketsReceived()I
|
|
|
|
move-result v9
|
|
|
|
sub-int v9, v5, v9
|
|
|
|
invoke-virtual {v7}, Lco/discord/media_engine/InboundAudio;->getPacketsLost()I
|
|
|
|
move-result v10
|
|
|
|
sub-int v10, v6, v10
|
|
|
|
const-wide/16 v11, 0x0
|
|
|
|
invoke-virtual {v7}, Lco/discord/media_engine/InboundAudio;->getMosBuckets()[Ljava/lang/Integer;
|
|
|
|
move-result-object v14
|
|
|
|
if-lez v9, :cond_1
|
|
|
|
if-ltz v10, :cond_1
|
|
|
|
add-int/2addr v2, v4
|
|
|
|
int-to-double v11, v2
|
|
|
|
int-to-double v3, v10
|
|
|
|
add-int/2addr v9, v10
|
|
|
|
int-to-double v9, v9
|
|
|
|
div-double v16, v3, v9
|
|
|
|
const-wide/16 v18, 0x0
|
|
|
|
const-wide/high16 v20, 0x3ff0000000000000L # 1.0
|
|
|
|
invoke-static/range {v16 .. v21}, Lco/discord/media_engine/VoiceQualityKt;->access$clamp(DDD)D
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v11, v12, v3, v4}, Lco/discord/media_engine/VoiceQualityKt;->access$_calculateMos(DD)D
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->floor(D)D
|
|
|
|
move-result-wide v9
|
|
|
|
double-to-int v9, v9
|
|
|
|
aget-object v10, v14, v9
|
|
|
|
invoke-virtual {v10}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v10
|
|
|
|
add-int/2addr v10, v8
|
|
|
|
invoke-static {v10}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v10
|
|
|
|
aput-object v10, v14, v9
|
|
|
|
move-wide v11, v3
|
|
|
|
:cond_1
|
|
new-instance v3, Lco/discord/media_engine/InboundAudio;
|
|
|
|
invoke-virtual {v7}, Lco/discord/media_engine/InboundAudio;->getMosSum()D
|
|
|
|
move-result-wide v9
|
|
|
|
add-double/2addr v9, v11
|
|
|
|
invoke-virtual {v7}, Lco/discord/media_engine/InboundAudio;->getMosCount()I
|
|
|
|
move-result v4
|
|
|
|
move-wide/from16 v16, v9
|
|
|
|
const/4 v2, 0x0
|
|
|
|
int-to-double v8, v2
|
|
|
|
cmpl-double v7, v11, v8
|
|
|
|
if-lez v7, :cond_2
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v2, 0x0
|
|
|
|
:goto_1
|
|
add-int/2addr v2, v4
|
|
|
|
move-object v4, v3
|
|
|
|
move-wide v7, v11
|
|
|
|
move-wide/from16 v9, v16
|
|
|
|
move v11, v2
|
|
|
|
move-object v12, v14
|
|
|
|
move-object/from16 v14, v22
|
|
|
|
invoke-direct/range {v4 .. v14}, Lco/discord/media_engine/InboundAudio;-><init>(IIDDI[Ljava/lang/Integer;Lco/discord/media_engine/InboundBufferStats;Lco/discord/media_engine/InboundFrameOpStats;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
new-instance v3, Lco/discord/media_engine/InboundAudio;
|
|
|
|
const-wide/16 v7, 0x0
|
|
|
|
const-wide/16 v9, 0x0
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v4, 0x5
|
|
|
|
new-array v12, v4, [Ljava/lang/Integer;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v12, v2
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v4
|
|
|
|
const/4 v14, 0x1
|
|
|
|
aput-object v4, v12, v14
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v14
|
|
|
|
aput-object v14, v12, v4
|
|
|
|
const/4 v4, 0x3
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v14
|
|
|
|
aput-object v14, v12, v4
|
|
|
|
const/4 v4, 0x4
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v12, v4
|
|
|
|
move-object v4, v3
|
|
|
|
move-object/from16 v14, v22
|
|
|
|
invoke-direct/range {v4 .. v14}, Lco/discord/media_engine/InboundAudio;-><init>(IIDDI[Ljava/lang/Integer;Lco/discord/media_engine/InboundBufferStats;Lco/discord/media_engine/InboundFrameOpStats;)V
|
|
|
|
:goto_2
|
|
invoke-interface {v15, v1, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
const-string v1, "userStats"
|
|
|
|
invoke-static {v1}, Lz/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_5
|
|
const-string v1, "userId"
|
|
|
|
invoke-static {v1}, Lz/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|