Package javax.media.format

Examples of javax.media.format.H263Format


public class H263FormatTest extends TestCase
{
  public void testConstructors()
  {
    {
      final H263Format f1 = new H263Format();
      assertEquals(f1.getDataType(), byte[].class);
      assertEquals(f1.getFrameRate(), -1.f);
      assertEquals(f1.getMaxDataLength(), -1);
      assertEquals(f1.getSize(), null);
      assertEquals(f1.getAdvancedPrediction(), -1);
      assertEquals(f1.getArithmeticCoding(), -1);
      assertEquals(f1.getErrorCompensation(), -1);
      assertEquals(f1.getHrDB(), -1);
      assertEquals(f1.getPBFrames(), -1);
      assertEquals(f1.getUnrestrictedVector(), -1);
     
    }
   
   
    {
      final Dimension d = new Dimension(1, 2);
      final H263Format f1 = new H263Format(d, 1, int[].class, 2.f, 4, 5, 6, 7, 8, 9);
      assertEquals(f1.getDataType(), int[].class);
      assertEquals(f1.getFrameRate(), 2.f);
      assertEquals(f1.getMaxDataLength(), 1);
      assertEquals(f1.getSize(), new Dimension(1, 2));
      assertTrue(f1.getSize() != d);
      assertEquals(f1.getAdvancedPrediction(), 4);
      assertEquals(f1.getArithmeticCoding(), 5);
      assertEquals(f1.getErrorCompensation(), 6);
      assertEquals(f1.getHrDB(), 7);
      assertEquals(f1.getPBFrames(), 8);
      assertEquals(f1.getUnrestrictedVector(), 9);
    }
  }
View Full Code Here


