Package com.xuggle.xuggler

Examples of com.xuggle.xuggler.SimpleMediaFile


  @Test
  public void testContainerFormat()
  {
    IContainerFormat defaultVal = null;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getContainerFormat());

    IContainerFormat format = IContainerFormat.make();
    assertNotNull(format);
    format.setInputFormat("flv");
    assertNotNull(format.getInputFormatLongName());
    assertTrue(format.getInputFormatLongName().length()>0);
    obj.setContainerFormat(format);
    assertEquals(format.getInputFormatLongName(), obj.getContainerFormat().getInputFormatLongName());
  }
View Full Code Here


 
  @Test
  public void testDuration()
  {
    ITimeValue defaultVal = null;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getDuration());
   
    ITimeValue expected = ITimeValue.make(3, ITimeValue.Unit.SECONDS);
    obj.setDuration(expected);
    assertEquals(expected, obj.getDuration());
  }
View Full Code Here

  @Test
  public void testURL()
  {
    String defaultVal = null;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getURL());
   
    String expected = "hello:three";
    obj.setURL(expected);
    assertEquals(expected, obj.getURL());
  }
View Full Code Here

  }
 
  @Test
  public void testCreation()
  {
    new SimpleMediaFile();
  }
View Full Code Here

  }
 
  @Test(expected=IllegalArgumentException.class)
  public void testCopyNull()
  {
    new SimpleMediaFile(null);
  }
View Full Code Here

  }
 
  @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());
  }
View Full Code Here

  @Test
  public void testAudioBitRate()
  {
    int defaultVal = 64000;
    int val=123;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getAudioBitRate());
    obj.setAudioBitRate(val);
    assertEquals("set method failed", val, obj.getAudioBitRate());
  }
View Full Code Here

  @Test
  public void testAudioChannels()
  {
    int defaultVal = 1;
    int val=2;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getAudioChannels());
    obj.setAudioChannels(val);
    assertEquals("set method failed", val, obj.getAudioChannels());
  }
View Full Code Here

  @Test
  public void testAudioSampleRate()
  {
    int defaultVal = 44100;
    int val=22050;
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getAudioSampleRate());
    obj.setAudioSampleRate(val);
    assertEquals("set method failed", val, obj.getAudioSampleRate());
  }
View Full Code Here

  {
    ICodec.ID defaultVal = ICodec.ID.CODEC_ID_NONE;
    ICodec.ID val=ICodec.ID.CODEC_ID_AAC;
    assertNotNull("couldn't find codec", val);
   
    ISimpleMediaFile obj = new SimpleMediaFile();
    assertEquals("unexpected default", defaultVal, obj.getAudioCodec());
    obj.setAudioCodec(val);
    assertEquals("set method failed", val, obj.getAudioCodec());
  }
View Full Code Here

TOP

Related Classes of com.xuggle.xuggler.SimpleMediaFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.