Skip to content

Commit 31b15cc

Browse files
committed
Stability and bug fixes.
1 parent 4dfa26f commit 31b15cc

File tree

8 files changed

+32
-23
lines changed

8 files changed

+32
-23
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ This library is licensed under the Amazon Software License.
4545
----
4646
### Release notes
4747

48+
#### Release 1.7.7 (22th Feb 2019)
49+
* Stability and bug fixes.
50+
4851
#### Release 1.7.6 (21th Feb 2019)
4952
* Audio integration for Kinesis Video Stream. Now Kinesis Video Streams Producer SDK CPP supports ingesting video and audio.
5053

docker_native_scripts/raspberry-pi-docker/Dockerfile

-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ FROM resin/rpi-raspbian:stretch
33
RUN apt-get update && apt-get install -y \
44
git \
55
curl \
6-
ca-certificates-java \
7-
openjdk-8-jre \
8-
openjdk-8-jdk \
96
pkg-config \
107
cmake \
118
vim \
@@ -17,8 +14,6 @@ RUN apt-get update && apt-get install -y \
1714
python \
1815
bzip2
1916

20-
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-armhf/
21-
2217
WORKDIR /opt/
2318
RUN curl -OL https://github.com/raspberrypi/firmware/archive/1.20180417.tar.gz
2419
RUN tar xvf 1.20180417.tar.gz

install-instructions-linux.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ if your camera supports outputting h264 encoded stream directly, then you can us
303303
gst-launch-1.0 -v v4l2src device=/dev/video0 ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="my-stream-name" access-key="YourAccessKey" secret-key="YourSecretKey" alsasrc device=hw:1,0 ! audioconvert ! avenc_aac ! queue ! sink.
304304
```
305305

306-
if you get errors like `WARNING: erroneous pipeline: no element "alsasrc"`, make sure that **libasound2-dev** was installed and run the **install-script** again.
306+
if you get errors like `WARNING: erroneous pipeline: no element "alsasrc"`, make sure that **libasound2-dev** was installed, then delete `<YourSdkFolderPath>/kinesis-video-native-build/downloads/local/lib/libgstvideo-1.0.so` to trigger rebuilding gst-plugin-base and run the **install-script** again.
307307

308308
##### Running the GStreamer webcam sample application
309309
The sample application `kinesis_video_gstreamer_sample_app` in the `kinesis-video-native-build` directory uses GStreamer pipeline to get video data from the camera. Launch it with a stream name and it will start streaming from the camera. The user can also supply a streaming resolution (width and height) through command line arguments.
@@ -509,3 +509,6 @@ make clean
509509
make
510510
make install
511511
```
512+
513+
##### When `kinesis_video_gstreamer_audio_video_sample_app` failed with: `WARNING: erroneous pipeline: no element "alsasrc"`
514+
if you get errors like `WARNING: erroneous pipeline: no element "alsasrc"`, make sure that **libasound2-dev** was installed, then delete `<YourSdkFolderPath>/kinesis-video-native-build/downloads/local/lib/libgstvideo-1.0.so` to trigger rebuilding gst-plugin-base and run the **install-script** again.