        new AudioFormat("abc"),
        "aced00057372001e6a617661782e6d656469612e666f726d61742e417564696f466f726d61748038235aea06c83002000a4900086368616e6e656c73490006656e6469616e4400096672616d655261746549000f6672616d6553697a65496e426974735a0004696e69744900066d617267696e44000a6d756c7469706c69657244000a73616d706c655261746549001073616d706c6553697a65496e426974734900067369676e6564787200126a617661782e6d656469612e466f726d61744de4dddeaaf25de70200044a000c656e636f64696e67436f64654c0003636c7a7400114c6a6176612f6c616e672f436c6173733b4c0008646174615479706571007e00024c0008656e636f64696e677400124c6a6176612f6c616e672f537472696e673b787000000000000000007671007e0000767200025b42acf317f8060854e00200007870740003616263ffffffffffffffffbff0000000000000ffffffff0000000000bff0000000000000bff0000000000000ffffffffffffffff"
       
    );
   
    assertEquals(new H263Format().getHrDB(), -1);
    test(
        new H263Format(),
        "aced00057372001d6a617661782e6d656469612e666f726d61742e48323633466f726d61741c900369fb2813ac020006490012616476616e63656450726564696374696f6e49001061726974686d65746963436f64696e674900116572726f72436f6d70656e736174696f6e4900046872444249000870624672616d6573490012756e72657374726963746564566563746f727872001e6a617661782e6d656469612e666f726d61742e566964656f466f726d617431e50c6e211506de0200034600096672616d655261746549000d6d6178446174614c656e6774684c000473697a657400144c6a6176612f6177742f44696d656e73696f6e3b787200126a617661782e6d656469612e466f726d61744de4dddeaaf25de70200044a000c656e636f64696e67436f64654c0003636c7a7400114c6a6176612f6c616e672f436c6173733b4c0008646174615479706571007e00044c0008656e636f64696e677400124c6a6176612f6c616e672f537472696e673b787000000000000000007671007e0000767200025b42acf317f8060854e0020000787074000468323633bf800000ffffffff70ffffffffffffffffffffffffffffffffffffffffffffffff"
       
    );
   
    test(
View Full Code Here

//  }
 
  public void testBitMapInfo4()
  {
    {
      BitMapInfo b = new BitMapInfo(new H263Format());
      assertEquals(b.biBitCount, 24);
      assertEquals(b.biWidth, 320);
      assertEquals(b.biHeight, 240);
      assertEquals(b.biPlanes, 1);
      assertEquals(b.biSizeImage, -1);
View Full Code Here

    assertEquals(new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, -1, 3).toString(), "jpeg video format: size = 1x1 FrameRate = 1.0 maxDataLength = 1000 dataType = class [S decimation = 3");
   
   
    assertEquals(new H261Format().toString(), "H.261 video format");
    assertEquals(new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1).toString(), "H.261 video format");
    assertEquals(new H263Format().toString(), "H.263 video format");
   
    assertEquals(new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6).toString(), "H.263 video format");
 
 
    assertEquals(new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB, 1x1, FrameRate=3.0, Length=2000");
    assertEquals(new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, -1.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB, 1x1, Length=2000");
    assertEquals(new IndexedColorFormat(new Dimension(1, 1), -1, Format.byteArray, -1.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB, 1x1");
View Full Code Here

      assertEquals(f2.getStillImageTransmission(), f1.getStillImageTransmission());
     
    }

    {
      final H263Format f1 = new H263Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6);
      final H263Format f2 = (H263Format) f1.relax();
      assertFalse(f1.equals(f2));
      assertEquals(f2.getEncoding(), f1.getEncoding());
      assertEquals(f2.getDataType(), f1.getDataType());
      assertEquals(f2.getFrameRate(), -1.f);
      assertEquals(f2.getMaxDataLength(), -1);
      assertEquals(f2.getSize(), null);
      assertEquals(f2.getAdvancedPrediction(), f1.getAdvancedPrediction());
      assertEquals(f2.getArithmeticCoding(), f1.getArithmeticCoding());
      assertEquals(f2.getErrorCompensation(), f1.getErrorCompensation());
      assertEquals(f2.getHrDB(), f1.getHrDB());
      assertEquals(f2.getPBFrames(), f1.getPBFrames());
      assertEquals(f2.getUnrestrictedVector(), f1.getUnrestrictedVector());
     
    }

  }
View Full Code Here

    }
  }

  public void testEqualsMatches_H263Format()
  {
    final H263Format f1 = new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6);

    // equal and match:
    {
      final H263Format[] f2s = new H263Format[]{
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
            (H263Format) f1.clone(),
            (H263Format) f1.intersects(f1)
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H263Format f2 = f2s[i];
        assertTrue(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertTrue(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
   
    // not equal and not match:
    {
      final H263Format[] f2s = new H263Format[]{
          new H263Format(new Dimension(1, 2), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 11, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 12, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 13, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 14, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 15, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 16),
                 
         
                 
                 
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H263Format f2 = f2s[i];
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertFalse(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertFalse(f2.matches(f1));
      }
    }

    // not equal but match:
    {     
      final H263Format[] f2s = new H263Format[]{
          new H263Format(new Dimension(1, 1), 2001, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(null, 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, null, 2.f, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, Format.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, Format.NOT_SPECIFIED, 3, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, Format.NOT_SPECIFIED, 4, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, Format.NOT_SPECIFIED, 5, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, Format.NOT_SPECIFIED, 6),
          new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, Format.NOT_SPECIFIED),

         
         
                 
                   
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H263Format f2 = f2s[i];
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
  }
View Full Code Here

    assertEquals(new H261Format().getFrameRate(), (float) Format.NOT_SPECIFIED);
    assertEquals(new H261Format().getMaxDataLength(), Format.NOT_SPECIFIED);
    assertEquals(new H261Format().getSize(), null);
    assertEquals(new H261Format().getDataType(), Format.byteArray);
   
    assertEquals(new H263Format().getEncoding(), "h263");
    assertEquals(new H263Format().getDataType(), Format.byteArray);
   
    final IndexedColorFormat indexedColorFormat = new IndexedColorFormat(new java.awt.Dimension(0, 0), 0, null, 0.f, 0, 0, null, null, null);
    assertEquals(indexedColorFormat.getEncoding(), "irgb")
    assertEquals(indexedColorFormat.getDataType(), null);
   
View Full Code Here

TOP

Related Classes of javax.media.format.H263Format

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.