Merge branch 'RikHeijdens-mediaformat-id-dash' into dev
This commit is contained in:
commit
e252dddeb0
@ -508,8 +508,7 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
private static String buildTrackIdString(MediaFormat format) {
|
||||
return format.trackId == MediaFormat.NO_VALUE ? ""
|
||||
: String.format(Locale.US, " (%d)", format.trackId);
|
||||
return format.trackId == null ? "" : " (" + format.trackId + ")";
|
||||
}
|
||||
|
||||
private boolean onTrackItemClick(MenuItem item, int type) {
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package com.google.android.exoplayer;
|
||||
|
||||
import com.google.android.exoplayer.util.Util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
|
||||
import com.google.android.exoplayer.util.Util;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@ -45,20 +45,20 @@ public final class MediaFormatTest extends TestCase {
|
||||
initData.add(initData2);
|
||||
|
||||
testConversionToFrameworkFormatV16(MediaFormat.createVideoFormat(
|
||||
MediaFormat.NO_VALUE, "video/xyz", 5000, 102400, 1000L, 1280, 720, initData));
|
||||
null, "video/xyz", 5000, 102400, 1000L, 1280, 720, initData));
|
||||
testConversionToFrameworkFormatV16(MediaFormat.createVideoFormat(
|
||||
MediaFormat.NO_VALUE, "video/xyz", 5000, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, 1280, 720,
|
||||
null, "video/xyz", 5000, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, 1280, 720,
|
||||
null));
|
||||
testConversionToFrameworkFormatV16(MediaFormat.createAudioFormat(
|
||||
MediaFormat.NO_VALUE, "audio/xyz", 500, 128, 1000L, 5, 44100, initData, null));
|
||||
null, "audio/xyz", 500, 128, 1000L, 5, 44100, initData, null));
|
||||
testConversionToFrameworkFormatV16(MediaFormat.createAudioFormat(
|
||||
MediaFormat.NO_VALUE, "audio/xyz", 500, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, 5, 44100,
|
||||
null, "audio/xyz", 500, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, 5, 44100,
|
||||
null, null));
|
||||
testConversionToFrameworkFormatV16(
|
||||
MediaFormat.createTextFormat(MediaFormat.NO_VALUE, "text/xyz", MediaFormat.NO_VALUE, 1000L,
|
||||
MediaFormat.createTextFormat(null, "text/xyz", MediaFormat.NO_VALUE, 1000L,
|
||||
"eng"));
|
||||
testConversionToFrameworkFormatV16(
|
||||
MediaFormat.createTextFormat(MediaFormat.NO_VALUE, "text/xyz", MediaFormat.NO_VALUE,
|
||||
MediaFormat.createTextFormat(null, "text/xyz", MediaFormat.NO_VALUE,
|
||||
C.UNKNOWN_TIME_US, null));
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ public final class FrameworkSampleSource implements SampleSource, SampleSourceRe
|
||||
}
|
||||
long durationUs = format.containsKey(android.media.MediaFormat.KEY_DURATION)
|
||||
? format.getLong(android.media.MediaFormat.KEY_DURATION) : C.UNKNOWN_TIME_US;
|
||||
MediaFormat mediaFormat = new MediaFormat(MediaFormat.NO_VALUE, mimeType, MediaFormat.NO_VALUE,
|
||||
MediaFormat mediaFormat = new MediaFormat(null, mimeType, MediaFormat.NO_VALUE,
|
||||
maxInputSize, durationUs, width, height, rotationDegrees, MediaFormat.NO_VALUE,
|
||||
channelCount, sampleRate, language, MediaFormat.OFFSET_SAMPLE_RELATIVE, initializationData,
|
||||
false, MediaFormat.NO_VALUE, MediaFormat.NO_VALUE);
|
||||
|
@ -15,12 +15,12 @@
|
||||
*/
|
||||
package com.google.android.exoplayer;
|
||||
|
||||
import com.google.android.exoplayer.util.Assertions;
|
||||
import com.google.android.exoplayer.util.Util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
|
||||
import com.google.android.exoplayer.util.Assertions;
|
||||
import com.google.android.exoplayer.util.Util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -40,10 +40,10 @@ public final class MediaFormat {
|
||||
public static final long OFFSET_SAMPLE_RELATIVE = Long.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* The identifier for the track represented by the format, or {@link #NO_VALUE} if unknown or not
|
||||
* The identifier for the track represented by the format, or null if unknown or not
|
||||
* applicable.
|
||||
*/
|
||||
public final int trackId;
|
||||
public final String trackId;
|
||||
/**
|
||||
* The mime type of the format.
|
||||
*/
|
||||
@ -139,13 +139,13 @@ public final class MediaFormat {
|
||||
private int hashCode;
|
||||
private android.media.MediaFormat frameworkMediaFormat;
|
||||
|
||||
public static MediaFormat createVideoFormat(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createVideoFormat(String trackId, String mimeType, int bitrate,
|
||||
int maxInputSize, long durationUs, int width, int height, List<byte[]> initializationData) {
|
||||
return createVideoFormat(trackId, mimeType, bitrate, maxInputSize, durationUs, width, height,
|
||||
initializationData, NO_VALUE, NO_VALUE);
|
||||
}
|
||||
|
||||
public static MediaFormat createVideoFormat(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createVideoFormat(String trackId, String mimeType, int bitrate,
|
||||
int maxInputSize, long durationUs, int width, int height, List<byte[]> initializationData,
|
||||
int rotationDegrees, float pixelWidthHeightRatio) {
|
||||
return new MediaFormat(trackId, mimeType, bitrate, maxInputSize, durationUs, width, height,
|
||||
@ -153,7 +153,7 @@ public final class MediaFormat {
|
||||
initializationData, false, NO_VALUE, NO_VALUE);
|
||||
}
|
||||
|
||||
public static MediaFormat createAudioFormat(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createAudioFormat(String trackId, String mimeType, int bitrate,
|
||||
int maxInputSize, long durationUs, int channelCount, int sampleRate,
|
||||
List<byte[]> initializationData, String language) {
|
||||
return new MediaFormat(trackId, mimeType, bitrate, maxInputSize, durationUs, NO_VALUE, NO_VALUE,
|
||||
@ -161,27 +161,27 @@ public final class MediaFormat {
|
||||
initializationData, false, NO_VALUE, NO_VALUE);
|
||||
}
|
||||
|
||||
public static MediaFormat createTextFormat(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createTextFormat(String trackId, String mimeType, int bitrate,
|
||||
long durationUs, String language) {
|
||||
return createTextFormat(trackId, mimeType, bitrate, durationUs, language,
|
||||
OFFSET_SAMPLE_RELATIVE);
|
||||
}
|
||||
|
||||
public static MediaFormat createTextFormat(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createTextFormat(String trackId, String mimeType, int bitrate,
|
||||
long durationUs, String language, long subsampleOffsetUs) {
|
||||
return new MediaFormat(trackId, mimeType, bitrate, NO_VALUE, durationUs, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, language, subsampleOffsetUs, null, false, NO_VALUE,
|
||||
NO_VALUE);
|
||||
}
|
||||
|
||||
public static MediaFormat createFormatForMimeType(int trackId, String mimeType, int bitrate,
|
||||
public static MediaFormat createFormatForMimeType(String trackId, String mimeType, int bitrate,
|
||||
long durationUs) {
|
||||
return new MediaFormat(trackId, mimeType, bitrate, NO_VALUE, durationUs, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, null, OFFSET_SAMPLE_RELATIVE, null, false, NO_VALUE,
|
||||
NO_VALUE);
|
||||
}
|
||||
|
||||
/* package */ MediaFormat(int trackId, String mimeType, int bitrate, int maxInputSize,
|
||||
/* package */ MediaFormat(String trackId, String mimeType, int bitrate, int maxInputSize,
|
||||
long durationUs, int width, int height, int rotationDegrees, float pixelWidthHeightRatio,
|
||||
int channelCount, int sampleRate, String language, long subsampleOffsetUs,
|
||||
List<byte[]> initializationData, boolean adaptive, int maxWidth, int maxHeight) {
|
||||
@ -230,7 +230,7 @@ public final class MediaFormat {
|
||||
}
|
||||
|
||||
public MediaFormat copyAsAdaptive() {
|
||||
return new MediaFormat(trackId, mimeType, NO_VALUE, NO_VALUE, durationUs, NO_VALUE, NO_VALUE,
|
||||
return new MediaFormat(null, mimeType, NO_VALUE, NO_VALUE, durationUs, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, null, OFFSET_SAMPLE_RELATIVE, null, true, maxWidth,
|
||||
maxHeight);
|
||||
}
|
||||
@ -288,7 +288,7 @@ public final class MediaFormat {
|
||||
public int hashCode() {
|
||||
if (hashCode == 0) {
|
||||
int result = 17;
|
||||
result = 31 * result + trackId;
|
||||
result = 31 * result + (trackId == null ? 0 : trackId.hashCode());
|
||||
result = 31 * result + (mimeType == null ? 0 : mimeType.hashCode());
|
||||
result = 31 * result + bitrate;
|
||||
result = 31 * result + maxInputSize;
|
||||
|
@ -610,14 +610,14 @@ public class DashChunkSource implements ChunkSource, Output {
|
||||
String mediaMimeType, long durationUs) {
|
||||
switch (adaptationSetType) {
|
||||
case AdaptationSet.TYPE_VIDEO:
|
||||
return MediaFormat.createVideoFormat(MediaFormat.NO_VALUE, mediaMimeType, format.bitrate,
|
||||
return MediaFormat.createVideoFormat(format.id, mediaMimeType, format.bitrate,
|
||||
MediaFormat.NO_VALUE, durationUs, format.width, format.height, null);
|
||||
case AdaptationSet.TYPE_AUDIO:
|
||||
return MediaFormat.createAudioFormat(MediaFormat.NO_VALUE, mediaMimeType, format.bitrate,
|
||||
return MediaFormat.createAudioFormat(format.id, mediaMimeType, format.bitrate,
|
||||
MediaFormat.NO_VALUE, durationUs, format.audioChannels, format.audioSamplingRate, null,
|
||||
format.language);
|
||||
case AdaptationSet.TYPE_TEXT:
|
||||
return MediaFormat.createTextFormat(MediaFormat.NO_VALUE, mediaMimeType, format.bitrate,
|
||||
return MediaFormat.createTextFormat(format.id, mediaMimeType, format.bitrate,
|
||||
durationUs, format.language);
|
||||
default:
|
||||
return null;
|
||||
|
@ -95,10 +95,9 @@ import java.util.Collections;
|
||||
Pair<Integer, Integer> audioParams = CodecSpecificDataUtil.parseAacAudioSpecificConfig(
|
||||
audioSpecificConfig);
|
||||
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(MediaFormat.NO_VALUE,
|
||||
MimeTypes.AUDIO_AAC, MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, getDurationUs(),
|
||||
audioParams.second, audioParams.first, Collections.singletonList(audioSpecificConfig),
|
||||
null);
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(null, MimeTypes.AUDIO_AAC,
|
||||
MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, getDurationUs(), audioParams.second,
|
||||
audioParams.first, Collections.singletonList(audioSpecificConfig), null);
|
||||
output.format(mediaFormat);
|
||||
hasOutputFormat = true;
|
||||
} else if (packetType == AAC_PACKET_TYPE_AAC_RAW) {
|
||||
|
@ -95,9 +95,9 @@ import java.util.List;
|
||||
nalUnitLengthFieldLength = avcData.nalUnitLengthFieldLength;
|
||||
|
||||
// Construct and output the format.
|
||||
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MediaFormat.NO_VALUE,
|
||||
MimeTypes.VIDEO_H264, MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, getDurationUs(),
|
||||
avcData.width, avcData.height, avcData.initializationData, MediaFormat.NO_VALUE,
|
||||
MediaFormat mediaFormat = MediaFormat.createVideoFormat(null, MimeTypes.VIDEO_H264,
|
||||
MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, getDurationUs(), avcData.width,
|
||||
avcData.height, avcData.initializationData, MediaFormat.NO_VALUE,
|
||||
avcData.pixelWidthAspectRatio);
|
||||
output.format(mediaFormat);
|
||||
hasOutputFormat = true;
|
||||
|
@ -332,7 +332,7 @@ public final class Mp3Extractor implements Extractor {
|
||||
if (seeker == null) {
|
||||
setupSeeker(extractorInput, headerPosition);
|
||||
extractorOutput.seekMap(seeker);
|
||||
trackOutput.format(MediaFormat.createAudioFormat(MediaFormat.NO_VALUE,
|
||||
trackOutput.format(MediaFormat.createAudioFormat(null,
|
||||
synchronizedHeader.mimeType, MediaFormat.NO_VALUE, MpegAudioHeader.MAX_FRAME_SIZE_BYTES,
|
||||
seeker.getDurationUs(), synchronizedHeader.channels, synchronizedHeader.sampleRate, null,
|
||||
null));
|
||||
|
@ -454,13 +454,13 @@ import java.util.List;
|
||||
parseAudioSampleEntry(stsd, childAtomType, childStartPosition, childAtomSize, trackId,
|
||||
durationUs, language, out, i);
|
||||
} else if (childAtomType == Atom.TYPE_TTML) {
|
||||
out.mediaFormat = MediaFormat.createTextFormat(trackId, MimeTypes.APPLICATION_TTML,
|
||||
out.mediaFormat = MediaFormat.createTextFormat(Integer.toString(trackId), MimeTypes.APPLICATION_TTML,
|
||||
MediaFormat.NO_VALUE, durationUs, language);
|
||||
} else if (childAtomType == Atom.TYPE_tx3g) {
|
||||
out.mediaFormat = MediaFormat.createTextFormat(trackId, MimeTypes.APPLICATION_TX3G,
|
||||
out.mediaFormat = MediaFormat.createTextFormat(Integer.toString(trackId), MimeTypes.APPLICATION_TX3G,
|
||||
MediaFormat.NO_VALUE, durationUs, language);
|
||||
} else if (childAtomType == Atom.TYPE_stpp) {
|
||||
out.mediaFormat = MediaFormat.createTextFormat(trackId, MimeTypes.APPLICATION_TTML,
|
||||
out.mediaFormat = MediaFormat.createTextFormat(Integer.toString(trackId), MimeTypes.APPLICATION_TTML,
|
||||
MediaFormat.NO_VALUE, durationUs, language, 0 /* subsample timing is absolute */);
|
||||
}
|
||||
stsd.setPosition(childStartPosition + childAtomSize);
|
||||
@ -531,7 +531,7 @@ import java.util.List;
|
||||
return;
|
||||
}
|
||||
|
||||
out.mediaFormat = MediaFormat.createVideoFormat(trackId, mimeType, MediaFormat.NO_VALUE,
|
||||
out.mediaFormat = MediaFormat.createVideoFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE,
|
||||
MediaFormat.NO_VALUE, durationUs, width, height, initializationData, rotationDegrees,
|
||||
pixelWidthHeightRatio);
|
||||
}
|
||||
@ -753,7 +753,7 @@ import java.util.List;
|
||||
} else if ((atomType == Atom.TYPE_dtsc || atomType == Atom.TYPE_dtse
|
||||
|| atomType == Atom.TYPE_dtsh || atomType == Atom.TYPE_dtsl)
|
||||
&& childAtomType == Atom.TYPE_ddts) {
|
||||
out.mediaFormat = MediaFormat.createAudioFormat(trackId, mimeType, MediaFormat.NO_VALUE,
|
||||
out.mediaFormat = MediaFormat.createAudioFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE,
|
||||
MediaFormat.NO_VALUE, durationUs, channelCount, sampleRate, null, language);
|
||||
return;
|
||||
}
|
||||
@ -765,7 +765,7 @@ import java.util.List;
|
||||
return;
|
||||
}
|
||||
|
||||
out.mediaFormat = MediaFormat.createAudioFormat(trackId, mimeType, MediaFormat.NO_VALUE,
|
||||
out.mediaFormat = MediaFormat.createAudioFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE,
|
||||
sampleSize, durationUs, channelCount, sampleRate,
|
||||
initializationData == null ? null : Collections.singletonList(initializationData),
|
||||
language);
|
||||
|
@ -170,7 +170,7 @@ import java.util.Collections;
|
||||
Pair<Integer, Integer> audioParams = CodecSpecificDataUtil.parseAacAudioSpecificConfig(
|
||||
audioSpecificConfig);
|
||||
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(MediaFormat.NO_VALUE,
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(null,
|
||||
MimeTypes.AUDIO_AAC, MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US,
|
||||
audioParams.second, audioParams.first, Collections.singletonList(audioSpecificConfig),
|
||||
null);
|
||||
|
@ -210,7 +210,7 @@ import java.util.List;
|
||||
SpsData parsedSpsData = CodecSpecificDataUtil.parseSpsNalUnit(bitArray);
|
||||
|
||||
// Construct and output the format.
|
||||
output.format(MediaFormat.createVideoFormat(MediaFormat.NO_VALUE, MimeTypes.VIDEO_H264,
|
||||
output.format(MediaFormat.createVideoFormat(null, MimeTypes.VIDEO_H264,
|
||||
MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, parsedSpsData.width,
|
||||
parsedSpsData.height, initializationData, MediaFormat.NO_VALUE,
|
||||
parsedSpsData.pixelWidthAspectRatio));
|
||||
|
@ -294,7 +294,7 @@ import java.util.Collections;
|
||||
}
|
||||
}
|
||||
|
||||
output.format(MediaFormat.createVideoFormat(MediaFormat.NO_VALUE, MimeTypes.VIDEO_H265,
|
||||
output.format(MediaFormat.createVideoFormat(null, MimeTypes.VIDEO_H265,
|
||||
MediaFormat.NO_VALUE, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, picWidthInLumaSamples,
|
||||
picHeightInLumaSamples, Collections.singletonList(csd), MediaFormat.NO_VALUE,
|
||||
pixelWidthHeightRatio));
|
||||
|
@ -35,7 +35,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
|
||||
|
||||
public Id3Reader(TrackOutput output) {
|
||||
super(output);
|
||||
output.format(MediaFormat.createFormatForMimeType(MediaFormat.NO_VALUE,
|
||||
output.format(MediaFormat.createFormatForMimeType(null,
|
||||
MimeTypes.APPLICATION_ID3, MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US));
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
|
||||
frameSize = header.frameSize;
|
||||
if (!hasOutputFormat) {
|
||||
frameDurationUs = (C.MICROS_PER_SECOND * header.samplesPerFrame) / header.sampleRate;
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(MediaFormat.NO_VALUE, header.mimeType,
|
||||
MediaFormat mediaFormat = MediaFormat.createAudioFormat(null, header.mimeType,
|
||||
MediaFormat.NO_VALUE, MpegAudioHeader.MAX_FRAME_SIZE_BYTES, C.UNKNOWN_TIME_US,
|
||||
header.channels, header.sampleRate, null, null);
|
||||
output.format(mediaFormat);
|
||||
|
@ -32,7 +32,7 @@ import com.google.android.exoplayer.util.ParsableByteArray;
|
||||
|
||||
public SeiReader(TrackOutput output) {
|
||||
super(output);
|
||||
output.format(MediaFormat.createTextFormat(MediaFormat.NO_VALUE, MimeTypes.APPLICATION_EIA608,
|
||||
output.format(MediaFormat.createTextFormat(null, MimeTypes.APPLICATION_EIA608,
|
||||
MediaFormat.NO_VALUE, C.UNKNOWN_TIME_US, null));
|
||||
}
|
||||
|
||||
|
@ -1227,14 +1227,16 @@ public final class WebmExtractor implements Extractor {
|
||||
}
|
||||
|
||||
MediaFormat format;
|
||||
// TODO: Read the name of the track from the header of the webm container and
|
||||
// supply this as id instead of trackId?
|
||||
if (MimeTypes.isAudio(mimeType)) {
|
||||
format = MediaFormat.createAudioFormat(trackId, mimeType, MediaFormat.NO_VALUE,
|
||||
format = MediaFormat.createAudioFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE,
|
||||
maxInputSize, durationUs, channelCount, sampleRate, initializationData, language);
|
||||
} else if (MimeTypes.isVideo(mimeType)) {
|
||||
format = MediaFormat.createVideoFormat(trackId, mimeType, MediaFormat.NO_VALUE,
|
||||
format = MediaFormat.createVideoFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE,
|
||||
maxInputSize, durationUs, width, height, initializationData);
|
||||
} else if (MimeTypes.APPLICATION_SUBRIP.equals(mimeType)) {
|
||||
format = MediaFormat.createTextFormat(trackId, mimeType, MediaFormat.NO_VALUE, durationUs,
|
||||
format = MediaFormat.createTextFormat(Integer.toString(trackId), mimeType, MediaFormat.NO_VALUE, durationUs,
|
||||
language);
|
||||
} else {
|
||||
throw new ParserException("Unexpected MIME type.");
|
||||
|
@ -398,7 +398,7 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
||||
int mp4TrackType;
|
||||
switch (element.type) {
|
||||
case StreamElement.TYPE_VIDEO:
|
||||
mediaFormat = MediaFormat.createVideoFormat(MediaFormat.NO_VALUE, format.mimeType,
|
||||
mediaFormat = MediaFormat.createVideoFormat(format.id, format.mimeType,
|
||||
format.bitrate, MediaFormat.NO_VALUE, durationUs, format.width, format.height,
|
||||
Arrays.asList(csdArray));
|
||||
mp4TrackType = Track.TYPE_vide;
|
||||
@ -411,13 +411,13 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
||||
csd = Collections.singletonList(CodecSpecificDataUtil.buildAacAudioSpecificConfig(
|
||||
format.audioSamplingRate, format.audioChannels));
|
||||
}
|
||||
mediaFormat = MediaFormat.createAudioFormat(MediaFormat.NO_VALUE, format.mimeType,
|
||||
mediaFormat = MediaFormat.createAudioFormat(format.id, format.mimeType,
|
||||
format.bitrate, MediaFormat.NO_VALUE, durationUs, format.audioChannels,
|
||||
format.audioSamplingRate, csd, format.language);
|
||||
mp4TrackType = Track.TYPE_soun;
|
||||
break;
|
||||
case StreamElement.TYPE_TEXT:
|
||||
mediaFormat = MediaFormat.createTextFormat(MediaFormat.NO_VALUE, format.mimeType,
|
||||
mediaFormat = MediaFormat.createTextFormat(format.id, format.mimeType,
|
||||
format.bitrate, durationUs, format.language);
|
||||
mp4TrackType = Track.TYPE_text;
|
||||
break;
|
||||
|
@ -55,7 +55,7 @@ public final class Ac3Util {
|
||||
if ((nextByte & 0x04) != 0) {
|
||||
channelCount++;
|
||||
}
|
||||
return MediaFormat.createAudioFormat(trackId, MimeTypes.AUDIO_AC3, MediaFormat.NO_VALUE,
|
||||
return MediaFormat.createAudioFormat(Integer.toString(trackId), MimeTypes.AUDIO_AC3, MediaFormat.NO_VALUE,
|
||||
MediaFormat.NO_VALUE, durationUs, channelCount, sampleRate, null, language);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public final class Ac3Util {
|
||||
if ((nextByte & 0x01) != 0) {
|
||||
channelCount++;
|
||||
}
|
||||
return MediaFormat.createAudioFormat(trackId, MimeTypes.AUDIO_EC3, MediaFormat.NO_VALUE,
|
||||
return MediaFormat.createAudioFormat(Integer.toString(trackId), MimeTypes.AUDIO_EC3, MediaFormat.NO_VALUE,
|
||||
MediaFormat.NO_VALUE, durationUs, channelCount, sampleRate, null, language);
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ public final class Ac3Util {
|
||||
data.skipBits(2); // dsurmod
|
||||
}
|
||||
boolean lfeon = data.readBit();
|
||||
return MediaFormat.createAudioFormat(trackId, MimeTypes.AUDIO_AC3, MediaFormat.NO_VALUE,
|
||||
return MediaFormat.createAudioFormat(Integer.toString(trackId), MimeTypes.AUDIO_AC3, MediaFormat.NO_VALUE,
|
||||
MediaFormat.NO_VALUE, durationUs, CHANNEL_COUNTS[acmod] + (lfeon ? 1 : 0),
|
||||
SAMPLE_RATES[fscod], null, language);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user