Methods Summary |
---|
protected int | checkEOM(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
processAtEOM(inputBuffer,outputBuffer); // process tail of input
// this is a little tricky since we have to output two frames now:
// one to close former session, another to signle EOM
if (outputBuffer.getLength() > 0 ) {
pendingEOM=true;
return BUFFER_PROCESSED_OK | INPUT_BUFFER_NOT_CONSUMED ;
} else {
// in case we have nothing in the output, we are done
propagateEOM(outputBuffer);
return BUFFER_PROCESSED_OK;
}
|
protected boolean | checkFormat(javax.media.Format format)
return true;
|
protected boolean | checkInputBuffer(javax.media.Buffer inputBuffer)
boolean fError= !isEOM(inputBuffer) &&
(inputBuffer == null || inputBuffer.getFormat() == null ||
!checkFormat(inputBuffer.getFormat()) );
if (DEBUG)
if (fError)
System.out.println(getClass().getName()+" : [error] checkInputBuffer");
return !fError;
|
public void | close()
opened = false;
|
protected int | getArrayElementSize(java.lang.Class type)
if (type == Format.intArray)
return 4;
else if (type == Format.shortArray)
return 2;
else if (type == Format.byteArray)
return 1;
else
return 0;
|
protected javax.media.Format | getInputFormat()
return inputFormat;
|
protected javax.media.Format | getOutputFormat()
return outputFormat;
|
public javax.media.Format[] | getSupportedInputFormats()
return inputFormats;
|
protected boolean | isEOM(javax.media.Buffer inputBuffer)
return inputBuffer.isEOM();
|
public void | open()
opened = true;
|
protected int | processAtEOM(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
return 0;
|
protected void | propagateEOM(javax.media.Buffer outputBuffer)
updateOutput(outputBuffer, getOutputFormat(), 0, 0);
outputBuffer.setEOM(true);
|
public void | reset()
|
public javax.media.Format | setInputFormat(javax.media.Format input)
inputFormat = input;
return input;
|
public javax.media.Format | setOutputFormat(javax.media.Format output)
outputFormat = output;
return output;
|
protected void | updateOutput(javax.media.Buffer outputBuffer, javax.media.Format format, int length, int offset)
outputBuffer.setFormat(format);
outputBuffer.setLength(length);
outputBuffer.setOffset(offset);
|
protected javax.media.format.RGBFormat | updateRGBFormat(javax.media.format.VideoFormat newFormat, javax.media.format.RGBFormat outputFormat)
Dimension size = newFormat.getSize();
RGBFormat oldFormat = (RGBFormat) outputFormat;
int lineStride = size.width * oldFormat.getPixelStride();
RGBFormat newRGB = new RGBFormat(size,
lineStride * size.height,
oldFormat.getDataType(),
newFormat.getFrameRate(),
oldFormat.getBitsPerPixel(),
oldFormat.getRedMask(),
oldFormat.getGreenMask(),
oldFormat.getBlueMask(),
oldFormat.getPixelStride(),
lineStride,
oldFormat.getFlipped(),
oldFormat.getEndian()
);
return newRGB;
|