mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Move component initialization from Mp4Muxer.Builder to Mp4Muxer
PiperOrigin-RevId: 645004885
This commit is contained in:
parent
cb8f87e05e
commit
307655f6d5
@ -167,27 +167,34 @@ public final class Mp4Muxer implements Muxer {
|
|||||||
|
|
||||||
/** Builds an {@link Mp4Muxer} instance. */
|
/** Builds an {@link Mp4Muxer} instance. */
|
||||||
public Mp4Muxer build() {
|
public Mp4Muxer build() {
|
||||||
MetadataCollector metadataCollector = new MetadataCollector();
|
return new Mp4Muxer(
|
||||||
Mp4MoovStructure moovStructure =
|
fileOutputStream,
|
||||||
new Mp4MoovStructure(metadataCollector, lastFrameDurationBehavior);
|
lastFrameDurationBehavior,
|
||||||
Mp4Writer mp4Writer =
|
annexBToAvccConverter == null ? AnnexBToAvccConverter.DEFAULT : annexBToAvccConverter,
|
||||||
new Mp4Writer(
|
sampleCopyEnabled,
|
||||||
fileOutputStream,
|
attemptStreamableOutputEnabled);
|
||||||
moovStructure,
|
|
||||||
annexBToAvccConverter == null ? AnnexBToAvccConverter.DEFAULT : annexBToAvccConverter,
|
|
||||||
sampleCopyEnabled,
|
|
||||||
attemptStreamableOutputEnabled);
|
|
||||||
|
|
||||||
return new Mp4Muxer(mp4Writer, metadataCollector);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Mp4Writer mp4Writer;
|
|
||||||
private final MetadataCollector metadataCollector;
|
private final MetadataCollector metadataCollector;
|
||||||
|
private final Mp4Writer mp4Writer;
|
||||||
|
|
||||||
private Mp4Muxer(Mp4Writer mp4Writer, MetadataCollector metadataCollector) {
|
private Mp4Muxer(
|
||||||
this.mp4Writer = mp4Writer;
|
FileOutputStream fileOutputStream,
|
||||||
this.metadataCollector = metadataCollector;
|
@LastFrameDurationBehavior int lastFrameDurationBehavior,
|
||||||
|
AnnexBToAvccConverter annexBToAvccConverter,
|
||||||
|
boolean sampleCopyEnabled,
|
||||||
|
boolean attemptStreamableOutputEnabled) {
|
||||||
|
metadataCollector = new MetadataCollector();
|
||||||
|
Mp4MoovStructure moovStructure =
|
||||||
|
new Mp4MoovStructure(metadataCollector, lastFrameDurationBehavior);
|
||||||
|
mp4Writer =
|
||||||
|
new Mp4Writer(
|
||||||
|
fileOutputStream,
|
||||||
|
moovStructure,
|
||||||
|
annexBToAvccConverter,
|
||||||
|
sampleCopyEnabled,
|
||||||
|
attemptStreamableOutputEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user