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
d01d0cfd
authored
Apr 23, 2020
by
krocard
Committed by
Ian Baker
Apr 27, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Define a interface type for Aac object type.
PiperOrigin-RevId: 308115863
parent
e250fe62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
library/common/src/main/java/com/google/android/exoplayer2/audio/AacUtil.java
library/common/src/main/java/com/google/android/exoplayer2/audio/AacUtil.java
View file @
d01d0cfd
...
@@ -15,11 +15,15 @@
...
@@ -15,11 +15,15 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
audio
;
package
com
.
google
.
android
.
exoplayer2
.
audio
;
import
androidx.annotation.IntDef
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.ParsableBitArray
;
import
com.google.android.exoplayer2.util.ParsableBitArray
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/** Utility methods for handling AAC audio streams. */
/** Utility methods for handling AAC audio streams. */
public
final
class
AacUtil
{
public
final
class
AacUtil
{
...
@@ -132,19 +136,37 @@ public final class AacUtil {
...
@@ -132,19 +136,37 @@ public final class AacUtil {
private
static
final
String
CODECS_STRING_PREFIX
=
"mp4a.40."
;
private
static
final
String
CODECS_STRING_PREFIX
=
"mp4a.40."
;
// Advanced Audio Coding Low-Complexity profile.
// Advanced Audio Coding Low-Complexity profile.
p
rivate
static
final
int
AUDIO_OBJECT_TYPE_AAC_LC
=
2
;
p
ublic
static
final
int
AUDIO_OBJECT_TYPE_AAC_LC
=
2
;
// Spectral Band Replication.
// Spectral Band Replication.
p
rivate
static
final
int
AUDIO_OBJECT_TYPE_AAC_SBR
=
5
;
p
ublic
static
final
int
AUDIO_OBJECT_TYPE_AAC_SBR
=
5
;
// Error Resilient Bit-Sliced Arithmetic Coding.
// Error Resilient Bit-Sliced Arithmetic Coding.
p
rivate
static
final
int
AUDIO_OBJECT_TYPE_AAC_ER_BSAC
=
22
;
p
ublic
static
final
int
AUDIO_OBJECT_TYPE_AAC_ER_BSAC
=
22
;
// Enhanced low delay.
// Enhanced low delay.
p
rivate
static
final
int
AUDIO_OBJECT_TYPE_AAC_ELD
=
23
;
p
ublic
static
final
int
AUDIO_OBJECT_TYPE_AAC_ELD
=
23
;
// Parametric Stereo.
// Parametric Stereo.
p
rivate
static
final
int
AUDIO_OBJECT_TYPE_AAC_PS
=
29
;
p
ublic
static
final
int
AUDIO_OBJECT_TYPE_AAC_PS
=
29
;
// Escape code for extended audio object types.
// Escape code for extended audio object types.
private
static
final
int
AUDIO_OBJECT_TYPE_ESCAPE
=
31
;
private
static
final
int
AUDIO_OBJECT_TYPE_ESCAPE
=
31
;
// Extended high efficiency.
// Extended high efficiency.
private
static
final
int
AUDIO_OBJECT_TYPE_AAC_XHE
=
42
;
public
static
final
int
AUDIO_OBJECT_TYPE_AAC_XHE
=
42
;
/**
* Valid AAC Audio object types. One of {@link #AUDIO_OBJECT_TYPE_AAC_LC}, {@link
* #AUDIO_OBJECT_TYPE_AAC_SBR}, {@link #AUDIO_OBJECT_TYPE_AAC_ER_BSAC}, {@link
* #AUDIO_OBJECT_TYPE_AAC_ELD}, {@link #AUDIO_OBJECT_TYPE_AAC_PS} or {@link
* #AUDIO_OBJECT_TYPE_AAC_XHE}.
*/
@Documented
@Retention
(
RetentionPolicy
.
SOURCE
)
@IntDef
({
AUDIO_OBJECT_TYPE_AAC_LC
,
AUDIO_OBJECT_TYPE_AAC_SBR
,
AUDIO_OBJECT_TYPE_AAC_ER_BSAC
,
AUDIO_OBJECT_TYPE_AAC_ELD
,
AUDIO_OBJECT_TYPE_AAC_PS
,
AUDIO_OBJECT_TYPE_AAC_XHE
})
public
@interface
AacAudioObjectType
{}
/**
/**
* Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
* Parses an AAC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
...
@@ -275,7 +297,7 @@ public final class AacUtil {
...
@@ -275,7 +297,7 @@ public final class AacUtil {
/** Returns the encoding for a given AAC audio object type. */
/** Returns the encoding for a given AAC audio object type. */
@C
.
Encoding
@C
.
Encoding
public
static
int
getEncodingForAudioObjectType
(
int
audioObjectType
)
{
public
static
int
getEncodingForAudioObjectType
(
@AacAudioObjectType
int
audioObjectType
)
{
switch
(
audioObjectType
)
{
switch
(
audioObjectType
)
{
case
AUDIO_OBJECT_TYPE_AAC_LC:
case
AUDIO_OBJECT_TYPE_AAC_LC:
return
C
.
ENCODING_AAC_LC
;
return
C
.
ENCODING_AAC_LC
;
...
...
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