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
cb51a1bf
authored
Apr 20, 2020
by
olly
Committed by
Oliver Woodman
Apr 20, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix H265Reader to correctly output SEI and AUD NAL units
Issue: #7113 PiperOrigin-RevId: 307380133
parent
9a729000
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
96 deletions
RELEASENOTES.md
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/H265Reader.java
testdata/src/test/assets/ts/sample_h265.ts.0.dump
testdata/src/test/assets/ts/sample_h265.ts.1.dump
testdata/src/test/assets/ts/sample_h265.ts.2.dump
testdata/src/test/assets/ts/sample_h265.ts.3.dump
testdata/src/test/assets/ts/sample_h265.ts.unknown_length.dump
RELEASENOTES.md
View file @
cb51a1bf
...
...
@@ -118,6 +118,8 @@
costly on large files.
*
MP4: Store the Android capture frame rate only in
`Format.metadata`
.
`Format.frameRate`
now stores the calculated frame rate.
*
MPEG-TS: Fix issue where SEI NAL units were incorrectly dropped from H.265
samples (
[
#7113
](
https://github.com/google/ExoPlayer/issues/7113
)
).
*
Testing
*
Add
`TestExoPlayer`
, a utility class with APIs to create
`SimpleExoPlayer`
instances with fake components for testing.
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/H265Reader.java
View file @
cb51a1bf
...
...
@@ -47,6 +47,7 @@ public final class H265Reader implements ElementaryStreamReader {
private
static
final
int
VPS_NUT
=
32
;
private
static
final
int
SPS_NUT
=
33
;
private
static
final
int
PPS_NUT
=
34
;
private
static
final
int
AUD_NUT
=
35
;
private
static
final
int
PREFIX_SEI_NUT
=
39
;
private
static
final
int
SUFFIX_SEI_NUT
=
40
;
...
...
@@ -472,7 +473,7 @@ public final class H265Reader implements ElementaryStreamReader {
}
}
// Look for the flag if this NAL unit contains a slice_segment_layer_rbsp.
// Look for the f
irst slice f
lag if this NAL unit contains a slice_segment_layer_rbsp.
nalUnitHasKeyframeData
=
(
nalUnitType
>=
BLA_W_LP
&&
nalUnitType
<=
CRA_NUT
);
lookingForFirstSliceFlag
=
nalUnitHasKeyframeData
||
nalUnitType
<=
RASL_R
;
}
...
...
@@ -516,14 +517,12 @@ public final class H265Reader implements ElementaryStreamReader {
/** Returns whether a NAL unit type is one that occurs before any VCL NAL units in a sample. */
private
static
boolean
isPrefixNalUnit
(
int
nalUnitType
)
{
// TODO: Include AUD_NUT and PREFIX_SEI_NUT
return
VPS_NUT
<=
nalUnitType
&&
nalUnitType
<=
PPS_NUT
;
return
(
VPS_NUT
<=
nalUnitType
&&
nalUnitType
<=
AUD_NUT
)
||
nalUnitType
==
PREFIX_SEI_NUT
;
}
/** Returns whether a NAL unit type is one that occurs in the VLC body of a sample. */
private
static
boolean
isVclBodyNalUnit
(
int
nalUnitType
)
{
// TODO: Include SUFFIX_SEI_NUT
return
nalUnitType
<
VPS_NUT
;
return
nalUnitType
<
VPS_NUT
||
nalUnitType
==
SUFFIX_SEI_NUT
;
}
}
}
testdata/src/test/assets/ts/sample_h265.ts.0.dump
View file @
cb51a1bf
...
...
@@ -19,119 +19,119 @@ track 256:
sample 0:
time = 66666
flags = 1
data = length 251
0, hash 796A98BE
data = length 251
7, hash 85352308
sample 1:
time = 100000
flags = 0
data = length 12
19, hash 131AA4E4
data = length 12
26, hash 11D564DA
sample 2:
time = 266666
flags = 0
data = length 781
0, hash 3F881DB9
data = length 781
7, hash 50D15703
sample 3:
time = 200000
flags = 0
data = length 23
06, hash 9A77959C
data = length 23
13, hash ECA5AEE6
sample 4:
time = 133333
flags = 0
data = length 10
58, hash B887F7EF
data = length 10
65, hash 8720A939
sample 5:
time = 166666
flags = 0
data = length
98, hash D95BF6E3
data = length
105, hash 3A3A582D
sample 6:
time = 233333
flags = 0
data = length 6
1, hash 574C41C3
data = length 6
8, hash FC241239
sample 7:
time = 433333
flags = 0
data = length
296, hash E92DB288
data = length
303, hash 41B28452
sample 8:
time = 366666
flags = 0
data = length 1
37, hash 586DADD6
data = length 1
44, hash 60BBCD4C
sample 9:
time = 300000
flags = 0
data = length 2
18, hash 91E82C9F
data = length 2
25, hash E0FAD7E9
sample 10:
time = 333333
flags = 0
data = length 1
77, hash 4A4FEEC0
data = length 1
84, hash A3A6E036
sample 11:
time = 400000
flags = 0
data = length 8
2, hash 2E2ADD8
data = length 8
9, hash 43B0E322
sample 12:
time = 533333
flags = 0
data = length 29
0, hash 63CF7D90
data = length 29
7, hash 6D9FEEDA
sample 13:
time = 500000
flags = 0
data = length 2
68, hash E8CBAC11
data = length 2
75, hash 27430DB
sample 14:
time = 466666
flags = 0
data = length 1
78, hash C5B1613E
data = length 1
85, hash 97389E88
sample 15:
time = 566666
flags = 0
data = length 27
1, hash 76652FC5
data = length 27
8, hash 5819FEBB
sample 16:
time = 733333
flags = 0
data = length 2
57, hash 960B5DF4
data = length 2
64, hash 8545F36A
sample 17:
time = 666666
flags = 0
data = length 2
06, hash 87358D00
data = length 2
13, hash 52C7574A
sample 18:
time = 600000
flags = 0
data = length 13
0, hash 4D7A038D
data = length 13
7, hash D4F0BCD7
sample 19:
time = 633333
flags = 0
data = length 1
14, hash 2B3C616E
data = length 1
21, hash BE52EEB8
sample 20:
time = 700000
flags = 0
data = length
95, hash 37D79559
data = length
102, hash 6AA3C84F
sample 21:
time = 900000
flags = 0
data = length 2
33, hash 80308C9E
data = length 2
40, hash 8E3CA414
sample 22:
time = 833333
flags = 0
data = length 2
03, hash E70BA5F2
data = length 2
10, hash 5D050FE8
sample 23:
time = 766666
flags = 0
data = length
95, hash BA6FA2D3
data = length
102, hash ED3BD5C9
sample 24:
time = 800000
flags = 0
data = length 1
03, hash 51291041
data = length 1
10, hash CF65ED37
sample 25:
time = 866666
flags = 0
data = length 11
1, hash EE9DCFC9
data = length 11
8, hash BA0156BF
sample 26:
time = 1033333
flags = 0
data = length 2
53, hash D0CEFBA7
data = length 2
60, hash ED6ABC1D
sample 27:
time = 966666
flags = 0
data = length 1
34, hash 8802EEF0
data = length 1
41, hash 9787F33A
sample 28:
time = 933333
flags = 0
data = length 8
0, hash C635D9C2
data = length 8
7, hash EEC4D98C
track 8448:
total output bytes = 0
sample count = 0
...
...
testdata/src/test/assets/ts/sample_h265.ts.1.dump
View file @
cb51a1bf
...
...
@@ -19,83 +19,83 @@ track 256:
sample 0:
time = 300000
flags = 0
data = length 2
18, hash 91E82C9F
data = length 2
25, hash E0FAD7E9
sample 1:
time = 333333
flags = 0
data = length 1
77, hash 4A4FEEC0
data = length 1
84, hash A3A6E036
sample 2:
time = 400000
flags = 0
data = length 8
2, hash 2E2ADD8
data = length 8
9, hash 43B0E322
sample 3:
time = 533333
flags = 0
data = length 29
0, hash 63CF7D90
data = length 29
7, hash 6D9FEEDA
sample 4:
time = 500000
flags = 0
data = length 2
68, hash E8CBAC11
data = length 2
75, hash 27430DB
sample 5:
time = 466666
flags = 0
data = length 1
78, hash C5B1613E
data = length 1
85, hash 97389E88
sample 6:
time = 566666
flags = 0
data = length 27
1, hash 76652FC5
data = length 27
8, hash 5819FEBB
sample 7:
time = 733333
flags = 0
data = length 2
57, hash 960B5DF4
data = length 2
64, hash 8545F36A
sample 8:
time = 666666
flags = 0
data = length 2
06, hash 87358D00
data = length 2
13, hash 52C7574A
sample 9:
time = 600000
flags = 0
data = length 13
0, hash 4D7A038D
data = length 13
7, hash D4F0BCD7
sample 10:
time = 633333
flags = 0
data = length 1
14, hash 2B3C616E
data = length 1
21, hash BE52EEB8
sample 11:
time = 700000
flags = 0
data = length
95, hash 37D79559
data = length
102, hash 6AA3C84F
sample 12:
time = 900000
flags = 0
data = length 2
33, hash 80308C9E
data = length 2
40, hash 8E3CA414
sample 13:
time = 833333
flags = 0
data = length 2
03, hash E70BA5F2
data = length 2
10, hash 5D050FE8
sample 14:
time = 766666
flags = 0
data = length
95, hash BA6FA2D3
data = length
102, hash ED3BD5C9
sample 15:
time = 800000
flags = 0
data = length 1
03, hash 51291041
data = length 1
10, hash CF65ED37
sample 16:
time = 866666
flags = 0
data = length 11
1, hash EE9DCFC9
data = length 11
8, hash BA0156BF
sample 17:
time = 1033333
flags = 0
data = length 2
53, hash D0CEFBA7
data = length 2
60, hash ED6ABC1D
sample 18:
time = 966666
flags = 0
data = length 1
34, hash 8802EEF0
data = length 1
41, hash 9787F33A
sample 19:
time = 933333
flags = 0
data = length 8
0, hash C635D9C2
data = length 8
7, hash EEC4D98C
track 8448:
total output bytes = 0
sample count = 0
...
...
testdata/src/test/assets/ts/sample_h265.ts.2.dump
View file @
cb51a1bf
...
...
@@ -19,47 +19,47 @@ track 256:
sample 0:
time = 600000
flags = 0
data = length 13
0, hash 4D7A038D
data = length 13
7, hash D4F0BCD7
sample 1:
time = 633333
flags = 0
data = length 1
14, hash 2B3C616E
data = length 1
21, hash BE52EEB8
sample 2:
time = 700000
flags = 0
data = length
95, hash 37D79559
data = length
102, hash 6AA3C84F
sample 3:
time = 900000
flags = 0
data = length 2
33, hash 80308C9E
data = length 2
40, hash 8E3CA414
sample 4:
time = 833333
flags = 0
data = length 2
03, hash E70BA5F2
data = length 2
10, hash 5D050FE8
sample 5:
time = 766666
flags = 0
data = length
95, hash BA6FA2D3
data = length
102, hash ED3BD5C9
sample 6:
time = 800000
flags = 0
data = length 1
03, hash 51291041
data = length 1
10, hash CF65ED37
sample 7:
time = 866666
flags = 0
data = length 11
1, hash EE9DCFC9
data = length 11
8, hash BA0156BF
sample 8:
time = 1033333
flags = 0
data = length 2
53, hash D0CEFBA7
data = length 2
60, hash ED6ABC1D
sample 9:
time = 966666
flags = 0
data = length 1
34, hash 8802EEF0
data = length 1
41, hash 9787F33A
sample 10:
time = 933333
flags = 0
data = length 8
0, hash C635D9C2
data = length 8
7, hash EEC4D98C
track 8448:
total output bytes = 0
sample count = 0
...
...
testdata/src/test/assets/ts/sample_h265.ts.3.dump
View file @
cb51a1bf
...
...
@@ -19,11 +19,11 @@ track 256:
sample 0:
time = 966666
flags = 0
data = length 1
34, hash 8802EEF0
data = length 1
41, hash 9787F33A
sample 1:
time = 933333
flags = 0
data = length 8
0, hash C635D9C2
data = length 8
7, hash EEC4D98C
track 8448:
total output bytes = 0
sample count = 0
...
...
testdata/src/test/assets/ts/sample_h265.ts.unknown_length.dump
View file @
cb51a1bf
...
...
@@ -16,119 +16,119 @@ track 256:
sample 0:
time = 66666
flags = 1
data = length 251
0, hash 796A98BE
data = length 251
7, hash 85352308
sample 1:
time = 100000
flags = 0
data = length 12
19, hash 131AA4E4
data = length 12
26, hash 11D564DA
sample 2:
time = 266666
flags = 0
data = length 781
0, hash 3F881DB9
data = length 781
7, hash 50D15703
sample 3:
time = 200000
flags = 0
data = length 23
06, hash 9A77959C
data = length 23
13, hash ECA5AEE6
sample 4:
time = 133333
flags = 0
data = length 10
58, hash B887F7EF
data = length 10
65, hash 8720A939
sample 5:
time = 166666
flags = 0
data = length
98, hash D95BF6E3
data = length
105, hash 3A3A582D
sample 6:
time = 233333
flags = 0
data = length 6
1, hash 574C41C3
data = length 6
8, hash FC241239
sample 7:
time = 433333
flags = 0
data = length
296, hash E92DB288
data = length
303, hash 41B28452
sample 8:
time = 366666
flags = 0
data = length 1
37, hash 586DADD6
data = length 1
44, hash 60BBCD4C
sample 9:
time = 300000
flags = 0
data = length 2
18, hash 91E82C9F
data = length 2
25, hash E0FAD7E9
sample 10:
time = 333333
flags = 0
data = length 1
77, hash 4A4FEEC0
data = length 1
84, hash A3A6E036
sample 11:
time = 400000
flags = 0
data = length 8
2, hash 2E2ADD8
data = length 8
9, hash 43B0E322
sample 12:
time = 533333
flags = 0
data = length 29
0, hash 63CF7D90
data = length 29
7, hash 6D9FEEDA
sample 13:
time = 500000
flags = 0
data = length 2
68, hash E8CBAC11
data = length 2
75, hash 27430DB
sample 14:
time = 466666
flags = 0
data = length 1
78, hash C5B1613E
data = length 1
85, hash 97389E88
sample 15:
time = 566666
flags = 0
data = length 27
1, hash 76652FC5
data = length 27
8, hash 5819FEBB
sample 16:
time = 733333
flags = 0
data = length 2
57, hash 960B5DF4
data = length 2
64, hash 8545F36A
sample 17:
time = 666666
flags = 0
data = length 2
06, hash 87358D00
data = length 2
13, hash 52C7574A
sample 18:
time = 600000
flags = 0
data = length 13
0, hash 4D7A038D
data = length 13
7, hash D4F0BCD7
sample 19:
time = 633333
flags = 0
data = length 1
14, hash 2B3C616E
data = length 1
21, hash BE52EEB8
sample 20:
time = 700000
flags = 0
data = length
95, hash 37D79559
data = length
102, hash 6AA3C84F
sample 21:
time = 900000
flags = 0
data = length 2
33, hash 80308C9E
data = length 2
40, hash 8E3CA414
sample 22:
time = 833333
flags = 0
data = length 2
03, hash E70BA5F2
data = length 2
10, hash 5D050FE8
sample 23:
time = 766666
flags = 0
data = length
95, hash BA6FA2D3
data = length
102, hash ED3BD5C9
sample 24:
time = 800000
flags = 0
data = length 1
03, hash 51291041
data = length 1
10, hash CF65ED37
sample 25:
time = 866666
flags = 0
data = length 11
1, hash EE9DCFC9
data = length 11
8, hash BA0156BF
sample 26:
time = 1033333
flags = 0
data = length 2
53, hash D0CEFBA7
data = length 2
60, hash ED6ABC1D
sample 27:
time = 966666
flags = 0
data = length 1
34, hash 8802EEF0
data = length 1
41, hash 9787F33A
sample 28:
time = 933333
flags = 0
data = length 8
0, hash C635D9C2
data = length 8
7, hash EEC4D98C
track 8448:
total output bytes = 0
sample count = 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