Examples of VideoFormat


Examples of javax.media.format.VideoFormat

              Class dataType = t.nextDataType();
        if (dataType == null)
          dataType = Format.byteArray;  // default
              final float frameRate = t.nextFloat();
             
        return new VideoFormat(encoding, size, maxDataLength, dataType, frameRate);
      }
      else if (formatClass == RGBFormat.class)
      {
        final java.awt.Dimension size = t.nextDimension();
              final int maxDataLength = t.nextInt();
View Full Code Here

Examples of javax.media.format.VideoFormat

  private BufferToImage bufferToImage;
 
  @Override
  public Format setInputFormat(Format format)
  {
    final VideoFormat videoFormat = (VideoFormat) format;
    if (videoFormat.getSize() == null)
      return null// must set a size.
    // TODO: check VideoFormat and compatibility
    bufferToImage = new BufferToImage((VideoFormat) format);
    return super.setInputFormat(format);
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  public Format[] getSupportedInputFormats()
  {
    if (TRACE) System.out.println(getClass().getSimpleName() + " getSupportedInputFormats");
    return new Format[] {
      new AudioFormat(null, -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
      new VideoFormat(null, null, -1, Format.byteArray, -1.0f)
    };
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  public Format[] getSupportedOutputFormats(Format input)
  {
    if (input == null)
      return supportedOutputFormats;
   
    final VideoFormat inputCast = (VideoFormat) input;
    final Format[] result = new Format[] {
        new RGBFormat(inputCast.getSize(), -1, Format.byteArray, inputCast.getFrameRate(), -1, -1, -1, -1)};
    // TODO: we don't know the details of the output format (pixel masks, etc) until we actually parse one!
   
    return result;
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  }
 
  @Override
  public Format setInputFormat(Format format)
  {
    final VideoFormat videoFormat = (VideoFormat) format;
    if (videoFormat.getSize() == null)
      return null// must set a size.
    // TODO: check VideoFormat and compatibility
    return super.setInputFormat(format);
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  @Override
  public Format[] getSupportedOutputFormats(Format input)
  {
    if (input == null)
      return supportedOutputFormats;
    VideoFormat inputCast = (VideoFormat) input;
    final Format[] result = new Format[] {
        new RGBFormat(DIMENSION, -1, Format.intArray, -1.0f, -1, -1, -1, -1)};
    // TODO: we have to specify the RGB, etc. in the output format.
    return result;
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  private BufferToImage bufferToImage;
 
  @Override
  public Format setInputFormat(Format format)
  {
    final VideoFormat videoFormat = (VideoFormat) format;
    if (videoFormat.getSize() == null)
      return null// must set a size.
   
//    logger.fine("FORMAT: " + MediaCGUtils.formatToStr(format));
    // TODO: check VideoFormat and compatibility
    bufferToImage = new BufferToImage((VideoFormat) format);
View Full Code Here

Examples of javax.media.format.VideoFormat

    return createBufferedImage(buffer);
  }
 
  public BufferedImage createBufferedImage(Buffer buffer)
  { 
    final VideoFormat format;
    final int w;
    final int h;
    final Class dataType;
   
    format = (VideoFormat) buffer.getFormat();
   
    w = format.getSize().width;
    h = format.getSize().height;
    dataType = format.getDataType();
   
    if (format instanceof RGBFormat)
    {
      final RGBFormat rgbFormat = (RGBFormat) format;
      final int bitsPerPixel = rgbFormat.getBitsPerPixel();
View Full Code Here

Examples of javax.media.format.VideoFormat

   
    {
      final Buffer b1 = new Buffer();
      b1.setData(new byte[10]);
      b1.setFlags(1);
      Format f = new VideoFormat(VideoFormat.JPEG);
      b1.setFormat(f);
      assertTrue(f == b1.getFormat());
      b1.setHeader(new byte[4]);
     
      testBuffer(b1);
View Full Code Here

Examples of javax.media.format.VideoFormat

  {
   

    final MyBasicPlugIn p = new MyBasicPlugIn();
    {
      final Format in = new VideoFormat(null, null, -1, null, -1.0f);
      final Format[] outs = new Format[]{
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)
         
      };
      assertTrue(BasicPlugIn.matches(in, outs) == outs[1]);
     
      // Sun's BasicPlugIn throws an NPE in this situation.  So for now, so will FMJ's.
      try
      {
        BasicPlugIn.matches(null, outs);
        assertTrue(false);
      }
      catch (NullPointerException e)
      {
      }
    }

    {
      final Format in = new VideoFormat(null, null, -1, null, -1.0f);
      final Format[] outs = new Format[]{
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.intArray)
         
      };
      assertTrue(BasicPlugIn.matches(in, outs) == null);
    }
   
    {
      final Format in = new VideoFormat(null, null, -1, null, -1.0f);
      final Format[] outs = new Format[]{
         
         
      };
      assertTrue(BasicPlugIn.matches(in, outs) == null);
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.