Package javax.media.format

Examples of javax.media.format.H261Format


public class H261FormatTest extends TestCase
{
  public void testConstructors()
  {
    {
      final H261Format f1 = new H261Format();
      assertEquals(f1.getDataType(), byte[].class);
      assertEquals(f1.getFrameRate(), -1.f);
      assertEquals(f1.getMaxDataLength(), -1);
      assertEquals(f1.getSize(), null);
      assertEquals(f1.getStillImageTransmission(), -1);
    }
   
   
    {
      final Dimension d = new Dimension(1, 2);
      final H261Format f1 = new H261Format(d, 1, int[].class, 2.f, 3);
      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.getStillImageTransmission(), 3);
    }
  }
View Full Code Here


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

        "aced00057372001c6a617661782e6d656469612e666f726d61742e595556466f726d61742fa41b76f11053ca0200064900076f6666736574554900076f6666736574564900076f666673657459490008737472696465555649000773747269646559490007797576547970657872001e6a617661782e6d656469612e666f726d61742e566964656f466f726d617431e50c6e211506de0200034600096672616d655261746549000d6d6178446174614c656e6774684c000473697a657400144c6a6176612f6177742f44696d656e73696f6e3b787200126a617661782e6d656469612e466f726d61744de4dddeaaf25de70200044a000c656e636f64696e67436f64654c0003636c7a7400114c6a6176612f6c616e672f436c6173733b4c0008646174615479706571007e00044c0008656e636f64696e677400124c6a6176612f6c616e672f537472696e673b787000000000000000007671007e0000767200025b42acf317f8060854e00200007870740003797576bf800000ffffffff70ffffffffffffffffffffffffffffffffffffffffffffffff"
       
    );
   
    test(
        new H261Format(),
        "aced00057372001d6a617661782e6d656469612e666f726d61742e48323631466f726d61747ae31a05f43968130200014900167374696c6c496d6167655472616e736d697373696f6e7872001e6a617661782e6d656469612e666f726d61742e566964656f466f726d617431e50c6e211506de0200034600096672616d655261746549000d6d6178446174614c656e6774684c000473697a657400144c6a6176612f6177742f44696d656e73696f6e3b787200126a617661782e6d656469612e466f726d61744de4dddeaaf25de70200044a000c656e636f64696e67436f64654c0003636c7a7400114c6a6176612f6c616e672f436c6173733b4c0008646174615479706571007e00044c0008656e636f64696e677400124c6a6176612f6c616e672f537472696e673b787000000000000000007671007e0000767200025b42acf317f8060854e0020000787074000468323631bf800000ffffffff70ffffffff"
       
    );
   
   
View Full Code Here

    assertEquals(new JPEGFormat().toString(), "jpeg video format: dataType = class [B");
    assertEquals(new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 2, 3).toString(), "jpeg video format: size = 1x1 FrameRate = 1.0 maxDataLength = 1000 dataType = class [S q factor = 2 decimation = 3");
    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");
 
 
View Full Code Here

      assertEquals(f2.getDecimation(), f1.getDecimation());
     
    }
   
    {
      final H261Format f1 = new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1);
      final H261Format f2 = (H261Format) 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.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_H261Format()
  {
    final H261Format f1 = new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1);

    // H261Format - equal and match:
    {
      final H261Format[] f2s = new H261Format[]{
          new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1),
            (H261Format) f1.clone(),
            (H261Format) f1.intersects(f1)
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H261Format f2 = f2s[i];
        assertTrue(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertTrue(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
   
    // H261Format - not equal and not match:
    {
      final H261Format[] f2s = new H261Format[]{
          new H261Format(new Dimension(1, 2), 2000, Format.byteArray, 3.f, 1),
          new H261Format(new Dimension(1, 1), 2000, Format.intArray, 3.f, 1),
          new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1),
          new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 11),
         
                 
                 
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H261Format f2 = f2s[i];
       
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertFalse(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertFalse(f2.matches(f1));
      }
    }

    // H261Format - not equal but match:
    {
      final H261Format[] f2s = new H261Format[]{
          new H261Format(new Dimension(1, 1), 3000, Format.byteArray, 3.f, 1),
          new H261Format(null, 2000, Format.byteArray, 3.f, 1),
          new H261Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 3.f, 1),
          new H261Format(new Dimension(1, 1), 2000, null, 3.f, 1),
          new H261Format(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1),
          new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, Format.NOT_SPECIFIED),
         
                 
                   
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        H261Format 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

  public void testConstants()
  {

   
   
    assertEquals(new H261Format().getEncoding(), "h261");
    assertEquals(new H261Format().getStillImageTransmission(), Format.NOT_SPECIFIED);
    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);
View Full Code Here

TOP

Related Classes of javax.media.format.H261Format

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.