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
dc7fde1f
authored
Jan 25, 2021
by
olly
Committed by
Ian Baker
Jan 25, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Some more language fixes
Issue: #7565 PiperOrigin-RevId: 353613493
parent
bfc73698
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
24 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/Util.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/C2Mp3TimestampTracker.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/wav/WavHeaderReader.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeExoMediaDrm.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java
library/common/src/main/java/com/google/android/exoplayer2/util/Util.java
View file @
dc7fde1f
...
@@ -2189,7 +2189,7 @@ public final class Util {
...
@@ -2189,7 +2189,7 @@ public final class Util {
return
getMobileNetworkType
(
networkInfo
);
return
getMobileNetworkType
(
networkInfo
);
case
ConnectivityManager
.
TYPE_ETHERNET
:
case
ConnectivityManager
.
TYPE_ETHERNET
:
return
C
.
NETWORK_TYPE_ETHERNET
;
return
C
.
NETWORK_TYPE_ETHERNET
;
default
:
// VPN, Bluetooth, Dummy.
default
:
return
C
.
NETWORK_TYPE_OTHER
;
return
C
.
NETWORK_TYPE_OTHER
;
}
}
}
}
...
@@ -2620,7 +2620,7 @@ public final class Util {
...
@@ -2620,7 +2620,7 @@ public final class Util {
"hsn"
,
"zh-hsn"
"hsn"
,
"zh-hsn"
};
};
// Legacy
("grandfathered") tags,
replaced by modern equivalents (including macrolanguage)
// Legacy
tags that have been
replaced by modern equivalents (including macrolanguage)
// See https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
// See https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
private
static
final
String
[]
isoLegacyTagReplacements
=
private
static
final
String
[]
isoLegacyTagReplacements
=
new
String
[]
{
new
String
[]
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/C2Mp3TimestampTracker.java
View file @
dc7fde1f
...
@@ -30,7 +30,7 @@ import java.nio.ByteBuffer;
...
@@ -30,7 +30,7 @@ import java.nio.ByteBuffer;
/* package */
final
class
C2Mp3TimestampTracker
{
/* package */
final
class
C2Mp3TimestampTracker
{
// Mirroring the actual codec, as can be found at
// Mirroring the actual codec, as can be found at
// https://cs.android.com/android/platform/superproject/+/ma
ster
:frameworks/av/media/codec2/components/mp3/C2SoftMp3Dec.h;l=55;drc=3665390c9d32a917398b240c5a46ced07a3b65eb
// https://cs.android.com/android/platform/superproject/+/ma
in
:frameworks/av/media/codec2/components/mp3/C2SoftMp3Dec.h;l=55;drc=3665390c9d32a917398b240c5a46ced07a3b65eb
private
static
final
long
DECODER_DELAY_SAMPLES
=
529
;
private
static
final
long
DECODER_DELAY_SAMPLES
=
529
;
private
static
final
String
TAG
=
"C2Mp3TimestampTracker"
;
private
static
final
String
TAG
=
"C2Mp3TimestampTracker"
;
...
@@ -76,7 +76,7 @@ import java.nio.ByteBuffer;
...
@@ -76,7 +76,7 @@ import java.nio.ByteBuffer;
}
}
// These calculations mirror the timestamp calculations in the Codec2 Mp3 Decoder.
// These calculations mirror the timestamp calculations in the Codec2 Mp3 Decoder.
// https://cs.android.com/android/platform/superproject/+/ma
ster
:frameworks/av/media/codec2/components/mp3/C2SoftMp3Dec.cpp;l=464;drc=ed134640332fea70ca4b05694289d91a5265bb46
// https://cs.android.com/android/platform/superproject/+/ma
in
:frameworks/av/media/codec2/components/mp3/C2SoftMp3Dec.cpp;l=464;drc=ed134640332fea70ca4b05694289d91a5265bb46
if
(
processedSamples
==
0
)
{
if
(
processedSamples
==
0
)
{
anchorTimestampUs
=
buffer
.
timeUs
;
anchorTimestampUs
=
buffer
.
timeUs
;
processedSamples
=
frameCount
-
DECODER_DELAY_SAMPLES
;
processedSamples
=
frameCount
-
DECODER_DELAY_SAMPLES
;
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java
View file @
dc7fde1f
...
@@ -178,10 +178,10 @@ public interface Cache {
...
@@ -178,10 +178,10 @@ public interface Cache {
* @param key The cache key of the resource.
* @param key The cache key of the resource.
* @param position The starting position in the resource from which data is required.
* @param position The starting position in the resource from which data is required.
* @param length The length of the data being requested, or {@link C#LENGTH_UNSET} if unbounded.
* @param length The length of the data being requested, or {@link C#LENGTH_UNSET} if unbounded.
* The length is ignored i
n the case of a cache hit. In the case of a cache miss, it defines
* The length is ignored i
f there is a cache entry that overlaps the position. Else, it
*
the maximum length of the hole {@link CacheSpan} that's returned. Cache implementations may
*
defines the maximum length of the hole {@link CacheSpan} that's returned. Cache
*
support parallel writes into non-overlapping holes, and so passing the actual required
*
implementations may support parallel writes into non-overlapping holes, and so passing the
* length should be preferred to passing {@link C#LENGTH_UNSET} when possible.
*
actual required
length should be preferred to passing {@link C#LENGTH_UNSET} when possible.
* @return The {@link CacheSpan}.
* @return The {@link CacheSpan}.
* @throws InterruptedException If the thread was interrupted.
* @throws InterruptedException If the thread was interrupted.
* @throws CacheException If an error is encountered.
* @throws CacheException If an error is encountered.
...
@@ -199,8 +199,8 @@ public interface Cache {
...
@@ -199,8 +199,8 @@ public interface Cache {
* @param key The cache key of the resource.
* @param key The cache key of the resource.
* @param position The starting position in the resource from which data is required.
* @param position The starting position in the resource from which data is required.
* @param length The length of the data being requested, or {@link C#LENGTH_UNSET} if unbounded.
* @param length The length of the data being requested, or {@link C#LENGTH_UNSET} if unbounded.
* The length is ignored i
n the case of a cache hit. In the case of a cache miss, it defines
* The length is ignored i
f there is a cache entry that overlaps the position. Else, it
* the range of data locked by the returned {@link CacheSpan}.
*
defines
the range of data locked by the returned {@link CacheSpan}.
* @return The {@link CacheSpan}. Or null if the cache entry is locked.
* @return The {@link CacheSpan}. Or null if the cache entry is locked.
* @throws CacheException If an error is encountered.
* @throws CacheException If an error is encountered.
*/
*/
...
...
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
View file @
dc7fde1f
...
@@ -4885,8 +4885,8 @@ public final class ExoPlayerTest {
...
@@ -4885,8 +4885,8 @@ public final class ExoPlayerTest {
MediaSource
mediaSource2
=
new
FakeMediaSource
(
timeline2
);
MediaSource
mediaSource2
=
new
FakeMediaSource
(
timeline2
);
Timeline
expectedPlaceholderTimeline
=
Timeline
expectedPlaceholderTimeline
=
new
FakeTimeline
(
new
FakeTimeline
(
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
2
));
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
2
));
ActionSchedule
actionSchedule
=
ActionSchedule
actionSchedule
=
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
waitForTimelineChanged
(
.
waitForTimelineChanged
(
...
@@ -4958,9 +4958,9 @@ public final class ExoPlayerTest {
...
@@ -4958,9 +4958,9 @@ public final class ExoPlayerTest {
Timeline
expectedPlaceholderTimeline
=
Timeline
expectedPlaceholderTimeline
=
new
FakeTimeline
(
new
FakeTimeline
(
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
2
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
2
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
3
));
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
3
));
Timeline
expectedRealTimeline
=
Timeline
expectedRealTimeline
=
new
FakeTimeline
(
firstWindowDefinition
,
secondWindowDefinition
,
thirdWindowDefinition
);
new
FakeTimeline
(
firstWindowDefinition
,
secondWindowDefinition
,
thirdWindowDefinition
);
Timeline
expectedRealTimelineAfterRemove
=
Timeline
expectedRealTimelineAfterRemove
=
...
@@ -5018,9 +5018,9 @@ public final class ExoPlayerTest {
...
@@ -5018,9 +5018,9 @@ public final class ExoPlayerTest {
Timeline
expectedPlaceholderTimeline
=
Timeline
expectedPlaceholderTimeline
=
new
FakeTimeline
(
new
FakeTimeline
(
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
1
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
2
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
2
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
3
));
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
3
));
Timeline
expectedRealTimeline
=
Timeline
expectedRealTimeline
=
new
FakeTimeline
(
firstWindowDefinition
,
secondWindowDefinition
,
thirdWindowDefinition
);
new
FakeTimeline
(
firstWindowDefinition
,
secondWindowDefinition
,
thirdWindowDefinition
);
Timeline
expectedRealTimelineAfterRemove
=
new
FakeTimeline
(
firstWindowDefinition
);
Timeline
expectedRealTimelineAfterRemove
=
new
FakeTimeline
(
firstWindowDefinition
);
...
@@ -5155,8 +5155,8 @@ public final class ExoPlayerTest {
...
@@ -5155,8 +5155,8 @@ public final class ExoPlayerTest {
Player
.
TIMELINE_CHANGE_REASON_SOURCE_UPDATE
/* source update after prepare */
);
Player
.
TIMELINE_CHANGE_REASON_SOURCE_UPDATE
/* source update after prepare */
);
Timeline
expectedSecondPlaceholderTimeline
=
Timeline
expectedSecondPlaceholderTimeline
=
new
FakeTimeline
(
new
FakeTimeline
(
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
0
),
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
0
),
TimelineWindowDefinition
.
create
Dummy
(
/* tag= */
0
));
TimelineWindowDefinition
.
create
Placeholder
(
/* tag= */
0
));
Timeline
expectedSecondRealTimeline
=
Timeline
expectedSecondRealTimeline
=
new
FakeTimeline
(
new
FakeTimeline
(
new
TimelineWindowDefinition
(
new
TimelineWindowDefinition
(
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/wav/WavHeaderReader.java
View file @
dc7fde1f
...
@@ -115,7 +115,7 @@ import java.io.IOException;
...
@@ -115,7 +115,7 @@ import java.io.IOException;
input
.
resetPeekPosition
();
input
.
resetPeekPosition
();
ParsableByteArray
scratch
=
new
ParsableByteArray
(
ChunkHeader
.
SIZE_IN_BYTES
);
ParsableByteArray
scratch
=
new
ParsableByteArray
(
ChunkHeader
.
SIZE_IN_BYTES
);
// Skip all chunks until we
hit
the data header.
// Skip all chunks until we
find
the data header.
ChunkHeader
chunkHeader
=
ChunkHeader
.
peek
(
input
,
scratch
);
ChunkHeader
chunkHeader
=
ChunkHeader
.
peek
(
input
,
scratch
);
while
(
chunkHeader
.
id
!=
WavUtil
.
DATA_FOURCC
)
{
while
(
chunkHeader
.
id
!=
WavUtil
.
DATA_FOURCC
)
{
if
(
chunkHeader
.
id
!=
WavUtil
.
RIFF_FOURCC
&&
chunkHeader
.
id
!=
WavUtil
.
FMT_FOURCC
)
{
if
(
chunkHeader
.
id
!=
WavUtil
.
RIFF_FOURCC
&&
chunkHeader
.
id
!=
WavUtil
.
FMT_FOURCC
)
{
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeExoMediaDrm.java
View file @
dc7fde1f
...
@@ -60,7 +60,7 @@ import java.util.concurrent.atomic.AtomicInteger;
...
@@ -60,7 +60,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@RequiresApi
(
29
)
@RequiresApi
(
29
)
public
final
class
FakeExoMediaDrm
implements
ExoMediaDrm
{
public
final
class
FakeExoMediaDrm
implements
ExoMediaDrm
{
public
static
final
ProvisionRequest
DUMMY
_PROVISION_REQUEST
=
public
static
final
ProvisionRequest
FAKE
_PROVISION_REQUEST
=
new
ProvisionRequest
(
TestUtil
.
createByteArray
(
7
,
8
,
9
),
"bar.test"
);
new
ProvisionRequest
(
TestUtil
.
createByteArray
(
7
,
8
,
9
),
"bar.test"
);
/** Key for use with the Map returned from {@link FakeExoMediaDrm#queryKeyStatus(byte[])}. */
/** Key for use with the Map returned from {@link FakeExoMediaDrm#queryKeyStatus(byte[])}. */
...
@@ -192,7 +192,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
...
@@ -192,7 +192,7 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
@Override
@Override
public
ProvisionRequest
getProvisionRequest
()
{
public
ProvisionRequest
getProvisionRequest
()
{
Assertions
.
checkState
(
referenceCount
>
0
);
Assertions
.
checkState
(
referenceCount
>
0
);
return
DUMMY
_PROVISION_REQUEST
;
return
FAKE
_PROVISION_REQUEST
;
}
}
@Override
@Override
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java
View file @
dc7fde1f
...
@@ -58,7 +58,7 @@ public final class FakeTimeline extends Timeline {
...
@@ -58,7 +58,7 @@ public final class FakeTimeline extends Timeline {
*
*
* @param tag The tag to use in the timeline.
* @param tag The tag to use in the timeline.
*/
*/
public
static
TimelineWindowDefinition
create
Dummy
(
Object
tag
)
{
public
static
TimelineWindowDefinition
create
Placeholder
(
Object
tag
)
{
return
new
TimelineWindowDefinition
(
return
new
TimelineWindowDefinition
(
/* periodCount= */
1
,
/* periodCount= */
1
,
/* id= */
tag
,
/* id= */
tag
,
...
...
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