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
310f268a
authored
Oct 26, 2021
by
olly
Committed by
bachinger
Oct 27, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Set assumedVideoMinimumCodecOperatingRate for all playbacks
PiperOrigin-RevId: 405736227
parent
383bad80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
4 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 @
310f268a
...
...
@@ -205,7 +205,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
/* enableDecoderFallback= */
false
,
eventHandler
,
eventListener
,
maxDroppedFramesToNotify
);
maxDroppedFramesToNotify
,
/* assumedMinimumCodecOperatingRate= */
30
);
}
/**
...
...
@@ -238,7 +239,46 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
enableDecoderFallback
,
eventHandler
,
eventListener
,
maxDroppedFramesToNotify
);
maxDroppedFramesToNotify
,
/* assumedMinimumCodecOperatingRate= */
30
);
}
/**
* @param context A context.
* @param codecAdapterFactory The {@link MediaCodecAdapter.Factory} used to create {@link
* MediaCodecAdapter} instances.
* @param mediaCodecSelector A decoder selector.
* @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
* can attempt to seamlessly join an ongoing playback.
* @param enableDecoderFallback Whether to enable fallback to lower-priority decoders if decoder
* initialization fails. This may result in using a decoder that is slower/less efficient than
* the primary decoder.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
*/
public
MediaCodecVideoRenderer
(
Context
context
,
MediaCodecAdapter
.
Factory
codecAdapterFactory
,
MediaCodecSelector
mediaCodecSelector
,
long
allowedJoiningTimeMs
,
boolean
enableDecoderFallback
,
@Nullable
Handler
eventHandler
,
@Nullable
VideoRendererEventListener
eventListener
,
int
maxDroppedFramesToNotify
)
{
this
(
context
,
codecAdapterFactory
,
mediaCodecSelector
,
allowedJoiningTimeMs
,
enableDecoderFallback
,
eventHandler
,
eventListener
,
maxDroppedFramesToNotify
,
/* assumedMinimumCodecOperatingRate= */
30
);
}
/**
...
...
@@ -258,6 +298,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
* @param assumedMinimumCodecOperatingRate A codec operating rate that all codecs instantiated by
* this renderer are assumed to meet implicitly (i.e. without the operating rate being set
* explicitly using {@link MediaFormat#KEY_OPERATING_RATE}).
*/
public
MediaCodecVideoRenderer
(
Context
context
,
...
...
@@ -267,13 +310,14 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
boolean
enableDecoderFallback
,
@Nullable
Handler
eventHandler
,
@Nullable
VideoRendererEventListener
eventListener
,
int
maxDroppedFramesToNotify
)
{
int
maxDroppedFramesToNotify
,
float
assumedMinimumCodecOperatingRate
)
{
super
(
C
.
TRACK_TYPE_VIDEO
,
codecAdapterFactory
,
mediaCodecSelector
,
enableDecoderFallback
,
/* assumedMinimumCodecOperatingRate= */
30
);
assumedMinimumCodecOperatingRate
);
this
.
allowedJoiningTimeMs
=
allowedJoiningTimeMs
;
this
.
maxDroppedFramesToNotify
=
maxDroppedFramesToNotify
;
this
.
context
=
context
.
getApplicationContext
();
...
...
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