kinesis-video-pic/src/client/src/Stream.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ STATUS waitForAvailability(PKinesisVideoStream pKinesisVideoStream, UINT32 alloc
13481348
ENTERS();
13491349
STATUS retStatus = STATUS_SUCCESS;
13501350
PKinesisVideoClient pKinesisVideoClient = pKinesisVideoStream->pKinesisVideoClient;
1351-
BOOL streamLocked = TRUE, availability = FALSE;
1351+
BOOL streamLocked = TRUE, availability = FALSE, bufferAvailabilityLocked = FALSE;
13521352

13531353
// Quick check if we need to do any awaiting
13541354
CHK(IS_OFFLINE_STREAMING_MODE(pKinesisVideoStream->streamInfo.streamCaps.streamingType), STATUS_SUCCESS);
@@ -1364,11 +1364,23 @@ STATUS waitForAvailability(PKinesisVideoStream pKinesisVideoStream, UINT32 alloc
13641364
pKinesisVideoClient->clientCallbacks.unlockMutexFn(pKinesisVideoClient->clientCallbacks.customData,
13651365
pKinesisVideoStream->base.lock);
13661366
streamLocked = FALSE;
1367+
1368+
// Acquire bufferAvailabilityLock before blocking
1369+
pKinesisVideoClient->clientCallbacks.lockMutexFn(pKinesisVideoClient->clientCallbacks.customData,
1370+
pKinesisVideoStream->bufferAvailabilityLock);
1371+
bufferAvailabilityLocked = TRUE;
1372+
13671373
// Long path which will await for the availability notification or cancellation
13681374
CHK_STATUS(pKinesisVideoClient->clientCallbacks.waitConditionVariableFn(pKinesisVideoClient->clientCallbacks.customData,
13691375
pKinesisVideoStream->bufferAvailabilityCondition,
13701376
pKinesisVideoStream->bufferAvailabilityLock,
13711377
MAX_BLOCKING_PUT_WAIT));
1378+
1379+
// Release bufferAvailabilityLock after been signaled.
1380+
pKinesisVideoClient->clientCallbacks.unlockMutexFn(pKinesisVideoClient->clientCallbacks.customData,
1381+
pKinesisVideoStream->bufferAvailabilityLock);
1382+
bufferAvailabilityLocked = FALSE;
1383+
13721384
// Lock the stream again in order to proceed
13731385
pKinesisVideoClient->clientCallbacks.lockMutexFn(pKinesisVideoClient->clientCallbacks.customData,
13741386
pKinesisVideoStream->base.lock);
@@ -1380,6 +1392,12 @@ STATUS waitForAvailability(PKinesisVideoStream pKinesisVideoStream, UINT32 alloc
13801392

13811393
CleanUp:
13821394

1395+
// Unlock the bufferAvailabilityLock if lockec
1396+
if (bufferAvailabilityLocked) {
1397+
pKinesisVideoClient->clientCallbacks.unlockMutexFn(pKinesisVideoClient->clientCallbacks.customData,
1398+
pKinesisVideoStream->bufferAvailabilityLock);
1399+
}
1400+
13831401
// Lock the stream again in order to proceed
13841402
if (!streamLocked) {
13851403
pKinesisVideoClient->clientCallbacks.lockMutexFn(pKinesisVideoClient->clientCallbacks.customData,

kinesis-video-producer-jni/src/include/com/amazonaws/kinesis/video/producer/jni/SyncMutex.h

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class SyncMutex
100100
// Acquire the mutex and wait on the condition variable.
101101
void wait(const char* function)
102102
{
103+
MUTEX_LOCK(mMutex);
104+
103105
UINT64 before = 0;
104106
if (mLogsEnabled)
105107
{
@@ -116,6 +118,8 @@ class SyncMutex
116118
UINT64 elapsed_ms = (after - before) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND;
117119
DLOGI("%s: waited %ldms for %s", function, elapsed_ms, mMutexDescription);
118120
}
121+
122+
MUTEX_UNLOCK(mMutex);
119123
}
120124

121125
// Signal the condition variable, allowing all blocked threads to continue.

kinesis-video-producer/src/Version.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "Version.h"
22

3-
#define AWS_SDK_KVS_PRODUCER_VERSION_STRING "1.7.6"
3+
#define AWS_SDK_KVS_PRODUCER_VERSION_STRING "1.7.7"
44

55
#if defined _WIN32 || defined _WIN64
66
#include <windows.h>

kinesis-video-producer/tst/ProducerTestFixture.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ STATUS TestStreamCallbackProvider::streamErrorReportHandler(UINT64 custom_data,
4949
if (STATUS_FAILED(ret)) {
5050
return ret;
5151
}
52-
if (status == STATUS_ACK_ERR_INVALID_MKV_DATA) {
53-
testBase->mkv_error_fragment_ts_ = errored_timecode;
54-
}
5552
testBase->setErrorStatus(status);
5653

5754
return validateCallback(custom_data);
@@ -105,15 +102,6 @@ STATUS TestStreamCallbackProvider::fragmentAckReceivedHandler(UINT64 custom_data
105102
testBase->buffering_ack_in_sequence_ = false;
106103
}
107104

108-
// clear error status if we have successfully recovered
109-
if (testBase->getErrorStatus() == STATUS_ACK_ERR_INVALID_MKV_DATA && (fragment_ack->timestamp == testBase->mkv_error_fragment_ts_)) {
110-
LOG_DEBUG("Successfully restreamed fragment " << testBase->mkv_error_fragment_ts_ << " that had INVALID_MKV_ERROR.");
111-
testBase->setErrorStatus(STATUS_SUCCESS);
112-
testBase->mkv_error_fragment_ts_ = TEST_TIMESTAMP_SENTINEL;
113-
114-
} else if (testBase->getErrorStatus() == STATUS_ACK_ERR_INVALID_MKV_DATA) {
115-
LOG_WARN("Did not restream fragment caused invalid mkv. current ack fragment timestamp: " << fragment_ack->timestamp << ", error fragment timestamp: " << testBase->mkv_error_fragment_ts_);
116-
}
117105
testBase->previous_buffering_ack_timestamp_[upload_handle] = fragment_ack->timestamp;
118106
}
119107

kinesis-video-producer/tst/ProducerTestFixture.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ class ProducerTestBase : public ::testing::Test {
193193
total_frame_count_(TEST_TOTAL_FRAME_COUNT),
194194
current_pressure_state_(OK),
195195
buffering_ack_in_sequence_(true),
196-
mkv_error_fragment_ts_(TEST_TIMESTAMP_SENTINEL),
197196
key_frame_interval_(TEST_FPS),
198197
token_rotation_seconds_(TEST_STREAMING_TOKEN_DURATION_IN_SECONDS) {
199198

@@ -237,8 +236,7 @@ class ProducerTestBase : public ::testing::Test {
237236
atomic_bool storage_overflow_;
238237
atomic_bool buffering_ack_in_sequence_;
239238
atomic_uint error_status_;
240-
map<UPLOAD_HANDLE, atomic_llong> previous_buffering_ack_timestamp_;
241-
atomic_llong mkv_error_fragment_ts_;
239+
map<UPLOAD_HANDLE, uint64_t> previous_buffering_ack_timestamp_;
242240

243241
protected:
244242

0 commit comments

Comments
 (0)