Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0f94ebfb
authored
Dec 19, 2019
by
olly
Committed by
Oliver Woodman
Dec 19, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add NonNull at package level for extractor
PiperOrigin-RevId: 286381499
parent
fc4b258c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
8 deletions
library/core/src/main/java/com/google/android/exoplayer2/extractor/BinarySearchSeeker.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/ChunkIndex.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/FlacMetadataReader.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/GaplessInfoHolder.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/Id3Peeker.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/package-info.java
library/core/src/main/java/com/google/android/exoplayer2/extractor/BinarySearchSeeker.java
View file @
0f94ebfb
...
@@ -91,7 +91,7 @@ public abstract class BinarySearchSeeker {
...
@@ -91,7 +91,7 @@ public abstract class BinarySearchSeeker {
protected
final
BinarySearchSeekMap
seekMap
;
protected
final
BinarySearchSeekMap
seekMap
;
protected
final
TimestampSeeker
timestampSeeker
;
protected
final
TimestampSeeker
timestampSeeker
;
protected
@Nullable
SeekOperationParams
seekOperationParams
;
@Nullable
protected
SeekOperationParams
seekOperationParams
;
private
final
int
minimumSearchRange
;
private
final
int
minimumSearchRange
;
...
@@ -173,7 +173,6 @@ public abstract class BinarySearchSeeker {
...
@@ -173,7 +173,6 @@ public abstract class BinarySearchSeeker {
*/
*/
public
int
handlePendingSeek
(
ExtractorInput
input
,
PositionHolder
seekPositionHolder
)
public
int
handlePendingSeek
(
ExtractorInput
input
,
PositionHolder
seekPositionHolder
)
throws
InterruptedException
,
IOException
{
throws
InterruptedException
,
IOException
{
TimestampSeeker
timestampSeeker
=
Assertions
.
checkNotNull
(
this
.
timestampSeeker
);
while
(
true
)
{
while
(
true
)
{
SeekOperationParams
seekOperationParams
=
Assertions
.
checkNotNull
(
this
.
seekOperationParams
);
SeekOperationParams
seekOperationParams
=
Assertions
.
checkNotNull
(
this
.
seekOperationParams
);
long
floorPosition
=
seekOperationParams
.
getFloorBytePosition
();
long
floorPosition
=
seekOperationParams
.
getFloorBytePosition
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ChunkIndex.java
View file @
0f94ebfb
...
@@ -76,7 +76,7 @@ public final class ChunkIndex implements SeekMap {
...
@@ -76,7 +76,7 @@ public final class ChunkIndex implements SeekMap {
* @return The index of the corresponding chunk.
* @return The index of the corresponding chunk.
*/
*/
public
int
getChunkIndex
(
long
timeUs
)
{
public
int
getChunkIndex
(
long
timeUs
)
{
return
Util
.
binarySearchFloor
(
timesUs
,
timeUs
,
true
,
true
);
return
Util
.
binarySearchFloor
(
timesUs
,
timeUs
,
/* inclusive= */
true
,
/* stayInBounds= */
true
);
}
}
// SeekMap implementation.
// SeekMap implementation.
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java
View file @
0f94ebfb
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.extractor.amr.AmrExtractor
;
import
com.google.android.exoplayer2.extractor.amr.AmrExtractor
;
import
com.google.android.exoplayer2.extractor.flac.FlacExtractor
;
import
com.google.android.exoplayer2.extractor.flac.FlacExtractor
;
import
com.google.android.exoplayer2.extractor.flv.FlvExtractor
;
import
com.google.android.exoplayer2.extractor.flv.FlvExtractor
;
...
@@ -56,10 +57,11 @@ import java.lang.reflect.Constructor;
...
@@ -56,10 +57,11 @@ import java.lang.reflect.Constructor;
*/
*/
public
final
class
DefaultExtractorsFactory
implements
ExtractorsFactory
{
public
final
class
DefaultExtractorsFactory
implements
ExtractorsFactory
{
@Nullable
private
static
final
Constructor
<?
extends
Extractor
>
FLAC_EXTENSION_EXTRACTOR_CONSTRUCTOR
;
private
static
final
Constructor
<?
extends
Extractor
>
FLAC_EXTENSION_EXTRACTOR_CONSTRUCTOR
;
static
{
static
{
Constructor
<?
extends
Extractor
>
flacExtensionExtractorConstructor
=
null
;
@Nullable
Constructor
<?
extends
Extractor
>
flacExtensionExtractorConstructor
=
null
;
try
{
try
{
// LINT.IfChange
// LINT.IfChange
flacExtensionExtractorConstructor
=
flacExtensionExtractorConstructor
=
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/FlacMetadataReader.java
View file @
0f94ebfb
...
@@ -171,7 +171,7 @@ public final class FlacMetadataReader {
...
@@ -171,7 +171,7 @@ public final class FlacMetadataReader {
if
(
type
==
FlacConstants
.
METADATA_TYPE_STREAM_INFO
)
{
if
(
type
==
FlacConstants
.
METADATA_TYPE_STREAM_INFO
)
{
metadataHolder
.
flacStreamMetadata
=
readStreamInfoBlock
(
input
);
metadataHolder
.
flacStreamMetadata
=
readStreamInfoBlock
(
input
);
}
else
{
}
else
{
FlacStreamMetadata
flacStreamMetadata
=
metadataHolder
.
flacStreamMetadata
;
@Nullable
FlacStreamMetadata
flacStreamMetadata
=
metadataHolder
.
flacStreamMetadata
;
if
(
flacStreamMetadata
==
null
)
{
if
(
flacStreamMetadata
==
null
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/GaplessInfoHolder.java
View file @
0f94ebfb
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Util
.
castNonNull
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.id3.CommentFrame
;
import
com.google.android.exoplayer2.metadata.id3.CommentFrame
;
...
@@ -107,8 +109,8 @@ public final class GaplessInfoHolder {
...
@@ -107,8 +109,8 @@ public final class GaplessInfoHolder {
Matcher
matcher
=
GAPLESS_COMMENT_PATTERN
.
matcher
(
data
);
Matcher
matcher
=
GAPLESS_COMMENT_PATTERN
.
matcher
(
data
);
if
(
matcher
.
find
())
{
if
(
matcher
.
find
())
{
try
{
try
{
int
encoderDelay
=
Integer
.
parseInt
(
matcher
.
group
(
1
),
16
);
int
encoderDelay
=
Integer
.
parseInt
(
castNonNull
(
matcher
.
group
(
1
)
),
16
);
int
encoderPadding
=
Integer
.
parseInt
(
matcher
.
group
(
2
),
16
);
int
encoderPadding
=
Integer
.
parseInt
(
castNonNull
(
matcher
.
group
(
2
)
),
16
);
if
(
encoderDelay
>
0
||
encoderPadding
>
0
)
{
if
(
encoderDelay
>
0
||
encoderPadding
>
0
)
{
this
.
encoderDelay
=
encoderDelay
;
this
.
encoderDelay
=
encoderDelay
;
this
.
encoderPadding
=
encoderPadding
;
this
.
encoderPadding
=
encoderPadding
;
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/Id3Peeker.java
View file @
0f94ebfb
...
@@ -50,7 +50,7 @@ public final class Id3Peeker {
...
@@ -50,7 +50,7 @@ public final class Id3Peeker {
ExtractorInput
input
,
@Nullable
Id3Decoder
.
FramePredicate
id3FramePredicate
)
ExtractorInput
input
,
@Nullable
Id3Decoder
.
FramePredicate
id3FramePredicate
)
throws
IOException
,
InterruptedException
{
throws
IOException
,
InterruptedException
{
int
peekedId3Bytes
=
0
;
int
peekedId3Bytes
=
0
;
Metadata
metadata
=
null
;
@Nullable
Metadata
metadata
=
null
;
while
(
true
)
{
while
(
true
)
{
try
{
try
{
input
.
peekFully
(
scratch
.
data
,
/* offset= */
0
,
Id3Decoder
.
ID3_HEADER_LENGTH
);
input
.
peekFully
(
scratch
.
data
,
/* offset= */
0
,
Id3Decoder
.
ID3_HEADER_LENGTH
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/package-info.java
0 → 100644
View file @
0f94ebfb
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NonNullApi
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
import
com.google.android.exoplayer2.util.NonNullApi
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment