apkfuckery/com.discord/smali/co/discord/media_engine/NativeCapturerObserver.smali

234 lines
6.4 KiB
Smali

.class public final Lco/discord/media_engine/NativeCapturerObserver;
.super Ljava/lang/Object;
.source "NativeCapturerObserver.java"
# interfaces
.implements Lorg/webrtc/CapturerObserver;
# static fields
.field public static surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
# instance fields
.field public nativeHandle_:J
.field public startCaptureOnReconfigure_:Z
.field public videoCapturer_:Lorg/webrtc/VideoCapturer;
# direct methods
.method public static constructor <clinit>()V
.locals 2
const-string v0, "discord"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
invoke-static {}, Lco/discord/media_engine/SharedEglBaseContext;->getEglContext()Lorg/webrtc/EglBase$Context;
move-result-object v0
const-string v1, "SurfaceTextureHelperThread"
invoke-static {v1, v0}, Lorg/webrtc/SurfaceTextureHelper;->create(Ljava/lang/String;Lorg/webrtc/EglBase$Context;)Lorg/webrtc/SurfaceTextureHelper;
move-result-object v0
sput-object v0, Lco/discord/media_engine/NativeCapturerObserver;->surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
return-void
.end method
.method public constructor <init>(JLandroid/content/Context;Ljava/lang/String;)V
.locals 3
.param p3 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p4 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
new-instance v0, Lorg/webrtc/Camera1Capturer;
const/4 v1, 0x0
const/4 v2, 0x0
invoke-direct {v0, p4, v1, v2}, Lorg/webrtc/Camera1Capturer;-><init>(Ljava/lang/String;Lorg/webrtc/CameraVideoCapturer$CameraEventsHandler;Z)V
invoke-direct {p0, p1, p2, p3, v0}, Lco/discord/media_engine/NativeCapturerObserver;-><init>(JLandroid/content/Context;Lorg/webrtc/VideoCapturer;)V
return-void
.end method
.method public constructor <init>(JLandroid/content/Context;Lorg/webrtc/VideoCapturer;)V
.locals 1
.param p3 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p4 # Lorg/webrtc/VideoCapturer;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput-boolean v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->startCaptureOnReconfigure_:Z
const/4 v0, 0x1
iput-boolean v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->startCaptureOnReconfigure_:Z
iput-wide p1, p0, Lco/discord/media_engine/NativeCapturerObserver;->nativeHandle_:J
iput-object p4, p0, Lco/discord/media_engine/NativeCapturerObserver;->videoCapturer_:Lorg/webrtc/VideoCapturer;
sget-object p1, Lco/discord/media_engine/NativeCapturerObserver;->surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
invoke-interface {p4, p1, p3, p0}, Lorg/webrtc/VideoCapturer;->initialize(Lorg/webrtc/SurfaceTextureHelper;Landroid/content/Context;Lorg/webrtc/CapturerObserver;)V
return-void
.end method
.method private native nativeOnFrame(JLorg/webrtc/VideoFrame$Buffer;IIIJ)V
.param p3 # Lorg/webrtc/VideoFrame$Buffer;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.end method
.method private native nativeRepeatLastFrame(JJ)V
.end method
# virtual methods
.method public dispose()V
.locals 2
iget-object v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->videoCapturer_:Lorg/webrtc/VideoCapturer;
if-eqz v0, :cond_0
:try_start_0
invoke-interface {v0}, Lorg/webrtc/VideoCapturer;->stopCapture()V
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
iget-object v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->videoCapturer_:Lorg/webrtc/VideoCapturer;
invoke-interface {v0}, Lorg/webrtc/VideoCapturer;->dispose()V
const/4 v0, 0x0
iput-object v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->videoCapturer_:Lorg/webrtc/VideoCapturer;
goto :goto_0
:catch_0
move-exception v0
new-instance v1, Ljava/lang/RuntimeException;
invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw v1
:cond_0
:goto_0
return-void
.end method
.method public onCapturerStarted(Z)V
.locals 0
return-void
.end method
.method public onCapturerStopped()V
.locals 0
return-void
.end method
.method public onFrameCaptured(Lorg/webrtc/VideoFrame;)V
.locals 9
.param p1 # Lorg/webrtc/VideoFrame;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
iget-wide v1, p0, Lco/discord/media_engine/NativeCapturerObserver;->nativeHandle_:J
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getBuffer()Lorg/webrtc/VideoFrame$Buffer;
move-result-object v3
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getRotatedWidth()I
move-result v4
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getRotatedHeight()I
move-result v5
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getRotation()I
move-result v6
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->getTimestampNs()J
move-result-wide v7
move-object v0, p0
invoke-direct/range {v0 .. v8}, Lco/discord/media_engine/NativeCapturerObserver;->nativeOnFrame(JLorg/webrtc/VideoFrame$Buffer;IIIJ)V
return-void
.end method
.method public reconfigure(III)V
.locals 2
iget-object v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->videoCapturer_:Lorg/webrtc/VideoCapturer;
if-nez v0, :cond_0
return-void
:cond_0
iget-boolean v1, p0, Lco/discord/media_engine/NativeCapturerObserver;->startCaptureOnReconfigure_:Z
if-eqz v1, :cond_1
const/4 v1, 0x0
iput-boolean v1, p0, Lco/discord/media_engine/NativeCapturerObserver;->startCaptureOnReconfigure_:Z
invoke-interface {v0, p1, p2, p3}, Lorg/webrtc/VideoCapturer;->startCapture(III)V
goto :goto_0
:cond_1
invoke-interface {v0, p1, p2, p3}, Lorg/webrtc/VideoCapturer;->changeCaptureFormat(III)V
:goto_0
return-void
.end method
.method public repeatLastFrame(J)V
.locals 2
iget-wide v0, p0, Lco/discord/media_engine/NativeCapturerObserver;->nativeHandle_:J
invoke-direct {p0, v0, v1, p1, p2}, Lco/discord/media_engine/NativeCapturerObserver;->nativeRepeatLastFrame(JJ)V
return-void
.end method