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
12f7174e
authored
Oct 14, 2022
by
claincly
Committed by
Marc Baechinger
Oct 20, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use static import for Assertions in MCVR
PiperOrigin-RevId: 481122795
parent
9861f88f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
View file @
12f7174e
...
@@ -19,6 +19,8 @@ import static android.view.Display.DEFAULT_DISPLAY;
...
@@ -19,6 +19,8 @@ import static android.view.Display.DEFAULT_DISPLAY;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
REUSE_RESULT_NO
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
REUSE_RESULT_NO
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkNotNull
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkState
;
import
static
java
.
lang
.
Math
.
max
;
import
static
java
.
lang
.
Math
.
max
;
import
static
java
.
lang
.
Math
.
min
;
import
static
java
.
lang
.
Math
.
min
;
...
@@ -62,7 +64,6 @@ import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
...
@@ -62,7 +64,6 @@ import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
import
com.google.android.exoplayer2.mediacodec.MediaCodecSelector
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecSelector
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.MediaFormatUtil
;
import
com.google.android.exoplayer2.util.MediaFormatUtil
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
...
@@ -529,7 +530,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -529,7 +530,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
throws
ExoPlaybackException
{
throws
ExoPlaybackException
{
super
.
onEnabled
(
joining
,
mayRenderStartOfStream
);
super
.
onEnabled
(
joining
,
mayRenderStartOfStream
);
boolean
tunneling
=
getConfiguration
().
tunneling
;
boolean
tunneling
=
getConfiguration
().
tunneling
;
Assertions
.
checkState
(!
tunneling
||
tunnelingAudioSessionId
!=
C
.
AUDIO_SESSION_ID_UNSET
);
checkState
(!
tunneling
||
tunnelingAudioSessionId
!=
C
.
AUDIO_SESSION_ID_UNSET
);
if
(
this
.
tunneling
!=
tunneling
)
{
if
(
this
.
tunneling
!=
tunneling
)
{
this
.
tunneling
=
tunneling
;
this
.
tunneling
=
tunneling
;
releaseCodec
();
releaseCodec
();
...
@@ -891,10 +892,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -891,10 +892,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
eventDispatcher
.
decoderInitialized
(
name
,
initializedTimestampMs
,
initializationDurationMs
);
eventDispatcher
.
decoderInitialized
(
name
,
initializedTimestampMs
,
initializationDurationMs
);
codecNeedsSetOutputSurfaceWorkaround
=
codecNeedsSetOutputSurfaceWorkaround
(
name
);
codecNeedsSetOutputSurfaceWorkaround
=
codecNeedsSetOutputSurfaceWorkaround
(
name
);
codecHandlesHdr10PlusOutOfBandMetadata
=
codecHandlesHdr10PlusOutOfBandMetadata
=
Assertions
.
checkNotNull
(
getCodecInfo
()).
isHdr10PlusOutOfBandMetadataSupported
();
checkNotNull
(
getCodecInfo
()).
isHdr10PlusOutOfBandMetadataSupported
();
if
(
Util
.
SDK_INT
>=
23
&&
tunneling
)
{
if
(
Util
.
SDK_INT
>=
23
&&
tunneling
)
{
tunnelingOnFrameRenderedListener
=
tunnelingOnFrameRenderedListener
=
new
OnFrameRenderedListenerV23
(
checkNotNull
(
getCodec
()));
new
OnFrameRenderedListenerV23
(
Assertions
.
checkNotNull
(
getCodec
()));
}
}
}
}
...
@@ -952,7 +952,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -952,7 +952,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
currentWidth
=
format
.
width
;
currentWidth
=
format
.
width
;
currentHeight
=
format
.
height
;
currentHeight
=
format
.
height
;
}
else
{
}
else
{
Assertions
.
checkNotNull
(
mediaFormat
);
checkNotNull
(
mediaFormat
);
boolean
hasCrop
=
boolean
hasCrop
=
mediaFormat
.
containsKey
(
KEY_CROP_RIGHT
)
mediaFormat
.
containsKey
(
KEY_CROP_RIGHT
)
&&
mediaFormat
.
containsKey
(
KEY_CROP_LEFT
)
&&
mediaFormat
.
containsKey
(
KEY_CROP_LEFT
)
...
@@ -992,7 +992,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -992,7 +992,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
if
(!
codecHandlesHdr10PlusOutOfBandMetadata
)
{
if
(!
codecHandlesHdr10PlusOutOfBandMetadata
)
{
return
;
return
;
}
}
ByteBuffer
data
=
Assertions
.
checkNotNull
(
buffer
.
supplementalData
);
ByteBuffer
data
=
checkNotNull
(
buffer
.
supplementalData
);
if
(
data
.
remaining
()
>=
7
)
{
if
(
data
.
remaining
()
>=
7
)
{
// Check for HDR10+ out-of-band metadata. See User_data_registered_itu_t_t35 in ST 2094-40.
// Check for HDR10+ out-of-band metadata. See User_data_registered_itu_t_t35 in ST 2094-40.
byte
ituTT35CountryCode
=
data
.
get
();
byte
ituTT35CountryCode
=
data
.
get
();
...
@@ -1030,7 +1030,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1030,7 +1030,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
boolean
isLastBuffer
,
boolean
isLastBuffer
,
Format
format
)
Format
format
)
throws
ExoPlaybackException
{
throws
ExoPlaybackException
{
Assertions
.
checkNotNull
(
codec
);
// Can not render video without codec
checkNotNull
(
codec
);
// Can not render video without codec
if
(
initialPositionUs
==
C
.
TIME_UNSET
)
{
if
(
initialPositionUs
==
C
.
TIME_UNSET
)
{
initialPositionUs
=
positionUs
;
initialPositionUs
=
positionUs
;
...
...
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