Examples of VideoFormat


Examples of javax.media.format.VideoFormat

 
  final static int JPEG_QUALITY = 100;
 
    public static VideoFormat convertCodecPixelFormat(int pixFmt, int width, int height, float frameRate)
    {
      VideoFormat result = null;
      final int red, green, blue, bitsPerPixel, pixelStride, lineStride;
    final int endianess = getCpuEndianess();

      switch (pixFmt) {
        case AVCodecLibrary.PIX_FMT_RGB24:     ///< Packed RGB 8:8:8, 24bpp, RGBRGB...
View Full Code Here

Examples of javax.media.format.VideoFormat

  public Format[] getSupportedOutputFormats(Format input) {
    if (input == null)
      return new VideoFormat[] { jpegFormat };

    if(input.relax().matches(rgbFormat)) {
      final VideoFormat inputVideoFormat = (VideoFormat) input;
      return new VideoFormat[] { new JPEGFormat(inputVideoFormat.getSize(), -1, Format.byteArray, inputVideoFormat.getFrameRate(), -1, -1) };
    }
    return new Format[] {};
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

  static Hashtable imageTable = new Hashtable();
  protected int processRGBtoJPEG(Buffer input,Buffer output) {
    synchronized(imageTable) {
      try {
        RGBFormat inputFormat = (RGBFormat)input.getFormat();
        VideoFormat outputFormat = (VideoFormat)output.getFormat();
       
        if(outputFormat==null) {
          int width = inputFormat.getSize().width;
          int height = inputFormat.getSize().height;
          outputFormat = new JPEGFormat(
View Full Code Here

Examples of javax.media.format.VideoFormat

  public Format[] getSupportedOutputFormats(Format input) {
    if (input == null)
      return new VideoFormat[] { rgbFormat };
   
    if(input.relax().matches(jpegFormat)) {
      final VideoFormat inputVideoFormat = (VideoFormat) input;
      // TODO:
      return new VideoFormat[] { new RGBFormat(inputVideoFormat.getSize(), -1, Format.intArray, inputVideoFormat.getFrameRate(), 32, 0xff0000, 0xff00, 0xff)};
    }
    return new Format[] {};
  }
View Full Code Here

Examples of javax.media.format.VideoFormat

 
  static Hashtable imageTable = new Hashtable();
  protected int processJPEGtoRGB(Buffer input,Buffer output) {
    synchronized(imageTable) {
      try {
        VideoFormat inputFormat = (VideoFormat)input.getFormat();
        RGBFormat outputFormat = (RGBFormat)output.getFormat();
       
        if(outputFormat==null) {
          int width = inputFormat.getSize().width;
          int height = inputFormat.getSize().height;
          outputFormat = new RGBFormat(
              new Dimension(width,height),
              width*height,
              Format.intArray,
              inputFormat.getFrameRate(), 32,
              0xff0000, 0xff00, 0xff, //RGB masks
              1, width, //pixel stride, line stride
              RGBFormat.FALSE, RGBFormat.LITTLE_ENDIAN);
          output.setFormat(outputFormat);
        }
       
       
        byte[] b = (byte[])input.getData();
        Dimension d = inputFormat.getSize();
        BufferedImage dest = (BufferedImage)imageTable.get(d);
        if(dest==null) {
          dest = new BufferedImage(d.width,d.height,BufferedImage.TYPE_INT_RGB);
        }
        readJPEG(b, dest);
View Full Code Here

Examples of javax.media.format.VideoFormat

            // set the video capture format
            javax.media.control.FormatControl[] formatControls = ((javax.media.protocol.CaptureDevice)dataSource).getFormatControls();
            System.out.println("got format control " + formatControls[0].getClass().getName());
            System.out.println("current format is " + formatControls[0].getFormat());
            formatControls[0].setFormat(new VideoFormat(null, new Dimension(176, 144), -1, null, -1.0f));
            //formatControls[0].setFormat(new VideoFormat(null, new Dimension(352, 288), -1, null, -1.0f));
            //formatControls[0].setFormat(new VideoFormat(null, new Dimension(320, 240), -1, null, -1.0f));
            //formatControls[0].setFormat(new VideoFormat(null, new Dimension(640, 480), -1, null, -1.0f));
            System.out.println("format was set to " + formatControls[0].getFormat());
View Full Code Here

Examples of javax.media.format.VideoFormat

    {
      if ( started.getValue() )
      {
        long currentTime = System.nanoTime();
        // TODO: should always be the same as outputVideoFormat:
        final VideoFormat format = convertCivilFormat(image.getFormat());
       
        if ( null == jitterBuffer )
        {
          jitterBuffer = new RingBuffer(jitterbuflen);
          if (TRACE) logger.fine("jitterbuflen=" + jitterbuflen);
View Full Code Here

Examples of javax.media.format.VideoFormat

        if ( connected && !started.getValue() && (null != captureStream) )
        {
          final List<com.lti.civil.VideoFormat> formatList = captureStream.enumVideoFormats();
          for (int i=0; i<formatList.size(); i++)
          {
            VideoFormat videoFormat = net.sf.fmj.media.protocol.civil.DataSource.convertCivilFormat(formatList.get(i));
            if ( format.matches(videoFormat) )
            {
              captureStream.setVideoFormat(formatList.get(i));
              outputVideoFormat = videoFormat;
              break;
View Full Code Here

Examples of javax.media.format.VideoFormat

     */
    void setJPEGQuality(Player p, float val) {

  Control cs[] = p.getControls();
  QualityControl qc = null;
  VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);

  // Loop through the controls to find the Quality control for
   // the JPEG encoder.
  for (int i = 0; i < cs.length; i++) {

View Full Code Here

Examples of javax.media.format.VideoFormat

  public ImageSourceStream(int width, int height, int frameRate, 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
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.