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
e9fcc967
authored
Feb 01, 2022
by
Dustin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added copyright, better comments, removed dead code.
parent
0896a04d
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
643 additions
and
57 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java
library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
View file @
e9fcc967
...
@@ -55,7 +55,6 @@ public final class MimeTypes {
...
@@ -55,7 +55,6 @@ public final class MimeTypes {
public
static
final
String
VIDEO_DOLBY_VISION
=
BASE_TYPE_VIDEO
+
"/dolby-vision"
;
public
static
final
String
VIDEO_DOLBY_VISION
=
BASE_TYPE_VIDEO
+
"/dolby-vision"
;
public
static
final
String
VIDEO_OGG
=
BASE_TYPE_VIDEO
+
"/ogg"
;
public
static
final
String
VIDEO_OGG
=
BASE_TYPE_VIDEO
+
"/ogg"
;
public
static
final
String
VIDEO_AVI
=
BASE_TYPE_VIDEO
+
"/x-msvideo"
;
public
static
final
String
VIDEO_AVI
=
BASE_TYPE_VIDEO
+
"/x-msvideo"
;
//This exists on Nvidia Shield
public
static
final
String
VIDEO_MJPEG
=
BASE_TYPE_VIDEO
+
"/mjpeg"
;
public
static
final
String
VIDEO_MJPEG
=
BASE_TYPE_VIDEO
+
"/mjpeg"
;
public
static
final
String
VIDEO_UNKNOWN
=
BASE_TYPE_VIDEO
+
"/x-unknown"
;
public
static
final
String
VIDEO_UNKNOWN
=
BASE_TYPE_VIDEO
+
"/x-unknown"
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
/**
* Wrapper for the WAVEFORMATEX structure
*/
public
class
AudioFormat
{
public
class
AudioFormat
{
public
static
final
short
WAVE_FORMAT_PCM
=
1
;
public
static
final
short
WAVE_FORMAT_PCM
=
1
;
static
final
short
WAVE_FORMAT_AAC
=
0xff
;
static
final
short
WAVE_FORMAT_AAC
=
0xff
;
...
@@ -19,9 +37,8 @@ public class AudioFormat {
...
@@ -19,9 +37,8 @@ public class AudioFormat {
FORMAT_MAP
.
put
(
WAVE_FORMAT_DTS2
,
MimeTypes
.
AUDIO_DTS
);
FORMAT_MAP
.
put
(
WAVE_FORMAT_DTS2
,
MimeTypes
.
AUDIO_DTS
);
}
}
private
ByteBuffer
byteBuffer
;
private
final
ByteBuffer
byteBuffer
;
//WAVEFORMATEX
public
AudioFormat
(
ByteBuffer
byteBuffer
)
{
public
AudioFormat
(
ByteBuffer
byteBuffer
)
{
this
.
byteBuffer
=
byteBuffer
;
this
.
byteBuffer
=
byteBuffer
;
}
}
...
@@ -43,9 +60,6 @@ public class AudioFormat {
...
@@ -43,9 +60,6 @@ public class AudioFormat {
return
byteBuffer
.
getInt
(
8
);
return
byteBuffer
.
getInt
(
8
);
}
}
// 12 - nBlockAlign
// 12 - nBlockAlign
// public int getBlockAlign() {
// return byteBuffer.getShort(12);
// }
public
short
getBitsPerSample
()
{
public
short
getBitsPerSample
()
{
return
byteBuffer
.
getShort
(
14
);
return
byteBuffer
.
getShort
(
14
);
}
}
...
@@ -62,6 +76,4 @@ public class AudioFormat {
...
@@ -62,6 +76,4 @@ public class AudioFormat {
temp
.
get
(
data
);
temp
.
get
(
data
);
return
data
;
return
data
;
}
}
//TODO: Deal with WAVEFORMATEXTENSIBLE
}
}
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.VisibleForTesting
;
import
androidx.annotation.VisibleForTesting
;
...
@@ -10,11 +25,11 @@ import java.io.IOException;
...
@@ -10,11 +25,11 @@ import java.io.IOException;
/**
/**
* Corrects the time and PAR for H264 streams
* Corrects the time and PAR for H264 streams
*
H264 is very rare in AVI due to the rise of mp4
*
AVC is very rare in AVI due to the rise of the mp4 container
*/
*/
public
class
AvcChunkPeeker
extends
NalChunkPeeker
{
public
class
AvcChunkPeeker
extends
NalChunkPeeker
{
private
static
final
int
NAL_TYPE_MASK
=
0x1f
;
private
static
final
int
NAL_TYPE_MASK
=
0x1f
;
private
static
final
int
NAL_TYPE_I
RD
=
5
;
private
static
final
int
NAL_TYPE_I
DR
=
5
;
//I Frame
private
static
final
int
NAL_TYPE_SEI
=
6
;
private
static
final
int
NAL_TYPE_SEI
=
6
;
private
static
final
int
NAL_TYPE_SPS
=
7
;
private
static
final
int
NAL_TYPE_SPS
=
7
;
private
static
final
int
NAL_TYPE_PPS
=
8
;
private
static
final
int
NAL_TYPE_PPS
=
8
;
...
@@ -108,7 +123,7 @@ public class AvcChunkPeeker extends NalChunkPeeker {
...
@@ -108,7 +123,7 @@ public class AvcChunkPeeker extends NalChunkPeeker {
case
4
:
case
4
:
updatePicCountClock
(
nalTypeOffset
);
updatePicCountClock
(
nalTypeOffset
);
return
;
return
;
case
NAL_TYPE_I
RD
:
case
NAL_TYPE_I
DR
:
picCountClock
.
syncIndexes
();
picCountClock
.
syncIndexes
();
return
;
return
;
case
NAL_TYPE_AUD:
case
NAL_TYPE_AUD:
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -20,11 +35,11 @@ import java.util.Collections;
...
@@ -20,11 +35,11 @@ import java.util.Collections;
import
java.util.HashMap
;
import
java.util.HashMap
;
/**
/**
*
B
ased on the official MicroSoft spec
*
Extractor b
ased on the official MicroSoft spec
* https://docs.microsoft.com/en-us/windows/win32/directshow/avi-riff-file-reference
* https://docs.microsoft.com/en-us/windows/win32/directshow/avi-riff-file-reference
*/
*/
public
class
AviExtractor
implements
Extractor
{
public
class
AviExtractor
implements
Extractor
{
//Minimum time between keyframes in the SeekMap
//Minimum time between keyframes in the
Avi
SeekMap
static
final
long
MIN_KEY_FRAME_RATE_US
=
2_000_000L
;
static
final
long
MIN_KEY_FRAME_RATE_US
=
2_000_000L
;
static
final
long
UINT_MASK
=
0xffffffff
L
;
static
final
long
UINT_MASK
=
0xffffffff
L
;
...
@@ -130,9 +145,7 @@ public class AviExtractor implements Extractor {
...
@@ -130,9 +145,7 @@ public class AviExtractor implements Extractor {
@VisibleForTesting
@VisibleForTesting
AviSeekMap
aviSeekMap
;
AviSeekMap
aviSeekMap
;
// private long indexOffset; //Usually chunkStart
//Set if a chunk is only partially read
//If partial read
private
transient
AviTrack
chunkHandler
;
private
transient
AviTrack
chunkHandler
;
/**
/**
...
@@ -379,13 +392,7 @@ public class AviExtractor implements Extractor {
...
@@ -379,13 +392,7 @@ public class AviExtractor implements Extractor {
w
(
"Audio is not all key frames chunks="
+
aviTrack
.
chunks
+
" keyFrames="
+
w
(
"Audio is not all key frames chunks="
+
aviTrack
.
chunks
+
" keyFrames="
+
keyFrameCounts
[
aviTrack
.
id
]);
keyFrameCounts
[
aviTrack
.
id
]);
}
}
}
/* else if (aviTrack.isVideo()) {
final LinearClock clock = aviTrack.getClock();
if (clock.length != aviTrack.chunks) {
w("Video #" + aviTrack.id + " chunks != length changing FPS");
clock.setLength(aviTrack.chunks);
}
}
}*/
}
}
}
}
}
}
...
@@ -447,8 +454,6 @@ public class AviExtractor implements Extractor {
...
@@ -447,8 +454,6 @@ public class AviExtractor implements Extractor {
}
}
final
int
flags
=
indexByteBuffer
.
getInt
();
final
int
flags
=
indexByteBuffer
.
getInt
();
final
int
offset
=
indexByteBuffer
.
getInt
();
final
int
offset
=
indexByteBuffer
.
getInt
();
//Skip size
//indexByteBuffer.position(indexByteBuffer.position() + 4);
final
int
size
=
indexByteBuffer
.
getInt
();
final
int
size
=
indexByteBuffer
.
getInt
();
if
((
flags
&
AVIIF_KEYFRAME
)
==
AVIIF_KEYFRAME
)
{
if
((
flags
&
AVIIF_KEYFRAME
)
==
AVIIF_KEYFRAME
)
{
if
(
aviTrack
.
isVideo
())
{
if
(
aviTrack
.
isVideo
())
{
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.VisibleForTesting
;
import
androidx.annotation.VisibleForTesting
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
/**
* Wrapper around the AVIMAINHEADER structure
*/
public
class
AviHeaderBox
extends
ResidentBox
{
public
class
AviHeaderBox
extends
ResidentBox
{
static
final
int
LEN
=
0x38
;
static
final
int
LEN
=
0x38
;
static
final
int
AVIF_HASINDEX
=
0x10
;
static
final
int
AVIF_HASINDEX
=
0x10
;
private
static
final
int
AVIF_MUSTUSEINDEX
=
0x20
;
private
static
final
int
AVIF_MUSTUSEINDEX
=
0x20
;
static
final
int
AVIH
=
'a'
|
(
'v'
<<
8
)
|
(
'i'
<<
16
)
|
(
'h'
<<
24
);
static
final
int
AVIH
=
'a'
|
(
'v'
<<
8
)
|
(
'i'
<<
16
)
|
(
'h'
<<
24
);
//AVIMAINHEADER
AviHeaderBox
(
int
type
,
int
size
,
ByteBuffer
byteBuffer
)
{
AviHeaderBox
(
int
type
,
int
size
,
ByteBuffer
byteBuffer
)
{
super
(
type
,
size
,
byteBuffer
);
super
(
type
,
size
,
byteBuffer
);
}
}
...
@@ -39,9 +55,6 @@ public class AviHeaderBox extends ResidentBox {
...
@@ -39,9 +55,6 @@ public class AviHeaderBox extends ResidentBox {
}
}
// 20 - dwInitialFrames
// 20 - dwInitialFrames
// int getInitialFrames() {
// return byteBuffer.getInt(20);
// }
int
getStreams
()
{
int
getStreams
()
{
return
byteBuffer
.
getInt
(
24
);
return
byteBuffer
.
getInt
(
24
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -6,6 +21,10 @@ import com.google.android.exoplayer2.extractor.SeekMap;
...
@@ -6,6 +21,10 @@ import com.google.android.exoplayer2.extractor.SeekMap;
import
com.google.android.exoplayer2.extractor.SeekPoint
;
import
com.google.android.exoplayer2.extractor.SeekPoint
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
* Seek map for AVI.
* Consists of Video chunk offsets and indexes for all streams
*/
public
class
AviSeekMap
implements
SeekMap
{
public
class
AviSeekMap
implements
SeekMap
{
final
int
videoId
;
final
int
videoId
;
final
long
videoUsPerChunk
;
final
long
videoUsPerChunk
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -5,12 +20,12 @@ import androidx.annotation.Nullable;
...
@@ -5,12 +20,12 @@ import androidx.annotation.Nullable;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
com.google.android.exoplayer2.util.Log
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
/**
* Collection of info about a track
* Collection of info about a track.
* This acts a bridge between AVI and ExoPlayer structures
*/
*/
public
class
AviTrack
{
public
class
AviTrack
{
public
static
final
int
[]
ALL_KEY_FRAMES
=
new
int
[
0
];
public
static
final
int
[]
ALL_KEY_FRAMES
=
new
int
[
0
];
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
/**
/**
* This is referred to as a Chunk in the MS spec, but that gets confusing with AV chunks
* This is referred to as a Chunk in the MS spec, but that gets confusing with AV chunks.
* Borrowed the term from mp4 as these are similar to boxes or atoms.
*/
*/
public
class
Box
{
public
class
Box
{
private
final
int
size
;
private
final
int
size
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
...
@@ -5,6 +20,9 @@ import java.io.IOException;
...
@@ -5,6 +20,9 @@ import java.io.IOException;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
* Factory for Boxes. These usually exist inside a ListBox
*/
public
class
BoxFactory
{
public
class
BoxFactory
{
static
int
[]
types
=
{
AviHeaderBox
.
AVIH
,
StreamHeaderBox
.
STRH
,
StreamFormatBox
.
STRF
,
StreamNameBox
.
STRN
};
static
int
[]
types
=
{
AviHeaderBox
.
AVIH
,
StreamHeaderBox
.
STRH
,
StreamFormatBox
.
STRF
,
StreamNameBox
.
STRN
};
static
{
static
{
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
java.io.IOException
;
import
java.io.IOException
;
/**
* Peeks for import data in the chunk stream.
*/
public
interface
ChunkPeeker
{
public
interface
ChunkPeeker
{
void
peek
(
ExtractorInput
input
,
final
int
size
)
throws
IOException
;
void
peek
(
ExtractorInput
input
,
final
int
size
)
throws
IOException
;
}
}
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
/**
* A clock that is linearly derived from the current chunk index of a given stream
*/
public
class
LinearClock
{
public
class
LinearClock
{
long
durationUs
;
long
durationUs
;
int
length
;
int
length
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -9,7 +24,7 @@ import java.util.ArrayList;
...
@@ -9,7 +24,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
/**
/**
* An AVI LIST box
, memory resident
* An AVI LIST box
. Similar to a Java List<Box>
*/
*/
public
class
ListBox
extends
Box
{
public
class
ListBox
extends
Box
{
public
static
final
int
LIST
=
'L'
|
(
'I'
<<
8
)
|
(
'S'
<<
16
)
|
(
'T'
<<
24
);
public
static
final
int
LIST
=
'L'
|
(
'I'
<<
8
)
|
(
'S'
<<
16
)
|
(
'T'
<<
24
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -8,6 +23,9 @@ import com.google.android.exoplayer2.extractor.TrackOutput;
...
@@ -8,6 +23,9 @@ import com.google.android.exoplayer2.extractor.TrackOutput;
import
com.google.android.exoplayer2.util.ParsableNalUnitBitArray
;
import
com.google.android.exoplayer2.util.ParsableNalUnitBitArray
;
import
java.io.IOException
;
import
java.io.IOException
;
/**
* Peeks an MP4V stream looking for pixelWidthHeightRatio data
*/
public
class
Mp4vChunkPeeker
extends
NalChunkPeeker
{
public
class
Mp4vChunkPeeker
extends
NalChunkPeeker
{
@VisibleForTesting
@VisibleForTesting
static
final
byte
SEQUENCE_START_CODE
=
(
byte
)
0xb0
;
static
final
byte
SEQUENCE_START_CODE
=
(
byte
)
0xb0
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
* Generic base class for NAL (0x00 0x00 0x01) chunk headers
* Theses are used by AVC and MP4V (XVID)
*/
public
abstract
class
NalChunkPeeker
implements
ChunkPeeker
{
public
abstract
class
NalChunkPeeker
implements
ChunkPeeker
{
private
static
final
int
SEEK_PEEK_SIZE
=
256
;
private
static
final
int
SEEK_PEEK_SIZE
=
256
;
private
final
int
peekSize
;
private
final
int
peekSize
;
...
@@ -105,9 +124,4 @@ public abstract class NalChunkPeeker implements ChunkPeeker {
...
@@ -105,9 +124,4 @@ public abstract class NalChunkPeeker implements ChunkPeeker {
processChunk
(
input
,
nalTypeOffset
);
processChunk
(
input
,
nalTypeOffset
);
input
.
resetPeekPosition
();
input
.
resetPeekPosition
();
}
}
// @VisibleForTesting(otherwise = VisibleForTesting.NONE)
// void setBuffer(byte[] buffer) {
// this.buffer = buffer;
// }
}
}
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.VisibleForTesting
;
import
androidx.annotation.VisibleForTesting
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -15,8 +30,6 @@ import java.nio.ByteOrder;
...
@@ -15,8 +30,6 @@ import java.nio.ByteOrder;
* A box that is resident in memory
* A box that is resident in memory
*/
*/
public
class
ResidentBox
extends
Box
{
public
class
ResidentBox
extends
Box
{
private
static
final
String
TAG
=
AviExtractor
.
TAG
;
final
private
static
int
MAX_RESIDENT
=
1024
;
final
ByteBuffer
byteBuffer
;
final
ByteBuffer
byteBuffer
;
ResidentBox
(
int
type
,
int
size
,
ByteBuffer
byteBuffer
)
{
ResidentBox
(
int
type
,
int
size
,
ByteBuffer
byteBuffer
)
{
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
/**
* Wrapper around the various StreamFormats
*/
public
class
StreamFormatBox
extends
ResidentBox
{
public
class
StreamFormatBox
extends
ResidentBox
{
public
static
final
int
STRF
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'f'
<<
24
);
public
static
final
int
STRF
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'f'
<<
24
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
/**
/**
*
AVISTREAMHEADER
*
Wrapper around the AVISTREAMHEADER structure
*/
*/
public
class
StreamHeaderBox
extends
ResidentBox
{
public
class
StreamHeaderBox
extends
ResidentBox
{
public
static
final
int
STRH
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'h'
<<
24
);
public
static
final
int
STRH
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'h'
<<
24
);
...
@@ -51,9 +66,6 @@ public class StreamHeaderBox extends ResidentBox {
...
@@ -51,9 +66,6 @@ public class StreamHeaderBox extends ResidentBox {
return
byteBuffer
.
getInt
(
24
);
return
byteBuffer
.
getInt
(
24
);
}
}
//28 - dwStart - doesn't seem to ever be set
//28 - dwStart - doesn't seem to ever be set
// public int getStart() {
// return byteBuffer.getInt(28);
// }
public
int
getLength
()
{
public
int
getLength
()
{
return
byteBuffer
.
getInt
(
32
);
return
byteBuffer
.
getInt
(
32
);
}
}
...
@@ -63,11 +75,8 @@ public class StreamHeaderBox extends ResidentBox {
...
@@ -63,11 +75,8 @@ public class StreamHeaderBox extends ResidentBox {
}
}
//40 - dwQuality
//40 - dwQuality
//44 - dwSampleSize
//44 - dwSampleSize
// public int getSampleSize() {
// return byteBuffer.getInt(44);
// }
//
public String toString() {
public
String
toString
()
{
//
return "scale=" + getScale() + " rate=" + getRate() + " length=" + getLength() + " us=" + getDurationUs();
return
"scale="
+
getScale
()
+
" rate="
+
getRate
()
+
" length="
+
getLength
()
+
" us="
+
getDurationUs
();
//
}
}
}
}
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
/**
* Human readable stream name
*/
public
class
StreamNameBox
extends
ResidentBox
{
public
class
StreamNameBox
extends
ResidentBox
{
public
static
final
int
STRN
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'n'
<<
24
);
public
static
final
int
STRN
=
's'
|
(
't'
<<
8
)
|
(
'r'
<<
16
)
|
(
'n'
<<
24
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.VisibleForTesting
;
import
androidx.annotation.VisibleForTesting
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
* Optimized unbounded array of ints.
* Used primarily to create Index (SeekMap) data.
*/
public
class
UnboundedIntArray
{
public
class
UnboundedIntArray
{
@NonNull
@NonNull
@VisibleForTesting
@VisibleForTesting
int
[]
array
;
int
[]
array
;
//u
n
int
//uint
private
int
size
=
0
;
private
int
size
=
0
;
public
UnboundedIntArray
()
{
public
UnboundedIntArray
()
{
this
(
8
);
this
(
8
);
...
@@ -58,8 +77,6 @@ public class UnboundedIntArray {
...
@@ -58,8 +77,6 @@ public class UnboundedIntArray {
/**
/**
* Only works if values are in sequential order
* Only works if values are in sequential order
* @param v
* @return
*/
*/
public
int
indexOf
(
int
v
)
{
public
int
indexOf
(
int
v
)
{
return
Arrays
.
binarySearch
(
array
,
v
);
return
Arrays
.
binarySearch
(
array
,
v
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.annotation.VisibleForTesting
;
import
androidx.annotation.VisibleForTesting
;
...
@@ -5,6 +20,9 @@ import com.google.android.exoplayer2.util.MimeTypes;
...
@@ -5,6 +20,9 @@ import com.google.android.exoplayer2.util.MimeTypes;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
import
java.util.HashMap
;
import
java.util.HashMap
;
/**
* Wrapper around the BITMAPINFOHEADER structure
*/
public
class
VideoFormat
{
public
class
VideoFormat
{
static
final
int
XVID
=
'X'
|
(
'V'
<<
8
)
|
(
'I'
<<
16
)
|
(
'D'
<<
24
);
static
final
int
XVID
=
'X'
|
(
'V'
<<
8
)
|
(
'I'
<<
16
)
|
(
'D'
<<
24
);
...
@@ -39,7 +57,7 @@ public class VideoFormat {
...
@@ -39,7 +57,7 @@ public class VideoFormat {
this
.
byteBuffer
=
byteBuffer
;
this
.
byteBuffer
=
byteBuffer
;
}
}
//biSize - (uint)
//
0 -
biSize - (uint)
public
int
getWidth
()
{
public
int
getWidth
()
{
return
byteBuffer
.
getInt
(
4
);
return
byteBuffer
.
getInt
(
4
);
...
@@ -71,5 +89,4 @@ public class VideoFormat {
...
@@ -71,5 +89,4 @@ public class VideoFormat {
public
void
setCompression
(
final
int
compression
)
{
public
void
setCompression
(
final
int
compression
)
{
byteBuffer
.
putInt
(
16
,
compression
);
byteBuffer
.
putInt
(
16
,
compression
);
}
}
}
}
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
android.content.Context
;
import
android.content.Context
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
java.nio.ByteBuffer
;
import
org.junit.Assert
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
java.nio.BufferOverflowException
;
import
java.nio.BufferOverflowException
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
android.content.Context
;
import
android.content.Context
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
android.content.Context
;
import
android.content.Context
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java
View file @
e9fcc967
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
avi
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
...
...
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