Skip to content

Commit 211400a

Browse files
author
hu
committed
Producer time fix and install script update
1 parent 1b9703c commit 211400a

File tree

8 files changed

+22
-19
lines changed

8 files changed

+22
-19
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ $ sudo reboot
252252

253253

254254
## Release Notes
255+
### Release 1.2.1 (February 2018)
256+
* Bug fix for producer timestamp *video playback* in the console should be fixed if proper timestamp is provided to SDK. Current setting in sample app uses Gstreamer frame timecode and relative timestamp (used by SDK).
257+
* install-script is updated to automatically detect OS version and avoid dependency issue on Mac High Sierra and Ubuntu 17.10.
258+
* Known issue: Producer timestamp mode *video playback in console* will not work if GStreamer demoapp is configured to use frame timecode and absolute timestamp (used by SDK).
255259
### Release 1.2.0 (February 2018)
256260
* Bug fixes and performance enhancement
257261
* Streaming error recovery improvements

kinesis-video-gst-demo/kinesis_video_gstreamer_sample_app.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SampleCredentialProvider : public StaticCredentialProvider {
8282

8383
// Update only the expiration
8484
auto now_time = std::chrono::duration_cast<std::chrono::seconds>(
85-
std::chrono::steady_clock::now().time_since_epoch());
85+
std::chrono::system_clock::now().time_since_epoch());
8686
auto expiration_seconds = now_time + ROTATION_PERIOD;
8787
credentials.setExpiration(std::chrono::seconds(expiration_seconds.count()));
8888
LOG_INFO("New credentials expiration is " << credentials.getExpiration().count());
@@ -150,7 +150,7 @@ void create_kinesis_video_frame(Frame *frame, const nanoseconds &pts, const nano
150150
frame->flags = flags;
151151
frame->decodingTs = static_cast<UINT64>(dts.count()) / DEFAULT_TIME_UNIT_IN_NANOS;
152152
frame->presentationTs = static_cast<UINT64>(pts.count()) / DEFAULT_TIME_UNIT_IN_NANOS;
153-
frame->duration = 20 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND;
153+
frame->duration = 10 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND;
154154
frame->size = static_cast<UINT32>(len);
155155
frame->frameData = reinterpret_cast<PBYTE>(data);
156156
}
@@ -296,12 +296,12 @@ void kinesis_video_init(CustomData *data, char *stream_name) {
296296
milliseconds::zero(),
297297
seconds(2),
298298
milliseconds(1),
299-
true,
300-
true,
301-
true,
302-
true,
303-
true,
304-
true,
299+
true,//Construct a fragment at each key frame
300+
true,//Use provided frame timecode
301+
false,//Relative timecode
302+
true,//Ack on fragment is enabled
303+
true,//SDK will restart when error happens
304+
true,//recalculate_metrics
305305
0,
306306
30,
307307
4 * 1024 * 1024,

kinesis-video-gst-demo/kinesis_video_gstreamer_sample_rtsp_app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace com {
8484

8585
// Update only the expiration
8686
auto now_time = std::chrono::duration_cast<std::chrono::seconds>(
87-
std::chrono::steady_clock::now().time_since_epoch());
87+
std::chrono::system_clock::now().time_since_epoch());
8888
auto expiration_seconds = now_time + ROTATION_PERIOD;
8989
credentials.setExpiration(std::chrono::seconds(expiration_seconds.count()));
9090
LOG_INFO("New credentials expiration is " << credentials.getExpiration().count());

kinesis-video-producer/src/Auth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void CredentialProvider::getUpdatedCredentials(Credentials& credentials) {
2929

3030
void CredentialProvider::refreshCredentials(bool forceUpdate) {
3131
auto now_time = std::chrono::duration_cast<std::chrono::seconds>(
32-
std::chrono::steady_clock::now().time_since_epoch());
32+
std::chrono::system_clock::now().time_since_epoch());
3333
// update if we've exceeded the refresh interval
3434
if (now_time > next_rotation_time_ || forceUpdate) {
3535
LOG_INFO("Refreshing credentials. Force refreshing: " << forceUpdate

kinesis-video-producer/src/DefaultCallbackProvider.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ STATUS DefaultCallbackProvider::getSecurityTokenHandler(UINT64 custom_data, PBYT
6262

6363
UINT64 DefaultCallbackProvider::getCurrentTimeHandler(UINT64 custom_data) {
6464
UNUSED_PARAM(custom_data);
65-
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch())
65+
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch())
6666
.count() / DEFAULT_TIME_UNIT_IN_NANOS;
6767
}
6868

@@ -136,7 +136,7 @@ STATUS DefaultCallbackProvider::createStreamHandler(
136136

137137
// Wait for the specified amount of time before calling
138138
auto call_after_time = std::chrono::nanoseconds(service_call_ctx->callAfter * DEFAULT_TIME_UNIT_IN_NANOS);
139-
auto time_point = std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> (call_after_time);
139+
auto time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> (call_after_time);
140140
std::this_thread::sleep_until(time_point);
141141

142142
// Perform a sync call
@@ -222,7 +222,7 @@ STATUS DefaultCallbackProvider::tagResourceHandler(
222222

223223
// Wait for the specified amount of time before calling
224224
auto call_after_time = std::chrono::nanoseconds(service_call_ctx->callAfter * DEFAULT_TIME_UNIT_IN_NANOS);
225-
auto time_point = std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> (call_after_time);
225+
auto time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> (call_after_time);
226226
std::this_thread::sleep_until(time_point);
227227

228228
// Perform a sync call
@@ -285,7 +285,7 @@ STATUS DefaultCallbackProvider::describeStreamHandler(
285285

286286
// Wait for the specified amount of time before calling
287287
auto call_after_time = std::chrono::nanoseconds(service_call_ctx->callAfter * DEFAULT_TIME_UNIT_IN_NANOS);
288-
auto time_point = std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> (call_after_time);
288+
auto time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> (call_after_time);
289289
std::this_thread::sleep_until(time_point);
290290

291291
// Perform a sync call
@@ -411,7 +411,7 @@ STATUS DefaultCallbackProvider::streamingEndpointHandler(
411411

412412
// Wait for the specified amount of time before calling
413413
auto call_after_time = std::chrono::nanoseconds(service_call_ctx->callAfter * DEFAULT_TIME_UNIT_IN_NANOS);
414-
auto time_point = std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> (call_after_time);
414+
auto time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> (call_after_time);
415415
std::this_thread::sleep_until(time_point);
416416

417417
// Perform a sync call
@@ -556,7 +556,7 @@ STATUS DefaultCallbackProvider::putStreamHandler(
556556

557557
// Wait for the specified amount of time before calling
558558
auto call_after_time = std::chrono::nanoseconds(service_call_ctx->callAfter * DEFAULT_TIME_UNIT_IN_NANOS);
559-
auto time_point = std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds>(call_after_time);
559+
auto time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>(call_after_time);
560560
std::this_thread::sleep_until(time_point);
561561

562562
LOG_INFO("Creating new connection for Kinesis Video stream: " << stream_name_str);

kinesis-video-producer/src/KinesisVideoProducer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ unique_ptr<KinesisVideoProducer> KinesisVideoProducer::create(
6969
override_callbacks.clientReadyFn = KinesisVideoProducer::clientReadyFunc;
7070
override_callbacks.streamReadyFn = KinesisVideoProducer::streamReadyFunc;
7171

72-
7372
STATUS status = createKinesisVideoClient(&device_info, &override_callbacks, &client_handle);
7473
if (STATUS_FAILED(status)) {
7574
// Delete the producer on error

kinesis-video-producer/tst/ProducerApiTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PVOID ProducerTestBase::basicProducerRoutine(KinesisVideoStream* kinesis_video_s
2626
while (!stop_producer_) {
2727
// Produce frames
2828
timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(
29-
std::chrono::steady_clock::now().time_since_epoch()).count() / DEFAULT_TIME_UNIT_IN_NANOS;
29+
std::chrono::system_clock::now().time_since_epoch()).count() / DEFAULT_TIME_UNIT_IN_NANOS;
3030
frame.index = index++;
3131
frame.decodingTs = timestamp;
3232
frame.presentationTs = timestamp;

kinesis-video-producer/tst/ProducerTestFixture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class TestCredentialProvider : public StaticCredentialProvider {
9090

9191
// Update only the expiration
9292
auto now_time = std::chrono::duration_cast<std::chrono::seconds>(
93-
std::chrono::steady_clock::now().time_since_epoch());
93+
std::chrono::system_clock::now().time_since_epoch());
9494
auto expiration_seconds = now_time + ROTATION_PERIOD;
9595
credentials.setExpiration(std::chrono::seconds(expiration_seconds.count()));
9696
LOG_INFO("New credentials expiration is " << credentials.getExpiration().count());

0 commit comments

Comments
 (0)