diff --git a/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java b/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java index 85ed1d3df4..e033ec31fc 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java @@ -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_OGG = BASE_TYPE_VIDEO + "/ogg"; 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_UNKNOWN = BASE_TYPE_VIDEO + "/x-unknown"; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java index 94d5ef6d43..479da0b7dc 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AudioFormat.java @@ -1,9 +1,27 @@ +/* + * 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; import android.util.SparseArray; import com.google.android.exoplayer2.util.MimeTypes; import java.nio.ByteBuffer; +/** + * Wrapper for the WAVEFORMATEX structure + */ public class AudioFormat { public static final short WAVE_FORMAT_PCM = 1; static final short WAVE_FORMAT_AAC = 0xff; @@ -19,9 +37,8 @@ public class AudioFormat { FORMAT_MAP.put(WAVE_FORMAT_DTS2, MimeTypes.AUDIO_DTS); } - private ByteBuffer byteBuffer; + private final ByteBuffer byteBuffer; - //WAVEFORMATEX public AudioFormat(ByteBuffer byteBuffer) { this.byteBuffer = byteBuffer; } @@ -43,9 +60,6 @@ public class AudioFormat { return byteBuffer.getInt(8); } // 12 - nBlockAlign -// public int getBlockAlign() { -// return byteBuffer.getShort(12); -// } public short getBitsPerSample() { return byteBuffer.getShort(14); } @@ -62,6 +76,4 @@ public class AudioFormat { temp.get(data); return data; } - - //TODO: Deal with WAVEFORMATEXTENSIBLE } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java index 9b26c2d1da..b3ecf270d2 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeeker.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.VisibleForTesting; @@ -10,11 +25,11 @@ import java.io.IOException; /** * 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 { private static final int NAL_TYPE_MASK = 0x1f; - private static final int NAL_TYPE_IRD = 5; + private static final int NAL_TYPE_IDR = 5; //I Frame private static final int NAL_TYPE_SEI = 6; private static final int NAL_TYPE_SPS = 7; private static final int NAL_TYPE_PPS = 8; @@ -108,7 +123,7 @@ public class AvcChunkPeeker extends NalChunkPeeker { case 4: updatePicCountClock(nalTypeOffset); return; - case NAL_TYPE_IRD: + case NAL_TYPE_IDR: picCountClock.syncIndexes(); return; case NAL_TYPE_AUD: diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java index dee13c84ed..dd06a90c26 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviExtractor.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -20,11 +35,11 @@ import java.util.Collections; import java.util.HashMap; /** - * Based on the official MicroSoft spec + * Extractor based on the official MicroSoft spec * https://docs.microsoft.com/en-us/windows/win32/directshow/avi-riff-file-reference */ public class AviExtractor implements Extractor { - //Minimum time between keyframes in the SeekMap + //Minimum time between keyframes in the AviSeekMap static final long MIN_KEY_FRAME_RATE_US = 2_000_000L; static final long UINT_MASK = 0xffffffffL; @@ -130,9 +145,7 @@ public class AviExtractor implements Extractor { @VisibleForTesting AviSeekMap aviSeekMap; -// private long indexOffset; //Usually chunkStart - - //If partial read + //Set if a chunk is only partially read private transient AviTrack chunkHandler; /** @@ -379,13 +392,7 @@ public class AviExtractor implements Extractor { w("Audio is not all key frames chunks=" + aviTrack.chunks + " keyFrames=" + 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 { } final int flags = indexByteBuffer.getInt(); final int offset = indexByteBuffer.getInt(); - //Skip size - //indexByteBuffer.position(indexByteBuffer.position() + 4); final int size = indexByteBuffer.getInt(); if ((flags & AVIIF_KEYFRAME) == AVIIF_KEYFRAME) { if (aviTrack.isVideo()) { diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java index d2a21dd727..0a40b85218 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBox.java @@ -1,16 +1,32 @@ +/* + * 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; import androidx.annotation.VisibleForTesting; import java.nio.ByteBuffer; +/** + * Wrapper around the AVIMAINHEADER structure + */ public class AviHeaderBox extends ResidentBox { static final int LEN = 0x38; static final int AVIF_HASINDEX = 0x10; private static final int AVIF_MUSTUSEINDEX = 0x20; static final int AVIH = 'a' | ('v' << 8) | ('i' << 16) | ('h' << 24); - //AVIMAINHEADER - AviHeaderBox(int type, int size, ByteBuffer byteBuffer) { super(type, size, byteBuffer); } @@ -39,9 +55,6 @@ public class AviHeaderBox extends ResidentBox { } // 20 - dwInitialFrames -// int getInitialFrames() { -// return byteBuffer.getInt(20); -// } int getStreams() { return byteBuffer.getInt(24); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java index 717fd7f167..fe662ca615 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviSeekMap.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -6,6 +21,10 @@ import com.google.android.exoplayer2.extractor.SeekMap; import com.google.android.exoplayer2.extractor.SeekPoint; import java.util.Arrays; +/** + * Seek map for AVI. + * Consists of Video chunk offsets and indexes for all streams + */ public class AviSeekMap implements SeekMap { final int videoId; final long videoUsPerChunk; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java index 8d4131013d..ac1cd66501 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/AviTrack.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -5,12 +20,12 @@ import androidx.annotation.Nullable; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.TrackOutput; -import com.google.android.exoplayer2.util.Log; import java.io.IOException; 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 static final int[] ALL_KEY_FRAMES = new int[0]; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java index 2f6ea39092..e90bcd67e4 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Box.java @@ -1,7 +1,23 @@ +/* + * 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; /** - * 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 { private final int size; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java index 8921cde14d..075e60d0f0 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/BoxFactory.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.extractor.ExtractorInput; @@ -5,6 +20,9 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; +/** + * Factory for Boxes. These usually exist inside a ListBox + */ public class BoxFactory { static int[] types = {AviHeaderBox.AVIH, StreamHeaderBox.STRH, StreamFormatBox.STRF, StreamNameBox.STRN}; static { diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java index 84eb49e459..0cfd2a97e6 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ChunkPeeker.java @@ -1,8 +1,26 @@ +/* + * 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; import com.google.android.exoplayer2.extractor.ExtractorInput; import java.io.IOException; +/** + * Peeks for import data in the chunk stream. + */ public interface ChunkPeeker { void peek(ExtractorInput input, final int size) throws IOException; } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java index 03fcdbd795..63059bc919 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/LinearClock.java @@ -1,5 +1,23 @@ +/* + * 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; +/** + * A clock that is linearly derived from the current chunk index of a given stream + */ public class LinearClock { long durationUs; int length; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java index 952736ab39..daf5b4fc7a 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ListBox.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -9,7 +24,7 @@ import java.util.ArrayList; import java.util.List; /** - * An AVI LIST box, memory resident + * An AVI LIST box. Similar to a Java List */ public class ListBox extends Box { public static final int LIST = 'L' | ('I' << 8) | ('S' << 16) | ('T' << 24); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java index 48e270b265..518172cc77 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeeker.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -8,6 +23,9 @@ import com.google.android.exoplayer2.extractor.TrackOutput; import com.google.android.exoplayer2.util.ParsableNalUnitBitArray; import java.io.IOException; +/** + * Peeks an MP4V stream looking for pixelWidthHeightRatio data + */ public class Mp4vChunkPeeker extends NalChunkPeeker { @VisibleForTesting static final byte SEQUENCE_START_CODE = (byte)0xb0; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java index ca8c3d7b78..e5be793ae4 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeeker.java @@ -1,9 +1,28 @@ +/* + * 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; import com.google.android.exoplayer2.extractor.ExtractorInput; import java.io.IOException; 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 { private static final int SEEK_PEEK_SIZE = 256; private final int peekSize; @@ -105,9 +124,4 @@ public abstract class NalChunkPeeker implements ChunkPeeker { processChunk(input, nalTypeOffset); input.resetPeekPosition(); } - -// @VisibleForTesting(otherwise = VisibleForTesting.NONE) -// void setBuffer(byte[] buffer) { -// this.buffer = buffer; -// } } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java index 55743a83db..ccec181b4c 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/PicCountClock.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.VisibleForTesting; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java index 5234869389..e450d14848 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/ResidentBox.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.NonNull; @@ -15,8 +30,6 @@ import java.nio.ByteOrder; * A box that is resident in memory */ public class ResidentBox extends Box { - private static final String TAG = AviExtractor.TAG; - final private static int MAX_RESIDENT = 1024; final ByteBuffer byteBuffer; ResidentBox(int type, int size, ByteBuffer byteBuffer) { diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java index 8b727d4c1a..9cbabdfeba 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamFormatBox.java @@ -1,8 +1,26 @@ +/* + * 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; import androidx.annotation.NonNull; import java.nio.ByteBuffer; +/** + * Wrapper around the various StreamFormats + */ public class StreamFormatBox extends ResidentBox { public static final int STRF = 's' | ('t' << 8) | ('r' << 16) | ('f' << 24); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java index ff37d7d7c3..5486d43d7f 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBox.java @@ -1,9 +1,24 @@ +/* + * 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; import java.nio.ByteBuffer; /** - * AVISTREAMHEADER + * Wrapper around the AVISTREAMHEADER structure */ public class StreamHeaderBox extends ResidentBox { public static final int STRH = 's' | ('t' << 8) | ('r' << 16) | ('h' << 24); @@ -51,9 +66,6 @@ public class StreamHeaderBox extends ResidentBox { return byteBuffer.getInt(24); } //28 - dwStart - doesn't seem to ever be set -// public int getStart() { -// return byteBuffer.getInt(28); -// } public int getLength() { return byteBuffer.getInt(32); } @@ -63,11 +75,8 @@ public class StreamHeaderBox extends ResidentBox { } //40 - dwQuality //44 - dwSampleSize -// public int getSampleSize() { -// return byteBuffer.getInt(44); -// } -// public String toString() { -// return "scale=" + getScale() + " rate=" + getRate() + " length=" + getLength() + " us=" + getDurationUs(); -// } + public String toString() { + return "scale=" + getScale() + " rate=" + getRate() + " length=" + getLength() + " us=" + getDurationUs(); + } } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java index e8f31766c9..357bc9ecfe 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/StreamNameBox.java @@ -1,7 +1,25 @@ +/* + * 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; import java.nio.ByteBuffer; +/** + * Human readable stream name + */ public class StreamNameBox extends ResidentBox { public static final int STRN = 's' | ('t' << 8) | ('r' << 16) | ('n' << 24); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java index 61455d19b6..3db43cf730 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArray.java @@ -1,15 +1,34 @@ +/* + * 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; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import java.util.Arrays; +/** + * Optimized unbounded array of ints. + * Used primarily to create Index (SeekMap) data. + */ public class UnboundedIntArray { @NonNull @VisibleForTesting int[] array; - //unint - private int size =0; + //uint + private int size = 0; public UnboundedIntArray() { this(8); @@ -58,8 +77,6 @@ public class UnboundedIntArray { /** * Only works if values are in sequential order - * @param v - * @return */ public int indexOf(int v) { return Arrays.binarySearch(array, v); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java index 99acc62f57..0021647a98 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/avi/VideoFormat.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.annotation.VisibleForTesting; @@ -5,6 +20,9 @@ import com.google.android.exoplayer2.util.MimeTypes; import java.nio.ByteBuffer; import java.util.HashMap; +/** + * Wrapper around the BITMAPINFOHEADER structure + */ public class VideoFormat { static final int XVID = 'X' | ('V' << 8) | ('I' << 16) | ('D' << 24); @@ -39,7 +57,7 @@ public class VideoFormat { this.byteBuffer = byteBuffer; } - //biSize - (uint) + // 0 - biSize - (uint) public int getWidth() { return byteBuffer.getInt(4); @@ -71,5 +89,4 @@ public class VideoFormat { public void setCompression(final int compression) { byteBuffer.putInt(16, compression); } - } diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java index d01e5e3fd4..cfb084b9b5 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AudioFormatTest.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.test.ext.junit.runners.AndroidJUnit4; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java index 0e28dbc375..da9ddec141 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AvcChunkPeekerTest.java @@ -1,3 +1,18 @@ +/* + * 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; import android.content.Context; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java index 39126dfcaf..acfd3ae6b1 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorRoboTest.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.test.ext.junit.runners.AndroidJUnit4; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java index a6ff1487b3..c6a4d7842d 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviExtractorTest.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.Format; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java index e7b3a93e7b..e18e71ac1f 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviHeaderBoxTest.java @@ -1,6 +1,20 @@ +/* + * 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; -import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java index 4dfbc6e01c..8328d9a3f5 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviSeekMapTest.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.extractor.SeekMap; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java index 5b9afcfac9..6c848893fb 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/AviTrackTest.java @@ -1,3 +1,18 @@ +/* + * 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; import org.junit.Assert; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java index 66b24ada1b..78027534ad 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/BitBuffer.java @@ -1,3 +1,18 @@ +/* + * 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; import java.nio.BufferOverflowException; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java index 1e944b085f..5e74367243 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/DataHelper.java @@ -1,3 +1,18 @@ +/* + * 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; import android.content.Context; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java index ef88ac2dfa..c50fc76e7f 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/LinearClockTest.java @@ -1,3 +1,18 @@ +/* + * 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; import org.junit.Assert; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java index 3be00dd152..86283e31b8 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/ListBuilder.java @@ -1,3 +1,18 @@ +/* + * 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; import java.nio.ByteBuffer; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java index 0be4368b5c..1c5e303712 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/MockNalChunkPeeker.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.extractor.ExtractorInput; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java index 9a3205b90f..5f8f8936eb 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/Mp4vChunkPeekerTest.java @@ -1,3 +1,18 @@ +/* + * 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; import android.content.Context; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java index 2708015f4f..fe1d62f297 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/NalChunkPeekerTest.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.testutil.FakeExtractorInput; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java index 2139f13c1a..f9fc5109cd 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/PicCountClockTest.java @@ -1,3 +1,18 @@ +/* + * 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; import org.junit.Assert; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java index e36ac29cb3..115e1ab792 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamHeaderBoxTest.java @@ -1,3 +1,18 @@ +/* + * 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; import androidx.test.ext.junit.runners.AndroidJUnit4; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java index c721df59b6..70f4780ae5 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/StreamNameBoxTest.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.testutil.FakeExtractorInput; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java index 20a2df51a6..7f4251e31f 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/UnboundedIntArrayTest.java @@ -1,3 +1,18 @@ +/* + * 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; import org.junit.Assert; diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java index 53b9b4c6ad..521fa36278 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/avi/VideoFormatTest.java @@ -1,3 +1,18 @@ +/* + * 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; import com.google.android.exoplayer2.util.MimeTypes;