mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Move doInterleave() call to Mp4Writer
`Mp4Writer` receives all the tracks/samples and then it adds them to corresponding `Track` object. As the `Track` object is primarily to hold track specific data and `Mp4Writer` is responsible for interleaving related logic, the call to `doInterleave` should be with `Mp4Writer`. The `Track` object should just act like a data holding class. This will also help in reusing `Track` class for fragmented MP4 implementation. PiperOrigin-RevId: 590138002
This commit is contained in:
parent
90a0cbdf3d
commit
0660b55ceb
@ -90,6 +90,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
throws IOException {
|
||||
checkState(token instanceof Track);
|
||||
((Track) token).writeSampleData(byteBuf, bufferInfo);
|
||||
doInterleave();
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
@ -387,7 +388,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
}
|
||||
|
||||
pendingSamples.addLast(Pair.create(bufferInfo, byteBuffer));
|
||||
doInterleave();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user