2020-05-17 12:40:10 +00:00
|
|
|
.class public Lorg/webrtc/Camera2Session;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "Camera2Session.java"
|
|
|
|
|
|
|
|
# interfaces
|
|
|
|
.implements Lorg/webrtc/CameraSession;
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
|
|
value = 0x15
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lorg/webrtc/Camera2Session$CameraCaptureCallback;,
|
|
|
|
Lorg/webrtc/Camera2Session$CaptureSessionCallback;,
|
|
|
|
Lorg/webrtc/Camera2Session$CameraStateCallback;,
|
|
|
|
Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final TAG:Ljava/lang/String; = "Camera2Session"
|
|
|
|
|
|
|
|
.field public static final camera2ResolutionHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
.field public static final camera2StartTimeMsHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
.field public static final camera2StopTimeMsHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final applicationContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
.field public final callback:Lorg/webrtc/CameraSession$CreateSessionCallback;
|
|
|
|
|
|
|
|
.field public cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
.field public cameraDevice:Landroid/hardware/camera2/CameraDevice;
|
|
|
|
|
|
|
|
.field public final cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
.field public final cameraManager:Landroid/hardware/camera2/CameraManager;
|
|
|
|
|
|
|
|
.field public cameraOrientation:I
|
|
|
|
|
|
|
|
.field public final cameraThreadHandler:Landroid/os/Handler;
|
|
|
|
|
|
|
|
.field public captureFormat:Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
|
|
|
|
.field public captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
.field public final constructionTimeNs:J
|
|
|
|
|
|
|
|
.field public final events:Lorg/webrtc/CameraSession$Events;
|
|
|
|
|
|
|
|
.field public firstFrameReported:Z
|
|
|
|
|
|
|
|
.field public fpsUnitFactor:I
|
|
|
|
|
|
|
|
.field public final framerate:I
|
|
|
|
|
|
|
|
.field public final height:I
|
|
|
|
|
|
|
|
.field public isCameraFrontFacing:Z
|
|
|
|
|
|
|
|
.field public state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
.field public surface:Landroid/view/Surface;
|
|
|
|
|
|
|
|
.field public final surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
|
|
|
|
.field public final width:I
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 4
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v0, "WebRTC.Android.Camera2.StartTimeMs"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/16 v2, 0x2710
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/16 v3, 0x32
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {v0, v1, v2, v3}, Lorg/webrtc/Histogram;->createCounts(Ljava/lang/String;III)Lorg/webrtc/Histogram;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sput-object v0, Lorg/webrtc/Camera2Session;->camera2StartTimeMsHistogram:Lorg/webrtc/Histogram;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v0, "WebRTC.Android.Camera2.StopTimeMs"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {v0, v1, v2, v3}, Lorg/webrtc/Histogram;->createCounts(Ljava/lang/String;III)Lorg/webrtc/Histogram;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
sput-object v0, Lorg/webrtc/Camera2Session;->camera2StopTimeMsHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
sget-object v0, Lorg/webrtc/CameraEnumerationAndroid;->COMMON_RESOLUTIONS:Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const-string v1, "WebRTC.Android.Camera2.Resolution"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Histogram;->createEnumeration(Ljava/lang/String;I)Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
sput-object v0, Lorg/webrtc/Camera2Session;->camera2ResolutionHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Lorg/webrtc/CameraSession$CreateSessionCallback;Lorg/webrtc/CameraSession$Events;Landroid/content/Context;Landroid/hardware/camera2/CameraManager;Lorg/webrtc/SurfaceTextureHelper;Ljava/lang/String;III)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
sget-object v0, Lorg/webrtc/Camera2Session$SessionState;->RUNNING:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
iput-object v0, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "Create new camera2 session on camera "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "Camera2Session"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
iput-wide v0, p0, Lorg/webrtc/Camera2Session;->constructionTimeNs:J
|
|
|
|
|
|
|
|
new-instance v0, Landroid/os/Handler;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
|
|
|
|
|
|
|
|
iput-object v0, p0, Lorg/webrtc/Camera2Session;->cameraThreadHandler:Landroid/os/Handler;
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/Camera2Session;->callback:Lorg/webrtc/CameraSession$CreateSessionCallback;
|
|
|
|
|
|
|
|
iput-object p2, p0, Lorg/webrtc/Camera2Session;->events:Lorg/webrtc/CameraSession$Events;
|
|
|
|
|
|
|
|
iput-object p3, p0, Lorg/webrtc/Camera2Session;->applicationContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
iput-object p4, p0, Lorg/webrtc/Camera2Session;->cameraManager:Landroid/hardware/camera2/CameraManager;
|
|
|
|
|
|
|
|
iput-object p5, p0, Lorg/webrtc/Camera2Session;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
|
|
|
|
iput-object p6, p0, Lorg/webrtc/Camera2Session;->cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput p7, p0, Lorg/webrtc/Camera2Session;->width:I
|
|
|
|
|
|
|
|
iput p8, p0, Lorg/webrtc/Camera2Session;->height:I
|
|
|
|
|
|
|
|
iput p9, p0, Lorg/webrtc/Camera2Session;->framerate:I
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->start()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$000(Lorg/webrtc/Camera2Session;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$100(Lorg/webrtc/Camera2Session;)Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1000(Lorg/webrtc/Camera2Session;)Landroid/view/Surface;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->surface:Landroid/view/Surface;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1002(Lorg/webrtc/Camera2Session;Landroid/view/Surface;)Landroid/view/Surface;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/Camera2Session;->surface:Landroid/view/Surface;
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$102(Lorg/webrtc/Camera2Session;Landroid/hardware/camera2/CameraCaptureSession;)Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/Camera2Session;->captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1200(Lorg/webrtc/Camera2Session;)Landroid/os/Handler;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->cameraThreadHandler:Landroid/os/Handler;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1300(Lorg/webrtc/Camera2Session;)I
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget p0, p0, Lorg/webrtc/Camera2Session;->fpsUnitFactor:I
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1500(Lorg/webrtc/Camera2Session;)Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1600(Lorg/webrtc/Camera2Session;)Z
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-boolean p0, p0, Lorg/webrtc/Camera2Session;->firstFrameReported:Z
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1602(Lorg/webrtc/Camera2Session;Z)Z
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lorg/webrtc/Camera2Session;->firstFrameReported:Z
|
|
|
|
|
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1700(Lorg/webrtc/Camera2Session;)J
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/Camera2Session;->constructionTimeNs:J
|
|
|
|
|
|
|
|
return-wide v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1800()Lorg/webrtc/Histogram;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget-object v0, Lorg/webrtc/Camera2Session;->camera2StartTimeMsHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$1900(Lorg/webrtc/Camera2Session;)Z
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-boolean p0, p0, Lorg/webrtc/Camera2Session;->isCameraFrontFacing:Z
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$200(Lorg/webrtc/Camera2Session;)Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$2000(Lorg/webrtc/Camera2Session;)I
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget p0, p0, Lorg/webrtc/Camera2Session;->cameraOrientation:I
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$202(Lorg/webrtc/Camera2Session;Lorg/webrtc/Camera2Session$SessionState;)Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$2100(Lorg/webrtc/Camera2Session;)I
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->getFrameOrientation()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$300(Lorg/webrtc/Camera2Session;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->stopInternal()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$400(Lorg/webrtc/Camera2Session;)Lorg/webrtc/CameraSession$CreateSessionCallback;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->callback:Lorg/webrtc/CameraSession$CreateSessionCallback;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$500(Lorg/webrtc/Camera2Session;)Lorg/webrtc/CameraSession$Events;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->events:Lorg/webrtc/CameraSession$Events;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$600(Lorg/webrtc/Camera2Session;Ljava/lang/String;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lorg/webrtc/Camera2Session;->reportError(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$700(Lorg/webrtc/Camera2Session;)Landroid/hardware/camera2/CameraDevice;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->cameraDevice:Landroid/hardware/camera2/CameraDevice;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$702(Lorg/webrtc/Camera2Session;Landroid/hardware/camera2/CameraDevice;)Landroid/hardware/camera2/CameraDevice;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/Camera2Session;->cameraDevice:Landroid/hardware/camera2/CameraDevice;
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$800(Lorg/webrtc/Camera2Session;)Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->captureFormat:Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic access$900(Lorg/webrtc/Camera2Session;)Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lorg/webrtc/Camera2Session;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private checkIsOnCameraThread()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraThreadHandler:Landroid/os/Handler;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
|
|
|
|
const-string v1, "Wrong thread"
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static create(Lorg/webrtc/CameraSession$CreateSessionCallback;Lorg/webrtc/CameraSession$Events;Landroid/content/Context;Landroid/hardware/camera2/CameraManager;Lorg/webrtc/SurfaceTextureHelper;Ljava/lang/String;III)V
|
|
|
|
.locals 10
|
|
|
|
|
|
|
|
new-instance v0, Lorg/webrtc/Camera2Session;
|
|
|
|
|
|
|
|
move-object v1, p0
|
|
|
|
|
|
|
|
move-object v2, p1
|
|
|
|
|
|
|
|
move-object v3, p2
|
|
|
|
|
|
|
|
move-object v4, p3
|
|
|
|
|
|
|
|
move-object v5, p4
|
|
|
|
|
|
|
|
move-object v6, p5
|
|
|
|
|
|
|
|
move/from16 v7, p6
|
|
|
|
|
|
|
|
move/from16 v8, p7
|
|
|
|
|
|
|
|
move/from16 v9, p8
|
|
|
|
|
|
|
|
invoke-direct/range {v0 .. v9}, Lorg/webrtc/Camera2Session;-><init>(Lorg/webrtc/CameraSession$CreateSessionCallback;Lorg/webrtc/CameraSession$Events;Landroid/content/Context;Landroid/hardware/camera2/CameraManager;Lorg/webrtc/SurfaceTextureHelper;Ljava/lang/String;III)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private findCaptureFormat()V
|
|
|
|
.locals 5
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
sget-object v1, Landroid/hardware/camera2/CameraCharacteristics;->CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES:Landroid/hardware/camera2/CameraCharacteristics$Key;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/hardware/camera2/CameraCharacteristics;->get(Landroid/hardware/camera2/CameraCharacteristics$Key;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, [Landroid/util/Range;
|
|
|
|
|
|
|
|
invoke-static {v0}, Lorg/webrtc/Camera2Enumerator;->getFpsUnitFactor([Landroid/util/Range;)I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
iput v1, p0, Lorg/webrtc/Camera2Session;->fpsUnitFactor:I
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Camera2Enumerator;->convertFramerates([Landroid/util/Range;I)Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
invoke-static {v1}, Lorg/webrtc/Camera2Enumerator;->getSupportedSizes(Landroid/hardware/camera2/CameraCharacteristics;)Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v3, "Available preview sizes: "
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
const-string v3, "Camera2Session"
|
|
|
|
|
|
|
|
invoke-static {v3, v2}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v4, "Available fps ranges: "
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-static {v3, v2}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget v2, p0, Lorg/webrtc/Camera2Session;->framerate:I
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Lorg/webrtc/CameraEnumerationAndroid;->getClosestSupportedFramerateRange(Ljava/util/List;I)Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat$FramerateRange;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget v2, p0, Lorg/webrtc/Camera2Session;->width:I
|
|
|
|
|
|
|
|
iget v4, p0, Lorg/webrtc/Camera2Session;->height:I
|
|
|
|
|
|
|
|
invoke-static {v1, v2, v4}, Lorg/webrtc/CameraEnumerationAndroid;->getClosestSupportedSize(Ljava/util/List;II)Lorg/webrtc/Size;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
sget-object v2, Lorg/webrtc/Camera2Session;->camera2ResolutionHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
invoke-static {v2, v1}, Lorg/webrtc/CameraEnumerationAndroid;->reportCameraResolution(Lorg/webrtc/Histogram;Lorg/webrtc/Size;)V
|
|
|
|
|
|
|
|
new-instance v2, Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
|
|
|
|
iget v4, v1, Lorg/webrtc/Size;->width:I
|
|
|
|
|
|
|
|
iget v1, v1, Lorg/webrtc/Size;->height:I
|
|
|
|
|
|
|
|
invoke-direct {v2, v4, v1, v0}, Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;-><init>(IILorg/webrtc/CameraEnumerationAndroid$CaptureFormat$FramerateRange;)V
|
|
|
|
|
|
|
|
iput-object v2, p0, Lorg/webrtc/Camera2Session;->captureFormat:Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
|
|
|
|
const-string v0, "Using capture format: "
|
|
|
|
|
2020-10-03 03:03:24 +00:00
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->captureFormat:Lorg/webrtc/CameraEnumerationAndroid$CaptureFormat;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
invoke-static {v3, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
const-string v0, "No supported capture formats."
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lorg/webrtc/Camera2Session;->reportError(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private getFrameOrientation()I
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->applicationContext:Landroid/content/Context;
|
|
|
|
|
2020-09-29 21:44:44 +00:00
|
|
|
invoke-static {v0}, Lh0/c/g0;->b(Landroid/content/Context;)I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iget-boolean v1, p0, Lorg/webrtc/Camera2Session;->isCameraFrontFacing:Z
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
rsub-int v0, v0, 0x168
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget v1, p0, Lorg/webrtc/Camera2Session;->cameraOrientation:I
|
|
|
|
|
|
|
|
add-int/2addr v1, v0
|
|
|
|
|
|
|
|
rem-int/lit16 v1, v1, 0x168
|
|
|
|
|
|
|
|
return v1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private openCamera()V
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
const-string v0, "Opening camera "
|
|
|
|
|
2020-10-03 03:03:24 +00:00
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "Camera2Session"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->events:Lorg/webrtc/CameraSession$Events;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/CameraSession$Events;->onCameraOpening()V
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->cameraManager:Landroid/hardware/camera2/CameraManager;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
new-instance v2, Lorg/webrtc/Camera2Session$CameraStateCallback;
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v2, p0, v3}, Lorg/webrtc/Camera2Session$CameraStateCallback;-><init>(Lorg/webrtc/Camera2Session;Lorg/webrtc/Camera2Session$1;)V
|
|
|
|
|
|
|
|
iget-object v3, p0, Lorg/webrtc/Camera2Session;->cameraThreadHandler:Landroid/os/Handler;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2, v3}, Landroid/hardware/camera2/CameraManager;->openCamera(Ljava/lang/String;Landroid/hardware/camera2/CameraDevice$StateCallback;Landroid/os/Handler;)V
|
|
|
|
:try_end_0
|
|
|
|
.catch Landroid/hardware/camera2/CameraAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v2, "Failed to open camera: "
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lorg/webrtc/Camera2Session;->reportError(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private reportError(Ljava/lang/String;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "Error: "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "Camera2Session"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
sget-object v1, Lorg/webrtc/Camera2Session$SessionState;->STOPPED:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
sget-object v1, Lorg/webrtc/Camera2Session$SessionState;->STOPPED:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
iput-object v1, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->stopInternal()V
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->callback:Lorg/webrtc/CameraSession$CreateSessionCallback;
|
|
|
|
|
|
|
|
sget-object v1, Lorg/webrtc/CameraSession$FailureType;->ERROR:Lorg/webrtc/CameraSession$FailureType;
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, p1}, Lorg/webrtc/CameraSession$CreateSessionCallback;->onFailure(Lorg/webrtc/CameraSession$FailureType;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->events:Lorg/webrtc/CameraSession$Events;
|
|
|
|
|
|
|
|
invoke-interface {v0, p0, p1}, Lorg/webrtc/CameraSession$Events;->onCameraError(Lorg/webrtc/CameraSession;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private start()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
const-string v0, "Camera2Session"
|
|
|
|
|
|
|
|
const-string v1, "start"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->cameraManager:Landroid/hardware/camera2/CameraManager;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/hardware/camera2/CameraManager;->getCameraCharacteristics(Ljava/lang/String;)Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iput-object v0, p0, Lorg/webrtc/Camera2Session;->cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
:try_end_0
|
|
|
|
.catch Landroid/hardware/camera2/CameraAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
sget-object v1, Landroid/hardware/camera2/CameraCharacteristics;->SENSOR_ORIENTATION:Landroid/hardware/camera2/CameraCharacteristics$Key;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/hardware/camera2/CameraCharacteristics;->get(Landroid/hardware/camera2/CameraCharacteristics$Key;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iput v0, p0, Lorg/webrtc/Camera2Session;->cameraOrientation:I
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->cameraCharacteristics:Landroid/hardware/camera2/CameraCharacteristics;
|
|
|
|
|
|
|
|
sget-object v1, Landroid/hardware/camera2/CameraCharacteristics;->LENS_FACING:Landroid/hardware/camera2/CameraCharacteristics$Key;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/hardware/camera2/CameraCharacteristics;->get(Landroid/hardware/camera2/CameraCharacteristics$Key;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
iput-boolean v0, p0, Lorg/webrtc/Camera2Session;->isCameraFrontFacing:Z
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->findCaptureFormat()V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->openCamera()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
|
|
|
const-string v1, "getCameraCharacteristics(): "
|
|
|
|
|
2020-10-03 03:03:24 +00:00
|
|
|
invoke-static {v1}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/hardware/camera2/CameraAccessException;->getMessage()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lorg/webrtc/Camera2Session;->reportError(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private stopInternal()V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
const-string v0, "Camera2Session"
|
|
|
|
|
|
|
|
const-string v1, "Stop internal"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lorg/webrtc/SurfaceTextureHelper;->stopListening()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/hardware/camera2/CameraCaptureSession;->close()V
|
|
|
|
|
|
|
|
iput-object v2, p0, Lorg/webrtc/Camera2Session;->captureSession:Landroid/hardware/camera2/CameraCaptureSession;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->surface:Landroid/view/Surface;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/view/Surface;->release()V
|
|
|
|
|
|
|
|
iput-object v2, p0, Lorg/webrtc/Camera2Session;->surface:Landroid/view/Surface;
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraDevice:Landroid/hardware/camera2/CameraDevice;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/hardware/camera2/CameraDevice;->close()V
|
|
|
|
|
|
|
|
iput-object v2, p0, Lorg/webrtc/Camera2Session;->cameraDevice:Landroid/hardware/camera2/CameraDevice;
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string v1, "Stop done"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public stop()V
|
|
|
|
.locals 5
|
|
|
|
|
|
|
|
const-string v0, "Stop camera2 session on camera "
|
|
|
|
|
2020-10-03 03:03:24 +00:00
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/Camera2Session;->cameraId:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "Camera2Session"
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->checkIsOnCameraThread()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
sget-object v1, Lorg/webrtc/Camera2Session$SessionState;->STOPPED:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
sget-object v2, Lorg/webrtc/Camera2Session$SessionState;->STOPPED:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
iput-object v2, p0, Lorg/webrtc/Camera2Session;->state:Lorg/webrtc/Camera2Session$SessionState;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/Camera2Session;->stopInternal()V
|
|
|
|
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
sub-long/2addr v3, v0
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3, v4}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
long-to-int v1, v0
|
|
|
|
|
|
|
|
sget-object v0, Lorg/webrtc/Camera2Session;->camera2StopTimeMsHistogram:Lorg/webrtc/Histogram;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Lorg/webrtc/Histogram;->addSample(I)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|