FileDocCategorySizeDatePackage
DePacketizer.javaAPI DocJMF 2.1.1e2172Mon May 12 12:20:46 BST 2003com.sun.media.codec.audio.ulaw

DePacketizer

public class DePacketizer extends AudioCodec

Fields Summary
Constructors Summary
public DePacketizer()

	   inputFormats = new Format[] { new AudioFormat(AudioFormat.ULAW_RTP) };
    
Methods Summary
public voidclose()
Clean up

	
    
public java.lang.StringgetName()

      return "ULAW DePacketizer";
    
public javax.media.Format[]getSupportedOutputFormats(javax.media.Format in)


      if (in == null)
          return new Format[] { new AudioFormat(AudioFormat.ULAW) };

      if (matches(in, inputFormats) == null)
          return new Format[1];

      if (! (in instanceof AudioFormat) )
          return new Format[] { new AudioFormat(AudioFormat.ULAW) };

      AudioFormat af =(AudioFormat) in;
      return new Format[] {  new AudioFormat(
                AudioFormat.ULAW,
                af.getSampleRate(),
		af.getSampleSizeInBits(),
                af.getChannels())
          };
    
public voidopen()
Initializes the codec.


    
public intprocess(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
decode the buffer

	
	if (!checkInputBuffer(inputBuffer) ) {
	    return BUFFER_PROCESSED_FAILED;
	}
	
	if (isEOM(inputBuffer) ) {
	    propagateEOM(outputBuffer);
	    return BUFFER_PROCESSED_OK;
	}

	Object outData = outputBuffer.getData();
	outputBuffer.setData(inputBuffer.getData());
	inputBuffer.setData(outData);
	outputBuffer.setLength(inputBuffer.getLength());
	outputBuffer.setFormat(outputFormat);
	outputBuffer.setOffset(inputBuffer.getOffset());
	return BUFFER_PROCESSED_OK;