Methods Summary |
---|
public synchronized void | close()
rtpdp = null;
|
public void | finalize()
close();
|
protected javax.media.Format | getInputFormat()
return inputFormat;
|
public java.lang.String | getName()
return "MPEG Video DePacketizer";
|
protected javax.media.Format | getOutputFormat()
return outputFormat;
|
public javax.media.Format[] | getSupportedOutputFormats(javax.media.Format in)
if (in == null)
return outputFormats;
// Make sure the input is MPEG video format
if (matches(in, inputFormats) == null)
return new Format[0];
Format out [] = new Format[1];
out[0] = makeMPEGFormat(in);
return out;
|
private final javax.media.format.VideoFormat | makeMPEGFormat(javax.media.Format in)
VideoFormat vf = (VideoFormat)in;
return new VideoFormat(VideoFormat.MPEG,
vf.getSize(),
VideoFormat.NOT_SPECIFIED,
Format.byteArray,
vf.getFrameRate());
|
public void | open()
if (inputFormat == null || outputFormat == null)
throw new ResourceUnavailableException(
"Incorrect formats set on MPEG video depacketizer");
rtpdp = new RTPDePacketizer();
|
public synchronized int | process(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)
if (isEOM(inBuffer)) {
propagateEOM(outBuffer);
return BUFFER_PROCESSED_OK;
}
if (inBuffer.isDiscard()) {
updateOutput(outBuffer, outputFormat, 0, 0);
outBuffer.setDiscard(true);
return OUTPUT_BUFFER_NOT_FILLED;
}
// if the encoding is MPEG_RTP, send this packet over to the
// depacketizer, which will do all the work for you. If the
// depacketizer has not finished constructing a frame, dont
// send it for decoding and just return. If the depacketizer
// has finished constructing an entire frame, send it to the
// decoder.
int retVal = rtpdp.process(inBuffer, outBuffer);
// return any value from the depacketizer except,
// BUFFER_PROCESSED_OK, which indicates a complete frame
// is ready for decoding
if (retVal != BUFFER_PROCESSED_OK) {
return retVal;
}
// at this time, the outBuffer contains a complete MPEG
// frame of format MPEG
// get the outputFormat from the buffer only if this is the first time.
if (outputFormat == null) {
outputFormat = (VideoFormat) outBuffer.getFormat();
}
return BUFFER_PROCESSED_OK;
|
public void | reset()
// Anything to do?
|
public javax.media.Format | setInputFormat(javax.media.Format input)
inputFormat = (VideoFormat) input;
return input;
|
public javax.media.Format | setOutputFormat(javax.media.Format output)
if (!(output instanceof VideoFormat)) return null;
outputFormat = makeMPEGFormat(output);
return output;
|