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
2cf9d9b0
authored
Jul 23, 2020
by
kimvde
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add nullness annotations on MediaCodecRenderer processOutputBuffer
Issue: #7579 PiperOrigin-RevId: 322756102
parent
b041c59f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
View file @
2cf9d9b0
...
...
@@ -15,6 +15,8 @@
*/
package
com
.
google
.
android
.
exoplayer2
.
audio
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkNotNull
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.media.MediaCodec
;
...
...
@@ -40,7 +42,6 @@ import com.google.android.exoplayer2.mediacodec.MediaCodecSelector;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil
;
import
com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException
;
import
com.google.android.exoplayer2.mediacodec.MediaFormatUtil
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.MediaClock
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.Util
;
...
...
@@ -568,7 +569,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
long
positionUs
,
long
elapsedRealtimeUs
,
@Nullable
MediaCodec
codec
,
ByteBuffer
buffer
,
@Nullable
ByteBuffer
buffer
,
int
bufferIndex
,
int
bufferFlags
,
int
sampleCount
,
...
...
@@ -577,6 +578,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
boolean
isLastBuffer
,
Format
format
)
throws
ExoPlaybackException
{
checkNotNull
(
buffer
);
if
(
codec
!=
null
&&
codecNeedsEosBufferTimestampWorkaround
&&
bufferPresentationTimeUs
==
0
...
...
@@ -588,7 +590,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
if
(
codecPassthroughFormat
!=
null
&&
(
bufferFlags
&
MediaCodec
.
BUFFER_FLAG_CODEC_CONFIG
)
!=
0
)
{
// Discard output buffers from the passthrough (raw) decoder containing codec specific data.
Assertions
.
checkNotNull
(
codec
).
releaseOutputBuffer
(
bufferIndex
,
false
);
checkNotNull
(
codec
).
releaseOutputBuffer
(
bufferIndex
,
false
);
return
true
;
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
View file @
2cf9d9b0
...
...
@@ -387,7 +387,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private
long
codecHotswapDeadlineMs
;
private
int
inputIndex
;
private
int
outputIndex
;
private
ByteBuffer
outputBuffer
;
@Nullable
private
ByteBuffer
outputBuffer
;
private
boolean
isDecodeOnlyOutputBuffer
;
private
boolean
isLastOutputBuffer
;
private
boolean
bypassEnabled
;
...
...
@@ -1168,6 +1168,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
}
@Nullable
private
ByteBuffer
getOutputBuffer
(
int
outputIndex
)
{
if
(
Util
.
SDK_INT
>=
21
)
{
return
codec
.
getOutputBuffer
(
outputIndex
);
...
...
@@ -1874,7 +1875,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
* @param elapsedRealtimeUs {@link SystemClock#elapsedRealtime()} in microseconds, measured at the
* start of the current iteration of the rendering loop.
* @param codec The {@link MediaCodec} instance, or null in bypass mode were no codec is used.
* @param buffer The output buffer to process.
* @param buffer The output buffer to process, or null if the buffer data is not made available to
* the application layer (see {@link MediaCodec#getOutputBuffer(int)}). This {@code buffer}
* can only be null for video data. Note that the buffer data can still be rendered in this
* case by using the {@code bufferIndex}.
* @param bufferIndex The index of the output buffer.
* @param bufferFlags The flags attached to the output buffer.
* @param sampleCount The number of samples extracted from the sample queue in the buffer. This
...
...
@@ -1891,7 +1895,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
long
positionUs
,
long
elapsedRealtimeUs
,
@Nullable
MediaCodec
codec
,
ByteBuffer
buffer
,
@Nullable
ByteBuffer
buffer
,
int
bufferIndex
,
int
bufferFlags
,
int
sampleCount
,
...
...
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
View file @
2cf9d9b0
...
...
@@ -759,7 +759,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
long
positionUs
,
long
elapsedRealtimeUs
,
@Nullable
MediaCodec
codec
,
ByteBuffer
buffer
,
@Nullable
ByteBuffer
buffer
,
int
bufferIndex
,
int
bufferFlags
,
int
sampleCount
,
...
...
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