if (mTestContainer)
{
final MediaWriter writer = new MediaWriter(mDestination,
reader.getContainer());
writer.setMaskLateStreamExceptions(false);
writer.addListener(new MediaViewer(mViewerMode, true));
writer.addListener(new MediaDebugListener(OPEN, CLOSE));
reader.addListener(new MediaListenerAdapter()
{
public void onVideoPicture(IVideoPictureEvent event)
{
writer.onVideoPicture(event);
}
/** {@inheritDoc} */
public void onAudioSamples(IAudioSamplesEvent event)
{
writer.onAudioSamples(event);
}
});
// transcode
while (reader.readPacket() == null)
;
// close the container
writer.close();
}
// construct a writer give a reader, the easy simple case
else
{
// construct the writer, no need to keep a reference to the
// writer, it's maintained in the reader
MediaWriter writer = new MediaWriter(mDestination, reader);
reader.addListener(writer);
writer.setMaskLateStreamExceptions(false);
writer.addListener(new MediaViewer(mViewerMode, true));
writer.addListener(new MediaDebugListener(EVENT, META_DATA));
// transcode