use of org.codice.alliance.libs.klv.KlvHandler in project alliance by codice.
the class MpegTsInputTransformer method extractStanag4609Metadata.
private void extractStanag4609Metadata(MetacardImpl metacard, TemporaryFileBackedOutputStream fbos) throws IOException, CatalogTransformerException {
Stanag4609Parser stanag4609Parser = stanagParserFactory.createParser(fbos.asByteSource());
Map<Integer, List<DecodedKLVMetadataPacket>> decodedMetadata;
try {
decodedMetadata = stanag4609Parser.parse();
} catch (Stanag4609ParseException e) {
throw new CatalogTransformerException("failed to extract STANAG 4609 metadata", e);
}
Map<String, KlvHandler> handlers = klvHandlerFactory.createStanag4609Handlers();
stanag4609Processor.handle(handlers, defaultKlvHandler, decodedMetadata);
KlvProcessor.Configuration klvProcessConfiguration = new KlvProcessor.Configuration();
klvProcessConfiguration.set(KlvProcessor.Configuration.SUBSAMPLE_COUNT, subsampleCount);
klvProcessConfiguration.getGeometryOperatorContext().setDistanceTolerance(distanceTolerance);
klvProcessor.process(handlers, metacard, klvProcessConfiguration);
}
Aggregations