Skip to content

Commit

Permalink
Bug fix to avoid crash due to access to freed native stream object.
Browse files Browse the repository at this point in the history
  • Loading branch information
chehefen committed Mar 14, 2019
1 parent 8d7faf7 commit 8e996a5
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 90 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,30 @@ export LD_LIBRARY_PATH=/<YOUR_PRODUCER_SDK_CPP_DOWNLOAD>/amazon-kinesis-video-st
This should resolve native library loading issues.

## Release Notes
### Release 1.9.3 (12 March 2019)
* Bug fix to avoid crash due to access to freed native stream object.

### Release 1.9.2 (21 Feburary 2019)
* Bug fix for broken MKV generated due to difference between trackInfoType in Java and C layer.

### Release 1.9.1 (19 Feburary 2019)
* Bug fix for credentials not rotating issue when given credentials expire in less than 40 minutes.
* Add audio video sample to support injesting multiple track data into Kinesis Video.

### Release 1.9.0 (08 Feburary 2019)
### Release 1.9.0 (8 Feburary 2019)
* Bug fix for KinesisVideoClient.unregisterMediaSource() accessing to freed native object issue.
* Add KinesisVideoClient.freeMediaSource() clean-up function to handle async behavior.

### Release 1.8.0 (25th January 2019)
### Release 1.8.0 (25 January 2019)
* Fix duplicate stream error after unregistering media source when service call failed
* Fix inputstream not closing after stopSync issue
* Updating the name and description of Java SDK to publish in maven

### Release 1.7.0 (3rd December 2018)
### Release 1.7.0 (3 December 2018)
* Added support for uploading files(offline mode) to Kinesis Video Stream
* Additional fixes

### Release 1.6.0 (3rd December 2018)
### Release 1.6.0 (3 December 2018)
* Remove streamName parameter from KinesisVideoClient.registerMediaSource() as MediaSource already has the stream name in StreamInfo.
* Add KinesisVideoClient.unregisterMediaSource() to remove MediaSource to KinesisVideoProducerStream binding from KinesisVideoClient. Customers can use unregisterMediaSource() after they stop streaming, so MediaSource data will not to be sent to Kinesis Video Streams.
* Add getStreamInfo() to MediaSource instead of MediaSourceConfiguration. If customers have implemented their own MediaSource and MediaSourceConfiguration, they would need to provide stream information via MediaSource.getStreamInfo(). The MediaSourceConfiguration.getStreamInfo() will not work.
Expand Down Expand Up @@ -184,17 +187,17 @@ This should resolve native library loading issues.
* BlockingAckConsumer
* DefaultServiceCallbacksImpl

### Release 1.5.0 (24th August 2018)
### Release 1.5.0 (24 August 2018)
* Windows native library available for Producer SDK
* Intermittent producer support
* Per-stream customized callback support

### Release 1.3.1 (23rd July 2018)
### Release 1.3.1 (23 July 2018)

* Add reset connection function.
* Fix key frame data-flag matching issue which could cause parsing issue in decoding process.

### Release 1.3.0 (15th March 2018)
### Release 1.3.0 (15 March 2018)

