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
41636ada
authored
Jul 12, 2018
by
ojw28
Committed by
GitHub
Jul 12, 2018
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #4391 from kaltura/add-label
Add label attribute support for DASH audio/text
parents
28bb3ba7
cd9041c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
36 deletions
library/core/src/main/java/com/google/android/exoplayer2/Format.java
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistParser.java
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParser.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/DefaultTrackNameProvider.java
library/core/src/main/java/com/google/android/exoplayer2/Format.java
View file @
41636ada
...
...
@@ -160,6 +160,11 @@ public final class Format implements Parcelable {
public
final
@Nullable
String
language
;
/**
* The label, or null if unknown or not applicable.
*/
public
final
String
label
;
/**
* The Accessibility channel, or {@link #NO_VALUE} if not known or applicable.
*/
public
final
int
accessibilityChannel
;
...
...
@@ -183,7 +188,7 @@ public final class Format implements Parcelable {
return
new
Format
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
width
,
height
,
frameRate
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
selectionFlags
,
null
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
null
,
null
);
initializationData
,
null
,
null
,
null
);
}
public
static
Format
createVideoSampleFormat
(
...
...
@@ -238,7 +243,7 @@ public final class Format implements Parcelable {
return
new
Format
(
id
,
null
,
sampleMimeType
,
codecs
,
bitrate
,
maxInputSize
,
width
,
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
0
,
null
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
drmInitData
,
null
);
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
drmInitData
,
null
,
null
);
}
// Audio.
...
...
@@ -253,11 +258,12 @@ public final class Format implements Parcelable {
int
sampleRate
,
List
<
byte
[]>
initializationData
,
@C
.
SelectionFlags
int
selectionFlags
,
@Nullable
String
language
)
{
@Nullable
String
language
,
@Nullable
String
label
)
{
return
new
Format
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
channelCount
,
sampleRate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
selectionFlags
,
language
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
null
,
null
);
initializationData
,
null
,
null
,
label
);
}
public
static
Format
createAudioSampleFormat
(
...
...
@@ -313,7 +319,7 @@ public final class Format implements Parcelable {
return
new
Format
(
id
,
null
,
sampleMimeType
,
codecs
,
bitrate
,
maxInputSize
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
drmInitData
,
metadata
);
initializationData
,
drmInitData
,
metadata
,
null
);
}
// Text.
...
...
@@ -325,9 +331,10 @@ public final class Format implements Parcelable {
@Nullable
String
codecs
,
int
bitrate
,
@C
.
SelectionFlags
int
selectionFlags
,
@Nullable
String
language
)
{
@Nullable
String
language
,
@Nullable
String
label
)
{
return
createTextContainerFormat
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
selectionFlags
,
language
,
NO_VALUE
);
selectionFlags
,
language
,
NO_VALUE
,
label
);
}
public
static
Format
createTextContainerFormat
(
...
...
@@ -338,11 +345,13 @@ public final class Format implements Parcelable {
int
bitrate
,
@C
.
SelectionFlags
int
selectionFlags
,
@Nullable
String
language
,
int
accessibilityChannel
)
{
int
accessibilityChannel
,
@Nullable
String
label
)
{
return
new
Format
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
selectionFlags
,
language
,
accessibilityChannel
,
OFFSET_SAMPLE_RELATIVE
,
null
,
null
,
null
);
OFFSET_SAMPLE_RELATIVE
,
null
,
null
,
null
,
label
);
}
public
static
Format
createTextSampleFormat
(
...
...
@@ -403,7 +412,7 @@ public final class Format implements Parcelable {
return
new
Format
(
id
,
null
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
null
);
initializationData
,
drmInitData
,
null
,
null
);
}
// Image.
...
...
@@ -443,7 +452,8 @@ public final class Format implements Parcelable {
OFFSET_SAMPLE_RELATIVE
,
initializationData
,
drmInitData
,
null
);
null
,
null
);
}
// Generic.
...
...
@@ -459,14 +469,14 @@ public final class Format implements Parcelable {
return
new
Format
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
selectionFlags
,
language
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
null
,
null
,
null
);
null
,
null
);
}
public
static
Format
createSampleFormat
(
@Nullable
String
id
,
@Nullable
String
sampleMimeType
,
long
subsampleOffsetUs
)
{
return
new
Format
(
id
,
null
,
sampleMimeType
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
0
,
null
,
NO_VALUE
,
subsampleOffsetUs
,
null
,
null
,
null
);
NO_VALUE
,
0
,
null
,
NO_VALUE
,
subsampleOffsetUs
,
null
,
null
,
null
,
null
);
}
public
static
Format
createSampleFormat
(
...
...
@@ -477,7 +487,7 @@ public final class Format implements Parcelable {
@Nullable
DrmInitData
drmInitData
)
{
return
new
Format
(
id
,
null
,
sampleMimeType
,
codecs
,
bitrate
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
null
,
NO_VALUE
,
null
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
NO_VALUE
,
0
,
null
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
null
,
drmInitData
,
null
);
NO_VALUE
,
0
,
null
,
NO_VALUE
,
OFFSET_SAMPLE_RELATIVE
,
null
,
drmInitData
,
null
,
null
);
}
/* package */
Format
(
...
...
@@ -506,7 +516,9 @@ public final class Format implements Parcelable {
long
subsampleOffsetUs
,
@Nullable
List
<
byte
[]>
initializationData
,
@Nullable
DrmInitData
drmInitData
,
@Nullable
Metadata
metadata
)
{
@Nullable
Metadata
metadata
,
@Nullable
String
label
)
{
this
.
id
=
id
;
this
.
containerMimeType
=
containerMimeType
;
this
.
sampleMimeType
=
sampleMimeType
;
...
...
@@ -529,6 +541,7 @@ public final class Format implements Parcelable {
this
.
encoderPadding
=
encoderPadding
==
Format
.
NO_VALUE
?
0
:
encoderPadding
;
this
.
selectionFlags
=
selectionFlags
;
this
.
language
=
language
;
this
.
label
=
label
;
this
.
accessibilityChannel
=
accessibilityChannel
;
this
.
subsampleOffsetUs
=
subsampleOffsetUs
;
this
.
initializationData
=
initializationData
==
null
?
Collections
.<
byte
[]>
emptyList
()
...
...
@@ -561,6 +574,7 @@ public final class Format implements Parcelable {
encoderPadding
=
in
.
readInt
();
selectionFlags
=
in
.
readInt
();
language
=
in
.
readString
();
label
=
in
.
readString
();
accessibilityChannel
=
in
.
readInt
();
subsampleOffsetUs
=
in
.
readLong
();
int
initializationDataSize
=
in
.
readInt
();
...
...
@@ -577,7 +591,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithSubsampleOffsetUs
(
long
subsampleOffsetUs
)
{
...
...
@@ -585,7 +599,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithContainerInfo
(
...
...
@@ -601,7 +615,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
@SuppressWarnings
(
"ReferenceEquality"
)
...
...
@@ -616,13 +630,14 @@ public final class Format implements Parcelable {
float
frameRate
=
this
.
frameRate
==
NO_VALUE
?
manifestFormat
.
frameRate
:
this
.
frameRate
;
@C
.
SelectionFlags
int
selectionFlags
=
this
.
selectionFlags
|
manifestFormat
.
selectionFlags
;
String
language
=
this
.
language
==
null
?
manifestFormat
.
language
:
this
.
language
;
DrmInitData
drmInitData
=
DrmInitData
.
createSessionCreationData
(
manifestFormat
.
drmInitData
,
this
.
drmInitData
);
String
label
=
this
.
label
==
null
?
manifestFormat
.
label
:
this
.
label
;
DrmInitData
drmInitData
=
DrmInitData
.
createSessionCreationData
(
manifestFormat
.
drmInitData
,
this
.
drmInitData
);
return
new
Format
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
maxInputSize
,
width
,
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithGaplessInfo
(
int
encoderDelay
,
int
encoderPadding
)
{
...
...
@@ -630,7 +645,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithDrmInitData
(
@Nullable
DrmInitData
drmInitData
)
{
...
...
@@ -638,7 +653,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithMetadata
(
@Nullable
Metadata
metadata
)
{
...
...
@@ -646,7 +661,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
public
Format
copyWithRotationDegrees
(
int
rotationDegrees
)
{
...
...
@@ -654,7 +669,7 @@ public final class Format implements Parcelable {
height
,
frameRate
,
rotationDegrees
,
pixelWidthHeightRatio
,
projectionData
,
stereoMode
,
colorInfo
,
channelCount
,
sampleRate
,
pcmEncoding
,
encoderDelay
,
encoderPadding
,
selectionFlags
,
language
,
accessibilityChannel
,
subsampleOffsetUs
,
initializationData
,
drmInitData
,
metadata
);
drmInitData
,
metadata
,
label
);
}
/**
...
...
@@ -780,6 +795,9 @@ public final class Format implements Parcelable {
if
(
format
.
language
!=
null
)
{
builder
.
append
(
", language="
).
append
(
format
.
language
);
}
if
(
format
.
label
!=
null
)
{
builder
.
append
(
", label="
).
append
(
format
.
label
);
}
return
builder
.
toString
();
}
...
...
library/dash/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java
View file @
41636ada
...
...
@@ -248,6 +248,7 @@ public class DashManifestParser extends DefaultHandler
int
audioSamplingRate
=
parseInt
(
xpp
,
"audioSamplingRate"
,
Format
.
NO_VALUE
);
String
language
=
xpp
.
getAttributeValue
(
null
,
"lang"
);
String
drmSchemeType
=
null
;
String
label
=
xpp
.
getAttributeValue
(
null
,
"label"
);
ArrayList
<
SchemeData
>
drmSchemeDatas
=
new
ArrayList
<>();
ArrayList
<
Descriptor
>
inbandEventStreams
=
new
ArrayList
<>();
ArrayList
<
Descriptor
>
accessibilityDescriptors
=
new
ArrayList
<>();
...
...
@@ -285,7 +286,7 @@ public class DashManifestParser extends DefaultHandler
}
else
if
(
XmlPullParserUtil
.
isStartTag
(
xpp
,
"Representation"
))
{
RepresentationInfo
representationInfo
=
parseRepresentation
(
xpp
,
baseUrl
,
mimeType
,
codecs
,
width
,
height
,
frameRate
,
audioChannels
,
audioSamplingRate
,
language
,
selectionFlags
,
accessibilityDescriptors
,
segmentBase
);
selectionFlags
,
accessibilityDescriptors
,
segmentBase
,
label
);
contentType
=
checkContentTypeConsistency
(
contentType
,
getContentType
(
representationInfo
.
format
));
representationInfos
.
add
(
representationInfo
);
...
...
@@ -457,7 +458,7 @@ public class DashManifestParser extends DefaultHandler
int
adaptationSetHeight
,
float
adaptationSetFrameRate
,
int
adaptationSetAudioChannels
,
int
adaptationSetAudioSamplingRate
,
String
adaptationSetLanguage
,
@C
.
SelectionFlags
int
adaptationSetSelectionFlags
,
List
<
Descriptor
>
adaptationSetAccessibilityDescriptors
,
SegmentBase
segmentBase
)
List
<
Descriptor
>
adaptationSetAccessibilityDescriptors
,
SegmentBase
segmentBase
,
String
label
)
throws
XmlPullParserException
,
IOException
{
String
id
=
xpp
.
getAttributeValue
(
null
,
"id"
);
int
bandwidth
=
parseInt
(
xpp
,
"bandwidth"
,
Format
.
NO_VALUE
);
...
...
@@ -507,7 +508,7 @@ public class DashManifestParser extends DefaultHandler
Format
format
=
buildFormat
(
id
,
mimeType
,
width
,
height
,
frameRate
,
audioChannels
,
audioSamplingRate
,
bandwidth
,
adaptationSetLanguage
,
adaptationSetSelectionFlags
,
adaptationSetAccessibilityDescriptors
,
codecs
,
supplementalProperties
);
adaptationSetAccessibilityDescriptors
,
codecs
,
supplementalProperties
,
label
);
segmentBase
=
segmentBase
!=
null
?
segmentBase
:
new
SingleSegmentBase
();
return
new
RepresentationInfo
(
format
,
baseUrl
,
segmentBase
,
drmSchemeType
,
drmSchemeDatas
,
...
...
@@ -517,7 +518,7 @@ public class DashManifestParser extends DefaultHandler
protected
Format
buildFormat
(
String
id
,
String
containerMimeType
,
int
width
,
int
height
,
float
frameRate
,
int
audioChannels
,
int
audioSamplingRate
,
int
bitrate
,
String
language
,
@C
.
SelectionFlags
int
selectionFlags
,
List
<
Descriptor
>
accessibilityDescriptors
,
String
codecs
,
List
<
Descriptor
>
supplementalProperties
)
{
String
codecs
,
List
<
Descriptor
>
supplementalProperties
,
String
label
)
{
String
sampleMimeType
=
getSampleMimeType
(
containerMimeType
,
codecs
);
if
(
sampleMimeType
!=
null
)
{
if
(
MimeTypes
.
AUDIO_E_AC3
.
equals
(
sampleMimeType
))
{
...
...
@@ -528,7 +529,7 @@ public class DashManifestParser extends DefaultHandler
bitrate
,
width
,
height
,
frameRate
,
null
,
selectionFlags
);
}
else
if
(
MimeTypes
.
isAudio
(
sampleMimeType
))
{
return
Format
.
createAudioContainerFormat
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
audioChannels
,
audioSamplingRate
,
null
,
selectionFlags
,
language
);
bitrate
,
audioChannels
,
audioSamplingRate
,
null
,
selectionFlags
,
language
,
label
);
}
else
if
(
mimeTypeIsRawText
(
sampleMimeType
))
{
int
accessibilityChannel
;
if
(
MimeTypes
.
APPLICATION_CEA608
.
equals
(
sampleMimeType
))
{
...
...
@@ -539,7 +540,7 @@ public class DashManifestParser extends DefaultHandler
accessibilityChannel
=
Format
.
NO_VALUE
;
}
return
Format
.
createTextContainerFormat
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
selectionFlags
,
language
,
accessibilityChannel
);
bitrate
,
selectionFlags
,
language
,
accessibilityChannel
,
label
);
}
}
return
Format
.
createContainerFormat
(
id
,
containerMimeType
,
sampleMimeType
,
codecs
,
bitrate
,
...
...
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistParser.java
View file @
41636ada
...
...
@@ -295,7 +295,7 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
String
sampleMimeType
=
codecs
!=
null
?
MimeTypes
.
getMediaMimeType
(
codecs
)
:
null
;
format
=
Format
.
createAudioContainerFormat
(
id
,
MimeTypes
.
APPLICATION_M3U8
,
sampleMimeType
,
codecs
,
Format
.
NO_VALUE
,
Format
.
NO_VALUE
,
Format
.
NO_VALUE
,
null
,
selectionFlags
,
language
);
language
,
id
);
if
(
uri
==
null
)
{
muxedAudioFormat
=
format
;
}
else
{
...
...
@@ -304,7 +304,7 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
break
;
case
TYPE_SUBTITLES:
format
=
Format
.
createTextContainerFormat
(
id
,
MimeTypes
.
APPLICATION_M3U8
,
MimeTypes
.
TEXT_VTT
,
null
,
Format
.
NO_VALUE
,
selectionFlags
,
language
);
MimeTypes
.
TEXT_VTT
,
null
,
Format
.
NO_VALUE
,
selectionFlags
,
language
,
id
);
subtitles
.
add
(
new
HlsMasterPlaylist
.
HlsUrl
(
uri
,
format
));
break
;
case
TYPE_CLOSED_CAPTIONS:
...
...
@@ -322,7 +322,7 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
muxedCaptionFormats
=
new
ArrayList
<>();
}
muxedCaptionFormats
.
add
(
Format
.
createTextContainerFormat
(
id
,
null
,
mimeType
,
null
,
Format
.
NO_VALUE
,
selectionFlags
,
language
,
accessibilityChannel
));
Format
.
NO_VALUE
,
selectionFlags
,
language
,
accessibilityChannel
,
id
));
break
;
default
:
// Do nothing.
...
...
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParser.java
View file @
41636ada
...
...
@@ -603,6 +603,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
private
static
final
String
KEY_FOUR_CC
=
"FourCC"
;
private
static
final
String
KEY_TYPE
=
"Type"
;
private
static
final
String
KEY_LANGUAGE
=
"Language"
;
private
static
final
String
KEY_NAME
=
"Name"
;
private
static
final
String
KEY_MAX_WIDTH
=
"MaxWidth"
;
private
static
final
String
KEY_MAX_HEIGHT
=
"MaxHeight"
;
...
...
@@ -637,12 +638,14 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
CodecSpecificDataUtil
.
buildAacLcAudioSpecificConfig
(
samplingRate
,
channels
));
}
String
language
=
(
String
)
getNormalizedAttribute
(
KEY_LANGUAGE
);
String
label
=
(
String
)
getNormalizedAttribute
(
KEY_NAME
);
format
=
Format
.
createAudioContainerFormat
(
id
,
MimeTypes
.
AUDIO_MP4
,
sampleMimeType
,
null
,
bitrate
,
channels
,
samplingRate
,
codecSpecificData
,
0
,
language
);
bitrate
,
channels
,
samplingRate
,
codecSpecificData
,
0
,
language
,
label
);
}
else
if
(
type
==
C
.
TRACK_TYPE_TEXT
)
{
String
language
=
(
String
)
getNormalizedAttribute
(
KEY_LANGUAGE
);
String
label
=
(
String
)
getNormalizedAttribute
(
KEY_NAME
);
format
=
Format
.
createTextContainerFormat
(
id
,
MimeTypes
.
APPLICATION_MP4
,
sampleMimeType
,
null
,
bitrate
,
0
,
language
);
null
,
bitrate
,
0
,
language
,
label
);
}
else
{
format
=
Format
.
createContainerFormat
(
id
,
MimeTypes
.
APPLICATION_MP4
,
sampleMimeType
,
null
,
bitrate
,
0
,
null
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/DefaultTrackNameProvider.java
View file @
41636ada
...
...
@@ -88,6 +88,9 @@ public class DefaultTrackNameProvider implements TrackNameProvider {
}
private
String
buildLanguageString
(
Format
format
)
{
if
(
!
TextUtils
.
isEmpty
(
format
.
label
)
){
return
format
.
label
;
}
String
language
=
format
.
language
;
return
TextUtils
.
isEmpty
(
language
)
||
C
.
LANGUAGE_UNDETERMINED
.
equals
(
language
)
?
""
...
...
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