}
@Test
public void testCopy()
{
ISimpleMediaFile obj = new SimpleMediaFile();
// change all the defaults
obj.setAudioBitRate(123);
obj.setAudioChannels(2);
obj.setAudioSampleRate(22050);
obj.setAudioCodec(ICodec.ID.CODEC_ID_MP3);
obj.setAudioTimeBase(IRational.make(17, 100));
obj.setVideoWidth(1);
obj.setVideoHeight(2);
obj.setVideoTimeBase(IRational.make(1, 100));
obj.setVideoCodec(ICodec.ID.CODEC_ID_FLV1);
obj.setVideoPixelFormat(IPixelFormat.Type.ARGB);
obj.setVideoNumPicturesInGroupOfPictures(12);
obj.setVideoFrameRate(IRational.make(2, 15));
obj.setVideoGlobalQuality(5);
obj.setDuration(ITimeValue.make(1, ITimeValue.Unit.SECONDS));
IContainerFormat format = IContainerFormat.make();
format.setInputFormat("flv");
obj.setContainerFormat(format);
obj.setHasVideo(false);
obj.setHasAudio(false);
obj.setURL("foo:bar");
ISimpleMediaFile copy = new SimpleMediaFile(obj);
assertEquals(obj.getAudioBitRate(), copy.getAudioBitRate());
assertEquals(obj.isAudioBitRateKnown(), copy.isAudioBitRateKnown());
assertEquals(obj.getAudioChannels(), copy.getAudioChannels());
assertEquals(obj.isAudioChannelsKnown(), copy.isAudioChannelsKnown());
assertEquals(obj.getAudioSampleRate(), copy.getAudioSampleRate());
assertEquals(obj.isAudioSampleRateKnown(), copy.isAudioSampleRateKnown());
assertEquals(obj.getAudioCodec(), copy.getAudioCodec());
assertEquals(obj.getAudioTimeBase().getNumerator(), copy.getAudioTimeBase().getNumerator());
assertEquals(obj.getAudioTimeBase().getDenominator(), copy.getAudioTimeBase().getDenominator());
assertEquals(obj.getVideoWidth(), copy.getVideoWidth());
assertEquals(obj.isVideoWidthKnown(), copy.isVideoWidthKnown());
assertEquals(obj.getVideoHeight(), copy.getVideoHeight());
assertEquals(obj.isVideoHeightKnown(), copy.isVideoHeightKnown());
assertEquals(obj.getVideoTimeBase().getNumerator(), copy.getVideoTimeBase().getNumerator());
assertEquals(obj.getVideoTimeBase().getDenominator(), copy.getVideoTimeBase().getDenominator());
assertEquals(obj.getVideoCodec(), copy.getVideoCodec());
assertEquals(obj.getVideoPixelFormat(), copy.getVideoPixelFormat());
assertEquals(obj.isVideoPixelFormatKnown(), copy.isVideoPixelFormatKnown());
assertEquals(obj.getVideoNumPicturesInGroupOfPictures(), copy.getVideoNumPicturesInGroupOfPictures());
assertEquals(obj.isVideoNumPicturesInGroupOfPicturesKnown(), copy.isVideoNumPicturesInGroupOfPicturesKnown());
assertEquals(obj.getVideoFrameRate().getNumerator(), copy.getVideoFrameRate().getNumerator());
assertEquals(obj.getVideoFrameRate().getDenominator(), copy.getVideoFrameRate().getDenominator());
assertEquals(obj.getVideoGlobalQuality(), copy.getVideoGlobalQuality());
assertEquals(obj.isVideoGlobalQualityKnown(), copy.isVideoGlobalQualityKnown());
assertEquals(obj.hasVideo(), copy.hasVideo());
assertEquals(obj.hasAudio(), copy.hasVideo());
assertEquals(obj.getContainerFormat().getInputFormatLongName(), copy.getContainerFormat().getInputFormatLongName());
assertEquals(obj.getDuration(), copy.getDuration());
assertEquals(obj.getURL(), copy.getURL());
}