awslabs / amazon-kinesis-video-streams-pic

Apache License 2.0
49 stars 47 forks source link

Handle stop stream in streaming state #222

Open disa6302 opened 11 months ago

disa6302 commented 11 months ago

Issue #, if available:

Description of changes: When getStreamData is invoked, we have checks in place to see if the stop streaming was requested from the application. If so, we set status EOS and signal the stop() call to terminate streaming. However, these checks are limited to the UPLOAD HANDLE state being in READY state or TERMINATED state. In case of an error, if the application requests that streaming be stopped and no frames are actively being put into the buffer, and we get into the STREAMING state transition, the stop() call times out because as per the SDK, we are in active streaming state. This PR fixes the issue by including handling for the streaming state. If the stop stream is requested and there are no more frames in the buffer, we allow stop() to terminate gracefully.

Testing:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (792e0db) 80.42% compared to head (3e0f3d3) 80.42%.

:exclamation: Current head 3e0f3d3 differs from pull request most recent head 5c89a59. Consider uploading reports for the commit 5c89a59 to get more accurate results

Files Patch % Lines
src/client/src/Stream.c 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #222 +/- ## ======================================== Coverage 80.42% 80.42% ======================================== Files 52 52 Lines 10762 10770 +8 ======================================== + Hits 8655 8662 +7 - Misses 2107 2108 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.