Skip to content

Commit ac9ffc9

Browse files
author
hu
committed
Release 1.3.0 (15th March 2018)
Fixed producer intermittent termination issue for some edge cases involving re-streaming on error.
1 parent 45e6755 commit ac9ffc9

File tree

32 files changed

+1477
-342
lines changed

32 files changed

+1477
-342
lines changed

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ Please install the following additional build tools before proceeding with `./in
3636
After you've downloaded the code from GitHub, you can build it on Mac OS or Ubuntu using `./install-script` (which is inside the `kinesis-video-native-build` directory).
3737

3838
**Important** Change *current working directory* to the `kinesis-video-native-build` directory first. Then run the `./install-script` from that directory.
39-
39+
4040
This will produce the core library, the JNI library, unit tests executable and the sample GStreamer application. The script will download and build the dependent open source components in the 'downloads' directory (within `kinesis-video-native-build` directory)and link against it.
41-
41+
4242
#### Build the binaries using system versions
43-
The bulk of the install script is building the open source dependencies. The project is based on **CMake**. So the open source components building can be skipped if the system versions can be used for linking.
43+
The bulk of the install script is building the open source dependencies. The project is based on **CMake**. So the open source components building can be skipped if the system versions can be used for linking.
4444

45-
Running
45+
Running
4646

4747
```
48-
$ cmake .
48+
$ cmake .
4949
$ make
5050
```
51-
from the `kinesis-video-native-build` directory will build and link the SDK.
51+
from the `kinesis-video-native-build` directory will build and link the SDK.
5252
The `./min-install-script` inside the `kinesis-video-native-build` captures these steps for installing the Kinesis Video Streams Producer SDK with the system versions for linking.
5353

5454
#### Build the binaries using the dependent libraries from source
@@ -98,14 +98,14 @@ Many platforms come with a cert file with a lot of the well-known public certs i
9898
## Install Steps for Ubuntu 17.x using apt-get
9999
The following are the steps to install the build-time prerequisites for Ubuntu 17.x
100100

101-
Install **git**:
101+
Install **git**:
102102

103-
```
103+
```
104104
$ sudo apt-get install git
105105
$ git --version
106106
git version 2.14.1
107107
```
108-
Install **cmake**:
108+
Install **cmake**:
109109
```
110110
$ sudo apt-get install cmake
111111
$ cmake --version
@@ -125,7 +125,7 @@ Copyright (C) 2014 Free Software Foundation, Inc.
125125
This is free software; see the source for copying conditions. There is NO
126126
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
127127
```
128-
Install **automake**:
128+
Install **automake**:
129129
```
130130
$ sudo apt-get install automake
131131
$ automake --version
@@ -138,7 +138,7 @@ There is NO WARRANTY, to the extent permitted by law.
138138
Written by Tom Tromey <[email protected]>
139139
and Alexandre Duret-Lutz <[email protected]>.
140140
```
141-
Install **g++**:
141+
Install **g++**:
142142
```
143143
$ sudo apt-get install g++
144144
$ g++ --version
@@ -147,7 +147,7 @@ Copyright (C) 2017 Free Software Foundation, Inc.
147147
This is free software; see the source for copying conditions. There is NO
148148
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
149149
```
150-
Install **curl**:
150+
Install **curl**:
151151
```
152152
$ sudo apt-get install curl
153153
$ curl --version
@@ -156,13 +156,13 @@ Release-Date: 2017-08-14
156156
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
157157
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL
158158
```
159-
Install **pkg-config**:
159+
Install **pkg-config**:
160160
```
161161
$ sudo apt-get install pkg-config
162162
$ pkg-config --version
163163
0.29.1
164164
```
165-
Install **flex**:
165+
Install **flex**:
166166
```
167167
$ sudo apt-get install flex
168168
$ flex --version
@@ -179,19 +179,19 @@ Copyright (C) 2015 Free Software Foundation, Inc.
179179
This is free software; see the source for copying conditions. There is NO
180180
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
181181
```
182-
Install **Open JDK**:
182+
Install **Open JDK**:
183183
```
184184
$ sudo apt-get install openjdk-8-jdk
185185
$ java -showversion
186186
openjdk version "1.8.0_151"
187187
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12)
188188
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
189189
```
190-
Set **JAVA_HOME** environment variable:
190+
Set **JAVA_HOME** environment variable:
191191
```
192192
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
193193
```
194-
Run the build script: (within `kinesis-video-native-build` folder)
194+
Run the build script: (within `kinesis-video-native-build` folder)
195195
```
196196
./install-script
197197
```
@@ -214,10 +214,10 @@ optionally, set `AWS_SESSION_TOKEN` if integrating with temporary token and `AWS
214214
The GStreamer demo app will be built in `kinesis_video_gstreamer_sample_app` in the `kinesis-video-native-build` directory. 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.
215215

216216
```
217-
Usage: AWS_ACCESS_KEY_ID=<SAMPLEKEY> AWS_SECRET_ACCESS_KEY=<SAMPLESECRET> ./kinesis_video_gstreamer_sample_app -w <width> -h <height> -f <framerate> -b <bitrateInKBPS> <my-stream-name>
217+
Usage: AWS_ACCESS_KEY_ID=<SAMPLEKEY> AWS_SECRET_ACCESS_KEY=<SAMPLESECRET> ./kinesis_video_gstreamer_sample_app <my-stream-name> -w <width> -h <height> -f <framerate> -b <bitrateInKBPS>
218218
```
219219
* **A.** If resolution is provided then the sample will try to check if the camera supports that resolution. If it does detect that the camera can supprt the resolution supplied in command line, then streaming starts; else, it will fail with an error msg `Resolution not supported`
220-
220+
221221
* **B.** If no resolution is specified, the demo will try to use these three resolutions **1920x1080, 1280x720 and 640x480** in that order (highest resolution first) and will **start streaming** once the camera supported resolution is detected.
222222

223223
#### GStreamer RTSP demo application
@@ -240,7 +240,7 @@ Define `HEAP_DEBUG` and `LOG_STREAMING` C-defines by uncommenting the appropriat
240240

241241
#### Additional Examples
242242

243-
For additional examples on using Kinesis Video Streams Java SDK and Kinesis Video Streams Parsing Library refer:
243+
For additional examples on using Kinesis Video Streams Java SDK and Kinesis Video Streams Parsing Library refer:
244244

245245
##### [Kinesis Video Streams Producer Java SDK](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-java/blob/master/README.md)
246246
##### [Kinesis Video Streams Parser Library](https://github.com/aws/amazon-kinesis-video-streams-parser-library/blob/master/README.md)
@@ -253,15 +253,15 @@ For additional examples on using Kinesis Video Streams Java SDK and Kinesis Vid
253253
### Troubleshooting
254254

255255
##### Ubuntu builds link issues
256-
Ubuntu bulds link against the system versions of the open source component libraries or missing .so files (./start in the kinesis-video-native-build directory shows linkage against system versions of the open source libraries).We are working on providing fix but the immediate steps to remedy is to run
256+
Ubuntu bulds link against the system versions of the open source component libraries or missing .so files (./start in the kinesis-video-native-build directory shows linkage against system versions of the open source libraries).We are working on providing fix but the immediate steps to remedy is to run
257257

258258
```
259259
rm -rf ./kinesis-video-native-build/CMakeCache.txt ./kinesis-video-native-build/CMakeFiles
260-
```
261-
and run
260+
```
261+
and run
262262
```
263263
./install-script
264-
```
264+
```
265265
to rebuild and re-link the project only.
266266

267267
##### Raspberry PI failure to load the camera device.
@@ -272,7 +272,7 @@ $ls /dev/video*
272272
{not found}
273273
```
274274
```
275-
$vcgencmd get_camera
275+
$vcgencmd get_camera
276276
```
277277
Example output:
278278
```
@@ -286,7 +286,7 @@ if the driver does not detect the camera then
286286
$sudo modprobe bcm2835-v4l2
287287
```
288288
```
289-
$ls /dev/video*
289+
$ls /dev/video*
290290
{lists the device}
291291
```
292292

@@ -301,7 +301,7 @@ $ sudo reboot
301301
* Raspberry PI GStreamer assertion on gst_value_set_fraction_range_full: assertion 'gst_util_fraction_compare (numerator_start, denominator_start, numerator_end, denominator_end) < 0' failed. The uv4l service running in the background. Kill the service and restart the sample app.
302302

303303

304-
##### Raspberry PI seg fauls after some time running on `libx264.so`.
304+
##### Raspberry PI seg fauls after some time running on `libx264.so`.
305305
Rebuilding the `libx264.so` library and **re-linking the demo application** fixes the issue.
306306

307307
##### Curl SSL issue - "unable to get local issuer certificate"
@@ -322,6 +322,8 @@ make install
322322

323323

324324
## Release Notes
325+
#### Release 1.3.0 (15th March 2018)
326+
* Fixed producer intermittent termination issue for some edge cases involving re-streaming on error.
325327
#### Release 1.2.3 (1st March 2018)
326328
* Updated install-script to fix the local certificate trust issue for curl.
327329
* Added steps in README troubleshooting section for curl trust issues.

kinesis-video-native-build/install-script

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,22 @@ fi
255255
make
256256
make install
257257
fi
258-
258+
#-----------------------liby.a----------------------------
259+
if [[ $PLATFORM != 'mac' || $KERNEL_VERSION < 17 ]]; then
260+
if [ ! -f $DOWNLOADS/local/lib/liby.a ]; then
261+
echo "bison not found. Installing"
262+
if [ ! -f $DOWNLOADS/bison-2.3.tar.gz ]; then
263+
cd $DOWNLOADS
264+
curl -L "http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz" -o "bison-3.0.4.tar.xz"
265+
fi
266+
cd $DOWNLOADS
267+
tar -xvf bison-3.0.4.tar.xz
268+
cd $DOWNLOADS/bison-3.0.4
269+
./configure --prefix=$DOWNLOADS/local CFLAGS="-I$DOWNLOADS/local/include" LDFLAGS="-L$DOWNLOADS/local/lib"
270+
make
271+
make install
272+
fi
273+
fi
259274
# ----- libfl.2.dylib and libfl.2.so ---------------------
260275
if [ ! -f $DOWNLOADS/local/lib/libfl.2.dylib ]; then
261276
if [ ! -f $DOWNLOADS/local/lib/libfl.2.so ]; then
@@ -274,22 +289,6 @@ fi
274289
fi
275290
fi
276291
fi
277-
#-----------------------liby.a----------------------------
278-
if [[ $PLATFORM != 'mac' || $KERNEL_VERSION < 17 ]]; then
279-
if [ ! -f $DOWNLOADS/local/lib/liby.a ]; then
280-
echo "bison not found. Installing"
281-
if [ ! -f $DOWNLOADS/bison-2.3.tar.gz ]; then
282-
cd $DOWNLOADS
283-
curl -L "http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz" -o "bison-3.0.4.tar.xz"
284-
fi
285-
cd $DOWNLOADS
286-
tar -xvf bison-3.0.4.tar.xz
287-
cd $DOWNLOADS/bison-3.0.4
288-
./configure --prefix=$DOWNLOADS/local CFLAGS="-I$DOWNLOADS/local/include" LDFLAGS="-L$DOWNLOADS/local/lib"
289-
make
290-
make install
291-
fi
292-
fi
293292
# --------- libltdl------------------------------------------
294293
if [ ! -f $DOWNLOADS/local/lib/libltdl.7.dylib ]; then
295294
if [ ! -f $DOWNLOADS/local/lib/libltdl.7.so ]; then
@@ -612,7 +611,10 @@ export CMAKE_PREFIX_PATH="$DOWNLOADS/local"
612611
## --------- build kinesis video ---------
613612
cd $KINESIS_VIDEO_ROOT
614613
cmake CMakeLists.txt
615-
make
614+
make producer
615+
make start
616+
make kinesis_video_gstreamer_sample_app
617+
make kinesis_video_gstreamer_sample_rtsp_app
616618

