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
e16ab27b
authored
Oct 26, 2020
by
olly
Committed by
Oliver Woodman
Nov 02, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
No-op refactor of MediaCodecInfo.isSeamlessAdaptationSupported
PiperOrigin-RevId: 339084261
parent
50566fb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
View file @
e16ab27b
...
@@ -327,34 +327,42 @@ public final class MediaCodecInfo {
...
@@ -327,34 +327,42 @@ public final class MediaCodecInfo {
*/
*/
public
boolean
isSeamlessAdaptationSupported
(
public
boolean
isSeamlessAdaptationSupported
(
Format
oldFormat
,
Format
newFormat
,
boolean
isNewFormatComplete
)
{
Format
oldFormat
,
Format
newFormat
,
boolean
isNewFormatComplete
)
{
if
(!
Util
.
areEqual
(
oldFormat
.
sampleMimeType
,
newFormat
.
sampleMimeType
))
{
return
false
;
}
if
(
isVideo
)
{
if
(
isVideo
)
{
return
Assertions
.
checkNotNull
(
oldFormat
.
sampleMimeType
).
equals
(
newFormat
.
sampleMimeType
)
return
oldFormat
.
rotationDegrees
==
newFormat
.
rotationDegrees
&&
oldFormat
.
rotationDegrees
==
newFormat
.
rotationDegrees
&&
(
adaptive
&&
(
adaptive
||
(
oldFormat
.
width
==
newFormat
.
width
&&
oldFormat
.
height
==
newFormat
.
height
))
||
(
oldFormat
.
width
==
newFormat
.
width
&&
oldFormat
.
height
==
newFormat
.
height
))
&&
((!
isNewFormatComplete
&&
newFormat
.
colorInfo
==
null
)
&&
((!
isNewFormatComplete
&&
newFormat
.
colorInfo
==
null
)
||
Util
.
areEqual
(
oldFormat
.
colorInfo
,
newFormat
.
colorInfo
));
||
Util
.
areEqual
(
oldFormat
.
colorInfo
,
newFormat
.
colorInfo
));
}
else
{
}
else
{
if
(!
MimeTypes
.
AUDIO_AAC
.
equals
(
mimeType
)
if
(
oldFormat
.
channelCount
!=
newFormat
.
channelCount
||
!
Assertions
.
checkNotNull
(
oldFormat
.
sampleMimeType
).
equals
(
newFormat
.
sampleMimeType
)
||
oldFormat
.
channelCount
!=
newFormat
.
channelCount
||
oldFormat
.
sampleRate
!=
newFormat
.
sampleRate
)
{
||
oldFormat
.
sampleRate
!=
newFormat
.
sampleRate
)
{
return
false
;
return
false
;
}
}
// Check the codec profile levels support adaptation.
@Nullable
// Check whether we're adapting between two xHE-AAC formats, for which adaptation is possible
Pair
<
Integer
,
Integer
>
oldCodecProfileLevel
=
// without reconfiguration.
MediaCodecUtil
.
getCodecProfileAndLevel
(
oldFormat
);
if
(
MimeTypes
.
AUDIO_AAC
.
equals
(
mimeType
))
{
@Nullable
@Nullable
Pair
<
Integer
,
Integer
>
newCodecProfileLevel
=
Pair
<
Integer
,
Integer
>
oldCodecProfileLevel
=
MediaCodecUtil
.
getCodecProfileAndLevel
(
newFormat
);
MediaCodecUtil
.
getCodecProfileAndLevel
(
oldFormat
);
if
(
oldCodecProfileLevel
==
null
||
newCodecProfileLevel
==
null
)
{
@Nullable
return
false
;
Pair
<
Integer
,
Integer
>
newCodecProfileLevel
=
MediaCodecUtil
.
getCodecProfileAndLevel
(
newFormat
);
if
(
oldCodecProfileLevel
!=
null
&&
newCodecProfileLevel
!=
null
)
{
int
oldProfile
=
oldCodecProfileLevel
.
first
;
int
newProfile
=
newCodecProfileLevel
.
first
;
if
(
oldProfile
==
CodecProfileLevel
.
AACObjectXHE
&&
newProfile
==
CodecProfileLevel
.
AACObjectXHE
)
{
return
true
;
}
}
}
}
int
oldProfile
=
oldCodecProfileLevel
.
first
;
int
newProfile
=
newCodecProfileLevel
.
first
;
return
false
;
return
oldProfile
==
CodecProfileLevel
.
AACObjectXHE
&&
newProfile
==
CodecProfileLevel
.
AACObjectXHE
;
}
}
}
}
...
...
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