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
29a6280b
authored
Feb 01, 2022
by
olly
Committed by
Ian Baker
Feb 02, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rewrite EventLogger to use new track APIs
PiperOrigin-RevId: 425595951
parent
30feb077
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
23 deletions
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
docs/debug-logging.md
docs/listening-to-player-events.md
library/core/src/main/java/com/google/android/exoplayer2/util/EventLogger.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java
View file @
29a6280b
...
@@ -181,7 +181,7 @@ public final class MainActivity extends Activity {
...
@@ -181,7 +181,7 @@ public final class MainActivity extends Activity {
Assertions
.
checkNotNull
(
this
.
videoProcessingGLSurfaceView
);
Assertions
.
checkNotNull
(
this
.
videoProcessingGLSurfaceView
);
videoProcessingGLSurfaceView
.
setPlayer
(
player
);
videoProcessingGLSurfaceView
.
setPlayer
(
player
);
Assertions
.
checkNotNull
(
playerView
).
setPlayer
(
player
);
Assertions
.
checkNotNull
(
playerView
).
setPlayer
(
player
);
player
.
addAnalyticsListener
(
new
EventLogger
(
/* trackSelector= */
null
));
player
.
addAnalyticsListener
(
new
EventLogger
());
this
.
player
=
player
;
this
.
player
=
player
;
}
}
...
...
demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java
View file @
29a6280b
...
@@ -276,7 +276,7 @@ public class PlayerActivity extends AppCompatActivity
...
@@ -276,7 +276,7 @@ public class PlayerActivity extends AppCompatActivity
.
build
();
.
build
();
player
.
setTrackSelectionParameters
(
trackSelectionParameters
);
player
.
setTrackSelectionParameters
(
trackSelectionParameters
);
player
.
addListener
(
new
PlayerEventListener
());
player
.
addListener
(
new
PlayerEventListener
());
player
.
addAnalyticsListener
(
new
EventLogger
(
trackSelector
));
player
.
addAnalyticsListener
(
new
EventLogger
());
player
.
setAudioAttributes
(
AudioAttributes
.
DEFAULT
,
/* handleAudioFocus= */
true
);
player
.
setAudioAttributes
(
AudioAttributes
.
DEFAULT
,
/* handleAudioFocus= */
true
);
player
.
setPlayWhenReady
(
startAutoPlay
);
player
.
setPlayWhenReady
(
startAutoPlay
);
playerView
.
setPlayer
(
player
);
playerView
.
setPlayer
(
player
);
...
...
docs/debug-logging.md
View file @
29a6280b
...
@@ -9,13 +9,10 @@ issues. `EventLogger` implements `AnalyticsListener`, so registering an instance
...
@@ -9,13 +9,10 @@ issues. `EventLogger` implements `AnalyticsListener`, so registering an instance
with an
`ExoPlayer`
is easy:
with an
`ExoPlayer`
is easy:
```
```
player.addAnalyticsListener(new EventLogger(
trackSelector
));
player.addAnalyticsListener(new EventLogger());
```
```
{: .language-java}
{: .language-java}
Passing the
`trackSelector`
enables additional logging, but is optional and so
`null`
can be passed instead.
The easiest way to observe the log is using Android Studio's
[
logcat tab
][]
. You
The easiest way to observe the log is using Android Studio's
[
logcat tab
][]
. You
can select your app as debuggable process by the package name (
can select your app as debuggable process by the package name (
`com.google.android.exoplayer2.demo`
if using the demo app) and tell the logcat
`com.google.android.exoplayer2.demo`
if using the demo app) and tell the logcat
...
@@ -80,20 +77,16 @@ logging for an adaptive stream:
...
@@ -80,20 +77,16 @@ logging for an adaptive stream:
```
```
EventLogger: tracks [eventTime=0.30, mediaPos=0.00, window=0, period=0,
EventLogger: tracks [eventTime=0.30, mediaPos=0.00, window=0, period=0,
EventLogger: MediaCodecVideoRenderer [
EventLogger: group [
EventLogger: Group:0, adaptive_supported=YES [
EventLogger: [X] Track:0, id=133, mimeType=video/avc, bitrate=261112, codecs=avc1.4d4015, res=426x240, fps=30.0, supported=YES
EventLogger: [X] Track:0, id=133, mimeType=video/avc, bitrate=261112, codecs=avc1.4d4015, res=426x240, fps=30.0, supported=YES
EventLogger: [X] Track:1, id=134, mimeType=video/avc, bitrate=671331, codecs=avc1.4d401e, res=640x360, fps=30.0, supported=YES
EventLogger: [X] Track:1, id=134, mimeType=video/avc, bitrate=671331, codecs=avc1.4d401e, res=640x360, fps=30.0, supported=YES
EventLogger: [X] Track:2, id=135, mimeType=video/avc, bitrate=1204535, codecs=avc1.4d401f, res=854x480, fps=30.0, supported=YES
EventLogger: [X] Track:2, id=135, mimeType=video/avc, bitrate=1204535, codecs=avc1.4d401f, res=854x480, fps=30.0, supported=YES
EventLogger: [X] Track:3, id=160, mimeType=video/avc, bitrate=112329, codecs=avc1.4d400c, res=256x144, fps=30.0, supported=YES
EventLogger: [X] Track:3, id=160, mimeType=video/avc, bitrate=112329, codecs=avc1.4d400c, res=256x144, fps=30.0, supported=YES
EventLogger: [ ] Track:4, id=136, mimeType=video/avc, bitrate=2400538, codecs=avc1.4d401f, res=1280x720, fps=30.0, supported=NO_EXCEEDS_CAPABILITIES
EventLogger: [ ] Track:4, id=136, mimeType=video/avc, bitrate=2400538, codecs=avc1.4d401f, res=1280x720, fps=30.0, supported=NO_EXCEEDS_CAPABILITIES
EventLogger: ]
EventLogger: ]
EventLogger: ]
EventLogger: MediaCodecAudioRenderer [
EventLogger: group [
EventLogger: Group:0, adaptive_supported=YES_NOT_SEAMLESS [
EventLogger: [ ] Track:0, id=139, mimeType=audio/mp4a-latm, bitrate=48582, codecs=mp4a.40.5, channels=2, sample_rate=22050, supported=YES
EventLogger: [ ] Track:0, id=139, mimeType=audio/mp4a-latm, bitrate=48582, codecs=mp4a.40.5, channels=2, sample_rate=22050, supported=YES
EventLogger: [X] Track:1, id=140, mimeType=audio/mp4a-latm, bitrate=127868, codecs=mp4a.40.2, channels=2, sample_rate=44100, supported=YES
EventLogger: [X] Track:1, id=140, mimeType=audio/mp4a-latm, bitrate=127868, codecs=mp4a.40.2, channels=2, sample_rate=44100, supported=YES
EventLogger: ]
EventLogger: ]
EventLogger: ]
EventLogger: ]
EventLogger: ]
```
```
...
...
docs/listening-to-player-events.md
View file @
29a6280b
...
@@ -193,12 +193,11 @@ logging purposes. It can be added to an `ExoPlayer` to enable useful
...
@@ -193,12 +193,11 @@ logging purposes. It can be added to an `ExoPlayer` to enable useful
additional logging with a single line.
additional logging with a single line.
```
```
player.addAnalyticsListener(new EventLogger(
trackSelector
));
player.addAnalyticsListener(new EventLogger());
```
```
{: .language-java }
{: .language-java }
Passing the
`trackSelector`
enables additional logging, but is optional and so
See the
[
debug logging page
][]
for more details.
`null`
can be passed instead. See the
[
debug logging page
][]
for more details.
## Firing events at specified playback positions ##
## Firing events at specified playback positions ##
...
...
library/core/src/main/java/com/google/android/exoplayer2/util/EventLogger.java
View file @
29a6280b
This diff is collapsed.
Click to expand it.
testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java
View file @
29a6280b
...
@@ -136,7 +136,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
...
@@ -136,7 +136,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
player
=
buildExoPlayer
(
host
,
surface
,
trackSelector
);
player
=
buildExoPlayer
(
host
,
surface
,
trackSelector
);
player
.
play
();
player
.
play
();
player
.
addAnalyticsListener
(
this
);
player
.
addAnalyticsListener
(
this
);
player
.
addAnalyticsListener
(
new
EventLogger
(
t
rackSelector
,
t
ag
));
player
.
addAnalyticsListener
(
new
EventLogger
(
tag
));
// Schedule any pending actions.
// Schedule any pending actions.
actionHandler
=
actionHandler
=
Clock
.
DEFAULT
.
createHandler
(
Util
.
getCurrentOrMainLooper
(),
/* callback= */
null
);
Clock
.
DEFAULT
.
createHandler
(
Util
.
getCurrentOrMainLooper
(),
/* callback= */
null
);
...
...
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