Skip to content

Commit 75087f5

Browse files
committed
Release 2.0.1 (25th Jul 2019)
C-Producer - Updates Rotating file logger (small feature). Validating Stream description returned from Describe stream API call and warning if there is a mismatch. Additional tests and minor compiler warning fixes. CPP Producer - Updates Memory leak fix. Minor header include change. Test stability fix for RPi. Platform Independent Code - Updates Enabling put frame calls during async stream creation. Fixes for memory corruption on 32 bit platforms. Using PTS for file upload cases where DTS and frame durations are 0. Fix invalid error ACK timestamp mapping causing rollback/retry logic to issue a warning. Improved test coverage. More stability for RPi tests. Kinesis Video GStreamer Plugin version matching SDK version.
1 parent 5eedbb4 commit 75087f5

File tree

63 files changed

+1701
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1701
-265
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ kinesis-video-native-build/test_jpeg.mkv
1313
test-stream/
1414
*.key
1515
*.gpg
16+
cm-file

README.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,32 @@ Please follow the **installation instructions** applicable to your operating sys
6161

6262
[Kinesis Video Producer SDK CPP documentation](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-sdk-cpp.html)
6363

64+
[Kinesis Video C Producer documentation](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-sdk-c-api.html)
65+
6466
### License
6567

66-
This library is licensed under the Apache License, 2.0.
68+
This library is licensed under the Apache License, 2.0.
6769

6870
----
6971
### Release notes
7072

73+
#### Release 2.0.1 (25th Jul 2019)
74+
* C-Producer - Updates
75+
* Rotating file logger (small feature).
76+
* Validating Stream description returned from Describe stream API call and warning if there is a mismatch.
77+
* Additional tests and minor compiler warning fixes.
78+
* CPP Producer - Updates
79+
* Memory leak fix.
80+
* Minor header include change.
81+
* Test stability fix for RPi.
82+
* Platform Independent Code - Updates
83+
* Enabling put frame calls during async stream creation.
84+
* Fixes for memory corruption on 32 bit platforms.
85+
* Using PTS for file upload cases where DTS and frame durations are 0.
86+
* Fix invalid error ACK timestamp mapping causing rollback/retry logic to issue a warning.
87+
* Improved test coverage. More stability for RPi tests.
88+
* Kinesis Video GStreamer Plugin version matching SDK version.
89+
7190
#### Release 2.0.0 (9th Jul 2019)
7291
* License update: KVS SDK and GStreamer kvssink plugin are under Apache 2.0 license now.
7392
* C-Producer - New feature
@@ -87,7 +106,7 @@ This library is licensed under the Apache License, 2.0.
87106

88107
* Please note the following changes if you have customized the SDK for your integration and not using samples directly.
89108
* Changes to utility functions:
90-
* RotatingStaticCredentialProvider is removed from C++ producer. Customer can use StaticCredentialProvider instead.
109+
* RotatingStaticCredentialProvider is removed from C++ producer. Customer can use StaticCredentialProvider instead.
91110
* CredentialProviderUtil and SerializedCredentials are removed from C++ producer.
92111
* Following functions are removed from DefaultCallbackProvider: sleepUntilWithTimeCallback, shutdownStream, notifyResult, getControlPlaneUri, safeFreeBuffer, getStreamStatusFromString.
93112
* Changes to the object model:

docker_native_scripts/raspberry-pi-docker/Dockerfile

+16-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ RUN apt-get update && apt-get install -y \
66
pkg-config \
77
cmake \
88
vim \
9-
binutils \
109
make \
1110
openssh-server \
1211
gcc \
1312
g++ \
14-
python \
15-
bzip2
13+
bzip2 \
14+
libssl-dev \
15+
libcurl4-openssl-dev \
16+
liblog4cplus-dev \
17+
libgstreamer1.0-dev \
18+
libgstreamer-plugins-base1.0-dev \
19+
gstreamer1.0-plugins-base-apps \
20+
gstreamer1.0-plugins-bad \
21+
gstreamer1.0-plugins-good \
22+
gstreamer1.0-plugins-ugly \
23+
gstreamer1.0-tools \
24+
gstreamer1.0-omx
25+
1626

1727
WORKDIR /opt/
1828
RUN curl -OL https://github.com/raspberrypi/firmware/archive/1.20180417.tar.gz
@@ -36,9 +46,8 @@ RUN ln -s /opt/vc/lib/libopenmaxil.so /usr/lib/libopenmaxil.so && \
3646
WORKDIR /opt/
3747
RUN git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp
3848
WORKDIR /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/
39-
RUN chmod a+x install-script
40-
RUN ./install-script -j 4 -d
49+
RUN chmod a+x min-install-script
50+
RUN ./min-install-script
4151

