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
f7abce6a
authored
Sep 16, 2021
by
bachinger
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move FlacConstant to lib-extractor
PiperOrigin-RevId: 397156268
parent
c21d5c7f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
13 additions
and
15 deletions
extensions/flac/src/main/java/com/google/android/exoplayer2/ext/flac/FlacBinarySearchSeeker.java
extensions/flac/src/main/java/com/google/android/exoplayer2/ext/flac/LibflacAudioRenderer.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/FlacFrameReader.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/FlacMetadataReader.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/flac/FlacBinarySearchSeeker.java
library/common/src/main/java/com/google/android/exoplayer2/util/FlacConstants.java → library/extractor/src/main/java/com/google/android/exoplayer2/extractor/flac/FlacConstants.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/flac/FlacExtractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacFrameReaderTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacMetadataReaderTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacStreamMetadataTest.java
extensions/flac/src/main/java/com/google/android/exoplayer2/ext/flac/FlacBinarySearchSeeker.java
View file @
f7abce6a
...
...
@@ -22,7 +22,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
import
com.google.android.exoplayer2.extractor.FlacStreamMetadata
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
java.io.IOException
;
import
java.nio.ByteBuffer
;
...
...
@@ -50,6 +49,8 @@ import java.nio.ByteBuffer;
}
}
private
static
final
int
MIN_FRAME_HEADER_SIZE
=
6
;
private
final
FlacDecoderJni
decoderJni
;
/**
...
...
@@ -76,8 +77,7 @@ import java.nio.ByteBuffer;
/* floorBytePosition= */
firstFramePosition
,
/* ceilingBytePosition= */
inputLength
,
/* approxBytesPerFrame= */
streamMetadata
.
getApproxBytesPerFrame
(),
/* minimumSearchRange= */
max
(
FlacConstants
.
MIN_FRAME_HEADER_SIZE
,
streamMetadata
.
minFrameSize
));
/* minimumSearchRange= */
max
(
MIN_FRAME_HEADER_SIZE
,
streamMetadata
.
minFrameSize
));
this
.
decoderJni
=
Assertions
.
checkNotNull
(
decoderJni
);
}
...
...
extensions/flac/src/main/java/com/google/android/exoplayer2/ext/flac/LibflacAudioRenderer.java
View file @
f7abce6a
...
...
@@ -25,7 +25,6 @@ import com.google.android.exoplayer2.audio.AudioSink;
import
com.google.android.exoplayer2.audio.DecoderAudioRenderer
;
import
com.google.android.exoplayer2.decoder.CryptoConfig
;
import
com.google.android.exoplayer2.extractor.FlacStreamMetadata
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.TraceUtil
;
import
com.google.android.exoplayer2.util.Util
;
...
...
@@ -35,6 +34,8 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer<FlacDecoder
private
static
final
String
TAG
=
"LibflacAudioRenderer"
;
private
static
final
int
NUM_BUFFERS
=
16
;
private
static
final
int
STREAM_MARKER_SIZE
=
4
;
private
static
final
int
METADATA_BLOCK_HEADER_SIZE
=
4
;
public
LibflacAudioRenderer
()
{
this
(
/* eventHandler= */
null
,
/* eventListener= */
null
);
...
...
@@ -92,8 +93,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer<FlacDecoder
outputFormat
=
Util
.
getPcmFormat
(
C
.
ENCODING_PCM_16BIT
,
format
.
channelCount
,
format
.
sampleRate
);
}
else
{
int
streamMetadataOffset
=
FlacConstants
.
STREAM_MARKER_SIZE
+
FlacConstants
.
METADATA_BLOCK_HEADER_SIZE
;
int
streamMetadataOffset
=
STREAM_MARKER_SIZE
+
METADATA_BLOCK_HEADER_SIZE
;
FlacStreamMetadata
streamMetadata
=
new
FlacStreamMetadata
(
format
.
initializationData
.
get
(
0
),
streamMetadataOffset
);
outputFormat
=
getOutputFormat
(
streamMetadata
);
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/FlacFrameReader.java
View file @
f7abce6a
...
...
@@ -16,7 +16,7 @@
package
com
.
google
.
android
.
exoplayer2
.
extractor
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.
util
.FlacConstants
;
import
com.google.android.exoplayer2.
extractor.flac
.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/FlacMetadataReader.java
View file @
f7abce6a
...
...
@@ -18,10 +18,10 @@ package com.google.android.exoplayer2.extractor;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.extractor.VorbisUtil.CommentHeader
;
import
com.google.android.exoplayer2.extractor.flac.FlacConstants
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.flac.PictureFrame
;
import
com.google.android.exoplayer2.metadata.id3.Id3Decoder
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableBitArray
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
com.google.common.base.Charsets
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/flac/FlacBinarySearchSeeker.java
View file @
f7abce6a
...
...
@@ -23,7 +23,6 @@ import com.google.android.exoplayer2.extractor.FlacFrameReader;
import
com.google.android.exoplayer2.extractor.FlacFrameReader.SampleNumberHolder
;
import
com.google.android.exoplayer2.extractor.FlacStreamMetadata
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
java.io.IOException
;
/**
...
...
library/
common/src/main/java/com/google/android/exoplayer2/util
/FlacConstants.java
→
library/
extractor/src/main/java/com/google/android/exoplayer2/extractor/flac
/FlacConstants.java
View file @
f7abce6a
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
util
;
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
flac
;
/** Defines constants used by the FLAC extractor. */
public
final
class
FlacConstants
{
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/flac/FlacExtractor.java
View file @
f7abce6a
...
...
@@ -36,7 +36,6 @@ import com.google.android.exoplayer2.extractor.SeekMap;
import
com.google.android.exoplayer2.extractor.TrackOutput
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
java.io.IOException
;
import
java.lang.annotation.Documented
;
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ogg/FlacReader.java
View file @
f7abce6a
...
...
@@ -26,7 +26,7 @@ import com.google.android.exoplayer2.extractor.FlacSeekTableSeekMap;
import
com.google.android.exoplayer2.extractor.FlacStreamMetadata
;
import
com.google.android.exoplayer2.extractor.FlacStreamMetadata.SeekTable
;
import
com.google.android.exoplayer2.extractor.SeekMap
;
import
com.google.android.exoplayer2.
util
.FlacConstants
;
import
com.google.android.exoplayer2.
extractor.flac
.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacFrameReaderTest.java
View file @
f7abce6a
...
...
@@ -21,9 +21,9 @@ import androidx.test.core.app.ApplicationProvider;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.extractor.FlacFrameReader.SampleNumberHolder
;
import
com.google.android.exoplayer2.extractor.FlacMetadataReader.FlacStreamMetadataHolder
;
import
com.google.android.exoplayer2.extractor.flac.FlacConstants
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
java.io.IOException
;
import
org.junit.Test
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacMetadataReaderTest.java
View file @
f7abce6a
...
...
@@ -22,12 +22,12 @@ import androidx.test.core.app.ApplicationProvider;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.ParserException
;
import
com.google.android.exoplayer2.extractor.FlacMetadataReader.FlacStreamMetadataHolder
;
import
com.google.android.exoplayer2.extractor.flac.FlacConstants
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.flac.PictureFrame
;
import
com.google.android.exoplayer2.metadata.flac.VorbisComment
;
import
com.google.android.exoplayer2.testutil.FakeExtractorInput
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
java.io.IOException
;
import
java.util.ArrayList
;
...
...
library/extractor/src/test/java/com/google/android/exoplayer2/extractor/FlacStreamMetadataTest.java
View file @
f7abce6a
...
...
@@ -19,10 +19,10 @@ import static com.google.common.truth.Truth.assertThat;
import
androidx.test.core.app.ApplicationProvider
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.extractor.flac.FlacConstants
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.flac.VorbisComment
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.util.FlacConstants
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
org.junit.Test
;
...
...
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