use of cbit.vcell.export.gloworm.atoms.MovieAtom in project vcell by virtualcell.
the class MediaMethods method writeMovie.
/**
* This method was created in VisualAge.
* @param out OutputStream
*/
public static final void writeMovie(File file, MediaMovie movie, boolean isDataFile) throws DataFormatException, IOException {
// create and write out data atom
MediaChunk[] chunksToBeWritten = movie.getSelfreferencedChunks();
MediaData mdat = new MediaData(chunksToBeWritten);
mdat.writeData(file, isDataFile);
// create and write out movie atom
TrackAtom[] traks = new TrackAtom[movie.getTracks().length];
for (int i = 0; i < movie.getTracks().length; i++) traks[i] = MediaMethods.makeTrackAtom(movie, i);
MovieHeader mvhd = new MovieHeader(movie.getTimeScale(), movie.getDuration(), movie.getNumberOfTracks());
UserData userData = new UserData(movie.getUserDataEntries());
MovieAtom moov = new MovieAtom(mvhd, traks, userData);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
DataOutputStream dout = new DataOutputStream(bout);
moov.writeData(dout);
bout.close();
// byte[] moovBytes = bout.toByteArray();
RandomAccessFile fw = new RandomAccessFile(file, "rw");
fw.seek(file.length());
fw.write(bout.toByteArray());
fw.close();
}
use of cbit.vcell.export.gloworm.atoms.MovieAtom in project vcell by virtualcell.
the class MediaMethods method writeMovie.
/**
* This method was created in VisualAge.
* @param out OutputStream
*/
public static final void writeMovie(DataOutputStream dataOutputStream, MediaMovie movie) throws DataFormatException {
// create and write out data atom
MediaChunk[] chunksToBeWritten = movie.getSelfreferencedChunks();
MediaData mdat = new MediaData(chunksToBeWritten);
mdat.writeData(dataOutputStream);
// create and write out movie atom
TrackAtom[] traks = new TrackAtom[movie.getTracks().length];
for (int i = 0; i < movie.getTracks().length; i++) traks[i] = MediaMethods.makeTrackAtom(movie, i);
MovieHeader mvhd = new MovieHeader(movie.getTimeScale(), movie.getDuration(), movie.getNumberOfTracks());
UserData userData = new UserData(movie.getUserDataEntries());
MovieAtom moov = new MovieAtom(mvhd, traks, userData);
moov.writeData(dataOutputStream);
}
Aggregations