final Format f = s.getFormat(); // TODO
if (f.getEncoding().equals(VideoFormat.JPEG_RTP) && f.getClass() == VideoFormat.class)
{ final VideoFormat vf = (VideoFormat) f;
final JpegRTPHeader jpegRtpHeader = input.getLength() >= JpegRTPHeader.HEADER_SIZE ? JpegRTPHeader.parse((byte[]) input.getData(), input.getOffset()) : null;
if (jpegRtpHeader== null)
{ logger.warning("Expected buffer to be large enough for JPEG RTP Header"); // TODO: we could read buffers until we get one big enough.
fullFormat = f;
}
fullFormat = new VideoFormat(vf.getEncoding(), new Dimension(jpegRtpHeader.getWidthInPixels(), jpegRtpHeader.getHeightInPixels()), vf.getMaxDataLength(), vf.getDataType(), vf.getFrameRate());
}
else
fullFormat = f; // TODO: others
logger.info("Full format: " + fullFormat);