4252
WORKDIR /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/
43-
ENV PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/bin:$PATH
44-
ENV GST_PLUGIN_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$GST_PLUGIN_PATH
53+
ENV GST_PLUGIN_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/:$GST_PLUGIN_PATH

docker_native_scripts/raspberry-pi-docker/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ Follow the next few steps to start Producer SDK GStreamer plugin element for sen
5656

5757
##### 4.1 Set these environment variable:
5858

59-
`export LD_LIBRARY_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH`
60-
61-
`export PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/bin:$PATH`
62-
6359
`export GST_PLUGIN_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$GST_PLUGIN_PATH`
6460

6561

install-instructions-linux.md

+15
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,21 @@ Refer sample configuration in the folder `kinesis-video-native-build` for detail
381381
By default, the log configuration `log4cplus.rootLogger=DEBUG, KvsConsoleAppender` creates console appender (KvsConsoleAppender) which outputs the log messages in the console.
382382
* Log output messages to file: By adding file appender (KvsFileAppender) in the _rootLogger_ of log4cplus as `log4cplus.rootLogger=DEBUG, KvsConsoleAppender, KvsFileAppender` the debug messages will be stored in `kvs.log` file in the sub-folder `log` within `kinesis-video-native-build` directory. The filename for the logs and the location can be modified by changing the line ` log4cplus.appender.KvsFileAppender.File=./log/kvs.log`
383383

