Rabbit-R1/android (non root)/smali/smali_classes2/androidx/media3/extractor/FlacMetadataReader.smali

634 lines
17 KiB
Smali
Raw Normal View History

2024-05-21 21:08:36 +00:00
.class public final Landroidx/media3/extractor/FlacMetadataReader;
.super Ljava/lang/Object;
.source "FlacMetadataReader.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;
}
.end annotation
# static fields
.field private static final SEEK_POINT_SIZE:I = 0x12
.field private static final STREAM_MARKER:I = 0x664c6143
.field private static final SYNC_CODE:I = 0x3ffe
# direct methods
.method private constructor <init>()V
.locals 0
.line 275
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static checkAndPeekStreamMarker(Landroidx/media3/extractor/ExtractorInput;)Z
.locals 6
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 82
new-instance v0, Landroidx/media3/common/util/ParsableByteArray;
const/4 v1, 0x4
invoke-direct {v0, v1}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 83
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v2
const/4 v3, 0x0
invoke-interface {p0, v2, v3, v1}, Landroidx/media3/extractor/ExtractorInput;->peekFully([BII)V
.line 84
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->readUnsignedInt()J
move-result-wide v0
const-wide/32 v4, 0x664c6143
cmp-long p0, v0, v4
if-nez p0, :cond_0
const/4 v3, 0x1
:cond_0
return v3
.end method
.method public static getFrameStartMarker(Landroidx/media3/extractor/ExtractorInput;)I
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 234
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->resetPeekPosition()V
.line 235
new-instance v0, Landroidx/media3/common/util/ParsableByteArray;
const/4 v1, 0x2
invoke-direct {v0, v1}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 236
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v2
const/4 v3, 0x0
invoke-interface {p0, v2, v3, v1}, Landroidx/media3/extractor/ExtractorInput;->peekFully([BII)V
.line 238
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->readUnsignedShort()I
move-result v0
shr-int/lit8 v1, v0, 0x2
const/16 v2, 0x3ffe
if-ne v1, v2, :cond_0
.line 246
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->resetPeekPosition()V
return v0
.line 241
:cond_0
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->resetPeekPosition()V
const-string p0, "First frame does not start with sync code."
const/4 v0, 0x0
.line 242
invoke-static {p0, v0}, Landroidx/media3/common/ParserException;->createForMalformedContainer(Ljava/lang/String;Ljava/lang/Throwable;)Landroidx/media3/common/ParserException;
move-result-object p0
throw p0
.end method
.method public static peekId3Metadata(Landroidx/media3/extractor/ExtractorInput;Z)Landroidx/media3/common/Metadata;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_0
move-object p1, v0
goto :goto_0
.line 68
:cond_0
sget-object p1, Landroidx/media3/extractor/metadata/id3/Id3Decoder;->NO_FRAMES_PREDICATE:Landroidx/media3/extractor/metadata/id3/Id3Decoder$FramePredicate;
.line 69
:goto_0
new-instance v1, Landroidx/media3/extractor/Id3Peeker;
invoke-direct {v1}, Landroidx/media3/extractor/Id3Peeker;-><init>()V
invoke-virtual {v1, p0, p1}, Landroidx/media3/extractor/Id3Peeker;->peekId3Data(Landroidx/media3/extractor/ExtractorInput;Landroidx/media3/extractor/metadata/id3/Id3Decoder$FramePredicate;)Landroidx/media3/common/Metadata;
move-result-object p0
if-eqz p0, :cond_2
.line 70
invoke-virtual {p0}, Landroidx/media3/common/Metadata;->length()I
move-result p1
if-nez p1, :cond_1
goto :goto_1
:cond_1
move-object v0, p0
:cond_2
:goto_1
return-object v0
.end method
.method public static readId3Metadata(Landroidx/media3/extractor/ExtractorInput;Z)Landroidx/media3/common/Metadata;
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 103
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->resetPeekPosition()V
.line 104
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->getPeekPosition()J
move-result-wide v0
.line 105
invoke-static {p0, p1}, Landroidx/media3/extractor/FlacMetadataReader;->peekId3Metadata(Landroidx/media3/extractor/ExtractorInput;Z)Landroidx/media3/common/Metadata;
move-result-object p1
.line 106
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->getPeekPosition()J
move-result-wide v2
sub-long/2addr v2, v0
long-to-int v0, v2
.line 107
invoke-interface {p0, v0}, Landroidx/media3/extractor/ExtractorInput;->skipFully(I)V
return-object p1
.end method
.method public static readMetadataBlock(Landroidx/media3/extractor/ExtractorInput;Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;)Z
.locals 7
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 150
invoke-interface {p0}, Landroidx/media3/extractor/ExtractorInput;->resetPeekPosition()V
.line 151
new-instance v0, Landroidx/media3/common/util/ParsableBitArray;
const/4 v1, 0x4
new-array v2, v1, [B
invoke-direct {v0, v2}, Landroidx/media3/common/util/ParsableBitArray;-><init>([B)V
.line 152
iget-object v2, v0, Landroidx/media3/common/util/ParsableBitArray;->data:[B
const/4 v3, 0x0
invoke-interface {p0, v2, v3, v1}, Landroidx/media3/extractor/ExtractorInput;->peekFully([BII)V
.line 154
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableBitArray;->readBit()Z
move-result v2
const/4 v4, 0x7
.line 155
invoke-virtual {v0, v4}, Landroidx/media3/common/util/ParsableBitArray;->readBits(I)I
move-result v4
const/16 v5, 0x18
.line 156
invoke-virtual {v0, v5}, Landroidx/media3/common/util/ParsableBitArray;->readBits(I)I
move-result v0
add-int/2addr v0, v1
if-nez v4, :cond_0
.line 158
invoke-static {p0}, Landroidx/media3/extractor/FlacMetadataReader;->readStreamInfoBlock(Landroidx/media3/extractor/ExtractorInput;)Landroidx/media3/extractor/FlacStreamMetadata;
move-result-object p0
iput-object p0, p1, Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;->flacStreamMetadata:Landroidx/media3/extractor/FlacStreamMetadata;
goto :goto_0
.line 160
:cond_0
iget-object v5, p1, Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;->flacStreamMetadata:Landroidx/media3/extractor/FlacStreamMetadata;
if-eqz v5, :cond_4
const/4 v6, 0x3
if-ne v4, v6, :cond_1
.line 165
invoke-static {p0, v0}, Landroidx/media3/extractor/FlacMetadataReader;->readSeekTableMetadataBlock(Landroidx/media3/extractor/ExtractorInput;I)Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;
move-result-object p0
.line 166
invoke-virtual {v5, p0}, Landroidx/media3/extractor/FlacStreamMetadata;->copyWithSeekTable(Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;)Landroidx/media3/extractor/FlacStreamMetadata;
move-result-object p0
iput-object p0, p1, Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;->flacStreamMetadata:Landroidx/media3/extractor/FlacStreamMetadata;
goto :goto_0
:cond_1
if-ne v4, v1, :cond_2
.line 168
invoke-static {p0, v0}, Landroidx/media3/extractor/FlacMetadataReader;->readVorbisCommentMetadataBlock(Landroidx/media3/extractor/ExtractorInput;I)Ljava/util/List;
move-result-object p0
.line 170
invoke-virtual {v5, p0}, Landroidx/media3/extractor/FlacStreamMetadata;->copyWithVorbisComments(Ljava/util/List;)Landroidx/media3/extractor/FlacStreamMetadata;
move-result-object p0
iput-object p0, p1, Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;->flacStreamMetadata:Landroidx/media3/extractor/FlacStreamMetadata;
goto :goto_0
:cond_2
const/4 v6, 0x6
if-ne v4, v6, :cond_3
.line 172
new-instance v4, Landroidx/media3/common/util/ParsableByteArray;
invoke-direct {v4, v0}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 173
invoke-virtual {v4}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v6
invoke-interface {p0, v6, v3, v0}, Landroidx/media3/extractor/ExtractorInput;->readFully([BII)V
.line 174
invoke-virtual {v4, v1}, Landroidx/media3/common/util/ParsableByteArray;->skipBytes(I)V
.line 175
invoke-static {v4}, Landroidx/media3/extractor/metadata/flac/PictureFrame;->fromPictureBlock(Landroidx/media3/common/util/ParsableByteArray;)Landroidx/media3/extractor/metadata/flac/PictureFrame;
move-result-object p0
.line 177
invoke-static {p0}, Lcom/google/common/collect/ImmutableList;->of(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList;
move-result-object p0
invoke-virtual {v5, p0}, Landroidx/media3/extractor/FlacStreamMetadata;->copyWithPictureFrames(Ljava/util/List;)Landroidx/media3/extractor/FlacStreamMetadata;
move-result-object p0
iput-object p0, p1, Landroidx/media3/extractor/FlacMetadataReader$FlacStreamMetadataHolder;->flacStreamMetadata:Landroidx/media3/extractor/FlacStreamMetadata;
goto :goto_0
.line 179
:cond_3
invoke-interface {p0, v0}, Landroidx/media3/extractor/ExtractorInput;->skipFully(I)V
:goto_0
return v2
.line 162
:cond_4
new-instance p0, Ljava/lang/IllegalArgumentException;
invoke-direct {p0}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p0
.end method
.method public static readSeekTableMetadataBlock(Landroidx/media3/common/util/ParsableByteArray;)Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;
.locals 10
const/4 v0, 0x1
.line 197
invoke-virtual {p0, v0}, Landroidx/media3/common/util/ParsableByteArray;->skipBytes(I)V
.line 198
invoke-virtual {p0}, Landroidx/media3/common/util/ParsableByteArray;->readUnsignedInt24()I
move-result v0
.line 200
invoke-virtual {p0}, Landroidx/media3/common/util/ParsableByteArray;->getPosition()I
move-result v1
int-to-long v1, v1
int-to-long v3, v0
add-long/2addr v1, v3
.line 201
div-int/lit8 v0, v0, 0x12
.line 202
new-array v3, v0, [J
.line 203
new-array v4, v0, [J
const/4 v5, 0x0
:goto_0
if-ge v5, v0, :cond_1
.line 207
invoke-virtual {p0}, Landroidx/media3/common/util/ParsableByteArray;->readLong()J
move-result-wide v6
const-wide/16 v8, -0x1
cmp-long v8, v6, v8
if-nez v8, :cond_0
.line 209
invoke-static {v3, v5}, Ljava/util/Arrays;->copyOf([JI)[J
move-result-object v3
.line 210
invoke-static {v4, v5}, Ljava/util/Arrays;->copyOf([JI)[J
move-result-object v4
goto :goto_1
.line 213
:cond_0
aput-wide v6, v3, v5
.line 214
invoke-virtual {p0}, Landroidx/media3/common/util/ParsableByteArray;->readLong()J
move-result-wide v6
aput-wide v6, v4, v5
const/4 v6, 0x2
.line 215
invoke-virtual {p0, v6}, Landroidx/media3/common/util/ParsableByteArray;->skipBytes(I)V
add-int/lit8 v5, v5, 0x1
goto :goto_0
.line 218
:cond_1
:goto_1
invoke-virtual {p0}, Landroidx/media3/common/util/ParsableByteArray;->getPosition()I
move-result v0
int-to-long v5, v0
sub-long/2addr v1, v5
long-to-int v0, v1
invoke-virtual {p0, v0}, Landroidx/media3/common/util/ParsableByteArray;->skipBytes(I)V
.line 219
new-instance p0, Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;
invoke-direct {p0, v3, v4}, Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;-><init>([J[J)V
return-object p0
.end method
.method private static readSeekTableMetadataBlock(Landroidx/media3/extractor/ExtractorInput;I)Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 259
new-instance v0, Landroidx/media3/common/util/ParsableByteArray;
invoke-direct {v0, p1}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 260
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v1
const/4 v2, 0x0
invoke-interface {p0, v1, v2, p1}, Landroidx/media3/extractor/ExtractorInput;->readFully([BII)V
.line 261
invoke-static {v0}, Landroidx/media3/extractor/FlacMetadataReader;->readSeekTableMetadataBlock(Landroidx/media3/common/util/ParsableByteArray;)Landroidx/media3/extractor/FlacStreamMetadata$SeekTable;
move-result-object p0
return-object p0
.end method
.method private static readStreamInfoBlock(Landroidx/media3/extractor/ExtractorInput;)Landroidx/media3/extractor/FlacStreamMetadata;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/16 v0, 0x26
new-array v1, v0, [B
const/4 v2, 0x0
.line 252
invoke-interface {p0, v1, v2, v0}, Landroidx/media3/extractor/ExtractorInput;->readFully([BII)V
.line 253
new-instance p0, Landroidx/media3/extractor/FlacStreamMetadata;
const/4 v0, 0x4
invoke-direct {p0, v1, v0}, Landroidx/media3/extractor/FlacStreamMetadata;-><init>([BI)V
return-object p0
.end method
.method public static readStreamMarker(Landroidx/media3/extractor/ExtractorInput;)V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 121
new-instance v0, Landroidx/media3/common/util/ParsableByteArray;
const/4 v1, 0x4
invoke-direct {v0, v1}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 122
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v2
const/4 v3, 0x0
invoke-interface {p0, v2, v3, v1}, Landroidx/media3/extractor/ExtractorInput;->readFully([BII)V
.line 123
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->readUnsignedInt()J
move-result-wide v0
const-wide/32 v2, 0x664c6143
cmp-long p0, v0, v2
if-nez p0, :cond_0
return-void
:cond_0
const-string p0, "Failed to read FLAC stream marker."
const/4 v0, 0x0
.line 124
invoke-static {p0, v0}, Landroidx/media3/common/ParserException;->createForMalformedContainer(Ljava/lang/String;Ljava/lang/Throwable;)Landroidx/media3/common/ParserException;
move-result-object p0
throw p0
.end method
.method private static readVorbisCommentMetadataBlock(Landroidx/media3/extractor/ExtractorInput;I)Ljava/util/List;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/media3/extractor/ExtractorInput;",
"I)",
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 266
new-instance v0, Landroidx/media3/common/util/ParsableByteArray;
invoke-direct {v0, p1}, Landroidx/media3/common/util/ParsableByteArray;-><init>(I)V
.line 267
invoke-virtual {v0}, Landroidx/media3/common/util/ParsableByteArray;->getData()[B
move-result-object v1
const/4 v2, 0x0
invoke-interface {p0, v1, v2, p1}, Landroidx/media3/extractor/ExtractorInput;->readFully([BII)V
const/4 p0, 0x4
.line 268
invoke-virtual {v0, p0}, Landroidx/media3/common/util/ParsableByteArray;->skipBytes(I)V
.line 270
invoke-static {v0, v2, v2}, Landroidx/media3/extractor/VorbisUtil;->readVorbisCommentHeader(Landroidx/media3/common/util/ParsableByteArray;ZZ)Landroidx/media3/extractor/VorbisUtil$CommentHeader;
move-result-object p0
.line 272
iget-object p0, p0, Landroidx/media3/extractor/VorbisUtil$CommentHeader;->comments:[Ljava/lang/String;
invoke-static {p0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object p0
return-object p0
.end method