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
87457d50
authored
Aug 13, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add CodecCounters to LibvpxVideoTrackRenderer.
parent
d3995eaa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/LibvpxVideoTrackRenderer.java
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/LibvpxVideoTrackRenderer.java
View file @
87457d50
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
*/
*/
package
com
.
google
.
android
.
exoplayer
.
ext
.
vp9
;
package
com
.
google
.
android
.
exoplayer
.
ext
.
vp9
;
import
com.google.android.exoplayer.CodecCounters
;
import
com.google.android.exoplayer.ExoPlaybackException
;
import
com.google.android.exoplayer.ExoPlaybackException
;
import
com.google.android.exoplayer.ExoPlayer
;
import
com.google.android.exoplayer.ExoPlayer
;
import
com.google.android.exoplayer.MediaFormat
;
import
com.google.android.exoplayer.MediaFormat
;
...
@@ -89,6 +90,8 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
...
@@ -89,6 +90,8 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
public
static
final
int
MSG_SET_SURFACE
=
1
;
public
static
final
int
MSG_SET_SURFACE
=
1
;
public
static
final
int
MSG_SET_VPX_SURFACE_VIEW
=
2
;
public
static
final
int
MSG_SET_VPX_SURFACE_VIEW
=
2
;
public
final
CodecCounters
codecCounters
=
new
CodecCounters
();
private
final
boolean
scaleToFit
;
private
final
boolean
scaleToFit
;
private
final
Handler
eventHandler
;
private
final
Handler
eventHandler
;
private
final
EventListener
eventListener
;
private
final
EventListener
eventListener
;
...
@@ -209,6 +212,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
...
@@ -209,6 +212,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
if
(
timeToRenderUs
<
-
30000
||
outputBuffer
.
timestampUs
<
positionUs
)
{
if
(
timeToRenderUs
<
-
30000
||
outputBuffer
.
timestampUs
<
positionUs
)
{
// Drop frame if we are too late.
// Drop frame if we are too late.
codecCounters
.
droppedOutputBufferCount
++;
droppedFrameCount
++;
droppedFrameCount
++;
if
(
droppedFrameCount
==
maxDroppedFrameCountToNotify
)
{
if
(
droppedFrameCount
==
maxDroppedFrameCountToNotify
)
{
notifyAndResetDroppedFrameCount
();
notifyAndResetDroppedFrameCount
();
...
@@ -217,7 +221,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
...
@@ -217,7 +221,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
return
;
return
;
}
}
// If we have not rendere
re
d any frame so far (either initially or immediately following a
// If we have not rendered any frame so far (either initially or immediately following a
// seek), render one frame irresepective of the state.
// seek), render one frame irresepective of the state.
if
(!
renderedFirstFrame
)
{
if
(!
renderedFirstFrame
)
{
renderBuffer
();
renderBuffer
();
...
@@ -243,6 +247,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
...
@@ -243,6 +247,7 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
}
}
private
void
renderBuffer
()
throws
VpxDecoderException
{
private
void
renderBuffer
()
throws
VpxDecoderException
{
codecCounters
.
renderedOutputBufferCount
++;
notifyIfVideoSizeChanged
(
outputBuffer
);
notifyIfVideoSizeChanged
(
outputBuffer
);
if
(
outputRgb
)
{
if
(
outputRgb
)
{
renderRgbFrame
(
outputBuffer
,
scaleToFit
);
renderRgbFrame
(
outputBuffer
,
scaleToFit
);
...
...
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