135 lines
4.1 KiB
Smali
135 lines
4.1 KiB
Smali
.class public Lorg/webrtc/DefaultVideoEncoderFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "DefaultVideoEncoderFactory.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
|
|
# instance fields
|
|
.field public final hardwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
.field public final softwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lorg/webrtc/EglBase$Context;ZZ)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Lorg/webrtc/SoftwareVideoEncoderFactory;
|
|
|
|
invoke-direct {v0}, Lorg/webrtc/SoftwareVideoEncoderFactory;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->softwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
new-instance v0, Lorg/webrtc/HardwareVideoEncoderFactory;
|
|
|
|
invoke-direct {v0, p1, p2, p3}, Lorg/webrtc/HardwareVideoEncoderFactory;-><init>(Lorg/webrtc/EglBase$Context;ZZ)V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->hardwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lorg/webrtc/VideoEncoderFactory;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Lorg/webrtc/SoftwareVideoEncoderFactory;
|
|
|
|
invoke-direct {v0}, Lorg/webrtc/SoftwareVideoEncoderFactory;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->softwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
iput-object p1, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->hardwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public createEncoder(Lorg/webrtc/VideoCodecInfo;)Lorg/webrtc/VideoEncoder;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->softwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
invoke-interface {v0, p1}, Lorg/webrtc/VideoEncoderFactory;->createEncoder(Lorg/webrtc/VideoCodecInfo;)Lorg/webrtc/VideoEncoder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->hardwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
invoke-interface {v1, p1}, Lorg/webrtc/VideoEncoderFactory;->createEncoder(Lorg/webrtc/VideoCodecInfo;)Lorg/webrtc/VideoEncoder;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
new-instance v1, Lorg/webrtc/VideoEncoderFallback;
|
|
|
|
invoke-direct {v1, v0, p1}, Lorg/webrtc/VideoEncoderFallback;-><init>(Lorg/webrtc/VideoEncoder;Lorg/webrtc/VideoEncoder;)V
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object p1, v0
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public getSupportedCodecs()[Lorg/webrtc/VideoCodecInfo;
|
|
.locals 2
|
|
|
|
new-instance v0, Ljava/util/LinkedHashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V
|
|
|
|
iget-object v1, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->softwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
invoke-interface {v1}, Lorg/webrtc/VideoEncoderFactory;->getSupportedCodecs()[Lorg/webrtc/VideoCodecInfo;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/LinkedHashSet;->addAll(Ljava/util/Collection;)Z
|
|
|
|
iget-object v1, p0, Lorg/webrtc/DefaultVideoEncoderFactory;->hardwareVideoEncoderFactory:Lorg/webrtc/VideoEncoderFactory;
|
|
|
|
invoke-interface {v1}, Lorg/webrtc/VideoEncoderFactory;->getSupportedCodecs()[Lorg/webrtc/VideoCodecInfo;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/LinkedHashSet;->addAll(Ljava/util/Collection;)Z
|
|
|
|
invoke-virtual {v0}, Ljava/util/LinkedHashSet;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v1, v1, [Lorg/webrtc/VideoCodecInfo;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/LinkedHashSet;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Lorg/webrtc/VideoCodecInfo;
|
|
|
|
return-object v0
|
|
.end method
|