use of org.jcodec.api.JCodecException in project ddf by codice.
the class MpegTransportStreamMetadataExtractor method getProgramAssociationTable.
private void getProgramAssociationTable(final MTSPacket packet) throws JCodecException {
final ByteBuffer payload = packet.getPayload();
final int pointer = payload.get() & 0xff;
payload.position(payload.position() + pointer);
final PATSection programAssociationTable = PATSection.parse(payload);
if (programAssociationTable == null) {
throw new JCodecException("Program association table does not exist.");
}
programMapTablePacketIdDirectory.addAll(programAssociationTable.getPrograms().values());
if (programMapTablePacketIdDirectory.isEmpty()) {
throw new JCodecException("No programs found in transport stream.");
}
}
use of org.jcodec.api.JCodecException in project BoofCV by lessthanoptimal.
the class JCodecSimplified method reset.
@Override
public void reset() {
try {
grabber = new FrameGrab(NIOUtils.readableFileChannel(new File(filename)));
} catch (IOException | JCodecException e) {
throw new RuntimeException(e);
}
try {
frameCurrent = null;
frameNext = grabber.getNativeFrame();
} catch (IOException e) {
frameNext = null;
}
}
Aggregations