Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test for PIC PR 222 #432

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMake/Dependencies/libkvspic-CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject)
# clone repo only
ExternalProject_Add(libkvspic-download
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-pic.git
GIT_TAG develop
GIT_TAG handle-stop-stream-in-streaming-state
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvspic-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvspic-build"
CMAKE_ARGS
Expand Down
26 changes: 26 additions & 0 deletions tst/ProducerFunctionalityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,32 @@ TEST_F(ProducerFunctionalityTest, dropTailFragPolicyBufferOverflowNoInvalidMkv)
EXPECT_GT(mPersistedFragmentCount, 0);
}

TEST_F(ProducerFunctionalityTest, stopStreamingSyncSuccessTestWithErrorAcks)
{
STREAM_HANDLE streamHandle = INVALID_STREAM_HANDLE_VALUE;
UINT32 i;

createDefaultProducerClient(FALSE, 60 * HUNDREDS_OF_NANOS_IN_A_SECOND, 120 * HUNDREDS_OF_NANOS_IN_A_SECOND);

// Using low fps to enforce an error ack
mFps = TEST_LOW_FPS;
mKeyFrameInterval = TEST_NORMAL_KEY_FRAME_INTERVAL;
mFrame.duration = HUNDREDS_OF_NANOS_IN_A_SECOND / mFps;

EXPECT_EQ(STATUS_SUCCESS, createTestStream(0, STREAMING_TYPE_REALTIME, TEST_MAX_STREAM_LATENCY, TEST_STREAM_BUFFER_DURATION));
streamHandle = mStreams[0];
EXPECT_TRUE(streamHandle != INVALID_STREAM_HANDLE_VALUE);

UINT64 testRunTime = GETTIME() + (45 * HUNDREDS_OF_NANOS_IN_A_SECOND);
while (GETTIME() < testRunTime && mLastError == STATUS_SUCCESS) {
EXPECT_EQ(STATUS_SUCCESS, putKinesisVideoFrame(streamHandle, &mFrame));
updateFrame();
THREAD_SLEEP(mFrame.duration);
}

EXPECT_EQ(STATUS_SUCCESS, stopKinesisVideoStreamSync(streamHandle));
EXPECT_EQ(STATUS_SUCCESS, freeKinesisVideoStream(&streamHandle));
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions tst/ProducerTestFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
#define TEST_VIDEO_TRACK_ID 1
#define TEST_AUDIO_TRACK_ID 2

#define TEST_FPS 20
#define TEST_MEDIA_DURATION_SECONDS 60
#define TEST_FPS 20
#define TEST_LOW_FPS 1
#define TEST_NORMAL_KEY_FRAME_INTERVAL 25
#define TEST_MEDIA_DURATION_SECONDS 60

// 1 minutes of frames
#define TEST_TOTAL_FRAME_COUNT (TEST_FPS * TEST_MEDIA_DURATION_SECONDS)
Expand Down
Loading