.class public final Lf/a/h/j; .super Ljava/lang/Object; .source "RtcConnection.kt" # interfaces .implements Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$b; # instance fields .field public final synthetic a:Lcom/discord/rtcconnection/RtcConnection; # direct methods .method public constructor (Lcom/discord/rtcconnection/RtcConnection;)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "()V" } .end annotation iput-object p1, p0, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method # virtual methods .method public onConnected(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;Ljava/util/List;)V .locals 10 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;", "Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;", "Ljava/util/List<", "Lf/a/h/r/a;", ">;)V" } .end annotation const/4 v0, 0x0 if-eqz p1, :cond_8 if-eqz p2, :cond_7 if-eqz p3, :cond_6 iget-object p1, p0, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->e:Lcom/discord/utilities/networking/Backoff; invoke-virtual {v1}, Lcom/discord/utilities/networking/Backoff;->succeed()V iput-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->f:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo; iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->k:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection; if-eqz v1, :cond_1 iget-object v2, p1, Lcom/discord/rtcconnection/RtcConnection;->d:Lf/a/h/t/d; iput-object v0, v2, Lf/a/h/t/d;->a:Lco/discord/media_engine/Stats; new-instance v3, Lco/discord/media_engine/VoiceQuality; invoke-direct {v3}, Lco/discord/media_engine/VoiceQuality;->()V iput-object v3, v2, Lf/a/h/t/d;->b:Lco/discord/media_engine/VoiceQuality; iget-object v3, v2, Lf/a/h/t/d;->c:Lrx/Subscription; if-eqz v3, :cond_0 invoke-interface {v3}, Lrx/Subscription;->isUnsubscribed()Z move-result v3 if-nez v3, :cond_0 invoke-virtual {v2}, Lf/a/h/t/d;->a()V :cond_0 const-wide/16 v3, 0x0 iget-wide v5, v2, Lf/a/h/t/d;->d:J sget-object v7, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-static {v3, v4, v5, v6, v7}, Lrx/Observable;->A(JJLjava/util/concurrent/TimeUnit;)Lrx/Observable; move-result-object v3 new-instance v4, Lf/a/h/t/b; invoke-direct {v4, v2, v1}, Lf/a/h/t/b;->(Lf/a/h/t/d;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;)V new-instance v1, Lf/a/h/t/c; invoke-direct {v1, v2}, Lf/a/h/t/c;->(Lf/a/h/t/d;)V invoke-virtual {v3, v4, v1}, Lrx/Observable;->R(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription; move-result-object v1 iput-object v1, v2, Lf/a/h/t/d;->c:Lrx/Subscription; :cond_1 iget-object v1, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->c:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo$Protocol; invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I move-result v1 const/4 v2, 0x1 if-eqz v1, :cond_2 const-string p3, "Unsupported protocol: " invoke-static {p3}, Lf/e/b/a/a;->D(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p3 iget-object p2, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->c:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo$Protocol; invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; const/16 p2, 0x2e invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-virtual {p1, v2, p2, v0}, Lcom/discord/rtcconnection/RtcConnection;->c(ZLjava/lang/String;Ljava/lang/Throwable;)V goto :goto_1 :cond_2 iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger; iget-object v3, p1, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String; const-string v4, "Sending UDP info to RTC server." invoke-virtual {v1, v4, v3}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb(Ljava/lang/String;Ljava/lang/String;)V iget-object p1, p1, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/h/s/a; if-eqz p1, :cond_5 iget-object v1, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->a:Ljava/lang/String; iget p2, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->b:I if-eqz v1, :cond_4 new-instance v0, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo; const-string/jumbo v3, "xsalsa20_poly1305" invoke-direct {v0, v1, p2, v3}, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo;->(Ljava/lang/String;ILjava/lang/String;)V new-instance p2, Ljava/util/ArrayList; const/16 v1, 0xa invoke-static {p3, v1}, Lj0/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I move-result v1 invoke-direct {p2, v1}, Ljava/util/ArrayList;->(I)V invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object p3 :goto_0 invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_3 invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lf/a/h/r/a; new-instance v9, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$CodecInfo; iget-object v4, v1, Lf/a/h/r/a;->a:Ljava/lang/String; iget v5, v1, Lf/a/h/r/a;->b:I iget-object v6, v1, Lf/a/h/r/a;->c:Ljava/lang/String; iget v7, v1, Lf/a/h/r/a;->d:I iget-object v8, v1, Lf/a/h/r/a;->e:Ljava/lang/Integer; move-object v3, v9 invoke-direct/range {v3 .. v8}, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$CodecInfo;->(Ljava/lang/String;ILjava/lang/String;ILjava/lang/Integer;)V invoke-virtual {p2, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z goto :goto_0 :cond_3 new-instance p3, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol; const-string v1, "udp" invoke-direct {p3, v1, v0, p2}, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol;->(Ljava/lang/String;Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo;Ljava/util/List;)V invoke-virtual {p1, v2, p3}, Lf/a/h/s/a;->m(ILjava/lang/Object;)V goto :goto_1 :cond_4 const-string p1, "address" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 :cond_5 :goto_1 return-void :cond_6 const-string p1, "supportedVideoCodecs" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 :cond_7 const-string p1, "transportInfo" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 :cond_8 const-string p1, "connection" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 .end method .method public onConnectionStateChange(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$ConnectionState;)V .locals 5 const/4 v0, 0x0 if-eqz p1, :cond_a if-eqz p2, :cond_9 iget-object p1, p0, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State; iget-object v2, p1, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger; new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v4, "Connection state change: " invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 iget-object v4, p1, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String; invoke-virtual {v2, v3, v4}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb(Ljava/lang/String;Ljava/lang/String;)V invoke-virtual {p2}, Ljava/lang/Enum;->ordinal()I move-result p2 const/4 v2, 0x1 if-eqz p2, :cond_3 if-eq p2, v2, :cond_2 const/4 v3, 0x2 if-eq p2, v3, :cond_1 const/4 v3, 0x3 if-ne p2, v3, :cond_0 sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$e;->a:Lcom/discord/rtcconnection/RtcConnection$State$e; goto :goto_0 :cond_0 new-instance p1, Lkotlin/NoWhenBranchMatchedException; invoke-direct {p1}, Lkotlin/NoWhenBranchMatchedException;->()V throw p1 :cond_1 sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f; goto :goto_0 :cond_2 sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$g;->a:Lcom/discord/rtcconnection/RtcConnection$State$g; goto :goto_0 :cond_3 sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$h;->a:Lcom/discord/rtcconnection/RtcConnection$State$h; :goto_0 invoke-virtual {p1, p2}, Lcom/discord/rtcconnection/RtcConnection;->l(Lcom/discord/rtcconnection/RtcConnection$State;)V sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$g;->a:Lcom/discord/rtcconnection/RtcConnection$State$g; if-ne v1, p2, :cond_4 iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State; sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$h;->a:Lcom/discord/rtcconnection/RtcConnection$State$h; if-ne p2, v1, :cond_4 invoke-virtual {p1}, Lcom/discord/rtcconnection/RtcConnection;->j()V :cond_4 iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State; sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f; if-ne p2, v1, :cond_8 iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->D:Lcom/discord/utilities/time/Clock; invoke-interface {p2}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J move-result-wide v3 invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p2 iput-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->p:Ljava/lang/Long; iput-boolean v2, p1, Lcom/discord/rtcconnection/RtcConnection;->r:Z new-array p2, v2, [Lkotlin/Pair; const/4 v1, 0x0 iget v2, p1, Lcom/discord/rtcconnection/RtcConnection;->q:I invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v2 new-instance v3, Lkotlin/Pair; const-string v4, "connect_count" invoke-direct {v3, v4, v2}, Lkotlin/Pair;->(Ljava/lang/Object;Ljava/lang/Object;)V aput-object v3, p2, v1 invoke-static {p2}, Lj0/f;->mutableMapOf([Lkotlin/Pair;)Ljava/util/Map; move-result-object p2 iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->o:Ljava/lang/Long; iget-object v2, p1, Lcom/discord/rtcconnection/RtcConnection;->p:Ljava/lang/Long; if-eqz v2, :cond_6 if-nez v1, :cond_5 goto :goto_1 :cond_5 invoke-virtual {v2}, Ljava/lang/Long;->longValue()J move-result-wide v2 invoke-virtual {v1}, Ljava/lang/Long;->longValue()J move-result-wide v0 sub-long/2addr v2, v0 invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 :cond_6 :goto_1 if-eqz v0, :cond_7 invoke-virtual {v0}, Ljava/lang/Number;->longValue()J move-result-wide v0 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v0 move-object v1, p2 check-cast v1, Ljava/util/HashMap; const-string v2, "connect_time" invoke-virtual {v1, v2, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :cond_7 invoke-virtual {p1, p2}, Lcom/discord/rtcconnection/RtcConnection;->a(Ljava/util/Map;)Ljava/util/Map; sget-object v0, Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;->VOICE_CONNECTION_SUCCESS:Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent; invoke-virtual {p1, v0, p2}, Lcom/discord/rtcconnection/RtcConnection;->h(Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;Ljava/util/Map;)V :cond_8 return-void :cond_9 const-string p1, "connectionState" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 :cond_a const-string p1, "connection" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 .end method .method public onDestroy(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;)V .locals 0 if-eqz p1, :cond_0 return-void :cond_0 const-string p1, "connection" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public onError(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException;)V .locals 8 const/4 v0, 0x0 if-eqz p1, :cond_4 if-eqz p2, :cond_3 iget-object p1, p0, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; if-eqz p1, :cond_2 const-string v0, "connection error: " invoke-static {v0}, Lf/e/b/a/a;->D(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException;->type:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException$FailureType; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 iget-object v1, p2, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException;->type:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException$FailureType; invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I move-result v1 const/4 v2, 0x1 const/4 v3, 0x0 if-eqz v1, :cond_0 if-eq v1, v2, :cond_0 const/4 v4, 0x2 if-eq v1, v4, :cond_0 const/4 v1, 0x0 goto :goto_0 :cond_0 const/4 v1, 0x1 :goto_0 if-eqz v1, :cond_1 iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger; const-string v3, " -- " invoke-static {v0, v3}, Lf/e/b/a/a;->H(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {p2}, Ljava/lang/Exception;->getMessage()Ljava/lang/String; move-result-object v4 invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 iget-object v4, p1, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String; invoke-virtual {v1, v3, v4}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb(Ljava/lang/String;Ljava/lang/String;)V goto :goto_1 :cond_1 sget-object v1, Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;->VOICE_CONNECTION_FAILURE:Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent; new-array v4, v2, [Lkotlin/Pair; iget v5, p1, Lcom/discord/rtcconnection/RtcConnection;->q:I invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v5 new-instance v6, Lkotlin/Pair; const-string v7, "connect_count" invoke-direct {v6, v7, v5}, Lkotlin/Pair;->(Ljava/lang/Object;Ljava/lang/Object;)V aput-object v6, v4, v3 invoke-static {v4}, Lj0/f;->mutableMapOf([Lkotlin/Pair;)Ljava/util/Map; move-result-object v3 invoke-virtual {p1, v3}, Lcom/discord/rtcconnection/RtcConnection;->a(Ljava/util/Map;)Ljava/util/Map; invoke-virtual {p1, v1, v3}, Lcom/discord/rtcconnection/RtcConnection;->h(Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;Ljava/util/Map;)V :goto_1 invoke-virtual {p1, v2, v0, p2}, Lcom/discord/rtcconnection/RtcConnection;->c(ZLjava/lang/String;Ljava/lang/Throwable;)V return-void :cond_2 throw v0 :cond_3 const-string p1, "exception" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 :cond_4 const-string p1, "connection" invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V throw v0 .end method .method public onSpeaking(JIZ)V .locals 11 iget-object v0, p0, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; iget-wide v1, v0, Lcom/discord/rtcconnection/RtcConnection;->A:J cmp-long v3, p1, v1 if-nez v3, :cond_0 iget-object v1, v0, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/h/s/a; if-eqz v1, :cond_0 const/4 v2, 0x5 new-instance v10, Lcom/discord/rtcconnection/socket/io/Payloads$Speaking; invoke-static {p4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v5 const/4 v3, 0x0 invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v6 const/4 v7, 0x0 const/16 v8, 0x8 const/4 v9, 0x0 move-object v3, v10 move v4, p3 invoke-direct/range {v3 .. v9}, Lcom/discord/rtcconnection/socket/io/Payloads$Speaking;->(ILjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;ILkotlin/jvm/internal/DefaultConstructorMarker;)V invoke-virtual {v1, v2, v10}, Lf/a/h/s/a;->m(ILjava/lang/Object;)V :cond_0 new-instance p3, Lf/a/h/k; invoke-direct {p3, p1, p2, p4}, Lf/a/h/k;->(JZ)V invoke-virtual {v0, p3}, Lcom/discord/rtcconnection/RtcConnection;->i(Lkotlin/jvm/functions/Function1;)V return-void .end method .method public onVideo(JLjava/lang/Integer;III)V .locals 13 move-wide v0, p1 move-object v2, p0 iget-object v3, v2, Lf/a/h/j;->a:Lcom/discord/rtcconnection/RtcConnection; iget-wide v4, v3, Lcom/discord/rtcconnection/RtcConnection;->A:J cmp-long v6, v0, v4 if-nez v6, :cond_0 iget-object v4, v3, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/h/s/a; if-eqz v4, :cond_0 new-instance v12, Lcom/discord/rtcconnection/socket/io/Payloads$Video; const/4 v9, 0x0 const/16 v10, 0x8 const/4 v11, 0x0 move-object v5, v12 move/from16 v6, p4 move/from16 v7, p5 move/from16 v8, p6 invoke-direct/range {v5 .. v11}, Lcom/discord/rtcconnection/socket/io/Payloads$Video;->(IIILjava/lang/Long;ILkotlin/jvm/internal/DefaultConstructorMarker;)V const/16 v5, 0xc invoke-virtual {v4, v5, v12}, Lf/a/h/s/a;->m(ILjava/lang/Object;)V :cond_0 new-instance v4, Lf/a/h/l; move-object/from16 v5, p3 invoke-direct {v4, p1, p2, v5}, Lf/a/h/l;->(JLjava/lang/Integer;)V invoke-virtual {v3, v4}, Lcom/discord/rtcconnection/RtcConnection;->i(Lkotlin/jvm/functions/Function1;)V return-void .end method