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
ac86d3b5
authored
Jan 17, 2019
by
tonihei
Committed by
Oliver Woodman
Jan 17, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add missing @Nullable to SimpleExoPlayer fields and methods.
Issue:#5402 PiperOrigin-RevId: 229758525
parent
22413b80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
30 deletions
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
ac86d3b5
...
@@ -94,25 +94,25 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -94,25 +94,25 @@ public class SimpleExoPlayer extends BasePlayer
private
final
AudioFocusManager
audioFocusManager
;
private
final
AudioFocusManager
audioFocusManager
;
private
Format
videoFormat
;
@Nullable
private
Format
videoFormat
;
private
Format
audioFormat
;
@Nullable
private
Format
audioFormat
;
private
Surface
surface
;
@Nullable
private
Surface
surface
;
private
boolean
ownsSurface
;
private
boolean
ownsSurface
;
private
@C
.
VideoScalingMode
int
videoScalingMode
;
private
@C
.
VideoScalingMode
int
videoScalingMode
;
private
SurfaceHolder
surfaceHolder
;
@Nullable
private
SurfaceHolder
surfaceHolder
;
private
TextureView
textureView
;
@Nullable
private
TextureView
textureView
;
private
int
surfaceWidth
;
private
int
surfaceWidth
;
private
int
surfaceHeight
;
private
int
surfaceHeight
;
private
DecoderCounters
videoDecoderCounters
;
@Nullable
private
DecoderCounters
videoDecoderCounters
;
private
DecoderCounters
audioDecoderCounters
;
@Nullable
private
DecoderCounters
audioDecoderCounters
;
private
int
audioSessionId
;
private
int
audioSessionId
;
private
AudioAttributes
audioAttributes
;
private
AudioAttributes
audioAttributes
;
private
float
audioVolume
;
private
float
audioVolume
;
private
MediaSource
mediaSource
;
@Nullable
private
MediaSource
mediaSource
;
private
List
<
Cue
>
currentCues
;
private
List
<
Cue
>
currentCues
;
private
VideoFrameMetadataListener
videoFrameMetadataListener
;
@Nullable
private
VideoFrameMetadataListener
videoFrameMetadataListener
;
private
CameraMotionListener
cameraMotionListener
;
@Nullable
private
CameraMotionListener
cameraMotionListener
;
private
boolean
hasNotifiedFullWrongThreadWarning
;
private
boolean
hasNotifiedFullWrongThreadWarning
;
/**
/**
...
@@ -558,30 +558,26 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -558,30 +558,26 @@ public class SimpleExoPlayer extends BasePlayer
setPlaybackParameters
(
playbackParameters
);
setPlaybackParameters
(
playbackParameters
);
}
}
/**
/** Returns the video format currently being played, or null if no video is being played. */
* Returns the video format currently being played, or null if no video is being played.
@Nullable
*/
public
Format
getVideoFormat
()
{
public
Format
getVideoFormat
()
{
return
videoFormat
;
return
videoFormat
;
}
}
/**
/** Returns the audio format currently being played, or null if no audio is being played. */
* Returns the audio format currently being played, or null if no audio is being played.
@Nullable
*/
public
Format
getAudioFormat
()
{
public
Format
getAudioFormat
()
{
return
audioFormat
;
return
audioFormat
;
}
}
/**
/** Returns {@link DecoderCounters} for video, or null if no video is being played. */
* Returns {@link DecoderCounters} for video, or null if no video is being played.
@Nullable
*/
public
DecoderCounters
getVideoDecoderCounters
()
{
public
DecoderCounters
getVideoDecoderCounters
()
{
return
videoDecoderCounters
;
return
videoDecoderCounters
;
}
}
/**
/** Returns {@link DecoderCounters} for audio, or null if no audio is being played. */
* Returns {@link DecoderCounters} for audio, or null if no audio is being played.
@Nullable
*/
public
DecoderCounters
getAudioDecoderCounters
()
{
public
DecoderCounters
getAudioDecoderCounters
()
{
return
audioDecoderCounters
;
return
audioDecoderCounters
;
}
}
...
@@ -1053,7 +1049,8 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1053,7 +1049,8 @@ public class SimpleExoPlayer extends BasePlayer
}
}
@Override
@Override
public
@Nullable
Object
getCurrentManifest
()
{
@Nullable
public
Object
getCurrentManifest
()
{
verifyApplicationThread
();
verifyApplicationThread
();
return
player
.
getCurrentManifest
();
return
player
.
getCurrentManifest
();
}
}
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java
View file @
ac86d3b5
...
@@ -137,23 +137,40 @@ public class DebugTextViewHelper implements Player.EventListener, Runnable {
...
@@ -137,23 +137,40 @@ public class DebugTextViewHelper implements Player.EventListener, Runnable {
/** Returns a string containing video debugging information. */
/** Returns a string containing video debugging information. */
protected
String
getVideoString
()
{
protected
String
getVideoString
()
{
Format
format
=
player
.
getVideoFormat
();
Format
format
=
player
.
getVideoFormat
();
if
(
format
==
null
)
{
DecoderCounters
decoderCounters
=
player
.
getVideoDecoderCounters
();
if
(
format
==
null
||
decoderCounters
==
null
)
{
return
""
;
return
""
;
}
}
return
"\n"
+
format
.
sampleMimeType
+
"(id:"
+
format
.
id
+
" r:"
+
format
.
width
+
"x"
return
"\n"
+
format
.
height
+
getPixelAspectRatioString
(
format
.
pixelWidthHeightRatio
)
+
format
.
sampleMimeType
+
getDecoderCountersBufferCountString
(
player
.
getVideoDecoderCounters
())
+
")"
;
+
"(id:"
+
format
.
id
+
" r:"
+
format
.
width
+
"x"
+
format
.
height
+
getPixelAspectRatioString
(
format
.
pixelWidthHeightRatio
)
+
getDecoderCountersBufferCountString
(
decoderCounters
)
+
")"
;
}
}
/** Returns a string containing audio debugging information. */
/** Returns a string containing audio debugging information. */
protected
String
getAudioString
()
{
protected
String
getAudioString
()
{
Format
format
=
player
.
getAudioFormat
();
Format
format
=
player
.
getAudioFormat
();
if
(
format
==
null
)
{
DecoderCounters
decoderCounters
=
player
.
getAudioDecoderCounters
();
if
(
format
==
null
||
decoderCounters
==
null
)
{
return
""
;
return
""
;
}
}
return
"\n"
+
format
.
sampleMimeType
+
"(id:"
+
format
.
id
+
" hz:"
+
format
.
sampleRate
+
" ch:"
return
"\n"
+
format
.
sampleMimeType
+
"(id:"
+
format
.
id
+
" hz:"
+
format
.
sampleRate
+
" ch:"
+
format
.
channelCount
+
format
.
channelCount
+
getDecoderCountersBufferCountString
(
player
.
getAudioDecoderCounters
())
+
")"
;
+
getDecoderCountersBufferCountString
(
decoderCounters
)
+
")"
;
}
}
private
static
String
getDecoderCountersBufferCountString
(
DecoderCounters
counters
)
{
private
static
String
getDecoderCountersBufferCountString
(
DecoderCounters
counters
)
{
...
...
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