This commit is contained in:
2022-06-10 21:38:30 +09:00
commit 27f5152838
51323 changed files with 12934539 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,300 @@
.class public final Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;
.super Lcom/google/android/exoplayer2/text/SimpleSubtitleDecoder;
.source "Mp4WebvttDecoder.java"
# static fields
.field private static final BOX_HEADER_SIZE:I = 0x8
.field private static final TYPE_payl:I
.field private static final TYPE_sttg:I
.field private static final TYPE_vttc:I
# instance fields
.field private final builder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.field private final sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
# direct methods
.method public static constructor <clinit>()V
.locals 1
const-string v0, "payl"
.line 1
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Util;->getIntegerCodeForString(Ljava/lang/String;)I
move-result v0
sput v0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_payl:I
const-string v0, "sttg"
.line 2
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Util;->getIntegerCodeForString(Ljava/lang/String;)I
move-result v0
sput v0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_sttg:I
const-string v0, "vttc"
.line 3
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Util;->getIntegerCodeForString(Ljava/lang/String;)I
move-result v0
sput v0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_vttc:I
return-void
.end method
.method public constructor <init>()V
.locals 1
const-string v0, "Mp4WebvttDecoder"
.line 1
invoke-direct {p0, v0}, Lcom/google/android/exoplayer2/text/SimpleSubtitleDecoder;-><init>(Ljava/lang/String;)V
.line 2
new-instance v0, Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-direct {v0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
.line 3
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
invoke-direct {v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->builder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
return-void
.end method
.method private static parseVttCueBox(Lcom/google/android/exoplayer2/util/ParsableByteArray;Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;I)Lcom/google/android/exoplayer2/text/Cue;
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 1
invoke-virtual {p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->reset()V
:cond_0
:goto_0
if-lez p2, :cond_3
const/16 v0, 0x8
if-lt p2, v0, :cond_2
.line 2
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readInt()I
move-result v1
.line 3
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readInt()I
move-result v2
add-int/lit8 p2, p2, -0x8
sub-int/2addr v1, v0
.line 4
new-instance v0, Ljava/lang/String;
iget-object v3, p0, Lcom/google/android/exoplayer2/util/ParsableByteArray;->data:[B
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->getPosition()I
move-result v4
invoke-direct {v0, v3, v4, v1}, Ljava/lang/String;-><init>([BII)V
.line 5
invoke-virtual {p0, v1}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->skipBytes(I)V
sub-int/2addr p2, v1
.line 6
sget v1, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_sttg:I
if-ne v2, v1, :cond_1
.line 7
invoke-static {v0, p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;->parseCueSettingsList(Ljava/lang/String;Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;)V
goto :goto_0
.line 8
:cond_1
sget v1, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_payl:I
if-ne v2, v1, :cond_0
const/4 v1, 0x0
.line 9
invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v0
.line 10
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object v2
.line 11
invoke-static {v1, v0, p1, v2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;->parseCueText(Ljava/lang/String;Ljava/lang/String;Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;Ljava/util/List;)V
goto :goto_0
.line 12
:cond_2
new-instance p0, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
const-string p1, "Incomplete vtt cue box header found."
invoke-direct {p0, p1}, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;-><init>(Ljava/lang/String;)V
throw p0
.line 13
:cond_3
invoke-virtual {p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->build()Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
move-result-object p0
return-object p0
.end method
# virtual methods
.method public bridge synthetic decode([BIZ)Lcom/google/android/exoplayer2/text/Subtitle;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 1
invoke-virtual {p0, p1, p2, p3}, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->decode([BIZ)Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;
move-result-object p1
return-object p1
.end method
.method public decode([BIZ)Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 2
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p3, p1, p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->reset([BI)V
.line 3
new-instance p1, Ljava/util/ArrayList;
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
.line 4
:goto_0
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->bytesLeft()I
move-result p2
if-lez p2, :cond_2
.line 5
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->bytesLeft()I
move-result p2
const/16 p3, 0x8
if-lt p2, p3, :cond_1
.line 6
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readInt()I
move-result p2
.line 7
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p3}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readInt()I
move-result p3
.line 8
sget v0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->TYPE_vttc:I
if-ne p3, v0, :cond_0
.line 9
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->builder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
add-int/lit8 p2, p2, -0x8
invoke-static {p3, v0, p2}, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->parseVttCueBox(Lcom/google/android/exoplayer2/util/ParsableByteArray;Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;I)Lcom/google/android/exoplayer2/text/Cue;
move-result-object p2
invoke-virtual {p1, p2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 10
:cond_0
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttDecoder;->sampleData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
add-int/lit8 p2, p2, -0x8
invoke-virtual {p3, p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->skipBytes(I)V
goto :goto_0
.line 11
:cond_1
new-instance p1, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
const-string p2, "Incomplete Mp4Webvtt Top Level box header found."
invoke-direct {p1, p2}, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;-><init>(Ljava/lang/String;)V
throw p1
.line 12
:cond_2
new-instance p2, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;
invoke-direct {p2, p1}, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;-><init>(Ljava/util/List;)V
return-object p2
.end method
@@ -0,0 +1,126 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;
.super Ljava/lang/Object;
.source "Mp4WebvttSubtitle.java"
# interfaces
.implements Lcom/google/android/exoplayer2/text/Subtitle;
# instance fields
.field private final cues:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/Cue;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Ljava/util/List;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/Cue;",
">;)V"
}
.end annotation
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
invoke-static {p1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
move-result-object p1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;->cues:Ljava/util/List;
return-void
.end method
# virtual methods
.method public getCues(J)Ljava/util/List;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(J)",
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/Cue;",
">;"
}
.end annotation
const-wide/16 v0, 0x0
cmp-long p1, p1, v0
if-ltz p1, :cond_0
.line 1
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle;->cues:Ljava/util/List;
goto :goto_0
:cond_0
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object p1
:goto_0
return-object p1
.end method
.method public getEventTime(I)J
.locals 2
if-nez p1, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
.line 1
:goto_0
invoke-static {p1}, Lcom/google/android/exoplayer2/util/Assertions;->checkArgument(Z)V
const-wide/16 v0, 0x0
return-wide v0
.end method
.method public getEventTimeCount()I
.locals 1
const/4 v0, 0x1
return v0
.end method
.method public getNextEventTimeIndex(J)I
.locals 2
const-wide/16 v0, 0x0
cmp-long p1, p1, v0
if-gez p1, :cond_0
const/4 p1, 0x0
goto :goto_0
:cond_0
const/4 p1, -0x1
:goto_0
return p1
.end method
@@ -0,0 +1,21 @@
.class public interface abstract annotation Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle$FontSizeUnit;
.super Ljava/lang/Object;
.source "WebvttCssStyle.java"
# interfaces
.implements Ljava/lang/annotation/Annotation;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2609
name = "FontSizeUnit"
.end annotation
.annotation runtime Ljava/lang/annotation/Retention;
value = .enum Ljava/lang/annotation/RetentionPolicy;->SOURCE:Ljava/lang/annotation/RetentionPolicy;
.end annotation
@@ -0,0 +1,21 @@
.class public interface abstract annotation Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle$StyleFlags;
.super Ljava/lang/Object;
.source "WebvttCssStyle.java"
# interfaces
.implements Ljava/lang/annotation/Annotation;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2609
name = "StyleFlags"
.end annotation
.annotation runtime Ljava/lang/annotation/Retention;
value = .enum Ljava/lang/annotation/RetentionPolicy;->SOURCE:Ljava/lang/annotation/RetentionPolicy;
.end annotation
@@ -0,0 +1,729 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.super Ljava/lang/Object;
.source "WebvttCssStyle.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle$FontSizeUnit;,
Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle$StyleFlags;
}
.end annotation
# static fields
.field public static final FONT_SIZE_UNIT_EM:I = 0x2
.field public static final FONT_SIZE_UNIT_PERCENT:I = 0x3
.field public static final FONT_SIZE_UNIT_PIXEL:I = 0x1
.field private static final OFF:I = 0x0
.field private static final ON:I = 0x1
.field public static final STYLE_BOLD:I = 0x1
.field public static final STYLE_BOLD_ITALIC:I = 0x3
.field public static final STYLE_ITALIC:I = 0x2
.field public static final STYLE_NORMAL:I = 0x0
.field public static final UNSPECIFIED:I = -0x1
# instance fields
.field private backgroundColor:I
.field private bold:I
.field private fontColor:I
.field private fontFamily:Ljava/lang/String;
.field private fontSize:F
.field private fontSizeUnit:I
.field private hasBackgroundColor:Z
.field private hasFontColor:Z
.field private italic:I
.field private linethrough:I
.field private targetClasses:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field private targetId:Ljava/lang/String;
.field private targetTag:Ljava/lang/String;
.field private targetVoice:Ljava/lang/String;
.field private textAlign:Landroid/text/Layout$Alignment;
.field private underline:I
# direct methods
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
invoke-virtual {p0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->reset()V
return-void
.end method
.method private static updateScoreForMatch(ILjava/lang/String;Ljava/lang/String;I)I
.locals 1
.line 1
invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-nez v0, :cond_2
const/4 v0, -0x1
if-ne p0, v0, :cond_0
goto :goto_0
.line 2
:cond_0
invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_1
add-int v0, p0, p3
:cond_1
return v0
:cond_2
:goto_0
return p0
.end method
# virtual methods
.method public cascadeFrom(Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;)V
.locals 2
.line 1
iget-boolean v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasFontColor:Z
if-eqz v0, :cond_0
.line 2
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontColor:I
invoke-virtual {p0, v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->setFontColor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.line 3
:cond_0
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->bold:I
const/4 v1, -0x1
if-eq v0, v1, :cond_1
.line 4
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->bold:I
.line 5
:cond_1
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
if-eq v0, v1, :cond_2
.line 6
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
.line 7
:cond_2
iget-object v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontFamily:Ljava/lang/String;
if-eqz v0, :cond_3
.line 8
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontFamily:Ljava/lang/String;
.line 9
:cond_3
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
if-ne v0, v1, :cond_4
.line 10
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
.line 11
:cond_4
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
if-ne v0, v1, :cond_5
.line 12
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
.line 13
:cond_5
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
if-nez v0, :cond_6
.line 14
iget-object v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
.line 15
:cond_6
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
if-ne v0, v1, :cond_7
.line 16
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
.line 17
iget v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSize:F
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSize:F
.line 18
:cond_7
iget-boolean v0, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasBackgroundColor:Z
if-eqz v0, :cond_8
.line 19
iget p1, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->backgroundColor:I
invoke-virtual {p0, p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->setBackgroundColor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
:cond_8
return-void
.end method
.method public getBackgroundColor()I
.locals 2
.line 1
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasBackgroundColor:Z
if-eqz v0, :cond_0
.line 2
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->backgroundColor:I
return v0
.line 3
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Background color not defined."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public getFontColor()I
.locals 2
.line 1
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasFontColor:Z
if-eqz v0, :cond_0
.line 2
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontColor:I
return v0
.line 3
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Font color not defined"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public getFontFamily()Ljava/lang/String;
.locals 1
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontFamily:Ljava/lang/String;
return-object v0
.end method
.method public getFontSize()F
.locals 1
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSize:F
return v0
.end method
.method public getFontSizeUnit()I
.locals 1
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
return v0
.end method
.method public getSpecificityScore(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)I
.locals 3
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetId:Ljava/lang/String;
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetTag:Ljava/lang/String;
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetClasses:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetVoice:Ljava/lang/String;
.line 2
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
.line 3
invoke-virtual {p2}, Ljava/lang/String;->isEmpty()Z
move-result p1
return p1
.line 4
:cond_0
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetId:Ljava/lang/String;
const/high16 v1, 0x40000000 # 2.0f
const/4 v2, 0x0
invoke-static {v2, v0, p1, v1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->updateScoreForMatch(ILjava/lang/String;Ljava/lang/String;I)I
move-result p1
.line 5
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetTag:Ljava/lang/String;
const/4 v1, 0x2
invoke-static {p1, v0, p2, v1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->updateScoreForMatch(ILjava/lang/String;Ljava/lang/String;I)I
move-result p1
.line 6
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetVoice:Ljava/lang/String;
const/4 v0, 0x4
invoke-static {p1, p2, p4, v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->updateScoreForMatch(ILjava/lang/String;Ljava/lang/String;I)I
move-result p1
const/4 p2, -0x1
if-eq p1, p2, :cond_2
.line 7
invoke-static {p3}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object p2
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetClasses:Ljava/util/List;
invoke-interface {p2, p3}, Ljava/util/List;->containsAll(Ljava/util/Collection;)Z
move-result p2
if-nez p2, :cond_1
goto :goto_0
.line 8
:cond_1
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetClasses:Ljava/util/List;
invoke-interface {p2}, Ljava/util/List;->size()I
move-result p2
mul-int/2addr p2, v0
add-int/2addr p2, p1
return p2
:cond_2
:goto_0
return v2
.end method
.method public getStyle()I
.locals 4
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->bold:I
const/4 v1, -0x1
if-ne v0, v1, :cond_0
iget v2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
if-ne v2, v1, :cond_0
return v1
:cond_0
const/4 v1, 0x0
const/4 v2, 0x1
if-ne v0, v2, :cond_1
move v0, v2
goto :goto_0
:cond_1
move v0, v1
.line 2
:goto_0
iget v3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
if-ne v3, v2, :cond_2
const/4 v1, 0x2
:cond_2
or-int/2addr v0, v1
return v0
.end method
.method public getTextAlign()Landroid/text/Layout$Alignment;
.locals 1
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
return-object v0
.end method
.method public hasBackgroundColor()Z
.locals 1
.line 1
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasBackgroundColor:Z
return v0
.end method
.method public hasFontColor()Z
.locals 1
.line 1
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasFontColor:Z
return v0
.end method
.method public isLinethrough()Z
.locals 2
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
const/4 v1, 0x1
if-ne v0, v1, :cond_0
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
return v1
.end method
.method public isUnderline()Z
.locals 2
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
const/4 v1, 0x1
if-ne v0, v1, :cond_0
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
return v1
.end method
.method public reset()V
.locals 2
const-string v0, ""
.line 1
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetId:Ljava/lang/String;
.line 2
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetTag:Ljava/lang/String;
.line 3
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object v1
iput-object v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetClasses:Ljava/util/List;
.line 4
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetVoice:Ljava/lang/String;
const/4 v0, 0x0
.line 5
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontFamily:Ljava/lang/String;
const/4 v1, 0x0
.line 6
iput-boolean v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasFontColor:Z
.line 7
iput-boolean v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasBackgroundColor:Z
const/4 v1, -0x1
.line 8
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
.line 9
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
.line 10
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->bold:I
.line 11
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
.line 12
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
.line 13
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
return-void
.end method
.method public setBackgroundColor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->backgroundColor:I
const/4 p1, 0x1
.line 2
iput-boolean p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasBackgroundColor:Z
return-object p0
.end method
.method public setBold(Z)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->bold:I
return-object p0
.end method
.method public setFontColor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontColor:I
const/4 p1, 0x1
.line 2
iput-boolean p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->hasFontColor:Z
return-object p0
.end method
.method public setFontFamily(Ljava/lang/String;)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
invoke-static {p1}, Lcom/google/android/exoplayer2/util/Util;->toLowerInvariant(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontFamily:Ljava/lang/String;
return-object p0
.end method
.method public setFontSize(F)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSize:F
return-object p0
.end method
.method public setFontSizeUnit(S)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->fontSizeUnit:I
return-object p0
.end method
.method public setItalic(Z)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->italic:I
return-object p0
.end method
.method public setLinethrough(Z)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->linethrough:I
return-object p0
.end method
.method public setTargetClasses([Ljava/lang/String;)V
.locals 0
.line 1
invoke-static {p1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object p1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetClasses:Ljava/util/List;
return-void
.end method
.method public setTargetId(Ljava/lang/String;)V
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetId:Ljava/lang/String;
return-void
.end method
.method public setTargetTagName(Ljava/lang/String;)V
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetTag:Ljava/lang/String;
return-void
.end method
.method public setTargetVoice(Ljava/lang/String;)V
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->targetVoice:Ljava/lang/String;
return-void
.end method
.method public setTextAlign(Landroid/text/Layout$Alignment;)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->textAlign:Landroid/text/Layout$Alignment;
return-object p0
.end method
.method public setUnderline(Z)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;->underline:I
return-object p0
.end method
@@ -0,0 +1,83 @@
.class synthetic Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$1;
.super Ljava/lang/Object;
.source "WebvttCue.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1009
name = null
.end annotation
# static fields
.field public static final synthetic $SwitchMap$android$text$Layout$Alignment:[I
# direct methods
.method public static constructor <clinit>()V
.locals 3
.line 1
invoke-static {}, Landroid/text/Layout$Alignment;->values()[Landroid/text/Layout$Alignment;
move-result-object v0
array-length v0, v0
new-array v0, v0, [I
sput-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$1;->$SwitchMap$android$text$Layout$Alignment:[I
:try_start_0
sget-object v1, Landroid/text/Layout$Alignment;->ALIGN_NORMAL:Landroid/text/Layout$Alignment;
invoke-virtual {v1}, Landroid/text/Layout$Alignment;->ordinal()I
move-result v1
const/4 v2, 0x1
aput v2, v0, v1
:try_end_0
.catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
:try_start_1
sget-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$1;->$SwitchMap$android$text$Layout$Alignment:[I
sget-object v1, Landroid/text/Layout$Alignment;->ALIGN_CENTER:Landroid/text/Layout$Alignment;
invoke-virtual {v1}, Landroid/text/Layout$Alignment;->ordinal()I
move-result v1
const/4 v2, 0x2
aput v2, v0, v1
:try_end_1
.catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_1
:catch_1
:try_start_2
sget-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$1;->$SwitchMap$android$text$Layout$Alignment:[I
sget-object v1, Landroid/text/Layout$Alignment;->ALIGN_OPPOSITE:Landroid/text/Layout$Alignment;
invoke-virtual {v1}, Landroid/text/Layout$Alignment;->ordinal()I
move-result v1
const/4 v2, 0x3
aput v2, v0, v1
:try_end_2
.catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_2
:catch_2
return-void
.end method
@@ -0,0 +1,325 @@
.class public final Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.super Ljava/lang/Object;
.source "WebvttCue.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Builder"
.end annotation
# static fields
.field private static final TAG:Ljava/lang/String; = "WebvttCueBuilder"
# instance fields
.field private endTime:J
.field private line:F
.field private lineAnchor:I
.field private lineType:I
.field private position:F
.field private positionAnchor:I
.field private startTime:J
.field private text:Landroid/text/SpannableStringBuilder;
.field private textAlignment:Landroid/text/Layout$Alignment;
.field private width:F
# direct methods
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
invoke-virtual {p0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->reset()V
return-void
.end method
.method private derivePositionAnchorFromAlignment()Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 4
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->textAlignment:Landroid/text/Layout$Alignment;
if-nez v0, :cond_0
const/high16 v0, -0x80000000
.line 2
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
goto :goto_0
.line 3
:cond_0
sget-object v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$1;->$SwitchMap$android$text$Layout$Alignment:[I
invoke-virtual {v0}, Landroid/text/Layout$Alignment;->ordinal()I
move-result v0
aget v0, v1, v0
const/4 v1, 0x0
const/4 v2, 0x1
if-eq v0, v2, :cond_3
const/4 v3, 0x2
if-eq v0, v3, :cond_2
const/4 v2, 0x3
if-eq v0, v2, :cond_1
const-string v0, "Unrecognized alignment: "
.line 4
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->textAlignment:Landroid/text/Layout$Alignment;
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v2, "WebvttCueBuilder"
invoke-static {v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 5
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
goto :goto_0
.line 6
:cond_1
iput v3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
goto :goto_0
.line 7
:cond_2
iput v2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
goto :goto_0
.line 8
:cond_3
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
:goto_0
return-object p0
.end method
# virtual methods
.method public build()Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
.locals 15
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->position:F
const/4 v1, 0x1
cmpl-float v0, v0, v1
if-eqz v0, :cond_0
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
const/high16 v1, -0x80000000
if-ne v0, v1, :cond_0
.line 2
invoke-direct {p0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->derivePositionAnchorFromAlignment()Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.line 3
:cond_0
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
iget-wide v3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->startTime:J
iget-wide v5, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->endTime:J
iget-object v7, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->text:Landroid/text/SpannableStringBuilder;
iget-object v8, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->textAlignment:Landroid/text/Layout$Alignment;
iget v9, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->line:F
iget v10, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineType:I
iget v11, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineAnchor:I
iget v12, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->position:F
iget v13, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
iget v14, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->width:F
move-object v2, v0
invoke-direct/range {v2 .. v14}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;-><init>(JJLjava/lang/CharSequence;Landroid/text/Layout$Alignment;FIIFIF)V
return-object v0
.end method
.method public reset()V
.locals 2
const-wide/16 v0, 0x0
.line 1
iput-wide v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->startTime:J
.line 2
iput-wide v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->endTime:J
const/4 v0, 0x0
.line 3
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->text:Landroid/text/SpannableStringBuilder;
.line 4
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->textAlignment:Landroid/text/Layout$Alignment;
const/4 v0, 0x1
.line 5
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->line:F
const/high16 v1, -0x80000000
.line 6
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineType:I
.line 7
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineAnchor:I
.line 8
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->position:F
.line 9
iput v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
.line 10
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->width:F
return-void
.end method
.method public setEndTime(J)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput-wide p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->endTime:J
return-object p0
.end method
.method public setLine(F)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->line:F
return-object p0
.end method
.method public setLineAnchor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineAnchor:I
return-object p0
.end method
.method public setLineType(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->lineType:I
return-object p0
.end method
.method public setPosition(F)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->position:F
return-object p0
.end method
.method public setPositionAnchor(I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->positionAnchor:I
return-object p0
.end method
.method public setStartTime(J)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput-wide p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->startTime:J
return-object p0
.end method
.method public setText(Landroid/text/SpannableStringBuilder;)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->text:Landroid/text/SpannableStringBuilder;
return-object p0
.end method
.method public setTextAlignment(Landroid/text/Layout$Alignment;)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->textAlignment:Landroid/text/Layout$Alignment;
return-object p0
.end method
.method public setWidth(F)Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.locals 0
.line 1
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->width:F
return-object p0
.end method
@@ -0,0 +1,137 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
.super Lcom/google/android/exoplayer2/text/Cue;
.source "WebvttCue.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
}
.end annotation
# instance fields
.field public final endTime:J
.field public final startTime:J
# direct methods
.method public constructor <init>(JJLjava/lang/CharSequence;)V
.locals 13
const/4 v6, 0x0
const/4 v7, 0x1
const/high16 v8, -0x80000000
const/high16 v9, -0x80000000
const/4 v10, 0x1
const/high16 v11, -0x80000000
const/4 v12, 0x1
move-object v0, p0
move-wide v1, p1
move-wide/from16 v3, p3
move-object/from16 v5, p5
.line 2
invoke-direct/range {v0 .. v12}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;-><init>(JJLjava/lang/CharSequence;Landroid/text/Layout$Alignment;FIIFIF)V
return-void
.end method
.method public constructor <init>(JJLjava/lang/CharSequence;Landroid/text/Layout$Alignment;FIIFIF)V
.locals 10
move-object v9, p0
move-object v0, p0
move-object v1, p5
move-object/from16 v2, p6
move/from16 v3, p7
move/from16 v4, p8
move/from16 v5, p9
move/from16 v6, p10
move/from16 v7, p11
move/from16 v8, p12
.line 3
invoke-direct/range {v0 .. v8}, Lcom/google/android/exoplayer2/text/Cue;-><init>(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;FIIFIF)V
move-wide v0, p1
.line 4
iput-wide v0, v9, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;->startTime:J
move-wide v0, p3
.line 5
iput-wide v0, v9, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;->endTime:J
return-void
.end method
.method public constructor <init>(Ljava/lang/CharSequence;)V
.locals 6
const-wide/16 v1, 0x0
const-wide/16 v3, 0x0
move-object v0, p0
move-object v5, p1
.line 1
invoke-direct/range {v0 .. v5}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;-><init>(JJLjava/lang/CharSequence;)V
return-void
.end method
# virtual methods
.method public isNormalCue()Z
.locals 2
.line 1
iget v0, p0, Lcom/google/android/exoplayer2/text/Cue;->line:F
const/4 v1, 0x1
cmpl-float v0, v0, v1
if-nez v0, :cond_0
iget v0, p0, Lcom/google/android/exoplayer2/text/Cue;->position:F
cmpl-float v0, v0, v1
if-nez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
@@ -0,0 +1,177 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;
.super Ljava/lang/Object;
.source "WebvttCueParser.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "StartTag"
.end annotation
# static fields
.field private static final NO_CLASSES:[Ljava/lang/String;
# instance fields
.field public final classes:[Ljava/lang/String;
.field public final name:Ljava/lang/String;
.field public final position:I
.field public final voice:Ljava/lang/String;
# direct methods
.method public static constructor <clinit>()V
.locals 1
const/4 v0, 0x0
new-array v0, v0, [Ljava/lang/String;
.line 1
sput-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->NO_CLASSES:[Ljava/lang/String;
return-void
.end method
.method private constructor <init>(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;)V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
iput p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->position:I
.line 3
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->name:Ljava/lang/String;
.line 4
iput-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->voice:Ljava/lang/String;
.line 5
iput-object p4, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->classes:[Ljava/lang/String;
return-void
.end method
.method public static buildStartTag(Ljava/lang/String;I)Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;
.locals 4
.line 1
invoke-virtual {p0}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object p0
.line 2
invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
const/4 p0, 0x0
return-object p0
:cond_0
const-string v0, " "
.line 3
invoke-virtual {p0, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
const/4 v1, -0x1
const/4 v2, 0x0
if-ne v0, v1, :cond_1
const-string v0, ""
goto :goto_0
.line 4
:cond_1
invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v1
.line 5
invoke-virtual {p0, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
move-object v0, v1
:goto_0
const-string v1, "\\."
.line 6
invoke-virtual {p0, v1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object p0
.line 7
aget-object v1, p0, v2
.line 8
array-length v2, p0
const/4 v3, 0x1
if-le v2, v3, :cond_2
.line 9
array-length v2, p0
invoke-static {p0, v3, v2}, Ljava/util/Arrays;->copyOfRange([Ljava/lang/Object;II)[Ljava/lang/Object;
move-result-object p0
check-cast p0, [Ljava/lang/String;
goto :goto_1
.line 10
:cond_2
sget-object p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;->NO_CLASSES:[Ljava/lang/String;
.line 11
:goto_1
new-instance v2, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;
invoke-direct {v2, v1, p1, v0, p0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;-><init>(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;)V
return-object v2
.end method
.method public static buildWholeCueVirtualTag()Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;
.locals 4
.line 1
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;
const/4 v1, 0x0
new-array v2, v1, [Ljava/lang/String;
const-string v3, ""
invoke-direct {v0, v3, v1, v3, v2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StartTag;-><init>(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;)V
return-object v0
.end method
@@ -0,0 +1,85 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;
.super Ljava/lang/Object;
.source "WebvttCueParser.java"
# interfaces
.implements Ljava/lang/Comparable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "StyleMatch"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Ljava/lang/Comparable<",
"Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;",
">;"
}
.end annotation
# instance fields
.field public final score:I
.field public final style:Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
# direct methods
.method public constructor <init>(ILcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;)V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
iput p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;->score:I
.line 3
iput-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;->style:Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
return-void
.end method
# virtual methods
.method public compareTo(Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;)I
.locals 1
.param p1 # Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 2
iget v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;->score:I
iget p1, p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;->score:I
sub-int/2addr v0, p1
return v0
.end method
.method public bridge synthetic compareTo(Ljava/lang/Object;)I
.locals 0
.param p1 # Ljava/lang/Object;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.line 1
check-cast p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;
invoke-virtual {p0, p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;->compareTo(Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser$StyleMatch;)I
move-result p1
return p1
.end method
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,358 @@
.class public final Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;
.super Lcom/google/android/exoplayer2/text/SimpleSubtitleDecoder;
.source "WebvttDecoder.java"
# static fields
.field private static final COMMENT_START:Ljava/lang/String; = "NOTE"
.field private static final EVENT_COMMENT:I = 0x1
.field private static final EVENT_CUE:I = 0x3
.field private static final EVENT_END_OF_FILE:I = 0x0
.field private static final EVENT_NONE:I = -0x1
.field private static final EVENT_STYLE_BLOCK:I = 0x2
.field private static final STYLE_START:Ljava/lang/String; = "STYLE"
# instance fields
.field private final cssParser:Lcom/google/android/exoplayer2/text/webvtt/CssParser;
.field private final cueParser:Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
.field private final definedStyles:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;",
">;"
}
.end annotation
.end field
.field private final parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
.field private final webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
# direct methods
.method public constructor <init>()V
.locals 1
const-string v0, "WebvttDecoder"
.line 1
invoke-direct {p0, v0}, Lcom/google/android/exoplayer2/text/SimpleSubtitleDecoder;-><init>(Ljava/lang/String;)V
.line 2
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
invoke-direct {v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->cueParser:Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
.line 3
new-instance v0, Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-direct {v0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
.line 4
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
invoke-direct {v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
.line 5
new-instance v0, Lcom/google/android/exoplayer2/text/webvtt/CssParser;
invoke-direct {v0}, Lcom/google/android/exoplayer2/text/webvtt/CssParser;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->cssParser:Lcom/google/android/exoplayer2/text/webvtt/CssParser;
.line 6
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->definedStyles:Ljava/util/List;
return-void
.end method
.method private static getNextEvent(Lcom/google/android/exoplayer2/util/ParsableByteArray;)I
.locals 5
const/4 v0, 0x0
const/4 v1, -0x1
move v3, v0
move v2, v1
:goto_0
if-ne v2, v1, :cond_3
.line 1
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->getPosition()I
move-result v3
.line 2
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object v2
if-nez v2, :cond_0
move v2, v0
goto :goto_0
:cond_0
const-string v4, "STYLE"
.line 3
invoke-virtual {v4, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1
const/4 v2, 0x2
goto :goto_0
:cond_1
const-string v4, "NOTE"
.line 4
invoke-virtual {v4, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_2
const/4 v2, 0x1
goto :goto_0
:cond_2
const/4 v2, 0x3
goto :goto_0
.line 5
:cond_3
invoke-virtual {p0, v3}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->setPosition(I)V
return v2
.end method
.method private static skipComment(Lcom/google/android/exoplayer2/util/ParsableByteArray;)V
.locals 1
.line 1
:goto_0
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_0
goto :goto_0
:cond_0
return-void
.end method
# virtual methods
.method public bridge synthetic decode([BIZ)Lcom/google/android/exoplayer2/text/Subtitle;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 1
invoke-virtual {p0, p1, p2, p3}, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->decode([BIZ)Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;
move-result-object p1
return-object p1
.end method
.method public decode([BIZ)Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 2
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p3, p1, p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->reset([BI)V
.line 3
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
invoke-virtual {p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->reset()V
.line 4
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->definedStyles:Ljava/util/List;
invoke-interface {p1}, Ljava/util/List;->clear()V
.line 5
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-static {p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;->validateWebvttHeaderLine(Lcom/google/android/exoplayer2/util/ParsableByteArray;)V
.line 6
:goto_0
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p1}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object p1
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result p1
if-nez p1, :cond_0
goto :goto_0
.line 7
:cond_0
new-instance p1, Ljava/util/ArrayList;
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
.line 8
:cond_1
:goto_1
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-static {p2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->getNextEvent(Lcom/google/android/exoplayer2/util/ParsableByteArray;)I
move-result p2
if-eqz p2, :cond_5
const/4 p3, 0x1
if-ne p2, p3, :cond_2
.line 9
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-static {p2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->skipComment(Lcom/google/android/exoplayer2/util/ParsableByteArray;)V
goto :goto_1
:cond_2
const/4 p3, 0x2
if-ne p2, p3, :cond_4
.line 10
invoke-virtual {p1}, Ljava/util/ArrayList;->isEmpty()Z
move-result p2
if-eqz p2, :cond_3
.line 11
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
.line 12
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->cssParser:Lcom/google/android/exoplayer2/text/webvtt/CssParser;
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
invoke-virtual {p2, p3}, Lcom/google/android/exoplayer2/text/webvtt/CssParser;->parseBlock(Lcom/google/android/exoplayer2/util/ParsableByteArray;)Lcom/google/android/exoplayer2/text/webvtt/WebvttCssStyle;
move-result-object p2
if-eqz p2, :cond_1
.line 13
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->definedStyles:Ljava/util/List;
invoke-interface {p3, p2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_1
.line 14
:cond_3
new-instance p1, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
const-string p2, "A style block was found after the first cue."
invoke-direct {p1, p2}, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;-><init>(Ljava/lang/String;)V
throw p1
:cond_4
const/4 p3, 0x3
if-ne p2, p3, :cond_1
.line 15
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->cueParser:Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;
iget-object p3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->parsableWebvttData:Lcom/google/android/exoplayer2/util/ParsableByteArray;
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
iget-object v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->definedStyles:Ljava/util/List;
invoke-virtual {p2, p3, v0, v1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;->parseCue(Lcom/google/android/exoplayer2/util/ParsableByteArray;Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;Ljava/util/List;)Z
move-result p2
if-eqz p2, :cond_1
.line 16
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->build()Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
move-result-object p2
invoke-virtual {p1, p2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 17
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttDecoder;->webvttCueBuilder:Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;
invoke-virtual {p2}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue$Builder;->reset()V
goto :goto_1
.line 18
:cond_5
new-instance p2, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;
invoke-direct {p2, p1}, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;-><init>(Ljava/util/List;)V
return-object p2
.end method
@@ -0,0 +1,277 @@
.class public final Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;
.super Ljava/lang/Object;
.source "WebvttParserUtil.java"
# static fields
.field private static final COMMENT:Ljava/util/regex/Pattern;
.field private static final HEADER:Ljava/util/regex/Pattern;
# direct methods
.method public static constructor <clinit>()V
.locals 1
const-string v0, "^NOTE(( |\t).*)?$"
.line 1
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v0
sput-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;->COMMENT:Ljava/util/regex/Pattern;
const-string v0, "^\ufeff?WEBVTT(( |\t).*)?$"
.line 2
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v0
sput-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;->HEADER:Ljava/util/regex/Pattern;
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static findNextCueHeader(Lcom/google/android/exoplayer2/util/ParsableByteArray;)Ljava/util/regex/Matcher;
.locals 2
.line 1
:cond_0
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_2
.line 2
sget-object v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;->COMMENT:Ljava/util/regex/Pattern;
invoke-virtual {v1, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v1
invoke-virtual {v1}, Ljava/util/regex/Matcher;->matches()Z
move-result v1
if-eqz v1, :cond_1
.line 3
:goto_0
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-nez v0, :cond_0
goto :goto_0
.line 4
:cond_1
sget-object v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCueParser;->CUE_HEADER_PATTERN:Ljava/util/regex/Pattern;
invoke-virtual {v1, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v0
.line 5
invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z
move-result v1
if-eqz v1, :cond_0
return-object v0
:cond_2
const/4 p0, 0x0
return-object p0
.end method
.method public static parsePercentage(Ljava/lang/String;)F
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/NumberFormatException;
}
.end annotation
const-string v0, "%"
.line 1
invoke-virtual {p0, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x0
.line 2
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v1
add-int/lit8 v1, v1, -0x1
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F
move-result p0
const/high16 v0, 0x42c80000 # 100.0f
div-float/2addr p0, v0
return p0
.line 3
:cond_0
new-instance p0, Ljava/lang/NumberFormatException;
const-string v0, "Percentages must end with %"
invoke-direct {p0, v0}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static parseTimestampUs(Ljava/lang/String;)J
.locals 8
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/NumberFormatException;
}
.end annotation
const-string v0, "\\."
const/4 v1, 0x2
.line 1
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
move-result-object p0
const/4 v0, 0x0
.line 2
aget-object v1, p0, v0
const-string v2, ":"
invoke-virtual {v1, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v1
.line 3
array-length v2, v1
const-wide/16 v3, 0x0
:goto_0
if-ge v0, v2, :cond_0
aget-object v5, v1, v0
const-wide/16 v6, 0x3c
mul-long/2addr v3, v6
.line 4
invoke-static {v5}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
move-result-wide v5
add-long/2addr v3, v5
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_0
const-wide/16 v0, 0x3e8
mul-long/2addr v3, v0
const/4 v2, 0x1
.line 5
aget-object p0, p0, v2
invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
move-result-wide v5
add-long/2addr v5, v3
mul-long/2addr v5, v0
return-wide v5
.end method
.method public static validateWebvttHeaderLine(Lcom/google/android/exoplayer2/util/ParsableByteArray;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
}
.end annotation
.line 1
invoke-virtual {p0}, Lcom/google/android/exoplayer2/util/ParsableByteArray;->readLine()Ljava/lang/String;
move-result-object p0
if-eqz p0, :cond_0
.line 2
sget-object v0, Lcom/google/android/exoplayer2/text/webvtt/WebvttParserUtil;->HEADER:Ljava/util/regex/Pattern;
invoke-virtual {v0, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v0
invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z
move-result v0
if-eqz v0, :cond_0
return-void
.line 3
:cond_0
new-instance v0, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;
const-string v1, "Expected WEBVTT. Got "
invoke-static {v1, p0}, Lc/g;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Lcom/google/android/exoplayer2/text/SubtitleDecoderException;-><init>(Ljava/lang/String;)V
throw v0
.end method
@@ -0,0 +1,352 @@
.class final Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;
.super Ljava/lang/Object;
.source "WebvttSubtitle.java"
# interfaces
.implements Lcom/google/android/exoplayer2/text/Subtitle;
# instance fields
.field private final cueTimesUs:[J
.field private final cues:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;",
">;"
}
.end annotation
.end field
.field private final numCues:I
.field private final sortedCueTimesUs:[J
# direct methods
.method public constructor <init>(Ljava/util/List;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;",
">;)V"
}
.end annotation
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cues:Ljava/util/List;
.line 3
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
iput v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->numCues:I
mul-int/lit8 v0, v0, 0x2
.line 4
new-array v0, v0, [J
iput-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cueTimesUs:[J
const/4 v0, 0x0
.line 5
:goto_0
iget v1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->numCues:I
if-ge v0, v1, :cond_0
.line 6
invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
mul-int/lit8 v2, v0, 0x2
.line 7
iget-object v3, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cueTimesUs:[J
iget-wide v4, v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;->startTime:J
aput-wide v4, v3, v2
add-int/lit8 v2, v2, 0x1
.line 8
iget-wide v4, v1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;->endTime:J
aput-wide v4, v3, v2
add-int/lit8 v0, v0, 0x1
goto :goto_0
.line 9
:cond_0
iget-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cueTimesUs:[J
array-length v0, p1
invoke-static {p1, v0}, Ljava/util/Arrays;->copyOf([JI)[J
move-result-object p1
iput-object p1, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
.line 10
invoke-static {p1}, Ljava/util/Arrays;->sort([J)V
return-void
.end method
# virtual methods
.method public getCues(J)Ljava/util/List;
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(J)",
"Ljava/util/List<",
"Lcom/google/android/exoplayer2/text/Cue;",
">;"
}
.end annotation
const/4 v0, 0x0
const/4 v1, 0x0
move-object v2, v0
move v3, v1
move-object v1, v2
.line 1
:goto_0
iget v4, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->numCues:I
if-ge v3, v4, :cond_5
.line 2
iget-object v4, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cueTimesUs:[J
mul-int/lit8 v5, v3, 0x2
aget-wide v6, v4, v5
cmp-long v6, v6, p1
if-gtz v6, :cond_4
add-int/lit8 v5, v5, 0x1
aget-wide v5, v4, v5
cmp-long v4, p1, v5
if-gez v4, :cond_4
if-nez v2, :cond_0
.line 3
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 4
:cond_0
iget-object v4, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->cues:Ljava/util/List;
invoke-interface {v4, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
.line 5
invoke-virtual {v4}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;->isNormalCue()Z
move-result v5
if-eqz v5, :cond_3
if-nez v1, :cond_1
move-object v1, v4
goto :goto_1
:cond_1
const-string v5, "\n"
if-nez v0, :cond_2
.line 6
new-instance v0, Landroid/text/SpannableStringBuilder;
invoke-direct {v0}, Landroid/text/SpannableStringBuilder;-><init>()V
.line 7
iget-object v6, v1, Lcom/google/android/exoplayer2/text/Cue;->text:Ljava/lang/CharSequence;
invoke-virtual {v0, v6}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
move-result-object v6
invoke-virtual {v6, v5}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
move-result-object v5
iget-object v4, v4, Lcom/google/android/exoplayer2/text/Cue;->text:Ljava/lang/CharSequence;
invoke-virtual {v5, v4}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
goto :goto_1
.line 8
:cond_2
invoke-virtual {v0, v5}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
move-result-object v5
iget-object v4, v4, Lcom/google/android/exoplayer2/text/Cue;->text:Ljava/lang/CharSequence;
invoke-virtual {v5, v4}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
goto :goto_1
.line 9
:cond_3
invoke-virtual {v2, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_4
:goto_1
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_5
if-eqz v0, :cond_6
.line 10
new-instance p1, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;
invoke-direct {p1, v0}, Lcom/google/android/exoplayer2/text/webvtt/WebvttCue;-><init>(Ljava/lang/CharSequence;)V
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_2
:cond_6
if-eqz v1, :cond_7
.line 11
invoke-virtual {v2, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_7
:goto_2
if-eqz v2, :cond_8
return-object v2
.line 12
:cond_8
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object p1
return-object p1
.end method
.method public getEventTime(I)J
.locals 3
const/4 v0, 0x1
const/4 v1, 0x0
if-ltz p1, :cond_0
move v2, v0
goto :goto_0
:cond_0
move v2, v1
.line 1
:goto_0
invoke-static {v2}, Lcom/google/android/exoplayer2/util/Assertions;->checkArgument(Z)V
.line 2
iget-object v2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
array-length v2, v2
if-ge p1, v2, :cond_1
goto :goto_1
:cond_1
move v0, v1
:goto_1
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkArgument(Z)V
.line 3
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
aget-wide v1, v0, p1
return-wide v1
.end method
.method public getEventTimeCount()I
.locals 1
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
array-length v0, v0
return v0
.end method
.method public getNextEventTimeIndex(J)I
.locals 2
.line 1
iget-object v0, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
const/4 v1, 0x0
invoke-static {v0, p1, p2, v1, v1}, Lcom/google/android/exoplayer2/util/Util;->binarySearchCeil([JJZZ)I
move-result p1
.line 2
iget-object p2, p0, Lcom/google/android/exoplayer2/text/webvtt/WebvttSubtitle;->sortedCueTimesUs:[J
array-length p2, p2
if-ge p1, p2, :cond_0
goto :goto_0
:cond_0
const/4 p1, -0x1
:goto_0
return p1
.end method