-
-
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
LiveSource: Refine fetch for external exposed interface. #2873
LiveSource: Refine fetch for external exposed interface. #2873
Conversation
2f6ae6d
to
96c02a1
Compare
trunk/src/app/srs_app_source.hpp
Outdated
@@ -451,7 +451,7 @@ class SrsLiveSourceManager : public ISrsHourGlass | |||
public: | |||
// Get the exists source, NULL when not exists. | |||
// update the request and return the exists source. | |||
virtual SrsLiveSource* fetch(SrsRequest* r); | |||
virtual SrsLiveSource* fetch(SrsRequest* r, bool update = true); |
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 modification is the simplest, but it lacks maintainability and does not solve the fundamental problem.
Functions like fetch, which are similar to get, can never update.
Adding a parameter cannot solve this problem. Therefore, the fetch function should be separated into an API.
TRANS_BY_GPT3
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.
Remove the update
operation from fetch
and place update
in the corresponding position where the request
needs to be updated, such as in fetch_or_create
requiring an update to the request
.
TRANS_BY_GPT3
96c02a1
to
2f41775
Compare
Codecov Report
@@ Coverage Diff @@
## 4.0release #2873 +/- ##
===========================================
Coverage 60.22% 60.22%
===========================================
Files 121 121
Lines 51070 51070
===========================================
Hits 30756 30756
Misses 20314 20314 | 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_source.cpp | Continue to review full report at Codecov.
Translated to English while maintaining the markdown structure: '|
|
2f41775
to
751d8c9
Compare
751d8c9
to
82bdfda
Compare
NICE 👍 |
LiveSource's fetch function should be extended Parameters, because it update the request.