* Provide pre-built KinesisVideoProducerJNI library for Mac (x64), Ubuntu (x64) and Raspian (x86).
* Remove Lombok dependency on Java Producer SDK.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-video-streams-producer-sdk-java</artifactId>
<name>Amazon Kinesis Video Streams Producer SDK Java</name>
<version>1.9.0</version>
<version>1.9.3</version>
<description>The Amazon Kinesis Video Streams Producer SDK for Java enables Java developers to ingest data into
Amazon Kinesis Video.
</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,58 +104,69 @@ KinesisVideoProducerStream createStreamSync(final @Nonnull StreamInfo streamInfo
/**
* DescribeStream result event
*
* @param customData Custom data that should be passed to the engine
* @param stream Stream object for the result event callback
* @param streamHandle Stream handle returned by PIC
* @param streamDescription Stream description object
* @param httpStatusCode HTTP status code
* @throws ProducerException
*/
void describeStreamResult(final long customData,
void describeStreamResult(final KinesisVideoProducerStream stream,
final long streamHandle,
final @Nullable StreamDescription streamDescription,
int httpStatusCode) throws ProducerException;

/**
* GetStreamingEndpoint result event
*
* @param customData Custom data that should be passed to the engine
* @param stream Stream object for the result event callback
* @param streamHandle Stream handle returned by PIC
* @param endpoint Streaming endpoint if successful
* @param httpStatusCode HTTP status code
* @throws ProducerException
*/
void getStreamingEndpointResult(final long customData, final @Nullable String endpoint,
void getStreamingEndpointResult(final KinesisVideoProducerStream stream,
final long streamHandle,
final @Nullable String endpoint,
int httpStatusCode)
throws ProducerException;

/**
* GetStreamingToken result event
*
* @param customData Custom data that should be passed to the engine
* @param stream Stream object for the result event callback
* @param streamHandle Stream handle returned by PIC
* @param token Streaming token if successful
* @param expiration Streaming token expiration in absolute time in 100ns
* @param httpStatusCode HTTP status code
* @throws ProducerException
*/
void getStreamingTokenResult(final long customData, final @Nullable byte[] token, long expiration, int httpStatusCode)
void getStreamingTokenResult(final KinesisVideoProducerStream stream,
final long streamHandle,
final @Nullable byte[] token, long expiration,
int httpStatusCode)
throws ProducerException;

/**
* PutStream result event
*
* @param customData Custom data that should be passed to the engine
* @param stream Stream object for the result event callback
* @param uploadHandle A stream upload handle identifier from the client side
* @param httpStatusCode HTTP status code
* @throws ProducerException
*/
void putStreamResult(final long customData, long uploadHandle, int httpStatusCode)
void putStreamResult(final KinesisVideoProducerStream stream, long uploadHandle, int httpStatusCode)
throws ProducerException;

/**
* TagResource result event
*
* @param customData Custom data that should be passed to the engine
* @param stream Stream object for the result event callback
* @param streamHandle Stream handle returned by PIC
* @param httpStatusCode HTTP status code
* @throws ProducerException
*/
void tagResourceResult(final long customData, int httpStatusCode)
void tagResourceResult(final KinesisVideoProducerStream stream,
final long streamHandle, int httpStatusCode)
throws ProducerException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ void createStream(final @Nonnull String deviceName,
* @param timeout - Time out for the call - 100ns
* @param authData - Authentication bits
* @param authType - Authentication type - this is the AUTH_INFO_TYPE defined in /src/client/Include.h
* @param customData - Custom data to use to call the event functions
* @param streamHandle - stream handle returned by PIC
* @param stream - stream object for the result event callback
* @throws ProducerException
*/
void describeStream(final @Nonnull String streamName,
long callAfter,
long timeout,
final @Nullable byte[] authData,
int authType,
long customData) throws ProducerException;
long streamHandle,
KinesisVideoProducerStream stream) throws ProducerException;

/**
* Schedules a call to get streaming endpoint
Expand All @@ -85,16 +87,18 @@ void describeStream(final @Nonnull String streamName,
* @param timeout - Time out for the call - 100ns
* @param authData - Authentication bits
* @param authType - Authentication type - this is the AUTH_INFO_TYPE defined in /src/client/Include.h
* @param customData - Custom data to use to call the event functions
* @param streamHandle - stream handle returned by PIC
* @param stream - stream object for the result event callback
* @throws ProducerException
*/
void getStreamingEndpoint(final @Nonnull String streamName,
final @Nonnull String apiName,
long callAfter,
long timeout,
final @Nullable byte[] authData,
int authType,
long customData) throws ProducerException;
final @Nonnull String apiName,
long callAfter,
long timeout,
final @Nullable byte[] authData,
int authType,
long streamHandle,
KinesisVideoProducerStream stream) throws ProducerException;

/**
* Schedules a call to get streaming token
Expand All @@ -103,15 +107,17 @@ void getStreamingEndpoint(final @Nonnull String streamName,
* @param timeout - Time out for the call - 100ns
* @param authData - Authentication bits
* @param authType - Authentication type - this is the AUTH_INFO_TYPE defined in /src/client/Include.h
* @param customData - Custom data to use to call the event functions
* @param streamHandle - stream handle returned by PIC
* @param stream - stream object for the result event callback
* @throws ProducerException
*/
void getStreamingToken(final @Nonnull String streamName,
long callAfter,
long timeout,
final @Nullable byte[] authData,
int authType,
long customData) throws ProducerException;
long callAfter,
long timeout,
final @Nullable byte[] authData,
int authType,
long streamHandle,
KinesisVideoProducerStream stream) throws ProducerException;

/**
* Schedules a call to put stream API
Expand All @@ -125,7 +131,7 @@ void getStreamingToken(final @Nonnull String streamName,
* @param timeout - Time out for the call - 100ns
* @param authData - Authentication bits
* @param authType - Authentication type - this is the AUTH_INFO_TYPE defined in /src/client/Include.h
* @param customData - Custom data to use to call the event functions
* @param stream - stream object for the result event callback
* @throws ProducerException
*/
void putStream(final @Nonnull String streamName,
Expand All @@ -138,7 +144,7 @@ void putStream(final @Nonnull String streamName,
long timeout,
final @Nullable byte[] authData,
int authType,
long customData) throws ProducerException;
KinesisVideoProducerStream stream) throws ProducerException;

/**
* Schedules a call to tag resource API
Expand All @@ -148,7 +154,8 @@ void putStream(final @Nonnull String streamName,
* @param timeout - Time out for the call - 100ns
* @param authData - Authentication bits
* @param authType - Authentication type - this is the AUTH_INFO_TYPE defined in /src/client/Include.h
* @param customData - Custom data to use to call the event functions
* @param streamHandle - stream handle returned by PIC
* @param stream - stream object for the result event callback
* @throws ProducerException
*/
void tagResource(final @Nonnull String resourceArn,
Expand All @@ -157,7 +164,8 @@ void tagResource(final @Nonnull String resourceArn,
long timeout,
final @Nullable byte[] authData,
int authType,
long customData) throws ProducerException;
long streamHandle,
KinesisVideoProducerStream stream) throws ProducerException;

/**
* Schedules a call to create device
Expand Down
Loading

0 comments on commit 8e996a5

Please sign in to comment.