From 139fd2be8d03c5bc8ded090ef6327210fe113445 Mon Sep 17 00:00:00 2001 From: "Qia (Chad) Wang" Date: Mon, 10 Dec 2018 23:05:45 +0000 Subject: [PATCH] release 1.0.8 --- README.md | 8 ++++++++ pom.xml | 2 +- .../examples/ContinuousGetMediaWorker.java | 4 ++-- .../mkv/visitors/CompositeMkvElementVisitor.java | 16 ++++++---------- .../parser/utilities/FrameVisitor.java | 5 +++-- .../parser/utilities/H264FrameDecoder.java | 3 ++- .../consumer/GetMediaResponseStreamConsumer.java | 2 -- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e0aa468..f8a9fde 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,14 @@ with the AWS SDK for the Kinesis Video. This example provides examples for The Gstreamer pipeline is a toy example that demonstrates that Gstreamer can parse the mkv passed into it. ## Release Notes +### Release 1.0.8 (Dec 2018) +* Add close method for derived classes to cleanup resources. +* Add exception type which could be used in downstream frame processing logic. +* Make boolean value thread-safe in ContinuousGetMediaWorker. +* Remove extra exception wrapping in CompositeMkvElementVisitor. +* Declare exception throwing for some methods. +* Enabled stack trace in ContinuousGetMediaWorker when there is an exception. + ### Release 1.0.7 (Sep 2018) * Add flag in KinesisVideoRendererExample and KinesisVideoExample to use the existing stream (and not doing PutMedia again if it exists already). * Added support to retrieve the information from FragmentMetadata and display in the image panel during rendering. diff --git a/pom.xml b/pom.xml index 9e646de..7cbfecb 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ amazon-kinesis-video-streams-parser-library jar Amazon Kinesis Video Streams Parser Library - 1.0.8-SNAPSHOT + 1.0.8 The Amazon Kinesis Video Streams Parser Library for Java enables Java developers to parse the streams returned by GetMedia calls to Amazon Kinesis Video. diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ContinuousGetMediaWorker.java b/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ContinuousGetMediaWorker.java index 8c5d6c8..a0a062e 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ContinuousGetMediaWorker.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ContinuousGetMediaWorker.java @@ -106,10 +106,10 @@ public void run() { Thread.sleep(200); } } catch (FrameProcessException e) { - log.error("FrameProcessException in ContinuousGetMedia worker for stream {} {}", streamName, e); + log.error("FrameProcessException in ContinuousGetMedia worker for stream: " + streamName, e); break; } catch (IOException | MkvElementVisitException e) { - log.error("Failure in ContinuousGetMedia worker for stream {} {}", streamName, e); + log.error("Failure in ContinuousGetMedia worker for stream: " + streamName, e); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new RuntimeException(ie); diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CompositeMkvElementVisitor.java b/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CompositeMkvElementVisitor.java index a7a36d7..6401ce8 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CompositeMkvElementVisitor.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CompositeMkvElementVisitor.java @@ -63,17 +63,13 @@ public boolean isDone() { } private void visitAll(MkvElement element) throws MkvElementVisitException { - try { - for (MkvElementVisitor childVisitor : childVisitors) { - if (log.isDebugEnabled()) { - log.debug("Composite visitor calling {} on element {}", - childVisitor.getClass().toString(), - element.toString()); - } - element.accept(childVisitor); + for (MkvElementVisitor childVisitor : childVisitors) { + if (log.isDebugEnabled()) { + log.debug("Composite visitor calling {} on element {}", + childVisitor.getClass().toString(), + element.toString()); } - } catch (MkvElementVisitException e) { - throw new MkvElementVisitException("Composite Visitor caught exception ", e); + element.accept(childVisitor); } } } diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java index b367a6b..a9e3ef7 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java @@ -17,6 +17,7 @@ import com.amazonaws.kinesisvideo.parser.ebml.MkvTypeInfos; import com.amazonaws.kinesisvideo.parser.mkv.Frame; +import com.amazonaws.kinesisvideo.parser.mkv.FrameProcessException; import com.amazonaws.kinesisvideo.parser.mkv.MkvElementVisitor; import com.amazonaws.kinesisvideo.parser.mkv.MkvValue; import com.amazonaws.kinesisvideo.parser.mkv.visitors.CompositeMkvElementVisitor; @@ -58,13 +59,13 @@ public void close() { public interface FrameProcessor extends AutoCloseable { default void process(Frame frame, MkvTrackMetadata trackMetadata, - Optional fragmentMetadata) { + Optional fragmentMetadata) throws FrameProcessException { throw new NotImplementedException("Default FrameVisitor.FrameProcessor"); } default void process(Frame frame, MkvTrackMetadata trackMetadata, Optional fragmentMetadata, - Optional tagProcessor) { + Optional tagProcessor) throws FrameProcessException { if (tagProcessor.isPresent()) { throw new NotImplementedException("Default FrameVisitor.FrameProcessor"); } else { diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java index 7e04e9f..96d7fda 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java @@ -14,6 +14,7 @@ package com.amazonaws.kinesisvideo.parser.utilities; import com.amazonaws.kinesisvideo.parser.mkv.Frame; +import com.amazonaws.kinesisvideo.parser.mkv.FrameProcessException; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.jcodec.codecs.h264.H264Decoder; @@ -43,7 +44,7 @@ public class H264FrameDecoder implements FrameVisitor.FrameProcessor { private byte[] codecPrivateData; @Override - public void process(Frame frame, MkvTrackMetadata trackMetadata, Optional fragmentMetadata) { + public void process(Frame frame, MkvTrackMetadata trackMetadata, Optional fragmentMetadata) throws FrameProcessException { decodeH264Frame(frame, trackMetadata); } diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumer.java b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumer.java index c366331..c9ce1e4 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumer.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumer.java @@ -17,8 +17,6 @@ import com.amazonaws.kinesisvideo.parser.mkv.MkvElementVisitException; import com.amazonaws.kinesisvideo.parser.mkv.MkvElementVisitor; import com.amazonaws.kinesisvideo.parser.mkv.StreamingMkvReader; -import com.amazonaws.kinesisvideo.parser.mkv.visitors.CompositeMkvElementVisitor; -import com.amazonaws.kinesisvideo.parser.utilities.OutputSegmentMerger; import java.io.IOException; import java.io.InputStream;