mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Minor ID3 tweaks
This commit is contained in:
parent
f4b8d9490a
commit
bffffb0fac
4 changed files with 9 additions and 20 deletions
|
|
@ -58,6 +58,10 @@ public final class Format implements Parcelable {
|
||||||
* Codecs of the format as described in RFC 6381, or null if unknown or not applicable.
|
* Codecs of the format as described in RFC 6381, or null if unknown or not applicable.
|
||||||
*/
|
*/
|
||||||
public final String codecs;
|
public final String codecs;
|
||||||
|
/**
|
||||||
|
* Metadata, or null if unknown or not applicable.
|
||||||
|
*/
|
||||||
|
public final Metadata metadata;
|
||||||
|
|
||||||
// Container specific.
|
// Container specific.
|
||||||
|
|
||||||
|
|
@ -87,11 +91,6 @@ public final class Format implements Parcelable {
|
||||||
* DRM initialization data if the stream is protected, or null otherwise.
|
* DRM initialization data if the stream is protected, or null otherwise.
|
||||||
*/
|
*/
|
||||||
public final DrmInitData drmInitData;
|
public final DrmInitData drmInitData;
|
||||||
/**
|
|
||||||
* Static metadata
|
|
||||||
*/
|
|
||||||
public final Metadata metadata;
|
|
||||||
|
|
||||||
|
|
||||||
// Video specific.
|
// Video specific.
|
||||||
|
|
||||||
|
|
@ -245,18 +244,18 @@ public final class Format implements Parcelable {
|
||||||
@C.SelectionFlags int selectionFlags, String language) {
|
@C.SelectionFlags int selectionFlags, String language) {
|
||||||
return createAudioSampleFormat(id, sampleMimeType, codecs, bitrate, maxInputSize, channelCount,
|
return createAudioSampleFormat(id, sampleMimeType, codecs, bitrate, maxInputSize, channelCount,
|
||||||
sampleRate, pcmEncoding, NO_VALUE, NO_VALUE, initializationData, drmInitData,
|
sampleRate, pcmEncoding, NO_VALUE, NO_VALUE, initializationData, drmInitData,
|
||||||
selectionFlags, language);
|
selectionFlags, language, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Format createAudioSampleFormat(String id, String sampleMimeType, String codecs,
|
public static Format createAudioSampleFormat(String id, String sampleMimeType, String codecs,
|
||||||
int bitrate, int maxInputSize, int channelCount, int sampleRate,
|
int bitrate, int maxInputSize, int channelCount, int sampleRate,
|
||||||
@C.PcmEncoding int pcmEncoding, int encoderDelay, int encoderPadding,
|
@C.PcmEncoding int pcmEncoding, int encoderDelay, int encoderPadding,
|
||||||
List<byte[]> initializationData, DrmInitData drmInitData,
|
List<byte[]> initializationData, DrmInitData drmInitData,
|
||||||
@C.SelectionFlags int selectionFlags, String language) {
|
@C.SelectionFlags int selectionFlags, String language, Metadata metadata) {
|
||||||
return new Format(id, null, sampleMimeType, codecs, bitrate, maxInputSize, NO_VALUE, NO_VALUE,
|
return new Format(id, null, sampleMimeType, codecs, bitrate, maxInputSize, NO_VALUE, NO_VALUE,
|
||||||
NO_VALUE, NO_VALUE, NO_VALUE, null, NO_VALUE, channelCount, sampleRate, pcmEncoding,
|
NO_VALUE, NO_VALUE, NO_VALUE, null, NO_VALUE, channelCount, sampleRate, pcmEncoding,
|
||||||
encoderDelay, encoderPadding, selectionFlags, language, OFFSET_SAMPLE_RELATIVE,
|
encoderDelay, encoderPadding, selectionFlags, language, OFFSET_SAMPLE_RELATIVE,
|
||||||
initializationData, drmInitData, null);
|
initializationData, drmInitData, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text.
|
// Text.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
package com.google.android.exoplayer2.extractor;
|
package com.google.android.exoplayer2.extractor;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,6 @@ import com.google.android.exoplayer2.metadata.Metadata;
|
||||||
import com.google.android.exoplayer2.metadata.id3.CommentFrame;
|
import com.google.android.exoplayer2.metadata.id3.CommentFrame;
|
||||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
|
||||||
import org.w3c.dom.Comment;
|
|
||||||
|
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
@ -147,14 +144,10 @@ public final class Mp3Extractor implements Extractor {
|
||||||
if (seeker == null) {
|
if (seeker == null) {
|
||||||
seeker = setupSeeker(input);
|
seeker = setupSeeker(input);
|
||||||
extractorOutput.seekMap(seeker);
|
extractorOutput.seekMap(seeker);
|
||||||
Format format = Format.createAudioSampleFormat(null, synchronizedHeader.mimeType, null,
|
trackOutput.format(Format.createAudioSampleFormat(null, synchronizedHeader.mimeType, null,
|
||||||
Format.NO_VALUE, MpegAudioHeader.MAX_FRAME_SIZE_BYTES, synchronizedHeader.channels,
|
Format.NO_VALUE, MpegAudioHeader.MAX_FRAME_SIZE_BYTES, synchronizedHeader.channels,
|
||||||
synchronizedHeader.sampleRate, Format.NO_VALUE, gaplessInfoHolder.encoderDelay,
|
synchronizedHeader.sampleRate, Format.NO_VALUE, gaplessInfoHolder.encoderDelay,
|
||||||
gaplessInfoHolder.encoderPadding, null, null, 0, null);
|
gaplessInfoHolder.encoderPadding, null, null, 0, null, metadata));
|
||||||
if (metadata != null) {
|
|
||||||
format = format.copyWithMetadata(metadata);
|
|
||||||
}
|
|
||||||
trackOutput.format(format);
|
|
||||||
}
|
}
|
||||||
return readSample(input);
|
return readSample(input);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer2.metadata.id3;
|
package com.google.android.exoplayer2.metadata.id3;
|
||||||
|
|
||||||
import android.os.Parcelable;
|
|
||||||
|
|
||||||
import com.google.android.exoplayer2.metadata.Metadata;
|
import com.google.android.exoplayer2.metadata.Metadata;
|
||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue