Skip to content

Commit 04069da

Browse files
committed
Fix memory leak in kinesis_video_gstreamer_audio_video_sample_app
1 parent 149d715 commit 04069da

File tree

11 files changed

+17
-18
lines changed

11 files changed

+17
-18
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ This library is licensed under the Amazon Software License.
5050
----
5151
### Release notes
5252

53+
#### Release 1.7.9 (13th Mar 2019)
54+
* Fix memory leak in kinesis_video_gstreamer_audio_video_sample_app.
55+
5356
#### Release 1.7.8 (6th Mar 2019)
5457
* Updated CMakeLists.txt and install scripts to be able to link against libraries in default system path.
5558
* Optimization and bug fixes.

docker_native_scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Download the `Dockerfile` and `start_rtsp_in_docker.sh` into a folder. Once the
3030

3131
* Start the Kinesis Video Streams Docker container using the following command:
3232
```
33-
$ docker run -it <IMAGE_ID> <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <STREAM_NAME> <RTSP_URL>
33+
$ docker run -it <IMAGE_ID> <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <RTSP_URL> <STREAM_NAME>
3434
```
3535

3636

docker_native_scripts/start_rtsp_in_docker.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ cd /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build
66

77
# Start the demo rtsp application to send video streams
88
export LD_LIBRARY_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH
9-
AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 ./kinesis_video_gstreamer_sample_app $3 $4
9+
10+
# $3 for STREAM_NAME and $4 is RTSP_URL
11+
AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 ./kinesis_video_gstreamer_sample_app $4 $3

docker_native_scripts/windows/start_rtsp_in_docker.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ set PATH=%PATH%;C:\opt\amazon-kinesis-video-streams-producer-sdk-cpp\kinesis-vid
88
set AWS_ACCESS_KEY_ID=%1
99
set AWS_SECRET_ACCESS_KEY=%2
1010

11-
REM %3 is RTSP_URL and %4 for STREAM_NAME
12-
kinesis_video_gstreamer_sample_app.exe %3 %4
11+
REM %3 for STREAM_NAME and %4 is RTSP_URL
12+
kinesis_video_gstreamer_sample_app.exe %4 %3

docker_native_scripts/windows/windows-docker-readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ Use the **IMAGE_ID** from the output (e.g `02181afc49f9`):
2828
#### 3. Start the Docker container to run RTSP video streaming
2929
Run the Docker container to send video to Kinesis Video Streams using the following command:
3030
```
31-
> docker run -it <IMAGE_ID> <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <YOUR_STREAM_NAME> <RTSP_URL>
31+
> docker run -it <IMAGE_ID> <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <RTSP_URL> <YOUR_STREAM_NAME>
3232
```

install-instructions-linux.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,6 @@ Ubuntu bulds link against the system versions of the open source component libra
394394
```
395395
to rebuild and re-link the project only.
396396

397-
##### Certificate issues during install-script build
398-
If you see errors during the build as _curl failed with 'unable to get local issuer certificate'_ then you can either follow the resolution steps in [81](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/issues/81) or you can download the [cacert.pem](https://curl.haxx.se/ca/cacert.pem) into the `kinesis-video-native-build` folder and run
399-
`./install-script -c`.
400-
401397
##### Library not found error when running the demo application
402398
If any error similar to the following shows that the library path is not properly set:
403399
```

install-instructions-macos.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ To resolve this issue, export the LD_LIBRARY_PATH=`<full path to your sdk cpp di
258258
export LD_LIBRARY_PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH
259259
```
260260

261-
##### Certificate issues during install-script build
262-
If you see errors during the build as _curl failed with 'unable to get local issuer certificate'_ then you can either follow the resolution steps in [81](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/issues/81) or you can download the [cacert.pem](https://curl.haxx.se/ca/cacert.pem) into the `kinesis-video-native-build` folder and run
263-
`./install-script -c`.
264-
265261
##### Curl SSL issue - "unable to get local issuer certificate"
266262
If curl throws *"Peer certificate cannot be authenticated with given CA certificates: SSL certificate problem: unable to get local issuer certificate"* error while sending data to KVS, then the local `curl`
267263
was not built properly with `--with-ca-bundle` path. So please remove the curl binaries and libraries and rebuilt it again by following below steps.

kinesis-video-gst-demo/kinesis_video_gstreamer_audio_video_sample_app.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ typedef struct _CustomData {
101101
GMainLoop *main_loop;
102102
unique_ptr<KinesisVideoProducer> kinesis_video_producer;
103103
shared_ptr<KinesisVideoStream> kinesis_video_stream;
104-
vector<GstElement *> pipelines;
105104

106105
// queue elements to be linked to demuxer's sometimes pad in demux_pad_cb
107106
GstElement *video_queue, *audio_queue;
@@ -371,15 +370,16 @@ static GstFlowReturn on_new_sample(GstElement *sink, CustomData *data) {
371370
size_t buffer_size;
372371
bool delta, dropFrame;
373372
FRAME_FLAGS kinesis_video_flags;
374-
gchar *g_stream_handle_key = gst_element_get_name(sink);
375-
int track_id = (string(g_stream_handle_key).back()) - '0';
376373
uint8_t *data_buffer;
377374
Frame frame;
378375
GstFlowReturn ret = GST_FLOW_OK;
379376
STATUS curr_stream_status = data->stream_status.load();
380377
GstSegment *segment;
381378
GstClockTime buf_pts, buf_dts;
382379
gint dts_sign;
380+
gchar *g_stream_handle_key = gst_element_get_name(sink);
381+
int track_id = (string(g_stream_handle_key).back()) - '0';
382+
g_free(g_stream_handle_key);
383383

384384
if (STATUS_FAILED(curr_stream_status)) {
385385
// handle network outage in live streaming scenario
@@ -1022,6 +1022,7 @@ int gstreamer_init(int argc, char *argv[], CustomData &data) {
10221022
* Known Issue: In live streaming mode on mac. a null pointer exception from osxaudiosrc will be thrown when the
10231023
* next line is executed.
10241024
*/
1025+
gst_bus_remove_signal_watch(bus);
10251026
gst_element_set_state(pipeline, GST_STATE_NULL);
10261027
gst_object_unref(GST_OBJECT (pipeline));
10271028
g_main_loop_unref(data.main_loop);

kinesis-video-gst-demo/kinesis_video_gstreamer_sample_app.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ int gstreamer_init(int argc, char* argv[], CustomData *data) {
10141014
g_main_loop_run(data->main_loop);
10151015

10161016
/* free resources */
1017+
gst_bus_remove_signal_watch(bus);
10171018
gst_element_set_state(pipeline, GST_STATE_NULL);
10181019
gst_object_unref(pipeline);
10191020
return 0;

kinesis-video-native-build/install-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ if [ ! -f $DOWNLOADS/local/bin/yasm ]; then
477477
echo "yasm-1.3.0.tar.gz not found. Installing"
478478
if [ ! -f $DOWNLOADS/yasm-1.3.0.tar.gz ]; then
479479
cd $DOWNLOADS
480-
$SYS_CURL -L "https://github.com/yasm/yasm/archive/v1.3.0.tar.gz" -o "yasm-1.3.0.tar.gz"
480+
$SYS_CURL -L "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" -o "yasm-1.3.0.tar.gz"
481481
cd $DOWNLOADS
482482
fi
483483
cd $DOWNLOADS

0 commit comments

Comments
 (0)