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
9cb24364
authored
Jan 28, 2022
by
Rakesh Kumar
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clean up RtpH265Reader
parent
4b99db93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/RtspMediaTrack.java
libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/RtspMediaTrack.java
View file @
9cb24364
...
...
@@ -44,10 +44,10 @@ import com.google.common.collect.ImmutableMap;
// Format specific parameter names.
private
static
final
String
PARAMETER_PROFILE_LEVEL_ID
=
"profile-level-id"
;
private
static
final
String
PARAMETER_SPROP_PARAMS
=
"sprop-parameter-sets"
;
private
static
final
String
H265_SPS
=
"sprop-sps"
;
private
static
final
String
H265_PPS
=
"sprop-pps"
;
private
static
final
String
H265_VPS
=
"sprop-vps"
;
private
static
final
String
H265_MAX_DON_DIFF
=
"sprop-max-don-diff"
;
private
static
final
String
PARAMETER_SPROP_
H265_SPS
=
"sprop-sps"
;
private
static
final
String
PARAMETER_SPROP_
H265_PPS
=
"sprop-pps"
;
private
static
final
String
PARAMETER_SPROP_
H265_VPS
=
"sprop-vps"
;
private
static
final
String
PARAMETER_SPROP_
H265_MAX_DON_DIFF
=
"sprop-max-don-diff"
;
/** Prefix for the RFC6381 codecs string for AAC formats. */
private
static
final
String
AAC_CODECS_PREFIX
=
"mp4a.40."
;
...
...
@@ -221,31 +221,30 @@ import com.google.common.collect.ImmutableMap;
private
static
void
processH265FmtpAttribute
(
Format
.
Builder
formatBuilder
,
ImmutableMap
<
String
,
String
>
fmtpAttributes
)
{
if
(
fmtpAttributes
.
containsKey
(
H265_MAX_DON_DIFF
))
{
checkArgument
(
Integer
.
parseInt
(
checkNotNull
(
fmtpAttributes
.
get
(
H265_MAX_DON_DIFF
)))
==
0
);
if
(
fmtpAttributes
.
containsKey
(
PARAMETER_SPROP_H265_MAX_DON_DIFF
))
{
checkArgument
(
Integer
.
parseInt
(
checkNotNull
(
fmtpAttributes
.
get
(
PARAMETER_SPROP_H265_MAX_DON_DIFF
)))
==
0
,
"non-zero sprop-max-don-diff is not supported"
);
}
checkArgument
(
fmtpAttributes
.
containsKey
(
H265_SPS
));
String
spropSPS
=
checkNotNull
(
fmtpAttributes
.
get
(
H265_SPS
));
checkArgument
(
fmtpAttributes
.
containsKey
(
H265_PPS
));
String
spropPPS
=
checkNotNull
(
fmtpAttributes
.
get
(
H265_PPS
));
checkArgument
(
fmtpAttributes
.
containsKey
(
H265_VPS
));
String
spropVPS
=
checkNotNull
(
fmtpAttributes
.
get
(
H265_VPS
));
String
[]
parameterSets
=
new
String
[]
{
spropSPS
,
spropPPS
,
spropVPS
};
checkArgument
(
fmtpAttributes
.
containsKey
(
PARAMETER_SPROP_H265_SPS
));
String
spropSPS
=
checkNotNull
(
fmtpAttributes
.
get
(
PARAMETER_SPROP_H265_SPS
));
checkArgument
(
fmtpAttributes
.
containsKey
(
PARAMETER_SPROP_H265_PPS
));
String
spropPPS
=
checkNotNull
(
fmtpAttributes
.
get
(
PARAMETER_SPROP_H265_PPS
));
checkArgument
(
fmtpAttributes
.
containsKey
(
PARAMETER_SPROP_H265_VPS
));
String
spropVPS
=
checkNotNull
(
fmtpAttributes
.
get
(
PARAMETER_SPROP_H265_VPS
));
checkArgument
(
parameterSets
.
length
==
3
);
ImmutableList
<
byte
[]>
initializationData
=
ImmutableList
.
of
(
getInitializationDataFromParameterSet
(
parameterSets
[
0
]),
getInitializationDataFromParameterSet
(
parameterSets
[
1
]),
getInitializationDataFromParameterSet
(
parameterSets
[
2
]));
byte
[]
vpsNalData
=
getInitializationDataFromParameterSet
(
spropVPS
);
byte
[]
spsNalData
=
getInitializationDataFromParameterSet
(
spropSPS
);
byte
[]
ppsNalData
=
getInitializationDataFromParameterSet
(
spropPPS
);
ImmutableList
<
byte
[]>
initializationData
=
ImmutableList
.
of
(
vpsNalData
,
spsNalData
,
ppsNalData
);
formatBuilder
.
setInitializationData
(
initializationData
);
// Process SPS (Sequence Parameter Set).
byte
[]
spsNalDataWithStartCode
=
initializationData
.
get
(
0
);
NalUnitUtil
.
H265SpsData
spsData
=
NalUnitUtil
.
parseH265SpsNalUnit
(
spsNalData
WithStartCode
,
NAL_START_CODE
.
length
,
spsNalDataWithStartCode
.
length
);
spsNalData
,
NAL_START_CODE
.
length
,
spsNalData
.
length
);
formatBuilder
.
setPixelWidthHeightRatio
(
spsData
.
pixelWidthHeightRatio
);
formatBuilder
.
setHeight
(
spsData
.
height
);
formatBuilder
.
setWidth
(
spsData
.
width
);
...
...
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