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
8fb1e5ce
authored
Aug 05, 2021
by
andrewlewis
Committed by
Christos Tsilopoulos
Aug 05, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Set StreamIndex Name as format.label in SS
Issue: #9252 #minor-release PiperOrigin-RevId: 388889406
parent
6ca0b307
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
RELEASENOTES.md
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParser.java
library/smoothstreaming/src/test/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParserTest.java
RELEASENOTES.md
View file @
8fb1e5ce
...
@@ -154,6 +154,9 @@
...
@@ -154,6 +154,9 @@
playlists, so that the
`PlaybackStatsListener`
can derive audio
playlists, so that the
`PlaybackStatsListener`
can derive audio
format-related information.
format-related information.
(
[
#9175
](
https://github.com/google/ExoPlayer/issues/9175
)
).
(
[
#9175
](
https://github.com/google/ExoPlayer/issues/9175
)
).
*
SS:
*
Propagate
`StreamIndex`
element
`Name`
attribute value as
`Format`
label (
[
#9252
](
https://github.com/google/ExoPlayer/issues/9252
)
).
### 2.14.2 (2021-07-20)
### 2.14.2 (2021-07-20)
...
...
library/smoothstreaming/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParser.java
View file @
8fb1e5ce
...
@@ -192,7 +192,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
...
@@ -192,7 +192,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
* provided name, the parent element parser will be queried, and so on up the chain.
* provided name, the parent element parser will be queried, and so on up the chain.
*
*
* @param key The name of the attribute.
* @param key The name of the attribute.
* @return The stashed value, or null if the attribute was not
be
found.
* @return The stashed value, or null if the attribute was not found.
*/
*/
@Nullable
@Nullable
protected
final
Object
getNormalizedAttribute
(
String
key
)
{
protected
final
Object
getNormalizedAttribute
(
String
key
)
{
...
@@ -595,6 +595,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
...
@@ -595,6 +595,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
}
}
putNormalizedAttribute
(
KEY_SUB_TYPE
,
subType
);
putNormalizedAttribute
(
KEY_SUB_TYPE
,
subType
);
name
=
parser
.
getAttributeValue
(
null
,
KEY_NAME
);
name
=
parser
.
getAttributeValue
(
null
,
KEY_NAME
);
putNormalizedAttribute
(
KEY_NAME
,
name
);
url
=
parseRequiredString
(
parser
,
KEY_URL
);
url
=
parseRequiredString
(
parser
,
KEY_URL
);
maxWidth
=
parseInt
(
parser
,
KEY_MAX_WIDTH
,
Format
.
NO_VALUE
);
maxWidth
=
parseInt
(
parser
,
KEY_MAX_WIDTH
,
Format
.
NO_VALUE
);
maxHeight
=
parseInt
(
parser
,
KEY_MAX_HEIGHT
,
Format
.
NO_VALUE
);
maxHeight
=
parseInt
(
parser
,
KEY_MAX_HEIGHT
,
Format
.
NO_VALUE
);
...
...
library/smoothstreaming/src/test/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifestParserTest.java
View file @
8fb1e5ce
...
@@ -15,11 +15,12 @@
...
@@ -15,11 +15,12 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
source
.
smoothstreaming
.
manifest
;
package
com
.
google
.
android
.
exoplayer2
.
source
.
smoothstreaming
.
manifest
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
android.net.Uri
;
import
android.net.Uri
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
java.io.IOException
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
...
@@ -32,7 +33,7 @@ public final class SsManifestParserTest {
...
@@ -32,7 +33,7 @@ public final class SsManifestParserTest {
/** Simple test to ensure the sample manifests parse without any exceptions being thrown. */
/** Simple test to ensure the sample manifests parse without any exceptions being thrown. */
@Test
@Test
public
void
parseSmoothStreamingManifest
()
throws
IO
Exception
{
public
void
parseSmoothStreamingManifest
()
throws
Exception
{
SsManifestParser
parser
=
new
SsManifestParser
();
SsManifestParser
parser
=
new
SsManifestParser
();
parser
.
parse
(
parser
.
parse
(
Uri
.
parse
(
"https://example.com/test.ismc"
),
Uri
.
parse
(
"https://example.com/test.ismc"
),
...
@@ -41,4 +42,15 @@ public final class SsManifestParserTest {
...
@@ -41,4 +42,15 @@ public final class SsManifestParserTest {
Uri
.
parse
(
"https://example.com/test.ismc"
),
Uri
.
parse
(
"https://example.com/test.ismc"
),
TestUtil
.
getInputStream
(
ApplicationProvider
.
getApplicationContext
(),
SAMPLE_ISMC_2
));
TestUtil
.
getInputStream
(
ApplicationProvider
.
getApplicationContext
(),
SAMPLE_ISMC_2
));
}
}
@Test
public
void
parse_populatesFormatLabelWithStreamIndexName
()
throws
Exception
{
SsManifestParser
parser
=
new
SsManifestParser
();
SsManifest
ssManifest
=
parser
.
parse
(
Uri
.
parse
(
"https://example.com/test.ismc"
),
TestUtil
.
getInputStream
(
ApplicationProvider
.
getApplicationContext
(),
SAMPLE_ISMC_1
));
assertThat
(
ssManifest
.
streamElements
[
0
].
formats
[
0
].
label
).
isEqualTo
(
"video"
);
}
}
}
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