mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Pass Metadata to Muxer when adding a track.
PiperOrigin-RevId: 514575400
This commit is contained in:
parent
e12de4cc1f
commit
2d22604efe
5 changed files with 10 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ import org.checkerframework.dataflow.qual.Pure;
|
|||
MuxerWrapper muxerWrapper,
|
||||
FallbackListener fallbackListener)
|
||||
throws ExportException {
|
||||
super(firstPipelineInputFormat, /* streamStartPositionUs= */ streamOffsetUs, muxerWrapper);
|
||||
super(firstAssetLoaderInputFormat, /* streamStartPositionUs= */ streamOffsetUs, muxerWrapper);
|
||||
|
||||
silentAudioGenerator = new SilentAudioGenerator(firstPipelineInputFormat);
|
||||
availableInputBuffers = new ConcurrentLinkedDeque<>();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import androidx.annotation.Nullable;
|
|||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
|
||||
import com.google.android.exoplayer2.metadata.Metadata;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.video.ColorInfo;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
|
@ -49,6 +50,7 @@ import java.util.List;
|
|||
private final long streamStartPositionUs;
|
||||
private final MuxerWrapper muxerWrapper;
|
||||
private final @C.TrackType int outputTrackType;
|
||||
@Nullable private final Metadata metadata;
|
||||
|
||||
private boolean muxerWrapperTrackAdded;
|
||||
|
||||
|
|
@ -56,6 +58,7 @@ import java.util.List;
|
|||
Format firstInputFormat, long streamStartPositionUs, MuxerWrapper muxerWrapper) {
|
||||
this.streamStartPositionUs = streamStartPositionUs;
|
||||
this.muxerWrapper = muxerWrapper;
|
||||
this.metadata = firstInputFormat.metadata;
|
||||
outputTrackType = getProcessedTrackType(firstInputFormat.sampleMimeType);
|
||||
}
|
||||
|
||||
|
|
@ -94,6 +97,9 @@ import java.util.List;
|
|||
if (inputFormat == null) {
|
||||
return false;
|
||||
}
|
||||
if (metadata != null) {
|
||||
inputFormat = inputFormat.buildUpon().setMetadata(metadata).build();
|
||||
}
|
||||
try {
|
||||
muxerWrapper.addTrackFormat(inputFormat);
|
||||
} catch (Muxer.MuxerException e) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ format 1:
|
|||
channelCount = 1
|
||||
sampleRate = 48000
|
||||
pcmEncoding = 2
|
||||
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0]]
|
||||
sample:
|
||||
trackIndex = 1
|
||||
dataHashCode = 1868041800
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ format 0:
|
|||
channelCount = 1
|
||||
sampleRate = 44100
|
||||
pcmEncoding = 2
|
||||
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0]]
|
||||
sample:
|
||||
trackIndex = 0
|
||||
dataHashCode = 915609509
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ format 1:
|
|||
channelCount = 2
|
||||
sampleRate = 12000
|
||||
pcmEncoding = 2
|
||||
metadata = entries=[smta: captureFrameRate=240.0, svcTemporalLayerCount=4, SlowMotion: segments=[Segment: startTimeMs=88, endTimeMs=879, speedDivisor=2, Segment: startTimeMs=1255, endTimeMs=1970, speedDivisor=8]]
|
||||
sample:
|
||||
trackIndex = 1
|
||||
dataHashCode = -212376212
|
||||
|
|
|
|||
Loading…
Reference in a new issue