Package javax.media.format

Examples of javax.media.format.VideoFormat


    Format jpegFmt = new Format(VideoFormat.JPEG_RTP);
   
    //Format h263Fmt = new Format(VideoFormat.H263_RTP);
   
    // Setting our Dimensions within jpegFormat
    Format myFormat =new VideoFormat(null,
        new Dimension(videoWidth, videoHeight),
        Format.NOT_SPECIFIED,
        null,
        Format.NOT_SPECIFIED).intersects(jpegFmt);
   
View Full Code Here


    }

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

    public ImageSourceStream(int width, int height, int frameRate) {
     
      this.width = width;
      this.height = height;
     
      format = new VideoFormat(VideoFormat.JPEG,
        new Dimension(width, height),
        Format.NOT_SPECIFIED,
        Format.byteArray,
        (float)frameRate);
    }
View Full Code Here

      //System.out.println("No grabbed frame");
      return false;
    }

    // there is a buffer, but check if it's empty
    VideoFormat vf = (VideoFormat) buf.getFormat();
    if (vf == null) {
      //System.out.println("No video format");
      return false;
    }
View Full Code Here

        super.fire();

        if (input.hasToken(0)) {
            JMFImageToken jmfImageToken = (JMFImageToken) input.get(0);
            Buffer in = jmfImageToken.getValue();
            VideoFormat videoFormat = (VideoFormat) in.getFormat();
            YUVFormat yuvFormat = null;

            try {
                yuvFormat = (YUVFormat) videoFormat;
            } catch (ClassCastException ex) {
                throw new IllegalActionException(this, ex, "Failed to cast "
                        + videoFormat.getClass() + ":\n" + videoFormat
                        + "\nto YUVFormat\n" + "in.getFormat() was: "
                        + in.getFormat().getClass()
                        + "\nPerhaps the video source is not generating YUV?");
            }
View Full Code Here

        Logger.error("No grabbed frame");
        return false;
      }
     
      // Hay un buffer, pero se debe verificar si est� vac�o o no
      VideoFormat vf = (VideoFormat) buf.getFormat();
      if (vf == null)
        return false;

      int width  = vf.getSize().width;
      int height  = vf.getSize().height;
     
      horizontalScaleFactor  = imageResolution.width  / width;
      verticalScaleFactor    = imageResolution.height / height;
     
      bufferToImage = new BufferToImage(vf);
View Full Code Here

        Vector images) {
      this.width = width;
      this.height = height;
      this.images = images;

      format = new VideoFormat(VideoFormat.JPEG, new Dimension(width,
          height), Format.NOT_SPECIFIED, Format.byteArray,
          (float) frameRate);
    }
View Full Code Here

  }
 
  public DePacketizer() {
    System.err.println(this.getClass().getName() + " constructor called.");
    PLUGIN_NAME = "Neon MP4V RTP DePacketizer";
    inputFormats = supportedInputFormats = new VideoFormat[] { new VideoFormat(IN_ENCODING), new VideoFormat("MP4V-ES"), new VideoFormat("MP4V-ES/90000") };
    defaultOutputFormats = new VideoFormat[] { new VideoFormat(OUT_ENCODING) };
   
/*    //DEBUG
    try {
      dumpFile = new File("dump.m4v");
      packDumpFile = new File("packdump.m4v");
View Full Code Here

  public Format[] getSupportedOutputFormats(Format f) {
    System.err.println("mp4v.DePacketizer: getting for f = " + f);
    if (f == null) return defaultOutputFormats;
    else if (f.getEncoding().equalsIgnoreCase(IN_ENCODING)) {
      if (f instanceof VideoFormat) {
        VideoFormat vf = (VideoFormat)f;
        VideoFormat supOutFmt = new VideoFormat(OUT_ENCODING, vf.getSize() == null ? new Dimension(DEF_WIDTH, DEF_HEIGHT):vf.getSize(), vf.getMaxDataLength(), Format.byteArray, vf.getFrameRate());
        System.err.println("mp4v.DePacketizer: supported Output Format = " + supOutFmt);
        return new Format[] { supOutFmt };
      } else return new Format[] {new VideoFormat(OUT_ENCODING, new Dimension(DEF_WIDTH, DEF_HEIGHT), Format.NOT_SPECIFIED, Format.byteArray, Format.NOT_SPECIFIED) };
    }
    System.err.println("mp4v.DePacketizer: getSupportedOutputFormats f = " + f);
    return new Format[0];
  }
View Full Code Here

  public String getName() {
    return PLUGIN_NAME;
  }

  public Format setOutputFormat(Format f) {
    VideoFormat vf = (VideoFormat)f;
    if (!f.getEncoding().equalsIgnoreCase(OUT_ENCODING)) {
      System.err.println("mp4v.DePacketizer: setOutputFormat received unsupported encoding: " + f.getEncoding());
      return null;
    }
    System.err.println("mp4v.DePacketizer: setOutputFormat received format with size: " + vf.getSize());
    outputFormat = new VideoFormat(OUT_ENCODING, vf.getSize() == null ? new Dimension(DEF_WIDTH, DEF_HEIGHT):vf.getSize(), vf.getMaxDataLength(), Format.byteArray, vf.getFrameRate());
    return outputFormat;
  }
View Full Code Here

TOP

Related Classes of javax.media.format.VideoFormat

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.