-
-
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
Add stream_id in the http_callback interface callback of on_publish #2838
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/gb28181 #2838 +/- ##
===================================================
- Coverage 59.86% 59.85% -0.01%
===================================================
Files 121 121
Lines 51333 51353 +20
===================================================
+ Hits 30729 30738 +9
- Misses 20604 20615 +11 | 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_edge.cpp | Translated to English while maintaining the markdown structure: | trunk/src/app/srs_app_rtc_source.hpp | Continue to review full report at Codecov.
Translated to English while maintaining the markdown structure: |
|
👍 Take matters into your own hands, and you will have enough clothing and food.
|
return srs_error_wrap(err, "rtmp: callback on publish"); | ||
} | ||
|
||
std::string stream_id = "vid-" + srs_random_str(7); |
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.
stream_id has already been generated, right? There is no need to generate it again here.
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.
According to the URL, it is better to obtain the statistic stream object and then retrieve the ID.
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.
It is better to obtain the statistic stream object based on the URL and then retrieve the ID.
I just tested it and it is possible to obtain the statistic stream object through the URL. This method is actually more reasonable. Previously, I didn't think of it because I haven't looked at the SRS source code much. I will submit a new method here, so I suggest closing this PR. Also, thank you for providing the idea.
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.
NICE 👍
@@ -825,17 +826,18 @@ srs_error_t SrsRtmpConn::publishing(SrsLiveSource* source) | |||
return srs_error_wrap(err, "rtmp: referer check"); | |||
} | |||
} | |||
|
|||
if ((err = http_hooks_on_publish()) != srs_success) { | |||
return srs_error_wrap(err, "rtmp: callback on publish"); |
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 part has been deleted, cannot be restored, and will not invoke this hook anymore?
TRANS_BY_GPT3
The changes you made are too significant. Can we refer to the handling method of server_id?
Alternatively, we can discuss other more reasonable approaches. ps:
|
Yes, it can be determined. The problem is that every time I need this stream information, I have to request the streams API to fetch the entire list, and then compare and filter out the streams that meet the criteria. I think it would be better to directly retrieve the specific information of this stream using the streams?id=streamId method.
|
Also, if multiple playback requests in gb28181 use the same app and stream, it seems that it is impossible to distinguish which specific stream.
|
#2837
Added the stream ID attribute in the on_publish callback event, currently only implemented for rtmp connection, not yet understood the process for rtc.
TRANS_BY_GPT3