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
6796b179
authored
Jul 10, 2019
by
aquilescanta
Committed by
Oliver Woodman
Jul 14, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make onInputFormatChanged methods in Renderers take FormatHolders
PiperOrigin-RevId: 257478434
parent
972c6c2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java
extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java
View file @
6796b179
...
...
@@ -307,7 +307,7 @@ public class LibvpxVideoRenderer extends BaseRenderer {
flagsOnlyBuffer
.
clear
();
int
result
=
readSource
(
formatHolder
,
flagsOnlyBuffer
,
true
);
if
(
result
==
C
.
RESULT_FORMAT_READ
)
{
onInputFormatChanged
(
formatHolder
.
format
);
onInputFormatChanged
(
formatHolder
);
}
else
if
(
result
==
C
.
RESULT_BUFFER_READ
)
{
// End of stream read having not read a format.
Assertions
.
checkState
(
flagsOnlyBuffer
.
isEndOfStream
());
...
...
@@ -491,15 +491,15 @@ public class LibvpxVideoRenderer extends BaseRenderer {
/**
* Called when a new format is read from the upstream source.
*
* @param
newFormat The new format
.
* @param
formatHolder A {@link FormatHolder} that holds the new {@link Format}
.
* @throws ExoPlaybackException If an error occurs (re-)initializing the decoder.
*/
@CallSuper
@SuppressWarnings
(
"unchecked"
)
protected
void
onInputFormatChanged
(
Format
newFormat
)
throws
ExoPlaybackException
{
protected
void
onInputFormatChanged
(
Format
Holder
formatHolder
)
throws
ExoPlaybackException
{
Format
oldFormat
=
format
;
format
=
newF
ormat
;
pendingFormat
=
newF
ormat
;
format
=
formatHolder
.
f
ormat
;
pendingFormat
=
f
ormat
;
boolean
drmInitDataChanged
=
!
Util
.
areEqual
(
format
.
drmInitData
,
oldFormat
==
null
?
null
:
oldFormat
.
drmInitData
);
...
...
@@ -513,7 +513,7 @@ public class LibvpxVideoRenderer extends BaseRenderer {
new
IllegalStateException
(
"Media requires a DrmSessionManager"
),
getIndex
());
}
DrmSession
<
ExoMediaCrypto
>
session
=
drmSessionManager
.
acquireSession
(
Looper
.
myLooper
(),
newF
ormat
.
drmInitData
);
drmSessionManager
.
acquireSession
(
Looper
.
myLooper
(),
f
ormat
.
drmInitData
);
if
(
sourceDrmSession
!=
null
)
{
sourceDrmSession
.
releaseReference
();
}
...
...
@@ -826,7 +826,7 @@ public class LibvpxVideoRenderer extends BaseRenderer {
return
false
;
}
if
(
result
==
C
.
RESULT_FORMAT_READ
)
{
onInputFormatChanged
(
formatHolder
.
format
);
onInputFormatChanged
(
formatHolder
);
return
true
;
}
if
(
inputBuffer
.
isEndOfStream
())
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java
View file @
6796b179
...
...
@@ -274,7 +274,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
flagsOnlyBuffer
.
clear
();
int
result
=
readSource
(
formatHolder
,
flagsOnlyBuffer
,
true
);
if
(
result
==
C
.
RESULT_FORMAT_READ
)
{
onInputFormatChanged
(
formatHolder
.
format
);
onInputFormatChanged
(
formatHolder
);
}
else
if
(
result
==
C
.
RESULT_BUFFER_READ
)
{
// End of stream read having not read a format.
Assertions
.
checkState
(
flagsOnlyBuffer
.
isEndOfStream
());
...
...
@@ -438,7 +438,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
return
false
;
}
if
(
result
==
C
.
RESULT_FORMAT_READ
)
{
onInputFormatChanged
(
formatHolder
.
format
);
onInputFormatChanged
(
formatHolder
);
return
true
;
}
if
(
inputBuffer
.
isEndOfStream
())
{
...
...
@@ -656,9 +656,9 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
}
@SuppressWarnings
(
"unchecked"
)
private
void
onInputFormatChanged
(
Format
newFormat
)
throws
ExoPlaybackException
{
private
void
onInputFormatChanged
(
Format
Holder
formatHolder
)
throws
ExoPlaybackException
{
Format
oldFormat
=
inputFormat
;
inputFormat
=
newF
ormat
;
inputFormat
=
formatHolder
.
f
ormat
;
boolean
drmInitDataChanged
=
!
Util
.
areEqual
(
inputFormat
.
drmInitData
,
oldFormat
==
null
?
null
:
oldFormat
.
drmInitData
);
...
...
@@ -673,7 +673,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
new
IllegalStateException
(
"Media requires a DrmSessionManager"
),
getIndex
());
}
DrmSession
<
ExoMediaCrypto
>
session
=
drmSessionManager
.
acquireSession
(
Looper
.
myLooper
(),
new
Format
.
drmInitData
);
drmSessionManager
.
acquireSession
(
Looper
.
myLooper
(),
input
Format
.
drmInitData
);
if
(
sourceDrmSession
!=
null
)
{
sourceDrmSession
.
releaseReference
();
}
...
...
@@ -694,10 +694,10 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
audioTrackNeedsConfigure
=
true
;
}
encoderDelay
=
new
Format
.
encoderDelay
;
encoderPadding
=
new
Format
.
encoderPadding
;
encoderDelay
=
input
Format
.
encoderDelay
;
encoderPadding
=
input
Format
.
encoderPadding
;
eventDispatcher
.
inputFormatChanged
(
new
Format
);
eventDispatcher
.
inputFormatChanged
(
input
Format
);
}
private
void
onQueueInputBuffer
(
DecoderInputBuffer
buffer
)
{
...
...
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