Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NotesChapter
ExoPlayer
提交
67d01549
E
ExoPlayer
项目概览
NotesChapter
/
ExoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
ExoPlayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67d01549
编写于
5月 22, 2015
作者:
O
Oliver Woodman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use Java7 <> syntax
上级
91bcec82
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
102 addition
and
101 deletion
+102
-101
demo/src/main/java/com/google/android/exoplayer/demo/SmoothStreamingTestMediaDrmCallback.java
...d/exoplayer/demo/SmoothStreamingTestMediaDrmCallback.java
+1
-1
demo/src/main/java/com/google/android/exoplayer/demo/player/DashRendererBuilder.java
...le/android/exoplayer/demo/player/DashRendererBuilder.java
+6
-6
demo/src/main/java/com/google/android/exoplayer/demo/player/DemoPlayer.java
.../com/google/android/exoplayer/demo/player/DemoPlayer.java
+1
-1
demo/src/main/java/com/google/android/exoplayer/demo/player/HlsRendererBuilder.java
...gle/android/exoplayer/demo/player/HlsRendererBuilder.java
+2
-2
demo/src/main/java/com/google/android/exoplayer/demo/player/SmoothStreamingRendererBuilder.java
...exoplayer/demo/player/SmoothStreamingRendererBuilder.java
+1
-1
library/src/main/java/com/google/android/exoplayer/DefaultLoadControl.java
...java/com/google/android/exoplayer/DefaultLoadControl.java
+2
-2
library/src/main/java/com/google/android/exoplayer/ExoPlayerImpl.java
...main/java/com/google/android/exoplayer/ExoPlayerImpl.java
+1
-1
library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java
...a/com/google/android/exoplayer/ExoPlayerImplInternal.java
+1
-1
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
...com/google/android/exoplayer/MediaCodecTrackRenderer.java
+1
-1
library/src/main/java/com/google/android/exoplayer/MediaCodecUtil.java
...ain/java/com/google/android/exoplayer/MediaCodecUtil.java
+1
-1
library/src/main/java/com/google/android/exoplayer/MediaFormat.java
...c/main/java/com/google/android/exoplayer/MediaFormat.java
+1
-1
library/src/main/java/com/google/android/exoplayer/chunk/ChunkSampleSource.java
...com/google/android/exoplayer/chunk/ChunkSampleSource.java
+1
-1
library/src/main/java/com/google/android/exoplayer/chunk/VideoFormatSelectorUtil.java
...ogle/android/exoplayer/chunk/VideoFormatSelectorUtil.java
+1
-1
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
...va/com/google/android/exoplayer/dash/DashChunkSource.java
+1
-1
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
...xoplayer/dash/mpd/MediaPresentationDescriptionParser.java
+7
-7
library/src/main/java/com/google/android/exoplayer/dash/mpd/UtcTimingElementResolver.java
.../android/exoplayer/dash/mpd/UtcTimingElementResolver.java
+1
-1
library/src/main/java/com/google/android/exoplayer/drm/DrmInitData.java
...in/java/com/google/android/exoplayer/drm/DrmInitData.java
+1
-1
library/src/main/java/com/google/android/exoplayer/drm/StreamingDrmSessionManager.java
...gle/android/exoplayer/drm/StreamingDrmSessionManager.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/ExtractorSampleSource.java
...le/android/exoplayer/extractor/ExtractorSampleSource.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/RollingSampleBuffer.java
...ogle/android/exoplayer/extractor/RollingSampleBuffer.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Atom.java
...java/com/google/android/exoplayer/extractor/mp4/Atom.java
+2
-2
library/src/main/java/com/google/android/exoplayer/extractor/mp4/AtomParsers.java
...m/google/android/exoplayer/extractor/mp4/AtomParsers.java
+2
-2
library/src/main/java/com/google/android/exoplayer/extractor/mp4/FragmentedMp4Extractor.java
...droid/exoplayer/extractor/mp4/FragmentedMp4Extractor.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Mp4Extractor.java
.../google/android/exoplayer/extractor/mp4/Mp4Extractor.java
+2
-2
library/src/main/java/com/google/android/exoplayer/extractor/ts/H264Reader.java
...com/google/android/exoplayer/extractor/ts/H264Reader.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/ts/TsExtractor.java
...om/google/android/exoplayer/extractor/ts/TsExtractor.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/webm/DefaultEbmlReader.java
...e/android/exoplayer/extractor/webm/DefaultEbmlReader.java
+1
-1
library/src/main/java/com/google/android/exoplayer/extractor/webm/WebmExtractor.java
...oogle/android/exoplayer/extractor/webm/WebmExtractor.java
+2
-2
library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java
...java/com/google/android/exoplayer/hls/HlsChunkSource.java
+3
-3
library/src/main/java/com/google/android/exoplayer/hls/HlsExtractorWrapper.java
...com/google/android/exoplayer/hls/HlsExtractorWrapper.java
+1
-1
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
...a/com/google/android/exoplayer/hls/HlsPlaylistParser.java
+4
-4
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
...ava/com/google/android/exoplayer/hls/HlsSampleSource.java
+1
-1
library/src/main/java/com/google/android/exoplayer/metadata/Id3Parser.java
...java/com/google/android/exoplayer/metadata/Id3Parser.java
+1
-1
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingChunkSource.java
...exoplayer/smoothstreaming/SmoothStreamingChunkSource.java
+2
-2
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingManifestParser.java
...player/smoothstreaming/SmoothStreamingManifestParser.java
+5
-5
library/src/main/java/com/google/android/exoplayer/text/SubtitleLayout.java
...ava/com/google/android/exoplayer/text/SubtitleLayout.java
+1
-1
library/src/main/java/com/google/android/exoplayer/text/eia608/Eia608Parser.java
...om/google/android/exoplayer/text/eia608/Eia608Parser.java
+1
-1
library/src/main/java/com/google/android/exoplayer/text/eia608/Eia608TrackRenderer.java
...le/android/exoplayer/text/eia608/Eia608TrackRenderer.java
+1
-1
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlNode.java
...java/com/google/android/exoplayer/text/ttml/TtmlNode.java
+2
-2
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlParser.java
...va/com/google/android/exoplayer/text/ttml/TtmlParser.java
+1
-1
library/src/main/java/com/google/android/exoplayer/text/webvtt/WebvttParser.java
...om/google/android/exoplayer/text/webvtt/WebvttParser.java
+1
-1
library/src/main/java/com/google/android/exoplayer/text/webvtt/WebvttSubtitle.java
.../google/android/exoplayer/text/webvtt/WebvttSubtitle.java
+1
-1
library/src/main/java/com/google/android/exoplayer/upstream/DefaultHttpDataSource.java
...gle/android/exoplayer/upstream/DefaultHttpDataSource.java
+2
-2
library/src/main/java/com/google/android/exoplayer/upstream/NetworkLock.java
...va/com/google/android/exoplayer/upstream/NetworkLock.java
+1
-1
library/src/main/java/com/google/android/exoplayer/upstream/cache/LeastRecentlyUsedCacheEvictor.java
...oplayer/upstream/cache/LeastRecentlyUsedCacheEvictor.java
+1
-1
library/src/main/java/com/google/android/exoplayer/upstream/cache/SimpleCache.java
.../google/android/exoplayer/upstream/cache/SimpleCache.java
+7
-7
library/src/main/java/com/google/android/exoplayer/util/CodecSpecificDataUtil.java
.../google/android/exoplayer/util/CodecSpecificDataUtil.java
+1
-1
library/src/main/java/com/google/android/exoplayer/util/ManifestFetcher.java
...va/com/google/android/exoplayer/util/ManifestFetcher.java
+2
-2
library/src/main/java/com/google/android/exoplayer/util/SlidingPercentile.java
.../com/google/android/exoplayer/util/SlidingPercentile.java
+1
-1
library/src/test/java/com/google/android/exoplayer/MediaFormatTest.java
...st/java/com/google/android/exoplayer/MediaFormatTest.java
+1
-1
library/src/test/java/com/google/android/exoplayer/dash/DashChunkSourceTest.java
...om/google/android/exoplayer/dash/DashChunkSourceTest.java
+7
-7
library/src/test/java/com/google/android/exoplayer/extractor/mp4/Mp4ExtractorTest.java
...gle/android/exoplayer/extractor/mp4/Mp4ExtractorTest.java
+1
-1
library/src/test/java/com/google/android/exoplayer/extractor/webm/DefaultEbmlReaderTest.java
...droid/exoplayer/extractor/webm/DefaultEbmlReaderTest.java
+1
-1
library/src/test/java/com/google/android/exoplayer/testutil/FakeDataSource.java
...com/google/android/exoplayer/testutil/FakeDataSource.java
+1
-1
library/src/test/java/com/google/android/exoplayer/text/webvtt/WebvttSubtitleTest.java
...gle/android/exoplayer/text/webvtt/WebvttSubtitleTest.java
+4
-3
library/src/test/java/com/google/android/exoplayer/util/UtilTest.java
...test/java/com/google/android/exoplayer/util/UtilTest.java
+2
-2
未找到文件。
demo/src/main/java/com/google/android/exoplayer/demo/SmoothStreamingTestMediaDrmCallback.java
浏览文件 @
67d01549
...
...
@@ -38,7 +38,7 @@ public class SmoothStreamingTestMediaDrmCallback implements MediaDrmCallback {
"http://playready.directtaps.net/pr/svc/rightsmanager.asmx"
;
private
static
final
Map
<
String
,
String
>
KEY_REQUEST_PROPERTIES
;
static
{
HashMap
<
String
,
String
>
keyRequestProperties
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
keyRequestProperties
=
new
HashMap
<>();
keyRequestProperties
.
put
(
"Content-Type"
,
"text/xml"
);
keyRequestProperties
.
put
(
"SOAPAction"
,
"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense"
);
...
...
demo/src/main/java/com/google/android/exoplayer/demo/player/DashRendererBuilder.java
浏览文件 @
67d01549
...
...
@@ -131,7 +131,7 @@ public class DashRendererBuilder implements RendererBuilder,
this
.
callback
=
callback
;
MediaPresentationDescriptionParser
parser
=
new
MediaPresentationDescriptionParser
();
manifestDataSource
=
new
DefaultUriDataSource
(
context
,
userAgent
);
manifestFetcher
=
new
ManifestFetcher
<
MediaPresentationDescription
>(
url
,
manifestDataSource
,
manifestFetcher
=
new
ManifestFetcher
<>(
url
,
manifestDataSource
,
parser
);
manifestFetcher
.
singleLoad
(
player
.
getMainHandler
().
getLooper
(),
this
);
}
...
...
@@ -247,13 +247,13 @@ public class DashRendererBuilder implements RendererBuilder,
}
// Build the audio chunk sources.
List
<
ChunkSource
>
audioChunkSourceList
=
new
ArrayList
<
ChunkSource
>();
List
<
String
>
audioTrackNameList
=
new
ArrayList
<
String
>();
List
<
ChunkSource
>
audioChunkSourceList
=
new
ArrayList
<>();
List
<
String
>
audioTrackNameList
=
new
ArrayList
<>();
if
(
audioAdaptationSet
!=
null
)
{
DataSource
audioDataSource
=
new
DefaultUriDataSource
(
context
,
bandwidthMeter
,
userAgent
);
FormatEvaluator
audioEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
List
<
Representation
>
audioRepresentations
=
audioAdaptationSet
.
representations
;
List
<
String
>
codecs
=
new
ArrayList
<
String
>();
List
<
String
>
codecs
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
audioRepresentations
.
size
();
i
++)
{
Format
format
=
audioRepresentations
.
get
(
i
).
format
;
audioTrackNameList
.
add
(
format
.
id
+
" ("
+
format
.
numChannels
+
"ch, "
+
...
...
@@ -307,8 +307,8 @@ public class DashRendererBuilder implements RendererBuilder,
// Build the text chunk sources.
DataSource
textDataSource
=
new
DefaultUriDataSource
(
context
,
bandwidthMeter
,
userAgent
);
FormatEvaluator
textEvaluator
=
new
FormatEvaluator
.
FixedEvaluator
();
List
<
ChunkSource
>
textChunkSourceList
=
new
ArrayList
<
ChunkSource
>();
List
<
String
>
textTrackNameList
=
new
ArrayList
<
String
>();
List
<
ChunkSource
>
textChunkSourceList
=
new
ArrayList
<>();
List
<
String
>
textTrackNameList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
period
.
adaptationSets
.
size
();
i
++)
{
AdaptationSet
adaptationSet
=
period
.
adaptationSets
.
get
(
i
);
if
(
adaptationSet
.
type
==
AdaptationSet
.
TYPE_TEXT
)
{
...
...
demo/src/main/java/com/google/android/exoplayer/demo/player/DemoPlayer.java
浏览文件 @
67d01549
...
...
@@ -207,7 +207,7 @@ public class DemoPlayer implements ExoPlayer.Listener, ChunkSampleSource.EventLi
player
.
addListener
(
this
);
playerControl
=
new
PlayerControl
(
player
);
mainHandler
=
new
Handler
();
listeners
=
new
CopyOnWriteArrayList
<
Listener
>();
listeners
=
new
CopyOnWriteArrayList
<>();
lastReportedPlaybackState
=
STATE_IDLE
;
rendererBuildingState
=
RENDERER_BUILDING_STATE_IDLE
;
selectedTracks
=
new
int
[
RENDERER_COUNT
];
...
...
demo/src/main/java/com/google/android/exoplayer/demo/player/HlsRendererBuilder.java
浏览文件 @
67d01549
...
...
@@ -76,7 +76,7 @@ public class HlsRendererBuilder implements RendererBuilder, ManifestCallback<Hls
this
.
player
=
player
;
this
.
callback
=
callback
;
HlsPlaylistParser
parser
=
new
HlsPlaylistParser
();
ManifestFetcher
<
HlsPlaylist
>
playlistFetcher
=
new
ManifestFetcher
<
HlsPlaylist
>(
url
,
ManifestFetcher
<
HlsPlaylist
>
playlistFetcher
=
new
ManifestFetcher
<>(
url
,
new
DefaultUriDataSource
(
context
,
userAgent
),
parser
);
playlistFetcher
.
singleLoad
(
player
.
getMainHandler
().
getLooper
(),
this
);
}
...
...
@@ -113,7 +113,7 @@ public class HlsRendererBuilder implements RendererBuilder, ManifestCallback<Hls
MediaCodecAudioTrackRenderer
audioRenderer
=
new
MediaCodecAudioTrackRenderer
(
sampleSource
);
MetadataTrackRenderer
<
Map
<
String
,
Object
>>
id3Renderer
=
new
MetadataTrackRenderer
<
Map
<
String
,
Object
>
>(
sampleSource
,
new
Id3Parser
(),
new
MetadataTrackRenderer
<>(
sampleSource
,
new
Id3Parser
(),
player
.
getId3MetadataRenderer
(),
mainHandler
.
getLooper
());
Eia608TrackRenderer
closedCaptionRenderer
=
new
Eia608TrackRenderer
(
sampleSource
,
player
,
...
...
demo/src/main/java/com/google/android/exoplayer/demo/player/SmoothStreamingRendererBuilder.java
浏览文件 @
67d01549
...
...
@@ -97,7 +97,7 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
manifestUrl
+=
"/Manifest"
;
}
SmoothStreamingManifestParser
parser
=
new
SmoothStreamingManifestParser
();
manifestFetcher
=
new
ManifestFetcher
<
SmoothStreamingManifest
>(
manifestUrl
,
manifestFetcher
=
new
ManifestFetcher
<>(
manifestUrl
,
new
DefaultHttpDataSource
(
userAgent
,
null
),
parser
);
manifestFetcher
.
singleLoad
(
player
.
getMainHandler
().
getLooper
(),
this
);
}
...
...
library/src/main/java/com/google/android/exoplayer/DefaultLoadControl.java
浏览文件 @
67d01549
...
...
@@ -127,8 +127,8 @@ public class DefaultLoadControl implements LoadControl {
this
.
allocator
=
allocator
;
this
.
eventHandler
=
eventHandler
;
this
.
eventListener
=
eventListener
;
this
.
loaders
=
new
ArrayList
<
Object
>();
this
.
loaderStates
=
new
HashMap
<
Object
,
LoaderState
>();
this
.
loaders
=
new
ArrayList
<>();
this
.
loaderStates
=
new
HashMap
<>();
this
.
lowWatermarkUs
=
lowWatermarkMs
*
1000L
;
this
.
highWatermarkUs
=
highWatermarkMs
*
1000L
;
this
.
lowBufferLoad
=
lowBufferLoad
;
...
...
library/src/main/java/com/google/android/exoplayer/ExoPlayerImpl.java
浏览文件 @
67d01549
...
...
@@ -55,7 +55,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
Log
.
i
(
TAG
,
"Init "
+
ExoPlayerLibraryInfo
.
VERSION
);
this
.
playWhenReady
=
false
;
this
.
playbackState
=
STATE_IDLE
;
this
.
listeners
=
new
CopyOnWriteArraySet
<
Listener
>();
this
.
listeners
=
new
CopyOnWriteArraySet
<>();
this
.
rendererEnabledFlags
=
new
boolean
[
rendererCount
];
for
(
int
i
=
0
;
i
<
rendererEnabledFlags
.
length
;
i
++)
{
rendererEnabledFlags
[
i
]
=
true
;
...
...
library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java
浏览文件 @
67d01549
...
...
@@ -99,7 +99,7 @@ import java.util.List;
this
.
bufferedPositionUs
=
TrackRenderer
.
UNKNOWN_TIME_US
;
mediaClock
=
new
MediaClock
();
enabledRenderers
=
new
ArrayList
<
TrackRenderer
>(
rendererEnabledFlags
.
length
);
enabledRenderers
=
new
ArrayList
<>(
rendererEnabledFlags
.
length
);
// Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
// not normally change to this priority" is incorrect.
internalPlaybackThread
=
new
PriorityHandlerThread
(
getClass
().
getSimpleName
()
+
":Handler"
,
...
...
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
浏览文件 @
67d01549
...
...
@@ -236,7 +236,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
codecCounters
=
new
CodecCounters
();
sampleHolder
=
new
SampleHolder
(
SampleHolder
.
BUFFER_REPLACEMENT_MODE_DISABLED
);
formatHolder
=
new
MediaFormatHolder
();
decodeOnlyPresentationTimestamps
=
new
ArrayList
<
Long
>();
decodeOnlyPresentationTimestamps
=
new
ArrayList
<>();
outputBufferInfo
=
new
MediaCodec
.
BufferInfo
();
codecReconfigurationState
=
RECONFIGURATION_STATE_NONE
;
codecReinitializationState
=
REINITIALIZATION_STATE_NONE
;
...
...
library/src/main/java/com/google/android/exoplayer/MediaCodecUtil.java
浏览文件 @
67d01549
...
...
@@ -53,7 +53,7 @@ public class MediaCodecUtil {
private
static
final
String
TAG
=
"MediaCodecUtil"
;
private
static
final
HashMap
<
CodecKey
,
Pair
<
String
,
CodecCapabilities
>>
codecs
=
new
HashMap
<
CodecKey
,
Pair
<
String
,
CodecCapabilities
>
>();
new
HashMap
<>();
/**
* Get information about the decoder that will be used for a given mime type.
...
...
library/src/main/java/com/google/android/exoplayer/MediaFormat.java
浏览文件 @
67d01549
...
...
@@ -121,7 +121,7 @@ public class MediaFormat {
channelCount
=
getOptionalIntegerV16
(
format
,
android
.
media
.
MediaFormat
.
KEY_CHANNEL_COUNT
);
sampleRate
=
getOptionalIntegerV16
(
format
,
android
.
media
.
MediaFormat
.
KEY_SAMPLE_RATE
);
pixelWidthHeightRatio
=
getOptionalFloatV16
(
format
,
KEY_PIXEL_WIDTH_HEIGHT_RATIO
);
initializationData
=
new
ArrayList
<
byte
[]
>();
initializationData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
format
.
containsKey
(
"csd-"
+
i
);
i
++)
{
ByteBuffer
buffer
=
format
.
getByteBuffer
(
"csd-"
+
i
);
byte
[]
data
=
new
byte
[
buffer
.
limit
()];
...
...
library/src/main/java/com/google/android/exoplayer/chunk/ChunkSampleSource.java
浏览文件 @
67d01549
...
...
@@ -113,7 +113,7 @@ public class ChunkSampleSource implements SampleSource, Loader.Callback {
this
.
eventSourceId
=
eventSourceId
;
this
.
minLoadableRetryCount
=
minLoadableRetryCount
;
currentLoadableHolder
=
new
ChunkOperationHolder
();
mediaChunks
=
new
LinkedList
<
BaseMediaChunk
>();
mediaChunks
=
new
LinkedList
<>();
readOnlyMediaChunks
=
Collections
.
unmodifiableList
(
mediaChunks
);
sampleQueue
=
new
DefaultTrackOutput
(
loadControl
.
getAllocator
());
state
=
STATE_UNPREPARED
;
...
...
library/src/main/java/com/google/android/exoplayer/chunk/VideoFormatSelectorUtil.java
浏览文件 @
67d01549
...
...
@@ -94,7 +94,7 @@ public final class VideoFormatSelectorUtil {
String
[]
allowedContainerMimeTypes
,
boolean
filterHdFormats
,
boolean
orientationMayChange
,
int
viewportWidth
,
int
viewportHeight
)
throws
DecoderQueryException
{
int
maxVideoPixelsToRetain
=
Integer
.
MAX_VALUE
;
ArrayList
<
Integer
>
selectedIndexList
=
new
ArrayList
<
Integer
>();
ArrayList
<
Integer
>
selectedIndexList
=
new
ArrayList
<>();
int
maxDecodableFrameSize
=
MediaCodecUtil
.
maxH264DecodableFrameSize
();
// First pass to filter out formats that individually fail to meet the selection criteria.
...
...
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
浏览文件 @
67d01549
...
...
@@ -232,7 +232,7 @@ public class DashChunkSource implements ChunkSource {
this
.
trackInfo
=
new
TrackInfo
(
representations
[
0
].
format
.
mimeType
,
periodDurationUs
);
this
.
formats
=
new
Format
[
representations
.
length
];
this
.
representationHolders
=
new
HashMap
<
String
,
RepresentationHolder
>();
this
.
representationHolders
=
new
HashMap
<>();
int
maxWidth
=
0
;
int
maxHeight
=
0
;
for
(
int
i
=
0
;
i
<
representations
.
length
;
i
++)
{
...
...
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
浏览文件 @
67d01549
...
...
@@ -112,7 +112,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
:
-
1
;
UtcTimingElement
utcTiming
=
null
;
List
<
Period
>
periods
=
new
ArrayList
<
Period
>();
List
<
Period
>
periods
=
new
ArrayList
<>();
do
{
xpp
.
next
();
if
(
isStartTag
(
xpp
,
"BaseURL"
))
{
...
...
@@ -152,7 +152,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
long
startMs
=
parseDuration
(
xpp
,
"start"
,
0
);
long
durationMs
=
parseDuration
(
xpp
,
"duration"
,
mpdDurationMs
);
SegmentBase
segmentBase
=
null
;
List
<
AdaptationSet
>
adaptationSets
=
new
ArrayList
<
AdaptationSet
>();
List
<
AdaptationSet
>
adaptationSets
=
new
ArrayList
<>();
do
{
xpp
.
next
();
if
(
isStartTag
(
xpp
,
"BaseURL"
))
{
...
...
@@ -188,7 +188,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
int
id
=
-
1
;
ContentProtectionsBuilder
contentProtectionsBuilder
=
new
ContentProtectionsBuilder
();
List
<
Representation
>
representations
=
new
ArrayList
<
Representation
>();
List
<
Representation
>
representations
=
new
ArrayList
<>();
do
{
xpp
.
next
();
if
(
isStartTag
(
xpp
,
"BaseURL"
))
{
...
...
@@ -432,7 +432,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
timeline
=
parseSegmentTimeline
(
xpp
);
}
else
if
(
isStartTag
(
xpp
,
"SegmentURL"
))
{
if
(
segments
==
null
)
{
segments
=
new
ArrayList
<
RangedUri
>();
segments
=
new
ArrayList
<>();
}
segments
.
add
(
parseSegmentUrl
(
xpp
,
baseUrl
));
}
...
...
@@ -499,7 +499,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
protected
List
<
SegmentTimelineElement
>
parseSegmentTimeline
(
XmlPullParser
xpp
)
throws
XmlPullParserException
,
IOException
{
List
<
SegmentTimelineElement
>
segmentTimeline
=
new
ArrayList
<
SegmentTimelineElement
>();
List
<
SegmentTimelineElement
>
segmentTimeline
=
new
ArrayList
<>();
long
elapsedTime
=
0
;
do
{
xpp
.
next
();
...
...
@@ -642,7 +642,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
*/
public
void
addAdaptationSetProtection
(
ContentProtection
contentProtection
)
{
if
(
adaptationSetProtections
==
null
)
{
adaptationSetProtections
=
new
ArrayList
<
ContentProtection
>();
adaptationSetProtections
=
new
ArrayList
<>();
}
maybeAddContentProtection
(
adaptationSetProtections
,
contentProtection
);
}
...
...
@@ -654,7 +654,7 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
*/
public
void
addRepresentationProtection
(
ContentProtection
contentProtection
)
{
if
(
currentRepresentationProtections
==
null
)
{
currentRepresentationProtections
=
new
ArrayList
<
ContentProtection
>();
currentRepresentationProtections
=
new
ArrayList
<>();
}
maybeAddContentProtection
(
currentRepresentationProtections
,
contentProtection
);
}
...
...
library/src/main/java/com/google/android/exoplayer/dash/mpd/UtcTimingElementResolver.java
浏览文件 @
67d01549
...
...
@@ -124,7 +124,7 @@ public class UtcTimingElementResolver implements Loader.Callback {
private
void
resolveHttp
(
UriLoadable
.
Parser
<
Long
>
parser
)
{
singleUseLoader
=
new
Loader
(
"utctiming"
);
singleUseLoadable
=
new
UriLoadable
<
Long
>(
timingElement
.
value
,
uriDataSource
,
parser
);
singleUseLoadable
=
new
UriLoadable
<>(
timingElement
.
value
,
uriDataSource
,
parser
);
singleUseLoader
.
startLoading
(
singleUseLoadable
,
this
);
}
...
...
library/src/main/java/com/google/android/exoplayer/drm/DrmInitData.java
浏览文件 @
67d01549
...
...
@@ -52,7 +52,7 @@ public abstract class DrmInitData {
public
Mapped
(
String
mimeType
)
{
super
(
mimeType
);
schemeData
=
new
HashMap
<
UUID
,
byte
[]
>();
schemeData
=
new
HashMap
<>();
}
@Override
...
...
library/src/main/java/com/google/android/exoplayer/drm/StreamingDrmSessionManager.java
浏览文件 @
67d01549
...
...
@@ -139,7 +139,7 @@ public class StreamingDrmSessionManager implements DrmSessionManager {
EventListener
eventListener
)
throws
UnsupportedSchemeException
{
HashMap
<
String
,
String
>
optionalKeyRequestParameters
;
if
(!
TextUtils
.
isEmpty
(
customData
))
{
optionalKeyRequestParameters
=
new
HashMap
<
String
,
String
>();
optionalKeyRequestParameters
=
new
HashMap
<>();
optionalKeyRequestParameters
.
put
(
PLAYREADY_CUSTOM_DATA_KEY
,
customData
);
}
else
{
optionalKeyRequestParameters
=
null
;
...
...
library/src/main/java/com/google/android/exoplayer/extractor/ExtractorSampleSource.java
浏览文件 @
67d01549
...
...
@@ -130,7 +130,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
this
.
remainingReleaseCount
=
downstreamRendererCount
;
this
.
requestedBufferSize
=
requestedBufferSize
;
this
.
minLoadableRetryCount
=
minLoadableRetryCount
;
sampleQueues
=
new
SparseArray
<
InternalTrackOutput
>();
sampleQueues
=
new
SparseArray
<>();
allocator
=
new
DefaultAllocator
(
BUFFER_FRAGMENT_LENGTH
);
pendingResetPositionUs
=
NO_RESET_PENDING
;
frameAccurateSeeking
=
true
;
...
...
library/src/main/java/com/google/android/exoplayer/extractor/RollingSampleBuffer.java
浏览文件 @
67d01549
...
...
@@ -57,7 +57,7 @@ import java.util.concurrent.LinkedBlockingDeque;
this
.
allocator
=
allocator
;
allocationLength
=
allocator
.
getIndividualAllocationLength
();
infoQueue
=
new
InfoQueue
();
dataQueue
=
new
LinkedBlockingDeque
<
Allocation
>();
dataQueue
=
new
LinkedBlockingDeque
<>();
extrasHolder
=
new
SampleExtrasHolder
();
scratch
=
new
ParsableByteArray
(
INITIAL_SCRATCH_SIZE
);
lastAllocationOffset
=
allocationLength
;
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Atom.java
浏览文件 @
67d01549
...
...
@@ -122,8 +122,8 @@ import java.util.List;
public
ContainerAtom
(
int
type
,
long
endByteOffset
)
{
super
(
type
);
leafChildren
=
new
ArrayList
<
LeafAtom
>();
containerChildren
=
new
ArrayList
<
ContainerAtom
>();
leafChildren
=
new
ArrayList
<>();
containerChildren
=
new
ArrayList
<>();
this
.
endByteOffset
=
endByteOffset
;
}
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp4/AtomParsers.java
浏览文件 @
67d01549
...
...
@@ -396,7 +396,7 @@ import java.util.List;
if
(
nalUnitLengthFieldLength
==
3
)
{
throw
new
IllegalStateException
();
}
List
<
byte
[]>
initializationData
=
new
ArrayList
<
byte
[]
>();
List
<
byte
[]>
initializationData
=
new
ArrayList
<>();
// TODO: We should try and parse these using CodecSpecificDataUtil.parseSpsNalUnit, and
// expose the AVC profile and level somewhere useful; Most likely in MediaFormat.
int
numSequenceParameterSets
=
parent
.
readUnsignedByte
()
&
0x1F
;
...
...
@@ -472,7 +472,7 @@ import java.util.List;
int
height
=
parent
.
readUnsignedShort
();
parent
.
skipBytes
(
50
);
List
<
byte
[]>
initializationData
=
new
ArrayList
<
byte
[]
>(
1
);
List
<
byte
[]>
initializationData
=
new
ArrayList
<>(
1
);
int
childPosition
=
parent
.
getPosition
();
while
(
childPosition
-
position
<
size
)
{
parent
.
setPosition
(
childPosition
);
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp4/FragmentedMp4Extractor.java
浏览文件 @
67d01549
...
...
@@ -110,7 +110,7 @@ public final class FragmentedMp4Extractor implements Extractor {
nalLength
=
new
ParsableByteArray
(
4
);
encryptionSignalByte
=
new
ParsableByteArray
(
1
);
extendedTypeScratch
=
new
byte
[
16
];
containerAtoms
=
new
Stack
<
ContainerAtom
>();
containerAtoms
=
new
Stack
<>();
fragmentRun
=
new
TrackFragment
();
parserState
=
STATE_READING_ATOM_HEADER
;
}
...
...
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Mp4Extractor.java
浏览文件 @
67d01549
...
...
@@ -71,7 +71,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
public
Mp4Extractor
()
{
atomHeader
=
new
ParsableByteArray
(
Atom
.
LONG_HEADER_SIZE
);
containerAtoms
=
new
Stack
<
Atom
.
ContainerAtom
>();
containerAtoms
=
new
Stack
<>();
nalStartCode
=
new
ParsableByteArray
(
H264Util
.
NAL_START_CODE
);
nalLength
=
new
ParsableByteArray
(
4
);
parserState
=
STATE_READING_ATOM_HEADER
;
...
...
@@ -216,7 +216,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
/** Updates the stored track metadata to reflect the contents of the specified moov atom. */
private
void
processMoovAtom
(
ContainerAtom
moov
)
{
List
<
Mp4Track
>
tracks
=
new
ArrayList
<
Mp4Track
>();
List
<
Mp4Track
>
tracks
=
new
ArrayList
<>();
long
earliestSampleOffset
=
Long
.
MAX_VALUE
;
for
(
int
i
=
0
;
i
<
moov
.
containerChildren
.
size
();
i
++)
{
Atom
.
ContainerAtom
atom
=
moov
.
containerChildren
.
get
(
i
);
...
...
library/src/main/java/com/google/android/exoplayer/extractor/ts/H264Reader.java
浏览文件 @
67d01549
...
...
@@ -224,7 +224,7 @@ import java.util.List;
byte
[]
ppsData
=
new
byte
[
pps
.
nalLength
];
System
.
arraycopy
(
sps
.
nalData
,
0
,
spsData
,
0
,
sps
.
nalLength
);
System
.
arraycopy
(
pps
.
nalData
,
0
,
ppsData
,
0
,
pps
.
nalLength
);
List
<
byte
[]>
initializationData
=
new
ArrayList
<
byte
[]
>();
List
<
byte
[]>
initializationData
=
new
ArrayList
<>();
initializationData
.
add
(
spsData
);
initializationData
.
add
(
ppsData
);
...
...
library/src/main/java/com/google/android/exoplayer/extractor/ts/TsExtractor.java
浏览文件 @
67d01549
...
...
@@ -85,7 +85,7 @@ public final class TsExtractor implements Extractor, SeekMap {
tsPacketBuffer
=
new
ParsableByteArray
(
TS_PACKET_SIZE
);
streamTypes
=
new
SparseBooleanArray
();
allowedPassthroughStreamTypes
=
getPassthroughStreamTypes
(
audioCapabilities
);
tsPayloadReaders
=
new
SparseArray
<
TsPayloadReader
>();
tsPayloadReaders
=
new
SparseArray
<>();
tsPayloadReaders
.
put
(
TS_PAT_PID
,
new
PatReader
());
lastPts
=
Long
.
MIN_VALUE
;
}
...
...
library/src/main/java/com/google/android/exoplayer/extractor/webm/DefaultEbmlReader.java
浏览文件 @
67d01549
...
...
@@ -37,7 +37,7 @@ import java.util.Stack;
private
static
final
int
VALID_FLOAT64_ELEMENT_SIZE_BYTES
=
8
;
private
final
byte
[]
scratch
=
new
byte
[
8
];
private
final
Stack
<
MasterElement
>
masterElementsStack
=
new
Stack
<
MasterElement
>();
private
final
Stack
<
MasterElement
>
masterElementsStack
=
new
Stack
<>();
private
final
VarintReader
varintReader
=
new
VarintReader
();
private
EbmlReaderOutput
output
;
...
...
library/src/main/java/com/google/android/exoplayer/extractor/webm/WebmExtractor.java
浏览文件 @
67d01549
...
...
@@ -665,7 +665,7 @@ public final class WebmExtractor implements Extractor {
durationUs
,
audioTrackFormat
.
channelCount
,
audioTrackFormat
.
sampleRate
,
parseVorbisCodecPrivate
());
}
else
if
(
audioTrackFormat
!=
null
&&
CODEC_ID_OPUS
.
equals
(
audioTrackFormat
.
codecId
))
{
ArrayList
<
byte
[]>
opusInitializationData
=
new
ArrayList
<
byte
[]
>(
3
);
ArrayList
<
byte
[]>
opusInitializationData
=
new
ArrayList
<>(
3
);
opusInitializationData
.
add
(
audioTrackFormat
.
codecPrivate
);
opusInitializationData
.
add
(
ByteBuffer
.
allocate
(
Long
.
SIZE
).
putLong
(
audioTrackFormat
.
codecDelayNs
).
array
());
...
...
@@ -757,7 +757,7 @@ public final class WebmExtractor implements Extractor {
}
byte
[]
vorbisBooks
=
new
byte
[
codecPrivate
.
length
-
offset
];
System
.
arraycopy
(
codecPrivate
,
offset
,
vorbisBooks
,
0
,
codecPrivate
.
length
-
offset
);
ArrayList
<
byte
[]>
initializationData
=
new
ArrayList
<
byte
[]
>(
2
);
ArrayList
<
byte
[]>
initializationData
=
new
ArrayList
<>(
2
);
initializationData
.
add
(
vorbisInfo
);
initializationData
.
add
(
vorbisBooks
);
return
initializationData
;
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsChunkSource.java
浏览文件 @
67d01549
...
...
@@ -516,7 +516,7 @@ public class HlsChunkSource {
}
private
static
Format
[]
buildEnabledFormats
(
List
<
Variant
>
variants
,
int
[]
variantIndices
)
{
ArrayList
<
Variant
>
enabledVariants
=
new
ArrayList
<
Variant
>();
ArrayList
<
Variant
>
enabledVariants
=
new
ArrayList
<>();
if
(
variantIndices
!=
null
)
{
for
(
int
i
=
0
;
i
<
variantIndices
.
length
;
i
++)
{
enabledVariants
.
add
(
variants
.
get
(
variantIndices
[
i
]));
...
...
@@ -526,8 +526,8 @@ public class HlsChunkSource {
enabledVariants
.
addAll
(
variants
);
}
ArrayList
<
Variant
>
definiteVideoVariants
=
new
ArrayList
<
Variant
>();
ArrayList
<
Variant
>
definiteAudioOnlyVariants
=
new
ArrayList
<
Variant
>();
ArrayList
<
Variant
>
definiteVideoVariants
=
new
ArrayList
<>();
ArrayList
<
Variant
>
definiteAudioOnlyVariants
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
enabledVariants
.
size
();
i
++)
{
Variant
variant
=
enabledVariants
.
get
(
i
);
if
(
variant
.
format
.
height
>
0
||
variantHasExplicitCodecWithPrefix
(
variant
,
"avc"
))
{
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsExtractorWrapper.java
浏览文件 @
67d01549
...
...
@@ -60,7 +60,7 @@ public final class HlsExtractorWrapper implements ExtractorOutput {
this
.
startTimeUs
=
startTimeUs
;
this
.
extractor
=
extractor
;
this
.
shouldSpliceIn
=
shouldSpliceIn
;
sampleQueues
=
new
SparseArray
<
DefaultTrackOutput
>();
sampleQueues
=
new
SparseArray
<>();
}
/**
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsPlaylistParser.java
浏览文件 @
67d01549
...
...
@@ -106,7 +106,7 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
public
HlsPlaylist
parse
(
String
connectionUrl
,
InputStream
inputStream
)
throws
IOException
,
ParserException
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
));
Queue
<
String
>
extraLines
=
new
LinkedList
<
String
>();
Queue
<
String
>
extraLines
=
new
LinkedList
<>();
String
line
;
try
{
while
((
line
=
reader
.
readLine
())
!=
null
)
{
...
...
@@ -137,8 +137,8 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
private
static
HlsMasterPlaylist
parseMasterPlaylist
(
LineIterator
iterator
,
String
baseUri
)
throws
IOException
{
ArrayList
<
Variant
>
variants
=
new
ArrayList
<
Variant
>();
ArrayList
<
Subtitle
>
subtitles
=
new
ArrayList
<
Subtitle
>();
ArrayList
<
Variant
>
variants
=
new
ArrayList
<>();
ArrayList
<
Subtitle
>
subtitles
=
new
ArrayList
<>();
int
bitrate
=
0
;
String
codecs
=
null
;
int
width
=
-
1
;
...
...
@@ -202,7 +202,7 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
int
targetDurationSecs
=
0
;
int
version
=
1
;
// Default version == 1.
boolean
live
=
true
;
List
<
Segment
>
segments
=
new
ArrayList
<
Segment
>();
List
<
Segment
>
segments
=
new
ArrayList
<>();
double
segmentDurationSecs
=
0.0
;
boolean
segmentDiscontinuity
=
false
;
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
浏览文件 @
67d01549
...
...
@@ -120,7 +120,7 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
this
.
eventListener
=
eventListener
;
this
.
eventSourceId
=
eventSourceId
;
this
.
pendingResetPositionUs
=
NO_RESET_PENDING
;
extractors
=
new
LinkedList
<
HlsExtractorWrapper
>();
extractors
=
new
LinkedList
<>();
allocator
=
new
DefaultAllocator
(
BUFFER_FRAGMENT_LENGTH
);
}
...
...
library/src/main/java/com/google/android/exoplayer/metadata/Id3Parser.java
浏览文件 @
67d01549
...
...
@@ -42,7 +42,7 @@ public class Id3Parser implements MetadataParser<Map<String, Object>> {
@Override
public
Map
<
String
,
Object
>
parse
(
byte
[]
data
,
int
size
)
throws
UnsupportedEncodingException
,
ParserException
{
Map
<
String
,
Object
>
metadata
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
metadata
=
new
HashMap
<>();
ParsableByteArray
id3Data
=
new
ParsableByteArray
(
data
,
size
);
int
id3Size
=
parseId3Header
(
id3Data
);
...
...
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingChunkSource.java
浏览文件 @
67d01549
...
...
@@ -153,8 +153,8 @@ public class SmoothStreamingChunkSource implements ChunkSource {
int
trackCount
=
trackIndices
!=
null
?
trackIndices
.
length
:
streamElement
.
tracks
.
length
;
formats
=
new
Format
[
trackCount
];
extractorWrappers
=
new
SparseArray
<
ChunkExtractorWrapper
>();
mediaFormats
=
new
SparseArray
<
MediaFormat
>();
extractorWrappers
=
new
SparseArray
<>();
mediaFormats
=
new
SparseArray
<>();
int
maxWidth
=
0
;
int
maxHeight
=
0
;
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
...
...
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingManifestParser.java
浏览文件 @
67d01549
...
...
@@ -96,7 +96,7 @@ public class SmoothStreamingManifestParser implements UriLoadable.Parser<SmoothS
this
.
parent
=
parent
;
this
.
baseUri
=
baseUri
;
this
.
tag
=
tag
;
this
.
normalizedAttributes
=
new
LinkedList
<
Pair
<
String
,
Object
>
>();
this
.
normalizedAttributes
=
new
LinkedList
<>();
}
public
final
Object
parse
(
XmlPullParser
xmlParser
)
throws
XmlPullParserException
,
IOException
,
...
...
@@ -343,7 +343,7 @@ public class SmoothStreamingManifestParser implements UriLoadable.Parser<SmoothS
super
(
parent
,
baseUri
,
TAG
);
lookAheadCount
=
-
1
;
protectionElement
=
null
;
streamElements
=
new
LinkedList
<
StreamElement
>();
streamElements
=
new
LinkedList
<>();
}
@Override
...
...
@@ -473,7 +473,7 @@ public class SmoothStreamingManifestParser implements UriLoadable.Parser<SmoothS
public
StreamElementParser
(
ElementParser
parent
,
String
baseUri
)
{
super
(
parent
,
baseUri
,
TAG
);
this
.
baseUri
=
baseUri
;
tracks
=
new
LinkedList
<
TrackElement
>();
tracks
=
new
LinkedList
<>();
}
@Override
...
...
@@ -539,7 +539,7 @@ public class SmoothStreamingManifestParser implements UriLoadable.Parser<SmoothS
if
(
timescale
==
-
1
)
{
timescale
=
(
Long
)
getNormalizedAttribute
(
KEY_TIME_SCALE
);
}
startTimes
=
new
ArrayList
<
Long
>();
startTimes
=
new
ArrayList
<>();
}
private
int
parseType
(
XmlPullParser
parser
)
throws
ParserException
{
...
...
@@ -602,7 +602,7 @@ public class SmoothStreamingManifestParser implements UriLoadable.Parser<SmoothS
public
TrackElementParser
(
ElementParser
parent
,
String
baseUri
)
{
super
(
parent
,
baseUri
,
TAG
);
this
.
csd
=
new
LinkedList
<
byte
[]
>();
this
.
csd
=
new
LinkedList
<>();
}
@Override
...
...
library/src/main/java/com/google/android/exoplayer/text/SubtitleLayout.java
浏览文件 @
67d01549
...
...
@@ -49,7 +49,7 @@ public final class SubtitleLayout extends ViewGroup {
public
SubtitleLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
subtitleViews
=
new
ArrayList
<
SubtitleView
>();
subtitleViews
=
new
ArrayList
<>();
fontScale
=
1
;
captionStyle
=
CaptionStyleCompat
.
DEFAULT
;
}
...
...
library/src/main/java/com/google/android/exoplayer/text/eia608/Eia608Parser.java
浏览文件 @
67d01549
...
...
@@ -109,7 +109,7 @@ public class Eia608Parser {
/* package */
Eia608Parser
()
{
seiBuffer
=
new
ParsableBitArray
();
stringBuilder
=
new
StringBuilder
();
captions
=
new
ArrayList
<
ClosedCaption
>();
captions
=
new
ArrayList
<>();
}
/* package */
boolean
canParse
(
String
mimeType
)
{
...
...
library/src/main/java/com/google/android/exoplayer/text/eia608/Eia608TrackRenderer.java
浏览文件 @
67d01549
...
...
@@ -88,7 +88,7 @@ public class Eia608TrackRenderer extends TrackRenderer implements Callback {
formatHolder
=
new
MediaFormatHolder
();
sampleHolder
=
new
SampleHolder
(
SampleHolder
.
BUFFER_REPLACEMENT_MODE_NORMAL
);
captionStringBuilder
=
new
StringBuilder
();
pendingCaptionLists
=
new
TreeSet
<
ClosedCaptionList
>();
pendingCaptionLists
=
new
TreeSet
<>();
}
@Override
...
...
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlNode.java
浏览文件 @
67d01549
...
...
@@ -76,7 +76,7 @@ import java.util.TreeSet;
public
void
addChild
(
TtmlNode
child
)
{
if
(
children
==
null
)
{
children
=
new
ArrayList
<
TtmlNode
>();
children
=
new
ArrayList
<>();
}
children
.
add
(
child
);
}
...
...
@@ -93,7 +93,7 @@ import java.util.TreeSet;
}
public
long
[]
getEventTimesUs
()
{
TreeSet
<
Long
>
eventTimeSet
=
new
TreeSet
<
Long
>();
TreeSet
<
Long
>
eventTimeSet
=
new
TreeSet
<>();
getEventTimes
(
eventTimeSet
,
false
);
long
[]
eventTimes
=
new
long
[
eventTimeSet
.
size
()];
Iterator
<
Long
>
eventTimeIterator
=
eventTimeSet
.
iterator
();
...
...
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlParser.java
浏览文件 @
67d01549
...
...
@@ -105,7 +105,7 @@ public class TtmlParser implements SubtitleParser {
XmlPullParser
xmlParser
=
xmlParserFactory
.
newPullParser
();
xmlParser
.
setInput
(
inputStream
,
inputEncoding
);
TtmlSubtitle
ttmlSubtitle
=
null
;
LinkedList
<
TtmlNode
>
nodeStack
=
new
LinkedList
<
TtmlNode
>();
LinkedList
<
TtmlNode
>
nodeStack
=
new
LinkedList
<>();
int
unsupportedNodeDepth
=
0
;
int
eventType
=
xmlParser
.
getEventType
();
while
(
eventType
!=
XmlPullParser
.
END_DOCUMENT
)
{
...
...
library/src/main/java/com/google/android/exoplayer/text/webvtt/WebvttParser.java
浏览文件 @
67d01549
...
...
@@ -81,7 +81,7 @@ public class WebvttParser implements SubtitleParser {
@Override
public
WebvttSubtitle
parse
(
InputStream
inputStream
,
String
inputEncoding
,
long
startTimeUs
)
throws
IOException
{
ArrayList
<
WebvttCue
>
subtitles
=
new
ArrayList
<
WebvttCue
>();
ArrayList
<
WebvttCue
>
subtitles
=
new
ArrayList
<>();
long
mediaTimestampUs
=
startTimeUs
;
long
mediaTimestampOffsetUs
=
0
;
...
...
library/src/main/java/com/google/android/exoplayer/text/webvtt/WebvttSubtitle.java
浏览文件 @
67d01549
...
...
@@ -100,7 +100,7 @@ public class WebvttSubtitle implements Subtitle {
for
(
int
i
=
0
;
i
<
numCues
;
i
++)
{
if
((
cueTimesUs
[
i
*
2
]
<=
timeUs
)
&&
(
timeUs
<
cueTimesUs
[
i
*
2
+
1
]))
{
if
(
list
==
null
)
{
list
=
new
ArrayList
<
Cue
>();
list
=
new
ArrayList
<>();
}
WebvttCue
cue
=
cues
.
get
(
i
);
if
(
cue
.
isNormalCue
())
{
...
...
library/src/main/java/com/google/android/exoplayer/upstream/DefaultHttpDataSource.java
浏览文件 @
67d01549
...
...
@@ -61,7 +61,7 @@ public class DefaultHttpDataSource implements HttpDataSource {
private
static
final
String
TAG
=
"HttpDataSource"
;
private
static
final
Pattern
CONTENT_RANGE_HEADER
=
Pattern
.
compile
(
"^bytes (\\d+)-(\\d+)/(\\d+)$"
);
private
static
final
AtomicReference
<
byte
[]>
skipBufferReference
=
new
AtomicReference
<
byte
[]
>();
private
static
final
AtomicReference
<
byte
[]>
skipBufferReference
=
new
AtomicReference
<>();
private
final
boolean
allowCrossProtocolRedirects
;
private
final
int
connectTimeoutMillis
;
...
...
@@ -141,7 +141,7 @@ public class DefaultHttpDataSource implements HttpDataSource {
this
.
userAgent
=
Assertions
.
checkNotEmpty
(
userAgent
);
this
.
contentTypePredicate
=
contentTypePredicate
;
this
.
listener
=
listener
;
this
.
requestProperties
=
new
HashMap
<
String
,
String
>();
this
.
requestProperties
=
new
HashMap
<>();
this
.
connectTimeoutMillis
=
connectTimeoutMillis
;
this
.
readTimeoutMillis
=
readTimeoutMillis
;
this
.
allowCrossProtocolRedirects
=
allowCrossProtocolRedirects
;
...
...
library/src/main/java/com/google/android/exoplayer/upstream/NetworkLock.java
浏览文件 @
67d01549
...
...
@@ -62,7 +62,7 @@ public final class NetworkLock {
private
int
highestPriority
;
private
NetworkLock
()
{
queue
=
new
PriorityQueue
<
Integer
>();
queue
=
new
PriorityQueue
<>();
highestPriority
=
Integer
.
MAX_VALUE
;
}
...
...
library/src/main/java/com/google/android/exoplayer/upstream/cache/LeastRecentlyUsedCacheEvictor.java
浏览文件 @
67d01549
...
...
@@ -30,7 +30,7 @@ public class LeastRecentlyUsedCacheEvictor implements CacheEvictor, Comparator<C
public
LeastRecentlyUsedCacheEvictor
(
long
maxBytes
)
{
this
.
maxBytes
=
maxBytes
;
this
.
leastRecentlyUsed
=
new
TreeSet
<
CacheSpan
>(
this
);
this
.
leastRecentlyUsed
=
new
TreeSet
<>(
this
);
}
@Override
...
...
library/src/main/java/com/google/android/exoplayer/upstream/cache/SimpleCache.java
浏览文件 @
67d01549
...
...
@@ -50,9 +50,9 @@ public class SimpleCache implements Cache {
public
SimpleCache
(
File
cacheDir
,
CacheEvictor
evictor
)
{
this
.
cacheDir
=
cacheDir
;
this
.
evictor
=
evictor
;
this
.
lockedSpans
=
new
HashMap
<
String
,
CacheSpan
>();
this
.
cachedSpans
=
new
HashMap
<
String
,
TreeSet
<
CacheSpan
>
>();
this
.
listeners
=
new
HashMap
<
String
,
ArrayList
<
Listener
>
>();
this
.
lockedSpans
=
new
HashMap
<>();
this
.
cachedSpans
=
new
HashMap
<>();
this
.
listeners
=
new
HashMap
<>();
// Start cache initialization.
final
ConditionVariable
conditionVariable
=
new
ConditionVariable
();
new
Thread
()
{
...
...
@@ -71,7 +71,7 @@ public class SimpleCache implements Cache {
public
synchronized
NavigableSet
<
CacheSpan
>
addListener
(
String
key
,
Listener
listener
)
{
ArrayList
<
Listener
>
listenersForKey
=
listeners
.
get
(
key
);
if
(
listenersForKey
==
null
)
{
listenersForKey
=
new
ArrayList
<
Listener
>();
listenersForKey
=
new
ArrayList
<>();
listeners
.
put
(
key
,
listenersForKey
);
}
listenersForKey
.
add
(
listener
);
...
...
@@ -92,12 +92,12 @@ public class SimpleCache implements Cache {
@Override
public
synchronized
NavigableSet
<
CacheSpan
>
getCachedSpans
(
String
key
)
{
TreeSet
<
CacheSpan
>
spansForKey
=
cachedSpans
.
get
(
key
);
return
spansForKey
==
null
?
null
:
new
TreeSet
<
CacheSpan
>(
spansForKey
);
return
spansForKey
==
null
?
null
:
new
TreeSet
<>(
spansForKey
);
}
@Override
public
synchronized
Set
<
String
>
getKeys
()
{
return
new
HashSet
<
String
>(
cachedSpans
.
keySet
());
return
new
HashSet
<>(
cachedSpans
.
keySet
());
}
@Override
...
...
@@ -263,7 +263,7 @@ public class SimpleCache implements Cache {
private
void
addSpan
(
CacheSpan
span
)
{
TreeSet
<
CacheSpan
>
spansForKey
=
cachedSpans
.
get
(
span
.
key
);
if
(
spansForKey
==
null
)
{
spansForKey
=
new
TreeSet
<
CacheSpan
>();
spansForKey
=
new
TreeSet
<>();
cachedSpans
.
put
(
span
.
key
,
spansForKey
);
}
spansForKey
.
add
(
span
);
...
...
library/src/main/java/com/google/android/exoplayer/util/CodecSpecificDataUtil.java
浏览文件 @
67d01549
...
...
@@ -132,7 +132,7 @@ public final class CodecSpecificDataUtil {
// data does not consist of NAL start code delimited units.
return
null
;
}
List
<
Integer
>
starts
=
new
ArrayList
<
Integer
>();
List
<
Integer
>
starts
=
new
ArrayList
<>();
int
nalUnitIndex
=
0
;
do
{
starts
.
add
(
nalUnitIndex
);
...
...
library/src/main/java/com/google/android/exoplayer/util/ManifestFetcher.java
浏览文件 @
67d01549
...
...
@@ -146,7 +146,7 @@ public class ManifestFetcher<T> implements Loader.Callback {
*/
public
void
singleLoad
(
Looper
callbackLooper
,
final
ManifestCallback
<
T
>
callback
)
{
SingleFetchHelper
fetchHelper
=
new
SingleFetchHelper
(
new
UriLoadable
<
T
>(
manifestUrl
,
uriDataSource
,
parser
),
callbackLooper
,
callback
);
new
UriLoadable
<>(
manifestUrl
,
uriDataSource
,
parser
),
callbackLooper
,
callback
);
fetchHelper
.
startLoading
();
}
...
...
@@ -219,7 +219,7 @@ public class ManifestFetcher<T> implements Loader.Callback {
loader
=
new
Loader
(
"manifestLoader"
);
}
if
(!
loader
.
isLoading
())
{
currentLoadable
=
new
UriLoadable
<
T
>(
manifestUrl
,
uriDataSource
,
parser
);
currentLoadable
=
new
UriLoadable
<>(
manifestUrl
,
uriDataSource
,
parser
);
loader
.
startLoading
(
currentLoadable
,
this
);
notifyManifestRefreshStarted
();
}
...
...
library/src/main/java/com/google/android/exoplayer/util/SlidingPercentile.java
浏览文件 @
67d01549
...
...
@@ -67,7 +67,7 @@ public class SlidingPercentile {
public
SlidingPercentile
(
int
maxWeight
)
{
this
.
maxWeight
=
maxWeight
;
recycledSamples
=
new
Sample
[
MAX_RECYCLED_SAMPLES
];
samples
=
new
ArrayList
<
Sample
>();
samples
=
new
ArrayList
<>();
currentSortOrder
=
SORT_ORDER_NONE
;
}
...
...
library/src/test/java/com/google/android/exoplayer/MediaFormatTest.java
浏览文件 @
67d01549
...
...
@@ -37,7 +37,7 @@ public class MediaFormatTest extends TestCase {
byte
[]
initData1
=
new
byte
[]
{
1
,
2
,
3
};
byte
[]
initData2
=
new
byte
[]
{
4
,
5
,
6
};
List
<
byte
[]>
initData
=
new
ArrayList
<
byte
[]
>();
List
<
byte
[]>
initData
=
new
ArrayList
<>();
initData
.
add
(
initData1
);
initData
.
add
(
initData2
);
...
...
library/src/test/java/com/google/android/exoplayer/dash/DashChunkSourceTest.java
浏览文件 @
67d01549
...
...
@@ -383,7 +383,7 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
}
private
static
MediaPresentationDescription
generateVodMpd
()
{
List
<
Representation
>
representations
=
new
ArrayList
<
Representation
>();
List
<
Representation
>
representations
=
new
ArrayList
<>();
SingleSegmentBase
segmentBase1
=
new
SingleSegmentBase
(
"https://example.com/1.mp4"
);
Representation
representation1
=
...
...
@@ -399,10 +399,10 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
}
private
static
MediaPresentationDescription
generateLiveMpdWithTimeline
(
long
startTime
)
{
List
<
Representation
>
representations
=
new
ArrayList
<
Representation
>();
List
<
Representation
>
representations
=
new
ArrayList
<>();
List
<
SegmentTimelineElement
>
segmentTimeline
=
new
ArrayList
<
SegmentTimelineElement
>();
List
<
RangedUri
>
mediaSegments
=
new
ArrayList
<
RangedUri
>();
List
<
SegmentTimelineElement
>
segmentTimeline
=
new
ArrayList
<>();
List
<
RangedUri
>
mediaSegments
=
new
ArrayList
<>();
long
byteStart
=
0
;
for
(
int
i
=
0
;
i
<
LIVE_SEGMENT_COUNT
;
i
++)
{
segmentTimeline
.
add
(
new
SegmentTimelineElement
(
startTime
,
LIVE_SEGMENT_DURATION_MS
));
...
...
@@ -423,7 +423,7 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
private
static
MediaPresentationDescription
generateLiveMpdWithTemplate
(
boolean
limitTimeshiftBuffer
)
{
List
<
Representation
>
representations
=
new
ArrayList
<
Representation
>();
List
<
Representation
>
representations
=
new
ArrayList
<>();
UrlTemplate
initializationTemplate
=
null
;
UrlTemplate
mediaTemplate
=
UrlTemplate
.
compile
(
"$RepresentationID$/$Number$"
);
...
...
@@ -464,7 +464,7 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
long
seekPositionMs
,
long
seekRangeStartMs
,
long
seekRangeEndMs
,
long
chunkStartTimeMs
,
long
chunkEndTimeMs
)
{
DashChunkSource
chunkSource
=
setupLiveEdgeTimelineTest
(
startTimeMs
,
liveEdgeLatencyMs
);
List
<
MediaChunk
>
queue
=
new
ArrayList
<
MediaChunk
>();
List
<
MediaChunk
>
queue
=
new
ArrayList
<>();
ChunkOperationHolder
out
=
new
ChunkOperationHolder
();
chunkSource
.
getChunkOperation
(
queue
,
seekPositionMs
*
1000
,
0
,
out
);
TimeRange
seekRange
=
chunkSource
.
getSeekRange
();
...
...
@@ -482,7 +482,7 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
long
chunkEndTimeMs
,
boolean
limitTimeshiftBuffer
)
{
DashChunkSource
chunkSource
=
setupLiveEdgeTemplateTest
(
startTimeMs
,
liveEdgeLatencyMs
,
limitTimeshiftBuffer
);
List
<
MediaChunk
>
queue
=
new
ArrayList
<
MediaChunk
>();
List
<
MediaChunk
>
queue
=
new
ArrayList
<>();
ChunkOperationHolder
out
=
new
ChunkOperationHolder
();
chunkSource
.
getChunkOperation
(
queue
,
seekPositionMs
*
1000
,
0
,
out
);
TimeRange
seekRange
=
chunkSource
.
getSeekRange
();
...
...
library/src/test/java/com/google/android/exoplayer/extractor/mp4/Mp4ExtractorTest.java
浏览文件 @
67d01549
...
...
@@ -267,7 +267,7 @@ public class Mp4ExtractorTest extends TestCase {
private
static
byte
[]
getStsc
()
{
int
samplesPerChunk
=
-
1
;
List
<
Integer
>
samplesInChunkChangeIndices
=
new
ArrayList
<
Integer
>();
List
<
Integer
>
samplesInChunkChangeIndices
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
SAMPLES_IN_CHUNK
.
length
;
i
++)
{
if
(
SAMPLES_IN_CHUNK
[
i
]
!=
samplesPerChunk
)
{
samplesInChunkChangeIndices
.
add
(
i
);
...
...
library/src/test/java/com/google/android/exoplayer/extractor/webm/DefaultEbmlReaderTest.java
浏览文件 @
67d01549
...
...
@@ -173,7 +173,7 @@ public class DefaultEbmlReaderTest extends TestCase {
private
static
final
int
ID_DURATION
=
0x4489
;
private
static
final
int
ID_SIMPLE_BLOCK
=
0xA3
;
private
final
List
<
String
>
events
=
new
ArrayList
<
String
>();
private
final
List
<
String
>
events
=
new
ArrayList
<>();
@Override
public
int
getElementType
(
int
id
)
{
...
...
library/src/test/java/com/google/android/exoplayer/testutil/FakeDataSource.java
浏览文件 @
67d01549
...
...
@@ -169,7 +169,7 @@ public final class FakeDataSource implements DataSource {
private
boolean
simulateUnknownLength
;
public
Builder
()
{
segments
=
new
ArrayList
<
Segment
>();
segments
=
new
ArrayList
<>();
}
/**
...
...
library/src/test/java/com/google/android/exoplayer/text/webvtt/WebvttSubtitleTest.java
浏览文件 @
67d01549
...
...
@@ -34,7 +34,7 @@ public class WebvttSubtitleTest extends TestCase {
private
WebvttSubtitle
emptySubtitle
=
new
WebvttSubtitle
(
new
ArrayList
<
WebvttCue
>(),
0
);
private
ArrayList
<
WebvttCue
>
simpleSubtitleCues
=
new
ArrayList
<
WebvttCue
>();
private
ArrayList
<
WebvttCue
>
simpleSubtitleCues
=
new
ArrayList
<>();
{
WebvttCue
firstCue
=
new
WebvttCue
(
1000000
,
2000000
,
FIRST_SUBTITLE_STRING
);
simpleSubtitleCues
.
add
(
firstCue
);
...
...
@@ -44,7 +44,7 @@ public class WebvttSubtitleTest extends TestCase {
}
private
WebvttSubtitle
simpleSubtitle
=
new
WebvttSubtitle
(
simpleSubtitleCues
,
0
);
private
ArrayList
<
WebvttCue
>
overlappingSubtitleCues
=
new
ArrayList
<
WebvttCue
>();
private
ArrayList
<
WebvttCue
>
overlappingSubtitleCues
=
new
ArrayList
<>();
{
WebvttCue
firstCue
=
new
WebvttCue
(
1000000
,
3000000
,
FIRST_SUBTITLE_STRING
);
overlappingSubtitleCues
.
add
(
firstCue
);
...
...
@@ -54,7 +54,8 @@ public class WebvttSubtitleTest extends TestCase {
}
private
WebvttSubtitle
overlappingSubtitle
=
new
WebvttSubtitle
(
overlappingSubtitleCues
,
0
);
private
ArrayList
<
WebvttCue
>
nestedSubtitleCues
=
new
ArrayList
<
WebvttCue
>();
@SuppressWarnings
(
"unused"
)
private
ArrayList
<
WebvttCue
>
nestedSubtitleCues
=
new
ArrayList
<>();
{
WebvttCue
firstCue
=
new
WebvttCue
(
1000000
,
4000000
,
FIRST_SUBTITLE_STRING
);
nestedSubtitleCues
.
add
(
firstCue
);
...
...
library/src/test/java/com/google/android/exoplayer/util/UtilTest.java
浏览文件 @
67d01549
...
...
@@ -53,7 +53,7 @@ public class UtilTest extends TestCase {
}
public
void
testListBinarySearchFloor
()
{
List
<
Integer
>
values
=
new
ArrayList
<
Integer
>();
List
<
Integer
>
values
=
new
ArrayList
<>();
assertEquals
(-
1
,
Util
.
binarySearchFloor
(
values
,
0
,
false
,
false
));
assertEquals
(
0
,
Util
.
binarySearchFloor
(
values
,
0
,
false
,
true
));
...
...
@@ -107,7 +107,7 @@ public class UtilTest extends TestCase {
}
public
void
testListBinarySearchCeil
()
{
List
<
Integer
>
values
=
new
ArrayList
<
Integer
>();
List
<
Integer
>
values
=
new
ArrayList
<>();
assertEquals
(
0
,
Util
.
binarySearchCeil
(
values
,
0
,
false
,
false
));
assertEquals
(-
1
,
Util
.
binarySearchCeil
(
values
,
0
,
false
,
true
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录