277 lines
6.3 KiB
Smali
277 lines
6.3 KiB
Smali
.class public Lorg/webrtc/RtpSender;
|
|
.super Ljava/lang/Object;
|
|
.source "RtpSender.java"
|
|
|
|
|
|
# instance fields
|
|
.field public cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
.field public final dtmfSender:Lorg/webrtc/DtmfSender;
|
|
|
|
.field public nativeRtpSender:J
|
|
|
|
.field public ownsTrack:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(J)V
|
|
.locals 3
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lorg/webrtc/RtpSender;->ownsTrack:Z
|
|
|
|
iput-wide p1, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-static {p1, p2}, Lorg/webrtc/RtpSender;->nativeGetTrack(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/MediaStreamTrack;->createMediaStreamTrack(J)Lorg/webrtc/MediaStreamTrack;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/RtpSender;->cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
invoke-static {p1, p2}, Lorg/webrtc/RtpSender;->nativeGetDtmfSender(J)J
|
|
|
|
move-result-wide p1
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v2, p1, v0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
new-instance v0, Lorg/webrtc/DtmfSender;
|
|
|
|
invoke-direct {v0, p1, p2}, Lorg/webrtc/DtmfSender;-><init>(J)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iput-object v0, p0, Lorg/webrtc/RtpSender;->dtmfSender:Lorg/webrtc/DtmfSender;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private checkRtpSenderExists()V
|
|
.locals 5
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "RtpSender has been disposed."
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static native nativeGetDtmfSender(J)J
|
|
.end method
|
|
|
|
.method public static native nativeGetId(J)Ljava/lang/String;
|
|
.end method
|
|
|
|
.method public static native nativeGetParameters(J)Lorg/webrtc/RtpParameters;
|
|
.end method
|
|
|
|
.method public static native nativeGetTrack(J)J
|
|
.end method
|
|
|
|
.method public static native nativeSetFrameEncryptor(JJ)V
|
|
.end method
|
|
|
|
.method public static native nativeSetParameters(JLorg/webrtc/RtpParameters;)Z
|
|
.end method
|
|
|
|
.method public static native nativeSetTrack(JJ)Z
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public dispose()V
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RtpSender;->dtmfSender:Lorg/webrtc/DtmfSender;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/DtmfSender;->dispose()V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/webrtc/RtpSender;->cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-boolean v1, p0, Lorg/webrtc/RtpSender;->ownsTrack:Z
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/MediaStreamTrack;->dispose()V
|
|
|
|
:cond_1
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/JniCommon;->nativeReleaseRef(J)V
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
iput-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public dtmf()Lorg/webrtc/DtmfSender;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RtpSender;->dtmfSender:Lorg/webrtc/DtmfSender;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getNativeRtpSender()J
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public getParameters()Lorg/webrtc/RtpParameters;
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/RtpSender;->nativeGetParameters(J)Lorg/webrtc/RtpParameters;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public id()Ljava/lang/String;
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/RtpSender;->nativeGetId(J)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public setFrameEncryptor(Lorg/webrtc/FrameEncryptor;)V
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-interface {p1}, Lorg/webrtc/FrameEncryptor;->getNativeFrameEncryptor()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v0, v1, v2, v3}, Lorg/webrtc/RtpSender;->nativeSetFrameEncryptor(JJ)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setParameters(Lorg/webrtc/RtpParameters;)Z
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
invoke-static {v0, v1, p1}, Lorg/webrtc/RtpSender;->nativeSetParameters(JLorg/webrtc/RtpParameters;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public setTrack(Lorg/webrtc/MediaStreamTrack;Z)Z
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/RtpSender;->checkRtpSenderExists()V
|
|
|
|
iget-wide v0, p0, Lorg/webrtc/RtpSender;->nativeRtpSender:J
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lorg/webrtc/MediaStreamTrack;->getNativeMediaStreamTrack()J
|
|
|
|
move-result-wide v2
|
|
|
|
:goto_0
|
|
invoke-static {v0, v1, v2, v3}, Lorg/webrtc/RtpSender;->nativeSetTrack(JJ)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lorg/webrtc/RtpSender;->cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-boolean v1, p0, Lorg/webrtc/RtpSender;->ownsTrack:Z
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/MediaStreamTrack;->dispose()V
|
|
|
|
:cond_2
|
|
iput-object p1, p0, Lorg/webrtc/RtpSender;->cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
iput-boolean p2, p0, Lorg/webrtc/RtpSender;->ownsTrack:Z
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public track()Lorg/webrtc/MediaStreamTrack;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RtpSender;->cachedTrack:Lorg/webrtc/MediaStreamTrack;
|
|
|
|
return-object v0
|
|
.end method
|