From 1e6830ec5acc7568d6df0baeec0e8406ddfb9fb0 Mon Sep 17 00:00:00 2001 From: qqia Date: Mon, 29 Apr 2019 10:38:43 -0700 Subject: [PATCH] Release 1.0.13 Adding throw FrameProcessingException to the method signature. So dependency package can throw such exception and handler properly --- README.md | 3 +++ pom.xml | 2 +- .../parser/examples/lambda/H264FrameProcessor.java | 3 ++- .../parser/utilities/H264BoundingBoxFrameRenderer.java | 3 ++- .../kinesisvideo/parser/utilities/H264FrameDecoder.java | 2 +- .../kinesisvideo/parser/utilities/H264FrameRenderer.java | 3 ++- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0abd275..800b140 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,9 @@ To run the sample follow the below steps: the new Kinesis Video stream might be delayed significantly. ## Release Notes +### Release 1.0.13 (Apr 2019) +* Fix: Make process method in H264FrameProcessor and H264FrameDecoder throw FrameProcessException. + ### Release 1.0.12 (Mar 2019) * Bugfix: Fix KinesisVideoExampleTest example issue that was using non-exist test file. * Improve KinesisVideoRekognitionLambdaExample to use AWS CloudFormation Template to create resources. diff --git a/pom.xml b/pom.xml index 9721bad..4a0a5f9 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.13-SNAPSHOT + 1.0.13 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/lambda/H264FrameProcessor.java b/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java index bf283a3..6a239d7 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java @@ -20,6 +20,7 @@ import com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory; import com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel; import com.amazonaws.kinesisvideo.parser.mkv.Frame; +import com.amazonaws.kinesisvideo.parser.mkv.FrameProcessException; import com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput; import com.amazonaws.kinesisvideo.parser.utilities.FragmentMetadata; import com.amazonaws.kinesisvideo.parser.utilities.FrameVisitor; @@ -121,7 +122,7 @@ public static H264FrameProcessor create(final AWSCredentialsProvider credentials */ @Override public void process(final Frame frame, final MkvTrackMetadata trackMetadata, - final Optional fragmentMetadata) { + final Optional fragmentMetadata) throws FrameProcessException { if (rekognizedOutputs != null) { // Decode H264 frame diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264BoundingBoxFrameRenderer.java b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264BoundingBoxFrameRenderer.java index 4e0f0c9..c1c37ec 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264BoundingBoxFrameRenderer.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264BoundingBoxFrameRenderer.java @@ -19,6 +19,7 @@ import com.amazonaws.kinesisvideo.parser.examples.KinesisVideoBoundingBoxFrameViewer; import com.amazonaws.kinesisvideo.parser.mkv.Frame; +import com.amazonaws.kinesisvideo.parser.mkv.FrameProcessException; import com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedFragmentsIndex; import com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput; import lombok.Setter; @@ -55,7 +56,7 @@ public static H264BoundingBoxFrameRenderer create(final KinesisVideoBoundingBoxF @Override public void process(final Frame frame, final MkvTrackMetadata trackMetadata, final Optional fragmentMetadata, - final Optional tagProcessor) { + final Optional tagProcessor) throws FrameProcessException { final BufferedImage bufferedImage = decodeH264Frame(frame, trackMetadata); final Optional rekognizedOutput = getRekognizedOutput(frame, fragmentMetadata); renderFrame(bufferedImage, rekognizedOutput); 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 9771e9e..af8a5e9 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java @@ -48,7 +48,7 @@ public class H264FrameDecoder implements FrameVisitor.FrameProcessor { @Override public void process(final Frame frame, final MkvTrackMetadata trackMetadata, - final Optional fragmentMetadata) { + final Optional fragmentMetadata) throws FrameProcessException { decodeH264Frame(frame, trackMetadata); } diff --git a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameRenderer.java b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameRenderer.java index 513c8cf..65e7906 100644 --- a/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameRenderer.java +++ b/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameRenderer.java @@ -18,6 +18,7 @@ import com.amazonaws.kinesisvideo.parser.examples.KinesisVideoFrameViewer; import com.amazonaws.kinesisvideo.parser.mkv.Frame; +import com.amazonaws.kinesisvideo.parser.mkv.FrameProcessException; import lombok.extern.slf4j.Slf4j; import static com.amazonaws.kinesisvideo.parser.utilities.BufferedImageUtil.addTextToImage; @@ -43,7 +44,7 @@ public static H264FrameRenderer create(KinesisVideoFrameViewer kinesisVideoFrame @Override public void process(Frame frame, MkvTrackMetadata trackMetadata, Optional fragmentMetadata, - Optional tagProcessor) { + Optional tagProcessor) throws FrameProcessException { final BufferedImage bufferedImage = decodeH264Frame(frame, trackMetadata); if (tagProcessor.isPresent()) { final FragmentMetadataVisitor.BasicMkvTagProcessor processor =