Search in sources :

Example 1 with KlvHandler

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);
}
Also used : KlvHandler(org.codice.alliance.libs.klv.KlvHandler) Stanag4609Parser(org.codice.alliance.libs.klv.Stanag4609Parser) Stanag4609ParseException(org.codice.alliance.libs.klv.Stanag4609ParseException) List(java.util.List) CatalogTransformerException(ddf.catalog.transform.CatalogTransformerException) KlvProcessor(org.codice.alliance.libs.klv.KlvProcessor) SecurityClassificationKlvProcessor(org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)

Aggregations

CatalogTransformerException (ddf.catalog.transform.CatalogTransformerException)1 List (java.util.List)1 KlvHandler (org.codice.alliance.libs.klv.KlvHandler)1 KlvProcessor (org.codice.alliance.libs.klv.KlvProcessor)1 SecurityClassificationKlvProcessor (org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)1 Stanag4609ParseException (org.codice.alliance.libs.klv.Stanag4609ParseException)1 Stanag4609Parser (org.codice.alliance.libs.klv.Stanag4609Parser)1