-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
RTC: For #1657, support http hooks on_play/stop/publish/unpublish #2509
Conversation
Due to the special nature of WebRTC, signaling and data are two separate channels.
|
Codecov Report
@@ Coverage Diff @@
## develop #2509 +/- ##
===========================================
- Coverage 42.70% 42.64% -0.07%
===========================================
Files 102 102
Lines 36058 36117 +59
===========================================
+ Hits 15400 15401 +1
- Misses 20658 20716 +58 | Impacted Files | Coverage Δ | |' Translated to English while maintaining the markdown structure: '| Impacted Files | Coverage Δ | | Translated to English while maintaining the markdown structure: | trunk/src/app/srs_app_rtc_api.cpp | Continue to review full report at Codecov.
Translated to English while maintaining the markdown structure: |
|
Record an idea, usually there is a "start streaming" and a "stop streaming", but it seems that WebRTC doesn't pay much attention to this point. The player provided by SRS also does not provide an entry for "stop streaming". In the future, it may be considered to add a status button on the SRS playback page. In the WebRTC scenario, after "start streaming", it will check the streaming status. If the streaming is normal, the button will change to "stop streaming". Users can actively stop the WebRTC streaming through the http API (signaling).
|
@@ -379,6 +379,10 @@ SrsRtcPlayStream::SrsRtcPlayStream(SrsRtcConnection* s, const SrsContextId& cid) | |||
|
|||
SrsRtcPlayStream::~SrsRtcPlayStream() | |||
{ | |||
if (req_) { | |||
http_hooks_on_stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the issue that Guanghua mentioned before, regarding the problem of calling HTTP hooks in the destructor function.
publish' and 'play' must be called synchronously because they have authentication functionality.
unpublish' and 'stop' definitely do not require authentication, so it is possible to call them asynchronously.
Refer to ISrsAsyncCallTask
.
Calling HTTP in the destructor can lead to coroutine switching, which carries a high risk.
TRANS_BY_GPT3
No description provided.