180 lines
4.8 KiB
Smali
180 lines
4.8 KiB
Smali
.class public final Lco/discord/media_engine/CameraVideoSource;
|
|
.super Ljava/lang/Object;
|
|
.source "CameraVideoSource.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/CapturerObserver;
|
|
|
|
|
|
# static fields
|
|
.field public static surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
|
|
# instance fields
|
|
.field public nativeHandle_:J
|
|
|
|
.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/CameraVideoSource;->surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(JLandroid/content/Context;Ljava/lang/String;)V
|
|
.locals 1
|
|
.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
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-wide p1, p0, Lco/discord/media_engine/CameraVideoSource;->nativeHandle_:J
|
|
|
|
new-instance p1, Lorg/webrtc/Camera1Capturer;
|
|
|
|
const/4 p2, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p1, p4, p2, v0}, Lorg/webrtc/Camera1Capturer;-><init>(Ljava/lang/String;Lorg/webrtc/CameraVideoCapturer$CameraEventsHandler;Z)V
|
|
|
|
iput-object p1, p0, Lco/discord/media_engine/CameraVideoSource;->videoCapturer_:Lorg/webrtc/VideoCapturer;
|
|
|
|
sget-object p2, Lco/discord/media_engine/CameraVideoSource;->surfaceTextureHelper_:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
invoke-interface {p1, p2, p3, p0}, Lorg/webrtc/VideoCapturer;->initialize(Lorg/webrtc/SurfaceTextureHelper;Landroid/content/Context;Lorg/webrtc/CapturerObserver;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public dispose()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lco/discord/media_engine/CameraVideoSource;->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/CameraVideoSource;->videoCapturer_:Lorg/webrtc/VideoCapturer;
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/VideoCapturer;->dispose()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lco/discord/media_engine/CameraVideoSource;->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 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 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/CameraVideoSource;->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-virtual/range {v0 .. v8}, Lco/discord/media_engine/CameraVideoSource;->nativeOnFrame(JLorg/webrtc/VideoFrame$Buffer;IIIJ)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public reconfigure(III)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lco/discord/media_engine/CameraVideoSource;->videoCapturer_:Lorg/webrtc/VideoCapturer;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-interface {v0, p1, p2, p3}, Lorg/webrtc/VideoCapturer;->changeCaptureFormat(III)V
|
|
|
|
return-void
|
|
.end method
|