384+
----
385+
##### How to enable saving c producer log into files.
386+
387+
By default C producer prints all logging information to stdout.
388+
389+
To send log information to a file (named kvsProducerLog.index), you need to use the addFileLoggerPlatformCallbacksProvider API after ClientCallbacks has been initialized.
390+
391+
The addFileLoggerPlatformCallbacksProvider API takes five parameters.
392+
393+
* First parameter is the PClientCallbacks that is created during the createCallback provider API (e.g.createDefaultCallbacksProviderWithAuthCallbacks.
394+
* Second parameter is the size of string buffer that file logger will use. Logs are buffered in the string buffer and flushed into files when the buffer is full.
395+
* Third parameter is the maximum number of files that file logger will generate. When the limit is reached, oldest log file will be deleted before creating the new one.
396+
* Fourth parameter is the absolute directory path to store the log file.
397+
* Fifth parameter uses boolean true or false and is used to allow printing logs to both stdout and a file (useful in debugging).
398+
384399
----
385400

386401
### Open Source Dependencies

install-instructions-macos.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ AWS_ACCESS_KEY_ID=YourAccessKeyId AWS_SECRET_ACCESS_KEY=YourSecretAccessKey ./ki
219219
##### Using Docker to run the sample application
220220
Refer the **README.md** file in the *docker_native_scripts* folder for running the build and **RTSP sample application** to start streaming from **IP camera** within Docker container.
221221

222-
### How to run sample applications for sending H264 video files to KVS
223-
222+
### How to run sample applications for sending H264 video files to KVS
223+
224224
The sample application `kinesis_video_cproducer_video_only_sample` sends h264 video frames inside the folder `kinesis-video-c-producer/samples/h264SampleFrames` to KVS.
225-
The following command sends the video frames in a loop for ten seconds to KVS.
225+
The following command sends the video frames in a loop for ten seconds to KVS.
226226
you can run `./kinesis_video_cproducer_video_only_sample YourStreamName 10`
227227
`./kinesis_video_cproducer_video_only_sample YourStreamName 10`
228-
228+
229229
If you want to send H264 files from another folder (`MyH264FramesFolder`) you can run the sample with the following arguments
230230
`./kinesis_video_cproducer_video_only_sample YourStreamName 10 MyH264FramesFolder`
231231

@@ -240,17 +240,17 @@ For additional examples on using Kinesis Video Streams Java SDK and Kinesis Vid
240240

241241
##### Running C++ Unit tests
242242

243-
**Note:** Please set the [credentials](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/install-instructions-macos.md#setting-credentials-in-environment-variables) before running the unit tests.
243+
**Note:** Please set the [credentials](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/install-instructions-macos.md#setting-credentials-in-environment-variables) before running the unit tests.
244244

245245
The executable for **unit tests** will be built as `./producer_test` inside the `kinesis-video-native-build` directory. Launch it and it will run the unit test and kick off dummy frame streaming.
246246

247247
##### Running C unit tests
248248

249-
The executable for **unit tests** will be built as `./cproducer_test` inside the `kinesis-video-native-build` directory.
249+
The executable for **unit tests** will be built as `./cproducer_test` inside the `kinesis-video-native-build` directory.
250250

251251
##### Running PIC unit tests
252252

253-
The executable for **unit tests** will be built as `./pic_test` inside the `kinesis-video-native-build` directory.
253+
The executable for **unit tests** will be built as `./pic_test` inside the `kinesis-video-native-build` directory.
254254

255255

256256
##### Enabling verbose logs
@@ -266,6 +266,22 @@ Refer sample configuration in the folder `kinesis-video-native-build` for detail
266266
By default, the log configuration `log4cplus.rootLogger=DEBUG, KvsConsoleAppender` creates console appender (KvsConsoleAppender) which outputs the log messages in the console.
267267
* Log output messages to file: By adding file appender (KvsFileAppender) in the _rootLogger_ of log4cplus as `log4cplus.rootLogger=DEBUG, KvsConsoleAppender, KvsFileAppender` the debug messages will be stored in `kvs.log` file in the sub-folder `log` within `kinesis-video-native-build` directory. The filename for the logs and the location can be modified by changing the line `log4cplus.appender.KvsFileAppender.File=./log/kvs.log`
268268

269+
----
270+
##### How to enable saving c producer log into files.
271+
272+
By default C producer prints all logging information to stdout.
273+
274+
To send log information to a file (named kvsProducerLog.index), you need to use the addFileLoggerPlatformCallbacksProvider API after ClientCallbacks has been initialized.
275+
276+
The addFileLoggerPlatformCallbacksProvider API takes five parameters.
277+
278+
* First parameter is the PClientCallbacks that is created during the createCallback provider API (e.g.createDefaultCallbacksProviderWithAuthCallbacks.
279+
* Second parameter is the size of string buffer that file logger will use. Logs are buffered in the string buffer and flushed into files when the buffer is full.
280+
* Third parameter is the maximum number of files that file logger will generate. When the limit is reached, oldest log file will be deleted before creating the new one.
281+
* Fourth parameter is the absolute directory path to store the log file.
282+
* Fifth parameter uses boolean true or false and is used to allow printing logs to both stdout and a file (useful in debugging).
283+
284+
269285
----
270286
#### Troubleshooting:
271287

install-instructions-windows-msys2.md

+25
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,28 @@ gst-launch-1.0 -v ksvideosrc ! videoconvert ! x264enc bframes=0 key-int-max=45 b
183183
```
184184
gst-launch-1.0 -v ksvideosrc ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name=stream-name access-key=YOUR_ACCESS_KEY secret-key=YOUR_SECRET_ACCESS_KEY_ID wasapisrc device="\{0.0.1.00000000\}.\{f1245929-0c97-4389-9c28-1ca9cb01576b\}" ! audioconvert ! avenc_aac ! queue ! sink.
185185
```
186+
187+
----
188+
##### How to configure logging for producer SDK sample applications.
189+
190+
For the sample applications included in the producer SDK (CPP), the log configuration is referred from the file `kvs_log_configuration` (within the `kinesis-video-native-build` folder).
191+
192+
Refer sample configuration in the folder `kinesis-video-native-build` for details on how to set the log level (DEBUG or INFO) and output options (whether to send log output to either console or file (or both)).
193+
* Log output messages to console:
194+
By default, the log configuration `log4cplus.rootLogger=DEBUG, KvsConsoleAppender` creates console appender (KvsConsoleAppender) which outputs the log messages in the console.
195+
* Log output messages to file: By adding file appender (KvsFileAppender) in the _rootLogger_ of log4cplus as `log4cplus.rootLogger=DEBUG, KvsConsoleAppender, KvsFileAppender` the debug messages will be stored in `kvs.log` file in the sub-folder `log` within `kinesis-video-native-build` directory. The filename for the logs and the location can be modified by changing the line `log4cplus.appender.KvsFileAppender.File=./log/kvs.log`
196+
197+
----
198+
##### How to enable saving c producer log into files.
199+
200+
By default C producer prints all logging information to stdout.
201+
202+
To send log information to a file (named kvsProducerLog.index), you need to use the addFileLoggerPlatformCallbacksProvider API after ClientCallbacks has been initialized.
203+
204+
The addFileLoggerPlatformCallbacksProvider API takes five parameters.
205+
206+
* First parameter is the PClientCallbacks that is created during the createCallback provider API (e.g.createDefaultCallbacksProviderWithAuthCallbacks.
207+
* Second parameter is the size of string buffer that file logger will use. Logs are buffered in the string buffer and flushed into files when the buffer is full.
208+
* Third parameter is the maximum number of files that file logger will generate. When the limit is reached, oldest log file will be deleted before creating the new one.
209+
* Fourth parameter is the absolute directory path to store the log file.
210+
* Fifth parameter uses boolean true or false and is used to allow printing logs to both stdout and a file (useful in debugging).

kinesis-video-c-producer/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ else()
159159
${KINESIS_VIDEO_PRODUCER_C_SRC}/src/source/StreamErrorReportStateMachine.c
160160
${KINESIS_VIDEO_PRODUCER_C_SRC}/src/source/StreamLatencyStateMachine.c
161161
${KINESIS_VIDEO_PRODUCER_C_SRC}/src/source/StreamCallbacksProvider.c
162+
${KINESIS_VIDEO_PRODUCER_C_SRC}/src/source/FileLoggerPlatformCallbackProvider.c
162163
${KINESIS_VIDEO_PRODUCER_C_SRC}/src/source/Version.c)
163164

164165
include_directories(${KINESIS_VIDEO_PIC_SRC}/src/client/include)

kinesis-video-c-producer/src/include/com/amazonaws/kinesis/video/cproducer/Include.h

+15
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extern "C" {
5050
#define STATUS_DUPLICATE_STREAM_CALLBACK_FREE_FUNC STATUS_PRODUCER_BASE + 0x0000001a
5151
#define STATUS_DUPLICATE_AUTH_CALLBACK_FREE_FUNC STATUS_PRODUCER_BASE + 0x0000001b
5252
#define STATUS_DUPLICATE_API_CALLBACK_FREE_FUNC STATUS_PRODUCER_BASE + 0x0000001c
53+
#define STATUS_FILE_LOGGER_INDEX_FILE_TOO_LARGE STATUS_PRODUCER_BASE + 0x0000001d
5354

5455

5556
/**
@@ -805,6 +806,20 @@ PUBLIC_API STATUS freeContinuousRetryStreamCallbacks(PStreamCallbacks*);
805806
*/
806807
PUBLIC_API STATUS createAbstractDefaultCallbacksProvider(UINT32, BOOL, UINT64, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PClientCallbacks*);
807808

809+
/**
810+
* Use file logger instead of default logger which log to stdout. The underlying objects are automatically freed
811+
* when PClientCallbacks is freed.
812+
*
813+
* @param - PClientCallbacks - IN - The callback provider whose logPrintFn will be replaced with file logger log printing function
814+
* @param - UINT64 - IN - Size of string buffer in file logger. When the string buffer is full the logger will flush everything into a new file
815+
* @param - UINT64 - IN - Max number of log file. When exceeded, the oldest file will be deleted when new one is generated
816+
* @param - PCHAR - IN - Directory in which the log file will be generated
817+
* @param - BOOL - IN - print log to std out too
818+
*
819+
* @return - STATUS code of the execution
820+
*/
821+
PUBLIC_API STATUS addFileLoggerPlatformCallbacksProvider(PClientCallbacks, UINT64, UINT64, PCHAR, BOOL);
822+
808823
#pragma pack(pop, include)
809824

810825
#ifdef __cplusplus

kinesis-video-c-producer/src/source/AwsV4Signer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ STATUS signCurlRequest(PCurlRequest pCurlRequest)
9494
hmac, &hmacSize));
9595

9696
// Increment the curSize to account for the NULL terminator that's required by the hex encoder
97-
hexHmacLen = SIZEOF(hexHmac) / SIZEOF(CHAR);
97+
hexHmacLen = ARRAY_SIZE(hexHmac);
9898
CHK_STATUS(hexEncodeCase(hmac, hmacSize, hexHmac, &hexHmacLen, FALSE));
9999

100100
// set the auth header

kinesis-video-c-producer/src/source/ContinuousRetryStreamCallbacks.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ STATUS createContinuousRetryStreamCallbacks(PClientCallbacks pCallbacksProvider,
2525
pContinuousRetryStreamCallbacks->pCallbacksProvider = (PCallbacksProvider) pCallbacksProvider;
2626

2727
// Create the mapping table
28-
CHK_STATUS(hashTableCreate(&pContinuousRetryStreamCallbacks->pStreamMapping));
28+
CHK_STATUS(hashTableCreateWithParams(STREAM_MAPPING_HASH_TABLE_BUCKET_COUNT, STREAM_MAPPING_HASH_TABLE_BUCKET_LENGTH, &pContinuousRetryStreamCallbacks->pStreamMapping));
2929

3030
// Create the guard locks
3131
pContinuousRetryStreamCallbacks->mappingLock = pContinuousRetryStreamCallbacks->pCallbacksProvider->clientCallbacks.createMutexFn(

0 commit comments

Comments
 (0)