617619
echo "**********************************************************"
618620
echo Success!!!

kinesis-video-native-build/min-install-script

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ fi
7171
## --------- build kinesis video ---------
7272
cd $KINESIS_VIDEO_ROOT
7373
cmake CMakeLists.txt
74-
make
74+
make producer
75+
make start
76+
make kinesis_video_gstreamer_sample_app
77+
make kinesis_video_gstreamer_sample_rtsp_app
7578

7679
echo "**********************************************************"
7780
echo Success!!!

kinesis-video-pic/src/client/include/com/amazonaws/kinesis/video/client/Include.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,21 +1257,21 @@ typedef STATUS (*StreamReadyFunc)(UINT64,
12571257
*
12581258
* @param 1 UINT64 - Custom handle passed by the caller.
12591259
* @param 2 STREAM_HANDLE - The stream to report for.
1260-
* @param 3 UINT64 - Client upload handle.
1260+
* @param 3 UPLOAD_HANDLE - Client upload handle.
12611261
*
12621262
* @return Status of the callback
12631263
*/
12641264
typedef STATUS (*StreamClosedFunc)(UINT64,
12651265
STREAM_HANDLE,
1266-
UINT64);
1266+
UPLOAD_HANDLE);
12671267

12681268
/**
12691269
* Notifies that a given stream has data available.
12701270
*
12711271
* @param 1 UINT64 - Custom handle passed by the caller.
12721272
* @param 2 STREAM_HANDLE - The stream to report for.
12731273
* @param 3 PCHAR - Stream name.
1274-
* @param 4 UINT64 - Current client stream handle passed by the caller.
1274+
* @param 4 UPLOAD_HANDLE - Current client stream upload handle passed by the caller.
12751275
* @param 5 UINT64 - The duration of content currently available in 100ns.
12761276
* @param 6 UINT64 - The size of content in bytes currently available.
12771277
*
@@ -1280,7 +1280,7 @@ typedef STATUS (*StreamClosedFunc)(UINT64,
12801280
typedef STATUS (*StreamDataAvailableFunc)(UINT64,
12811281
STREAM_HANDLE,
12821282
PCHAR,
1283-
UINT64,
1283+
UPLOAD_HANDLE,
12841284
UINT64,
12851285
UINT64);
12861286

@@ -1606,18 +1606,21 @@ PUBLIC_API STATUS stopKinesisVideoStream(STREAM_HANDLE);
16061606
PUBLIC_API STATUS putKinesisVideoFrame(STREAM_HANDLE, PFrame);
16071607

16081608
/**
1609-
* Updates the codec private data associated with the stream.
1609+
* Gets the data for the stream.
16101610
*
1611-
* NOTE: Many encoders provide CPD after they have been initialized.
1612-
* This update should happen in states other than STREAMING state.
1611+
* NOTE: The function will try to fill as much buffer as available to fill
1612+
* and will return a STATUS_NO_MORE_DATA_AVAILABLE status code. The caller
1613+
* should check the returned filled size for partially filled buffers.
16131614
*
16141615
* @param 1 STREAM_HANDLE - the stream handle.
1615-
* @param 2 UINT32 - Codec Private Data size
1616-
* @param 3 PBYTE - Codec Private Data bits.
1616+
* @param 2 PUINT64 - Client stream upload handle.
1617+
* @param 3 PBYTE - Buffer to fill in.
1618+
* @param 4 UINT32 - Size of the buffer to fill up-to.
1619+
* @param 5 PUINT32 - Actual size filled.
16171620
*
16181621
* @return Status of the function call.
16191622
*/
1620-
PUBLIC_API STATUS kinesisVideoStreamFormatChanged(STREAM_HANDLE, UINT32, PBYTE);
1623+
PUBLIC_API STATUS getKinesisVideoStreamData(STREAM_HANDLE, PUINT64, PBYTE, UINT32, PUINT32);
16211624

16221625
////////////////////////////////////////////////////
16231626
// Diagnostics functions
@@ -1722,11 +1725,11 @@ PUBLIC_API STATUS getStreamingEndpointResultEvent(UINT64, SERVICE_CALL_RESULT, P
17221725
*
17231726
* @param 1 UINT64 - the custom data passed to the callback by Kinesis Video.
17241727
* @param 2 SERVICE_CALL_RESULT - Service call result.
1725-
* @param 3 UINT64 - Client stream handle.
1728+
* @param 3 UPLOAD_HANDLE - Client stream upload handle.
17261729
*
17271730
* @return Status of the function call.
17281731
*/
1729-
PUBLIC_API STATUS putStreamResultEvent(UINT64, SERVICE_CALL_RESULT, UINT64);
1732+
PUBLIC_API STATUS putStreamResultEvent(UINT64, SERVICE_CALL_RESULT, UPLOAD_HANDLE);
17301733

17311734
/**
17321735
* Tag resource API call result event
@@ -1743,32 +1746,29 @@ PUBLIC_API STATUS tagResourceResultEvent(UINT64, SERVICE_CALL_RESULT);
17431746
////////////////////////////////////////////////////
17441747

17451748
/**
1746-
* Gets the data for the stream.
1749+
* Updates the codec private data associated with the stream.
17471750
*
1748-
* NOTE: The function will try to fill as much buffer as available to fill
1749-
* and will return a STATUS_NO_MORE_DATA_AVAILABLE status code. The caller
1750-
* should check the returned filled size for partially filled buffers.
1751+
* NOTE: Many encoders provide CPD after they have been initialized.
1752+
* This update should happen in states other than STREAMING state.
17511753
*
17521754
* @param 1 STREAM_HANDLE - the stream handle.
1753-
* @param 2 PUINT64 - Client stream handle.
1754-
* @param 3 PBYTE - Buffer to fill in
1755-
* @param 4 UINT32 - Size of the buffer to fill up-to
1756-
* @param 6 PUINT32 - Actual size filled.
1755+
* @param 2 UINT32 - Codec Private Data size
1756+
* @param 3 PBYTE - Codec Private Data bits.
17571757
*
17581758
* @return Status of the function call.
17591759
*/
1760-
PUBLIC_API STATUS getKinesisVideoStreamData(STREAM_HANDLE, PUINT64, PBYTE, UINT32, PUINT32);
1760+
PUBLIC_API STATUS kinesisVideoStreamFormatChanged(STREAM_HANDLE, UINT32, PBYTE);
17611761

17621762
/**
17631763
* Streaming has been terminated unexpectedly
17641764
*
17651765
* @param 1 STREAM_HANDLE - the stream handle.
1766-
* @param 2 UINT64 - Stream upload handle returned by the client.
1766+
* @param 2 UPLOAD_HANDLE - Stream upload handle returned by the client.
17671767
* @param 3 SERVICE_CALL_RESULT - Result returned.
17681768
*
17691769
* @return Status of the function call.
17701770
*/
1771-
PUBLIC_API STATUS kinesisVideoStreamTerminated(STREAM_HANDLE, UINT64, SERVICE_CALL_RESULT);
1771+
PUBLIC_API STATUS kinesisVideoStreamTerminated(STREAM_HANDLE, UPLOAD_HANDLE, SERVICE_CALL_RESULT);
17721772

17731773
/**
17741774
* Stream fragment ACK received.

0 commit comments

Comments
 (0)