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
d8876712
authored
Apr 21, 2023
by
rohks
Committed by
Rohit Singh
Apr 24, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add support to fetch `ColorInfo` from `avcC` box in `AtomParsers`
#minor-release PiperOrigin-RevId: 526082823
parent
49802cd2
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
177 additions
and
27 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/NalUnitUtil.java
library/common/src/test/java/com/google/android/exoplayer2/util/NalUnitUtilTest.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
library/extractor/src/main/java/com/google/android/exoplayer2/video/AvcConfig.java
library/extractor/src/main/java/com/google/android/exoplayer2/video/HevcConfig.java
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.0.dump
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.1.dump
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.2.dump
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.3.dump
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.unknown_length.dump
testdata/src/test/assets/muxerdumps/mp4_with_0_orientation.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_180_orientation.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_270_orientation.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_90_orientation.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_frame_rate.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_location.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_null_location.mp4.dump
testdata/src/test/assets/muxerdumps/mp4_with_same_tracks_offset.mp4.dump
library/common/src/main/java/com/google/android/exoplayer2/util/NalUnitUtil.java
View file @
d8876712
...
@@ -61,6 +61,9 @@ public final class NalUnitUtil {
...
@@ -61,6 +61,9 @@ public final class NalUnitUtil {
public
final
int
picOrderCountType
;
public
final
int
picOrderCountType
;
public
final
int
picOrderCntLsbLength
;
public
final
int
picOrderCntLsbLength
;
public
final
boolean
deltaPicOrderAlwaysZeroFlag
;
public
final
boolean
deltaPicOrderAlwaysZeroFlag
;
public
final
@C
.
ColorSpace
int
colorSpace
;
public
final
@C
.
ColorRange
int
colorRange
;
public
final
@C
.
ColorTransfer
int
colorTransfer
;
public
SpsData
(
public
SpsData
(
int
profileIdc
,
int
profileIdc
,
...
@@ -76,7 +79,10 @@ public final class NalUnitUtil {
...
@@ -76,7 +79,10 @@ public final class NalUnitUtil {
int
frameNumLength
,
int
frameNumLength
,
int
picOrderCountType
,
int
picOrderCountType
,
int
picOrderCntLsbLength
,
int
picOrderCntLsbLength
,
boolean
deltaPicOrderAlwaysZeroFlag
)
{
boolean
deltaPicOrderAlwaysZeroFlag
,
@C
.
ColorSpace
int
colorSpace
,
@C
.
ColorRange
int
colorRange
,
@C
.
ColorTransfer
int
colorTransfer
)
{
this
.
profileIdc
=
profileIdc
;
this
.
profileIdc
=
profileIdc
;
this
.
constraintsFlagsAndReservedZero2Bits
=
constraintsFlagsAndReservedZero2Bits
;
this
.
constraintsFlagsAndReservedZero2Bits
=
constraintsFlagsAndReservedZero2Bits
;
this
.
levelIdc
=
levelIdc
;
this
.
levelIdc
=
levelIdc
;
...
@@ -91,6 +97,9 @@ public final class NalUnitUtil {
...
@@ -91,6 +97,9 @@ public final class NalUnitUtil {
this
.
picOrderCountType
=
picOrderCountType
;
this
.
picOrderCountType
=
picOrderCountType
;
this
.
picOrderCntLsbLength
=
picOrderCntLsbLength
;
this
.
picOrderCntLsbLength
=
picOrderCntLsbLength
;
this
.
deltaPicOrderAlwaysZeroFlag
=
deltaPicOrderAlwaysZeroFlag
;
this
.
deltaPicOrderAlwaysZeroFlag
=
deltaPicOrderAlwaysZeroFlag
;
this
.
colorSpace
=
colorSpace
;
this
.
colorRange
=
colorRange
;
this
.
colorTransfer
=
colorTransfer
;
}
}
}
}
...
@@ -441,6 +450,9 @@ public final class NalUnitUtil {
...
@@ -441,6 +450,9 @@ public final class NalUnitUtil {
frameHeight
-=
(
frameCropTopOffset
+
frameCropBottomOffset
)
*
cropUnitY
;
frameHeight
-=
(
frameCropTopOffset
+
frameCropBottomOffset
)
*
cropUnitY
;
}
}
@C
.
ColorSpace
int
colorSpace
=
Format
.
NO_VALUE
;
@C
.
ColorRange
int
colorRange
=
Format
.
NO_VALUE
;
@C
.
ColorTransfer
int
colorTransfer
=
Format
.
NO_VALUE
;
float
pixelWidthHeightRatio
=
1
;
float
pixelWidthHeightRatio
=
1
;
boolean
vuiParametersPresentFlag
=
data
.
readBit
();
boolean
vuiParametersPresentFlag
=
data
.
readBit
();
if
(
vuiParametersPresentFlag
)
{
if
(
vuiParametersPresentFlag
)
{
...
@@ -459,6 +471,23 @@ public final class NalUnitUtil {
...
@@ -459,6 +471,23 @@ public final class NalUnitUtil {
Log
.
w
(
TAG
,
"Unexpected aspect_ratio_idc value: "
+
aspectRatioIdc
);
Log
.
w
(
TAG
,
"Unexpected aspect_ratio_idc value: "
+
aspectRatioIdc
);
}
}
}
}
if
(
data
.
readBit
())
{
// overscan_info_present_flag
data
.
skipBit
();
// overscan_appropriate_flag
}
if
(
data
.
readBit
())
{
// video_signal_type_present_flag
data
.
skipBits
(
3
);
// video_format
colorRange
=
data
.
readBit
()
?
C
.
COLOR_RANGE_FULL
:
C
.
COLOR_RANGE_LIMITED
;
// video_full_range_flag
if
(
data
.
readBit
())
{
// colour_description_present_flag
int
colorPrimaries
=
data
.
readBits
(
8
);
// colour_primaries
int
transferCharacteristics
=
data
.
readBits
(
8
);
// transfer_characteristics
data
.
skipBits
(
8
);
// matrix_coeffs
colorSpace
=
ColorInfo
.
isoColorPrimariesToColorSpace
(
colorPrimaries
);
colorTransfer
=
ColorInfo
.
isoTransferCharacteristicsToColorTransfer
(
transferCharacteristics
);
}
}
}
}
return
new
SpsData
(
return
new
SpsData
(
...
@@ -475,7 +504,10 @@ public final class NalUnitUtil {
...
@@ -475,7 +504,10 @@ public final class NalUnitUtil {
frameNumLength
,
frameNumLength
,
picOrderCntType
,
picOrderCntType
,
picOrderCntLsbLength
,
picOrderCntLsbLength
,
deltaPicOrderAlwaysZeroFlag
);
deltaPicOrderAlwaysZeroFlag
,
colorSpace
,
colorRange
,
colorTransfer
);
}
}
/**
/**
...
@@ -503,10 +535,6 @@ public final class NalUnitUtil {
...
@@ -503,10 +535,6 @@ public final class NalUnitUtil {
public
static
H265SpsData
parseH265SpsNalUnitPayload
(
public
static
H265SpsData
parseH265SpsNalUnitPayload
(
byte
[]
nalData
,
int
nalOffset
,
int
nalLimit
)
{
byte
[]
nalData
,
int
nalOffset
,
int
nalLimit
)
{
ParsableNalUnitBitArray
data
=
new
ParsableNalUnitBitArray
(
nalData
,
nalOffset
,
nalLimit
);
ParsableNalUnitBitArray
data
=
new
ParsableNalUnitBitArray
(
nalData
,
nalOffset
,
nalLimit
);
// HDR related metadata.
@C
.
ColorSpace
int
colorSpace
=
Format
.
NO_VALUE
;
@C
.
ColorRange
int
colorRange
=
Format
.
NO_VALUE
;
@C
.
ColorTransfer
int
colorTransfer
=
Format
.
NO_VALUE
;
data
.
skipBits
(
4
);
// sps_video_parameter_set_id
data
.
skipBits
(
4
);
// sps_video_parameter_set_id
int
maxSubLayersMinus1
=
data
.
readBits
(
3
);
int
maxSubLayersMinus1
=
data
.
readBits
(
3
);
data
.
skipBit
();
// sps_temporal_id_nesting_flag
data
.
skipBit
();
// sps_temporal_id_nesting_flag
...
@@ -593,6 +621,9 @@ public final class NalUnitUtil {
...
@@ -593,6 +621,9 @@ public final class NalUnitUtil {
}
}
}
}
data
.
skipBits
(
2
);
// sps_temporal_mvp_enabled_flag, strong_intra_smoothing_enabled_flag
data
.
skipBits
(
2
);
// sps_temporal_mvp_enabled_flag, strong_intra_smoothing_enabled_flag
@C
.
ColorSpace
int
colorSpace
=
Format
.
NO_VALUE
;
@C
.
ColorRange
int
colorRange
=
Format
.
NO_VALUE
;
@C
.
ColorTransfer
int
colorTransfer
=
Format
.
NO_VALUE
;
float
pixelWidthHeightRatio
=
1
;
float
pixelWidthHeightRatio
=
1
;
if
(
data
.
readBit
())
{
// vui_parameters_present_flag
if
(
data
.
readBit
())
{
// vui_parameters_present_flag
if
(
data
.
readBit
())
{
// aspect_ratio_info_present_flag
if
(
data
.
readBit
())
{
// aspect_ratio_info_present_flag
...
@@ -614,14 +645,14 @@ public final class NalUnitUtil {
...
@@ -614,14 +645,14 @@ public final class NalUnitUtil {
}
}
if
(
data
.
readBit
())
{
// video_signal_type_present_flag
if
(
data
.
readBit
())
{
// video_signal_type_present_flag
data
.
skipBits
(
3
);
// video_format
data
.
skipBits
(
3
);
// video_format
boolean
fullRangeFlag
=
data
.
readBit
();
// video_full_range_flag
colorRange
=
data
.
readBit
()
?
C
.
COLOR_RANGE_FULL
:
C
.
COLOR_RANGE_LIMITED
;
// video_full_range_flag
if
(
data
.
readBit
())
{
// colour_description_present_flag
if
(
data
.
readBit
())
{
// colour_description_present_flag
int
colorPrimaries
=
data
.
readBits
(
8
);
// colour_primaries
int
colorPrimaries
=
data
.
readBits
(
8
);
// colour_primaries
int
transferCharacteristics
=
data
.
readBits
(
8
);
// transfer_characteristics
int
transferCharacteristics
=
data
.
readBits
(
8
);
// transfer_characteristics
data
.
skipBits
(
8
);
// matrix_coeffs
data
.
skipBits
(
8
);
// matrix_coeffs
colorSpace
=
ColorInfo
.
isoColorPrimariesToColorSpace
(
colorPrimaries
);
colorSpace
=
ColorInfo
.
isoColorPrimariesToColorSpace
(
colorPrimaries
);
colorRange
=
fullRangeFlag
?
C
.
COLOR_RANGE_FULL
:
C
.
COLOR_RANGE_LIMITED
;
colorTransfer
=
colorTransfer
=
ColorInfo
.
isoTransferCharacteristicsToColorTransfer
(
transferCharacteristics
);
ColorInfo
.
isoTransferCharacteristicsToColorTransfer
(
transferCharacteristics
);
}
}
...
...
library/common/src/test/java/com/google/android/exoplayer2/util/NalUnitUtilTest.java
View file @
d8876712
...
@@ -31,8 +31,8 @@ public final class NalUnitUtilTest {
...
@@ -31,8 +31,8 @@ public final class NalUnitUtilTest {
private
static
final
int
TEST_NAL_POSITION
=
10
;
private
static
final
int
TEST_NAL_POSITION
=
10
;
private
static
final
byte
[]
SPS_TEST_DATA
=
private
static
final
byte
[]
SPS_TEST_DATA
=
createByteArray
(
createByteArray
(
0x00
,
0x00
,
0x01
,
0x67
,
0x4D
,
0x40
,
0x16
,
0xEC
,
0xA0
,
0x50
,
0x17
,
0xFC
,
0xB8
,
0x0
8
,
0x8
0
,
0x00
,
0x00
,
0x01
,
0x67
,
0x4D
,
0x40
,
0x16
,
0xEC
,
0xA0
,
0x50
,
0x17
,
0xFC
,
0xB8
,
0x0
A
,
0x9
0
,
0x
00
,
0x00
,
0x03
,
0x00
,
0x80
,
0x00
,
0x00
,
0x0F
,
0x47
,
0x8B
,
0x16
,
0xCB
);
0x
91
,
0x00
,
0x03
,
0x00
,
0x80
,
0x00
,
0x00
,
0x0F
,
0x47
,
0x8B
,
0x16
,
0xCB
);
private
static
final
int
SPS_TEST_DATA_OFFSET
=
3
;
private
static
final
int
SPS_TEST_DATA_OFFSET
=
3
;
@Test
@Test
...
@@ -135,6 +135,9 @@ public final class NalUnitUtilTest {
...
@@ -135,6 +135,9 @@ public final class NalUnitUtilTest {
assertThat
(
data
.
pixelWidthHeightRatio
).
isEqualTo
(
1.0f
);
assertThat
(
data
.
pixelWidthHeightRatio
).
isEqualTo
(
1.0f
);
assertThat
(
data
.
picOrderCountType
).
isEqualTo
(
0
);
assertThat
(
data
.
picOrderCountType
).
isEqualTo
(
0
);
assertThat
(
data
.
separateColorPlaneFlag
).
isFalse
();
assertThat
(
data
.
separateColorPlaneFlag
).
isFalse
();
assertThat
(
data
.
colorSpace
).
isEqualTo
(
6
);
assertThat
(
data
.
colorRange
).
isEqualTo
(
2
);
assertThat
(
data
.
colorTransfer
).
isEqualTo
(
6
);
}
}
@Test
@Test
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
View file @
d8876712
...
@@ -1197,6 +1197,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
...
@@ -1197,6 +1197,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
pixelWidthHeightRatio
=
avcConfig
.
pixelWidthHeightRatio
;
pixelWidthHeightRatio
=
avcConfig
.
pixelWidthHeightRatio
;
}
}
codecs
=
avcConfig
.
codecs
;
codecs
=
avcConfig
.
codecs
;
colorSpace
=
avcConfig
.
colorSpace
;
colorRange
=
avcConfig
.
colorRange
;
colorTransfer
=
avcConfig
.
colorTransfer
;
}
else
if
(
childAtomType
==
Atom
.
TYPE_hvcC
)
{
}
else
if
(
childAtomType
==
Atom
.
TYPE_hvcC
)
{
ExtractorUtil
.
checkContainerInput
(
mimeType
==
null
,
/* message= */
null
);
ExtractorUtil
.
checkContainerInput
(
mimeType
==
null
,
/* message= */
null
);
mimeType
=
MimeTypes
.
VIDEO_H265
;
mimeType
=
MimeTypes
.
VIDEO_H265
;
...
@@ -1309,12 +1312,13 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
...
@@ -1309,12 +1312,13 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
}
}
}
}
}
else
if
(
childAtomType
==
Atom
.
TYPE_colr
)
{
}
else
if
(
childAtomType
==
Atom
.
TYPE_colr
)
{
// Only modify these values if they have not been previously established by the bitstream.
// Only modify these values if 'colorSpace' and 'colorTransfer' have not been previously
// If 'Atom.TYPE_hvcC' atom or 'Atom.TYPE_vpcC' is available, they will take precedence and
// established by the bitstream. The absence of color descriptors ('colorSpace' and
// overwrite any existing values.
// 'colorTransfer') does not necessarily mean that 'colorRange' has default values, hence it
if
(
colorSpace
==
Format
.
NO_VALUE
// is not being verified here.
&&
colorRange
==
Format
.
NO_VALUE
// If 'Atom.TYPE_avcC', 'Atom.TYPE_hvcC' or 'Atom.TYPE_vpcC' is available, they will take
&&
colorTransfer
==
Format
.
NO_VALUE
)
{
// precedence and overwrite any existing values.
if
(
colorSpace
==
Format
.
NO_VALUE
&&
colorTransfer
==
Format
.
NO_VALUE
)
{
int
colorType
=
parent
.
readInt
();
int
colorType
=
parent
.
readInt
();
if
(
colorType
==
TYPE_nclx
||
colorType
==
TYPE_nclc
)
{
if
(
colorType
==
TYPE_nclx
||
colorType
==
TYPE_nclc
)
{
// For more info on syntax, see Section 8.5.2.2 in ISO/IEC 14496-12:2012(E) and
// For more info on syntax, see Section 8.5.2.2 in ISO/IEC 14496-12:2012(E) and
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/video/AvcConfig.java
View file @
d8876712
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
com
.
google
.
android
.
exoplayer2
.
video
;
package
com
.
google
.
android
.
exoplayer2
.
video
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.util.CodecSpecificDataUtil
;
import
com.google.android.exoplayer2.util.CodecSpecificDataUtil
;
...
@@ -55,6 +56,9 @@ public final class AvcConfig {
...
@@ -55,6 +56,9 @@ public final class AvcConfig {
int
width
=
Format
.
NO_VALUE
;
int
width
=
Format
.
NO_VALUE
;
int
height
=
Format
.
NO_VALUE
;
int
height
=
Format
.
NO_VALUE
;
@C
.
ColorSpace
int
colorSpace
=
Format
.
NO_VALUE
;
@C
.
ColorRange
int
colorRange
=
Format
.
NO_VALUE
;
@C
.
ColorTransfer
int
colorTransfer
=
Format
.
NO_VALUE
;
float
pixelWidthHeightRatio
=
1
;
float
pixelWidthHeightRatio
=
1
;
@Nullable
String
codecs
=
null
;
@Nullable
String
codecs
=
null
;
if
(
numSequenceParameterSets
>
0
)
{
if
(
numSequenceParameterSets
>
0
)
{
...
@@ -64,6 +68,9 @@ public final class AvcConfig {
...
@@ -64,6 +68,9 @@ public final class AvcConfig {
initializationData
.
get
(
0
),
nalUnitLengthFieldLength
,
sps
.
length
);
initializationData
.
get
(
0
),
nalUnitLengthFieldLength
,
sps
.
length
);
width
=
spsData
.
width
;
width
=
spsData
.
width
;
height
=
spsData
.
height
;
height
=
spsData
.
height
;
colorSpace
=
spsData
.
colorSpace
;
colorRange
=
spsData
.
colorRange
;
colorTransfer
=
spsData
.
colorTransfer
;
pixelWidthHeightRatio
=
spsData
.
pixelWidthHeightRatio
;
pixelWidthHeightRatio
=
spsData
.
pixelWidthHeightRatio
;
codecs
=
codecs
=
CodecSpecificDataUtil
.
buildAvcCodecString
(
CodecSpecificDataUtil
.
buildAvcCodecString
(
...
@@ -75,6 +82,9 @@ public final class AvcConfig {
...
@@ -75,6 +82,9 @@ public final class AvcConfig {
nalUnitLengthFieldLength
,
nalUnitLengthFieldLength
,
width
,
width
,
height
,
height
,
colorSpace
,
colorRange
,
colorTransfer
,
pixelWidthHeightRatio
,
pixelWidthHeightRatio
,
codecs
);
codecs
);
}
catch
(
ArrayIndexOutOfBoundsException
e
)
{
}
catch
(
ArrayIndexOutOfBoundsException
e
)
{
...
@@ -98,6 +108,22 @@ public final class AvcConfig {
...
@@ -98,6 +108,22 @@ public final class AvcConfig {
/** The height of each decoded frame, or {@link Format#NO_VALUE} if unknown. */
/** The height of each decoded frame, or {@link Format#NO_VALUE} if unknown. */
public
final
int
height
;
public
final
int
height
;
/**
* The {@link C.ColorSpace} of the video, or {@link Format#NO_VALUE} if unknown or not applicable.
*/
public
final
@C
.
ColorSpace
int
colorSpace
;
/**
* The {@link C.ColorRange} of the video, or {@link Format#NO_VALUE} if unknown or not applicable.
*/
public
final
@C
.
ColorRange
int
colorRange
;
/**
* The {@link C.ColorTransfer} of the video, or {@link Format#NO_VALUE} if unknown or not
* applicable.
*/
public
final
@C
.
ColorTransfer
int
colorTransfer
;
/** The pixel width to height ratio. */
/** The pixel width to height ratio. */
public
final
float
pixelWidthHeightRatio
;
public
final
float
pixelWidthHeightRatio
;
...
@@ -113,12 +139,18 @@ public final class AvcConfig {
...
@@ -113,12 +139,18 @@ public final class AvcConfig {
int
nalUnitLengthFieldLength
,
int
nalUnitLengthFieldLength
,
int
width
,
int
width
,
int
height
,
int
height
,
@C
.
ColorSpace
int
colorSpace
,
@C
.
ColorRange
int
colorRange
,
@C
.
ColorTransfer
int
colorTransfer
,
float
pixelWidthHeightRatio
,
float
pixelWidthHeightRatio
,
@Nullable
String
codecs
)
{
@Nullable
String
codecs
)
{
this
.
initializationData
=
initializationData
;
this
.
initializationData
=
initializationData
;
this
.
nalUnitLengthFieldLength
=
nalUnitLengthFieldLength
;
this
.
nalUnitLengthFieldLength
=
nalUnitLengthFieldLength
;
this
.
width
=
width
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
height
=
height
;
this
.
colorSpace
=
colorSpace
;
this
.
colorRange
=
colorRange
;
this
.
colorTransfer
=
colorTransfer
;
this
.
pixelWidthHeightRatio
=
pixelWidthHeightRatio
;
this
.
pixelWidthHeightRatio
=
pixelWidthHeightRatio
;
this
.
codecs
=
codecs
;
this
.
codecs
=
codecs
;
}
}
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/video/HevcConfig.java
View file @
d8876712
...
@@ -112,11 +112,11 @@ public final class HevcConfig {
...
@@ -112,11 +112,11 @@ public final class HevcConfig {
lengthSizeMinusOne
+
1
,
lengthSizeMinusOne
+
1
,
width
,
width
,
height
,
height
,
pixelWidthHeightRatio
,
codecs
,
colorSpace
,
colorSpace
,
colorRange
,
colorRange
,
colorTransfer
);
colorTransfer
,
pixelWidthHeightRatio
,
codecs
);
}
catch
(
ArrayIndexOutOfBoundsException
e
)
{
}
catch
(
ArrayIndexOutOfBoundsException
e
)
{
throw
ParserException
.
createForMalformedContainer
(
"Error parsing HEVC config"
,
e
);
throw
ParserException
.
createForMalformedContainer
(
"Error parsing HEVC config"
,
e
);
}
}
...
@@ -140,9 +140,6 @@ public final class HevcConfig {
...
@@ -140,9 +140,6 @@ public final class HevcConfig {
/** The height of each decoded frame, or {@link Format#NO_VALUE} if unknown. */
/** The height of each decoded frame, or {@link Format#NO_VALUE} if unknown. */
public
final
int
height
;
public
final
int
height
;
/** The pixel width to height ratio. */
public
final
float
pixelWidthHeightRatio
;
/**
/**
* The {@link C.ColorSpace} of the video or {@link Format#NO_VALUE} if unknown or not applicable.
* The {@link C.ColorSpace} of the video or {@link Format#NO_VALUE} if unknown or not applicable.
*/
*/
...
@@ -159,6 +156,9 @@ public final class HevcConfig {
...
@@ -159,6 +156,9 @@ public final class HevcConfig {
*/
*/
public
final
@C
.
ColorTransfer
int
colorTransfer
;
public
final
@C
.
ColorTransfer
int
colorTransfer
;
/** The pixel width to height ratio. */
public
final
float
pixelWidthHeightRatio
;
/**
/**
* An RFC 6381 codecs string representing the video format, or {@code null} if not known.
* An RFC 6381 codecs string representing the video format, or {@code null} if not known.
*
*
...
@@ -171,19 +171,19 @@ public final class HevcConfig {
...
@@ -171,19 +171,19 @@ public final class HevcConfig {
int
nalUnitLengthFieldLength
,
int
nalUnitLengthFieldLength
,
int
width
,
int
width
,
int
height
,
int
height
,
float
pixelWidthHeightRatio
,
@Nullable
String
codecs
,
@C
.
ColorSpace
int
colorSpace
,
@C
.
ColorSpace
int
colorSpace
,
@C
.
ColorRange
int
colorRange
,
@C
.
ColorRange
int
colorRange
,
@C
.
ColorTransfer
int
colorTransfer
)
{
@C
.
ColorTransfer
int
colorTransfer
,
float
pixelWidthHeightRatio
,
@Nullable
String
codecs
)
{
this
.
initializationData
=
initializationData
;
this
.
initializationData
=
initializationData
;
this
.
nalUnitLengthFieldLength
=
nalUnitLengthFieldLength
;
this
.
nalUnitLengthFieldLength
=
nalUnitLengthFieldLength
;
this
.
width
=
width
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
height
=
height
;
this
.
pixelWidthHeightRatio
=
pixelWidthHeightRatio
;
this
.
codecs
=
codecs
;
this
.
colorSpace
=
colorSpace
;
this
.
colorSpace
=
colorSpace
;
this
.
colorRange
=
colorRange
;
this
.
colorRange
=
colorRange
;
this
.
colorTransfer
=
colorTransfer
;
this
.
colorTransfer
=
colorTransfer
;
this
.
pixelWidthHeightRatio
=
pixelWidthHeightRatio
;
this
.
codecs
=
codecs
;
}
}
}
}
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.0.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 1280
width = 1280
height = 720
height = 720
frameRate = 13.307984
frameRate = 13.307984
colorInfo:
colorSpace = 2
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
initializationData:
initializationData:
data = length 22, hash 4CF81805
data = length 22, hash 4CF81805
...
...
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.1.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 1280
width = 1280
height = 720
height = 720
frameRate = 13.307984
frameRate = 13.307984
colorInfo:
colorSpace = 2
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
initializationData:
initializationData:
data = length 22, hash 4CF81805
data = length 22, hash 4CF81805
...
...
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.2.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 1280
width = 1280
height = 720
height = 720
frameRate = 13.307984
frameRate = 13.307984
colorInfo:
colorSpace = 2
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
initializationData:
initializationData:
data = length 22, hash 4CF81805
data = length 22, hash 4CF81805
...
...
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.3.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 1280
width = 1280
height = 720
height = 720
frameRate = 13.307984
frameRate = 13.307984
colorInfo:
colorSpace = 2
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
initializationData:
initializationData:
data = length 22, hash 4CF81805
data = length 22, hash 4CF81805
...
...
testdata/src/test/assets/extractordumps/mp4/sample_android_slow_motion.mp4.unknown_length.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 1280
width = 1280
height = 720
height = 720
frameRate = 13.307984
frameRate = 13.307984
colorInfo:
colorSpace = 2
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
metadata = entries=[mdta: key=com.android.capture.fps, value=43700000]
initializationData:
initializationData:
data = length 22, hash 4CF81805
data = length 22, hash 4CF81805
...
...
testdata/src/test/assets/muxerdumps/mp4_with_0_orientation.mp4.dump
View file @
d8876712
...
@@ -16,6 +16,11 @@ track 0:
...
@@ -16,6 +16,11 @@ track 0:
maxInputSize = 85
maxInputSize = 85
width = 12
width = 12
height = 10
height = 10
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_180_orientation.mp4.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 12
width = 12
height = 10
height = 10
rotationDegrees = 180
rotationDegrees = 180
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_270_orientation.mp4.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 12
width = 12
height = 10
height = 10
rotationDegrees = 270
rotationDegrees = 270
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_90_orientation.mp4.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 12
width = 12
height = 10
height = 10
rotationDegrees = 90
rotationDegrees = 90
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 12
width = 12
height = 10
height = 10
frameRate = 20000.0
frameRate = 20000.0
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
@@ -39,6 +44,11 @@ track 1:
...
@@ -39,6 +44,11 @@ track 1:
width = 12
width = 12
height = 10
height = 10
frameRate = 10000.0
frameRate = 10000.0
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_frame_rate.mp4.dump
View file @
d8876712
...
@@ -16,6 +16,11 @@ track 0:
...
@@ -16,6 +16,11 @@ track 0:
maxInputSize = 85
maxInputSize = 85
width = 12
width = 12
height = 10
height = 10
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[mdta: key=com.android.capture.fps, value=42f00000]
metadata = entries=[mdta: key=com.android.capture.fps, value=42f00000]
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
...
...
testdata/src/test/assets/muxerdumps/mp4_with_location.mp4.dump
View file @
d8876712
...
@@ -16,6 +16,11 @@ track 0:
...
@@ -16,6 +16,11 @@ track 0:
maxInputSize = 85
maxInputSize = 85
width = 12
width = 12
height = 10
height = 10
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
metadata = entries=[xyz: latitude=33.0, longitude=-120.0]
metadata = entries=[xyz: latitude=33.0, longitude=-120.0]
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
...
...
testdata/src/test/assets/muxerdumps/mp4_with_null_location.mp4.dump
View file @
d8876712
...
@@ -16,6 +16,11 @@ track 0:
...
@@ -16,6 +16,11 @@ track 0:
maxInputSize = 85
maxInputSize = 85
width = 12
width = 12
height = 10
height = 10
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
testdata/src/test/assets/muxerdumps/mp4_with_same_tracks_offset.mp4.dump
View file @
d8876712
...
@@ -17,6 +17,11 @@ track 0:
...
@@ -17,6 +17,11 @@ track 0:
width = 12
width = 12
height = 10
height = 10
frameRate = 20000.0
frameRate = 20000.0
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
@@ -39,6 +44,11 @@ track 1:
...
@@ -39,6 +44,11 @@ track 1:
width = 12
width = 12
height = 10
height = 10
frameRate = 10000.0
frameRate = 10000.0
colorInfo:
colorSpace = -1
colorRange = 1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
initializationData:
initializationData:
data = length 28, hash 410B510
data = length 28, hash 410B510
data = length 9, hash FBADD682
data = length 9, hash FBADD682
...
...
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