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
9875c5d2
authored
Feb 06, 2020
by
krocard
Committed by
kim-vde
Feb 11, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
AudioCapabilities: Missing int class annotation
PiperOrigin-RevId: 293565660
parent
04af8e60
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
library/common/src/test/java/com/google/android/exoplayer2/CTest.java
library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java
library/common/src/test/java/com/google/android/exoplayer2/CTest.java
View file @
9875c5d2
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2;
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.media.AudioFormat
;
import
android.media.MediaCodec
;
import
android.media.MediaCodec
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -36,4 +37,12 @@ public class CTest {
...
@@ -36,4 +37,12 @@ public class CTest {
assertThat
(
C
.
CRYPTO_MODE_AES_CTR
).
isEqualTo
(
MediaCodec
.
CRYPTO_MODE_AES_CTR
);
assertThat
(
C
.
CRYPTO_MODE_AES_CTR
).
isEqualTo
(
MediaCodec
.
CRYPTO_MODE_AES_CTR
);
}
}
@SuppressLint
(
"InlinedApi"
)
@Test
public
void
testEncodingConstants
()
{
// Sanity check that encoding constant values match those defined by the platform.
assertThat
(
C
.
ENCODING_PCM_16BIT
).
isEqualTo
(
AudioFormat
.
ENCODING_PCM_16BIT
);
assertThat
(
C
.
ENCODING_MP3
).
isEqualTo
(
AudioFormat
.
ENCODING_MP3
);
assertThat
(
C
.
ENCODING_PCM_FLOAT
).
isEqualTo
(
AudioFormat
.
ENCODING_PCM_FLOAT
);
}
}
}
library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java
View file @
9875c5d2
...
@@ -24,6 +24,7 @@ import android.media.AudioManager;
...
@@ -24,6 +24,7 @@ import android.media.AudioManager;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.provider.Settings.Global
;
import
android.provider.Settings.Global
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -115,10 +116,10 @@ public final class AudioCapabilities {
...
@@ -115,10 +116,10 @@ public final class AudioCapabilities {
/**
/**
* Returns whether this device supports playback of the specified audio {@code encoding}.
* Returns whether this device supports playback of the specified audio {@code encoding}.
*
*
* @param encoding One of {@link
android.media.AudioFormat
}'s {@code ENCODING_*} constants.
* @param encoding One of {@link
C.Encoding
}'s {@code ENCODING_*} constants.
* @return Whether this device supports playback the specified audio {@code encoding}.
* @return Whether this device supports playback the specified audio {@code encoding}.
*/
*/
public
boolean
supportsEncoding
(
int
encoding
)
{
public
boolean
supportsEncoding
(
@C
.
Encoding
int
encoding
)
{
return
Arrays
.
binarySearch
(
supportedEncodings
,
encoding
)
>=
0
;
return
Arrays
.
binarySearch
(
supportedEncodings
,
encoding
)
>=
0
;
}
}
...
...
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