Package javax.media

Examples of javax.media.Format


  }
 
  public Format intersects(Format other)
  { 
   
    final Format result = super.intersects(other);

    if (other instanceof WavAudioFormat)
    {
      final WavAudioFormat resultCast = (WavAudioFormat) result;
     
View Full Code Here


      //FormatUtils.matches(this.codecSpecificHeader, oCast.codecSpecificHeader);

  }
  public Format intersects(Format other)
  {
    final Format result = super.intersects(other);

    if (other instanceof AviVideoFormat)
    {
      final AviVideoFormat resultCast = (AviVideoFormat) result;
     
View Full Code Here

    }
    return new Format[] {};
  }

  public int process(Buffer input, Buffer output) {
    Format inputFormat = input.getFormat();
    Format outputFormat = output.getFormat();
   
    if(inputFormat.relax().matches(rgbFormat) && outputFormat.relax().matches(jpegFormat)) {
      return processRGBtoJPEG(input,output);
    }
    return PlugIn.BUFFER_PROCESSED_FAILED;
  }
View Full Code Here

    }
    return new Format[] {};
  }

  public int process(Buffer input, Buffer output) {
    Format inputFormat = input.getFormat();
    Format outputFormat = output.getFormat();
   
    if(inputFormat.relax().matches(jpegFormat) &&
        (outputFormat==null || outputFormat.relax().matches(rgbFormat))) {
      return processJPEGtoRGB(input,output);
    }
    return PlugIn.BUFFER_PROCESSED_FAILED;
  }
View Full Code Here

 
  void test(Format f) throws ParseException
  {
    String s = FormatArgUtils.toString(f);
    //System.out.println(s);
    Format f2 = FormatArgUtils.parse(s);
    assertEquals(f, f2);
   
  }
View Full Code Here

          final boolean enabled = trackConfigs[i].enabled;
          trackControls[i].setEnabled(enabled);
         
          if (enabled)
          {  // TODO: do the conversion to Format here, so we can validate.
            Format f = trackConfigs[i].format;
            Format result = trackControls[i].setFormat(f);
            if (result == null)
            {  throw new WizardStepException("Unable to set format of track " + i + " to " + f);
             
            }
          }
View Full Code Here

    if (buffer == null || buffer.getLength() <= 0) {
      //logger.info("zero length buffer");
      return BUFFER_PROCESSED_OK;
    }

    Format format = buffer.getFormat();
    if (format instanceof VideoFormat) {
      Dimension size = ((VideoFormat) format).getSize();
      if ((size != null) && (size.width != inWidth || size.height != inHeight)) {
        inWidth = size.width;
        inHeight = size.height;
        updateScale();
      }
    }

    synchronized (syncObject) {
      Object data = buffer.getData();
      if (data == null) {
        return BUFFER_PROCESSED_FAILED;
      }

      frameArray = buffer.getData();
      if (format.getDataType() == Format.byteArray) {
        frameData = ByteBuffer.wrap((byte[]) frameArray);
      }
      else if (format.getDataType() == Format.intArray) {
        frameData = IntBuffer.wrap((int[]) frameArray);
      }
      else {
        return BUFFER_PROCESSED_FAILED;
      }
View Full Code Here

                Object[] controls = ds.getControls();
                for (int i=0; i<controls.length; i++)
                {
                    if ( controls[i] instanceof RTPControl )
                    {
                        Format format = ((RTPControl)controls[i]).getFormat();
                        System.out.println("### format=" + format);
                       
                        if ( format instanceof VideoFormat )
                        {
                            isVideo = true;
View Full Code Here

  {

    {

     
      final Format rendererInputFormat;
      final javax.media.format.AudioFormat format;
      final Buffer initialBuffer;
     
      if (codec != null)
      {

        format = (javax.media.format.AudioFormat) track.getFormat();
        logger.fine("codec input format=" + format);
       
        codec.setInputFormat(format);
        final Format[] supportedOutputFormats = codec.getSupportedOutputFormats(format);
        if (supportedOutputFormats.length == 0)
        {
          logger.warning("No supported output formats for the codec");
          return;
        }
        final Format codecOutputFormat = supportedOutputFormats[0];
        codec.setOutputFormat(codecOutputFormat);
        rendererInputFormat = codecOutputFormat;
       
        logger.fine("codecOutputFormat=" + codecOutputFormat);
 
View Full Code Here

  TrackControl tc[] = p.getTrackControls();
  VideoFormat mpgVideo = new VideoFormat(VideoFormat.MPEG);
  AudioFormat rawAudio = new AudioFormat(AudioFormat.LINEAR);

  for (int i = 0; i < tc.length; i++) {
      Format preferred = null;

      if (tc[i].getFormat().matches(mpgVideo)) {
    preferred = new VideoFormat(VideoFormat.JPEG);
      } else if (tc[i].getFormat() instanceof AudioFormat &&
         !tc[i].getFormat().matches(rawAudio)) {
    preferred = rawAudio;
      }

      if (preferred != null) {
    Format supported[] = tc[i].getSupportedFormats();
    Format selected = null;

    for (int j = 0; j < supported.length; j++) {
        if (supported[j].matches(preferred)) {
      selected = supported[j];
      break;
View Full Code Here

TOP

Related Classes of javax.media.Format

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.