169 lines
6.8 KiB
Java
169 lines
6.8 KiB
Java
package com.discord.p000native.engine;
|
|
|
|
import android.content.Context;
|
|
import c0.z.d.m;
|
|
import co.discord.media_engine.CameraEnumeratorProvider;
|
|
import co.discord.media_engine.SharedEglBaseContext;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import org.webrtc.EglBase;
|
|
import org.webrtc.VideoFrame;
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine reason: invalid package */
|
|
public final class NativeEngine {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final int LOGLEVEL_DEBUG = 2;
|
|
public static final int LOGLEVEL_DEFAULT = -1;
|
|
private final int logLevel;
|
|
private final long nativeInstance;
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$Companion */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$ConnectToServerCallback */
|
|
public interface ConnectToServerCallback {
|
|
void onConnectToServer(ConnectionInfo connectionInfo, String str);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$DeviceChangeCallback */
|
|
public interface DeviceChangeCallback {
|
|
void onChange(AudioInputDeviceDescription[] audioInputDeviceDescriptionArr, AudioOutputDeviceDescription[] audioOutputDeviceDescriptionArr, VideoInputDeviceDescription[] videoInputDeviceDescriptionArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetAudioInputDevicesCallback */
|
|
public interface GetAudioInputDevicesCallback {
|
|
void onDevices(AudioInputDeviceDescription[] audioInputDeviceDescriptionArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetAudioOutputDevicesCallback */
|
|
public interface GetAudioOutputDevicesCallback {
|
|
void onDevices(AudioOutputDeviceDescription[] audioOutputDeviceDescriptionArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetAudioSubsystemCallback */
|
|
public interface GetAudioSubsystemCallback {
|
|
void onAudioSubsystem(String str, String str2);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetRankedRtcRegionsCallback */
|
|
public interface GetRankedRtcRegionsCallback {
|
|
void onRankedRtcRegions(String[] strArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetSupportedVideoCodecsCallback */
|
|
public interface GetSupportedVideoCodecsCallback {
|
|
void onSupportedVideoCodecs(String[] strArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$GetVideoInputDevicesCallback */
|
|
public interface GetVideoInputDevicesCallback {
|
|
void onDevices(VideoInputDeviceDescription[] videoInputDeviceDescriptionArr);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$OnNoInputCallback */
|
|
public interface OnNoInputCallback {
|
|
void onNoInput(boolean z2);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$OnVoiceCallback */
|
|
public interface OnVoiceCallback {
|
|
void onVoice(float f, int i);
|
|
}
|
|
|
|
/* compiled from: NativeEngine.kt */
|
|
/* renamed from: com.discord.native.engine.NativeEngine$VideoFrameCallback */
|
|
public interface VideoFrameCallback {
|
|
boolean onFrame(VideoFrame videoFrame);
|
|
}
|
|
|
|
static {
|
|
System.loadLibrary("discord");
|
|
}
|
|
|
|
public NativeEngine(Context context, int i) {
|
|
m.checkNotNullParameter(context, "context");
|
|
this.logLevel = i;
|
|
Context applicationContext = context.getApplicationContext();
|
|
m.checkNotNullExpressionValue(applicationContext, "context.applicationContext");
|
|
CameraEnumeratorProvider.maybeInit(applicationContext);
|
|
Context applicationContext2 = context.getApplicationContext();
|
|
m.checkNotNullExpressionValue(applicationContext2, "context.applicationContext");
|
|
EglBase.Context eglContext = SharedEglBaseContext.getEglContext();
|
|
m.checkNotNullExpressionValue(eglContext, "SharedEglBaseContext.getEglContext()");
|
|
this.nativeInstance = nativeCreateInstance(applicationContext2, eglContext, i);
|
|
}
|
|
|
|
private final native long nativeCreateInstance(Context context, EglBase.Context context2, int i);
|
|
|
|
private final native void nativeDestroyInstance();
|
|
|
|
public final native NativeConnection createVoiceConnection(long j, String str, String str2, int i, String str3, String str4, ConnectToServerCallback connectToServerCallback);
|
|
|
|
public final void dispose() {
|
|
nativeDestroyInstance();
|
|
}
|
|
|
|
public final native void enableBuiltInAEC(boolean z2);
|
|
|
|
public final native void getAudioSubsystem(GetAudioSubsystemCallback getAudioSubsystemCallback);
|
|
|
|
public final native void getInputDevices(GetAudioInputDevicesCallback getAudioInputDevicesCallback);
|
|
|
|
public final native void getOutputDevices(GetAudioOutputDevicesCallback getAudioOutputDevicesCallback);
|
|
|
|
public final native void getSupportedVideoCodecs(GetSupportedVideoCodecsCallback getSupportedVideoCodecsCallback);
|
|
|
|
public final native void getVideoInputDevices(GetVideoInputDevicesCallback getVideoInputDevicesCallback);
|
|
|
|
public final native void rankRtcRegions(String str, GetRankedRtcRegionsCallback getRankedRtcRegionsCallback);
|
|
|
|
public final native void setAudioInputEnabled(boolean z2);
|
|
|
|
public final native void setEmitVADLevel(boolean z2, boolean z3, String str);
|
|
|
|
public final native void setInputDevice(String str);
|
|
|
|
public final native void setInputDeviceIndex(int i);
|
|
|
|
public final native void setInputVolume(float f);
|
|
|
|
public final native void setNoInputThreshold(float f);
|
|
|
|
public final native void setOnDeviceChangeCallback(DeviceChangeCallback deviceChangeCallback);
|
|
|
|
public final native void setOnNoInputCallback(OnNoInputCallback onNoInputCallback);
|
|
|
|
public final native void setOnVoiceCallback(OnVoiceCallback onVoiceCallback);
|
|
|
|
public final native void setOutputDevice(String str);
|
|
|
|
public final native void setOutputDeviceIndex(int i);
|
|
|
|
public final native void setOutputVolume(float f);
|
|
|
|
public final native void setTransportOptions(String str);
|
|
|
|
public final native void setVideoInputDevice(String str);
|
|
|
|
public final native void setVideoInputDeviceIndex(int i);
|
|
|
|
public final native void setVideoOutputSink(String str, VideoFrameCallback videoFrameCallback);
|
|
}
|