mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +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.
|
||||
*/
|
||||
public final String codecs;
|
||||
/**
|
||||
* Metadata, or null if unknown or not applicable.
|
||||
*/
|
||||
public final Metadata metadata;
|
||||
|
||||
// Container specific.
|
||||
|
||||
|
|
@ -87,11 +91,6 @@ public final class Format implements Parcelable {
|
|||
* DRM initialization data if the stream is protected, or null otherwise.
|
||||
*/
|
||||
public final DrmInitData drmInitData;
|
||||
/**
|
||||
* Static metadata
|
||||
*/
|
||||
public final Metadata metadata;
|
||||
|
||||
|
||||
// Video specific.
|
||||
|
||||
|
|
@ -245,18 +244,18 @@ public final class Format implements Parcelable {
|
|||
@C.SelectionFlags int selectionFlags, String language) {
|
||||
return createAudioSampleFormat(id, sampleMimeType, codecs, bitrate, maxInputSize, channelCount,
|
||||
sampleRate, pcmEncoding, NO_VALUE, NO_VALUE, initializationData, drmInitData,
|
||||
selectionFlags, language);
|
||||
selectionFlags, language, null);
|
||||
}
|
||||
|
||||
public static Format createAudioSampleFormat(String id, String sampleMimeType, String codecs,
|
||||
int bitrate, int maxInputSize, int channelCount, int sampleRate,
|
||||
@C.PcmEncoding int pcmEncoding, int encoderDelay, int encoderPadding,
|
||||
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,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, null, NO_VALUE, channelCount, sampleRate, pcmEncoding,
|
||||
encoderDelay, encoderPadding, selectionFlags, language, OFFSET_SAMPLE_RELATIVE,
|
||||
initializationData, drmInitData, null);
|
||||
initializationData, drmInitData, metadata);
|
||||
}
|
||||
|
||||
// Text.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
package com.google.android.exoplayer2.extractor;
|
||||
|
||||
import com.google.android.exoplayer2.Format;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
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.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
|
||||
import org.w3c.dom.Comment;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
|
||||
|
|
@ -147,14 +144,10 @@ public final class Mp3Extractor implements Extractor {
|
|||
if (seeker == null) {
|
||||
seeker = setupSeeker(input);
|
||||
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,
|
||||
synchronizedHeader.sampleRate, Format.NO_VALUE, gaplessInfoHolder.encoderDelay,
|
||||
gaplessInfoHolder.encoderPadding, null, null, 0, null);
|
||||
if (metadata != null) {
|
||||
format = format.copyWithMetadata(metadata);
|
||||
}
|
||||
trackOutput.format(format);
|
||||
gaplessInfoHolder.encoderPadding, null, null, 0, null, metadata));
|
||||
}
|
||||
return readSample(input);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.metadata.id3;
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.google.android.exoplayer2.metadata.Metadata;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue