Examples of YUVFormat


Examples of javax.media.format.YUVFormat

      this.biClrUsed = fCast.getClrUsed();
      this.biClrImportant = fCast.getClrImportant();
    }
    else if (format instanceof YUVFormat)
    {
      final YUVFormat fCast = (YUVFormat) format;
      if (fCast.getYuvType() == YUVFormat.YUV_420)
      {  this.fourcc = "YV12";
        this.biBitCount = 12;
      }
      else
      {
View Full Code Here

Examples of javax.media.format.YUVFormat

          );
   
    }
    else if (fourcc.equals("YV12"))
    {
      return new YUVFormat(new Dimension(biWidth, biHeight),
          biSizeImage,
          byte[].class,
          frameRate,
          YUVFormat.YUV_420,
          biWidth,  // stride y
          biWidth / 2, // stride uv
          0, // offset y
          biWidth *  biHeight + (biWidth *  biHeight) / 4, // offset u
          biWidth *  biHeight // offset v
          );
         

    }
    else if (fourcc.equals("I420"))
    {
      return new YUVFormat(new Dimension(biWidth, biHeight),
          biSizeImage,
          byte[].class,
          frameRate,
          YUVFormat.YUV_420,
          biWidth,  // stride y
View Full Code Here

Examples of javax.media.format.YUVFormat

    assertEquals(new VideoFormat(VideoFormat.CINEPAK).toString(), "CVID");
    assertEquals(new VideoFormat(VideoFormat.JPEG_RTP).toString(), "JPEG/RTP");
    assertEquals(new VideoFormat(VideoFormat.IRGB).toString(), "IRGB");
    assertEquals(new VideoFormat(VideoFormat.INDEO32).toString(), "IV32");
   
    assertEquals(new YUVFormat().toString(), "YUV Video Format: Size = null MaxDataLength = -1 DataType = class [B yuvType = -1 StrideY = -1 StrideUV = -1 OffsetY = -1 OffsetU = -1 OffsetV = -1\n");
    assertEquals(new YUVFormat(YUVFormat.YUV_111).toString(), "YUV Video Format: Size = null MaxDataLength = -1 DataType = class [B yuvType = 8 StrideY = -1 StrideUV = -1 OffsetY = -1 OffsetU = -1 OffsetV = -1\n");
    assertEquals(new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6).toString(), "YUV Video Format: Size = java.awt.Dimension[width=120,height=200] MaxDataLength = 1000 DataType = class [B yuvType = 8 StrideY = 2 StrideUV = 3 OffsetY = 4 OffsetU = 5 OffsetV = 6\n");
   
    assertEquals(new RGBFormat().toString(), "RGB, -1-bit, Masks=-1:-1:-1, PixelStride=-1, LineStride=-1");

   
    assertEquals(new JPEGFormat().toString(), "jpeg video format: dataType = class [B");
View Full Code Here

Examples of javax.media.format.YUVFormat

    }
   
   
    {
      final Format f1 = new RGBFormat(new Dimension(1, 1), 1000, Format.byteArray, 2.f, 11, 2, 13, 14, 5, 6, 17, 8);
      final Format f2 = new YUVFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6);
      assertEquals(f1.intersects(f2), null);
      assertEquals(f2.intersects(f1), null);
    }
 
  }
View Full Code Here

Examples of javax.media.format.YUVFormat

      assertEquals(f2.getSize(), null);
     
    }

    {
      final YUVFormat f1 = new YUVFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6);
      final YUVFormat f2 = (YUVFormat) 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.getOffsetU(), -1);
      assertEquals(f2.getOffsetV(), -1);
      assertEquals(f2.getOffsetY(), -1);
      assertEquals(f2.getStrideUV(), -1);
      assertEquals(f2.getStrideY(), -1);
      assertEquals(f2.getYuvType(), f1.getYuvType());
     
    }
   
    {
      final JPEGFormat f1 = new JPEGFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2);
      final JPEGFormat f2 = (JPEGFormat) 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.getQFactor(), f1.getQFactor());
      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

Examples of javax.media.format.YUVFormat

   
  }

  public void testEqualsMatches_YUVFormat()
  {
    final YUVFormat f1 =  new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6);
   
    // YUVFormat - equal and match:
    {
      final YUVFormat[] f2s = new YUVFormat[]{
            new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
            (YUVFormat) f1.clone(),
            (YUVFormat) f1.intersects(f1)
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        YUVFormat f2 = f2s[i];
       
        assertTrue(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertTrue(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
   
    // YUVFormat - not equal and not match:
    {
     
      final YUVFormat[] f2s = new YUVFormat[]{
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_411, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 12, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 13, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 14, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 15, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 16),
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        YUVFormat f2 = f2s[i];
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertFalse(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertFalse(f2.matches(f1));
      }
    }

    // YUVFormat - not equal but match:
    {
     
      final YUVFormat[] f2s = new YUVFormat[]{
          new YUVFormat(null, 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), Format.NOT_SPECIFIED, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, null, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, Format.NOT_SPECIFIED, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, Format.NOT_SPECIFIED, 3, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, Format.NOT_SPECIFIED, 4, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, Format.NOT_SPECIFIED, 5, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, Format.NOT_SPECIFIED, 6),
          new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, Format.NOT_SPECIFIED),
                 
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        YUVFormat 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

Examples of javax.media.format.YUVFormat

    assertEquals(new JPEGFormat().getDataType(), Format.byteArray);
     
    assertEquals(new RGBFormat().getEncoding(), "rgb");
    assertEquals(new RGBFormat().getDataType(), null);

    assertEquals(new YUVFormat().getEncoding(), "yuv");
    assertEquals(new YUVFormat().getOffsetV(), -1);
    assertTrue(new YUVFormat().getSize() == null);
    assertEquals(new YUVFormat().getDataType(), Format.byteArray);
   
    assertEquals(new AudioFormat(AudioFormat.DOLBYAC3).getDataType(), Format.byteArray);

  }
View Full Code Here

Examples of javax.media.format.YUVFormat

        "aced0005737200256a617661782e6d656469612e666f726d61742e496e6465786564436f6c6f72466f726d61740f95264d8c0b23a302000549000a6c696e655374726964654900076d617053697a655b000a626c756556616c7565737400025b425b000b677265656e56616c75657371007e00015b000972656456616c75657371007e00017872001e6a617661782e6d656469612e666f726d61742e566964656f466f726d617431e50c6e211506de0200034600096672616d655261746549000d6d6178446174614c656e6774684c000473697a657400144c6a6176612f6177742f44696d656e73696f6e3b787200126a617661782e6d656469612e466f726d61744de4dddeaaf25de70200044a000c656e636f64696e67436f64654c0003636c7a7400114c6a6176612f6c616e672f436c6173733b4c0008646174615479706571007e00054c0008656e636f64696e677400124c6a6176612f6c616e672f537472696e673b787000000000000000007671007e0000767200025b42acf317f8060854e002000078707400046972676240400000000007d0737200126a6176612e6177742e44696d656e73696f6e418ed9d7ac5f441402000249000668656967687449000577696474687870000000010000000100000001000000027571007e00090000000200007571007e00090000000200007571007e0009000000020000"
       
    );

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

Examples of javax.media.format.YUVFormat

        new RGBFormat(null, -1, Format.byteArray, -1.0f, 24, 0xffffffff, 0xffffffff, 0xffffffff, -1, -1, -1, -1),
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, -1, -1),
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, -1, -1),
      },
      new Format[] {
        new YUVFormat(null, -1, Format.byteArray, -1.0f, 2, -1, -1, -1, -1, -1),
      },
      PlugInManager.CODEC);
    PlugInManager.addPlugIn("com.ibm.media.codec.audio.PCMToPCM",
      new Format[] {
        new AudioFormat("LINEAR", -1.0, 16, 1, -1, -1, -1, -1.0, Format.byteArray),
View Full Code Here

Examples of javax.media.format.YUVFormat

    assertEquals(c.doCheckFormat(new Format(null)), true);
    assertEquals(c.doCheckFormat(new Format("xyz")), true);
   
    c.setInputFormat(new RGBFormat());
    assertEquals(c.doCheckFormat(null), true);
    assertEquals(c.doCheckFormat(new YUVFormat()), true);
 
 
    c.setInputFormats(new Format[]{new RGBFormat()});
    assertEquals(c.doCheckFormat(null), true);
    assertEquals(c.doCheckFormat(new YUVFormat()), true);
   
    c.setOutputFormats(new Format[]{new RGBFormat()});
    assertEquals(c.doCheckFormat(null), true);
    assertEquals(c.doCheckFormat(new YUVFormat()), true);

    c.setOutputFormat(new RGBFormat());
    assertEquals(c.doCheckFormat(null), true);
    assertEquals(c.doCheckFormat(new YUVFormat()), true);
   
    {
      final TracingFormat f = new TracingFormat("zzz");
      c.doCheckFormat(f);
      assertEquals(f.getStringBuffer().toString(), "");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.