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

Fix bugs for RTC2RTMP. #2768

Merged
merged 1 commit into from
Dec 4, 2021
Merged

Conversation

xiaozhihong
Copy link
Collaborator

  1. Cache IDR frame's rtp timestamp instead of avsync timestamp.
  2. Cache clock rate calculate by sender report.
  3. Using srs_rtp_seq_distance instead of direct minus.
  4. Add utest of av timestamp sync when duplicated sender report.

@@ -307,7 +307,7 @@ class SrsRtmpFromRtcBridger : public ISrsRtcSourceBridger
RtcPacketCache cache_video_pkts_[s_cache_size];
uint16_t header_sn_;
uint16_t lost_sn_;
int64_t key_frame_ts_;
int64_t key_frame_ts_; // RTP timestamp, no rtmp.
Copy link
Contributor

@chen-guanghua chen-guanghua Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. key_frame_ts_: The meaning expressed is the timestamp of the RTP key frame. The variable is defined as rtp_key_frame_ts_. No need to add comments, as the meaning is clear from the variable name.
  2. If additional comments are required, they can be added as a new line above the variable. Follow the same formatting as other comments. 😄

TRANS_BY_GPT3

trunk/src/app/srs_app_rtc_source.cpp Show resolved Hide resolved

// Check sys_time_elapsed is equal to zero.
if (fpclassify(sys_time_elapsed) == FP_ZERO) {
return;
Copy link
Contributor

@chen-guanghua chen-guanghua Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fpclassify was introduced in C++11. Should we consider older versions of gcc?

https://en.cppreference.com/w/cpp/numeric/math/fpclassify

TRANS_BY_GPT3

Copy link
Collaborator Author

@xiaozhihong xiaozhihong Dec 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This is a function in the standard C library, and there is also a corresponding version in std:: library.

TRANS_BY_GPT3

1. Cache IDR frame's rtp timestamp instead of avsync timestamp.
2. Cache clock rate calculate by sender report.
3. Using srs_rtp_seq_distance instead of direct minus.
4. Add utest of av timestamp sync when duplicated sender report.
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2021

Codecov Report

Merging #2768 (ea569ab) into 4.0release (bc06394) will increase coverage by 0.03%.
The diff coverage is 74.68%.

Impacted file tree graph

@@              Coverage Diff               @@
##           4.0release    #2768      +/-   ##
==============================================
+ Coverage       60.11%   60.15%   +0.03%     
==============================================
  Files             121      121              
  Lines           50896    50947      +51     
==============================================
+ Hits            30597    30648      +51     
  Misses          20299    20299              

| Impacted Files | Coverage Δ | |'

Translated to English while maintaining the markdown structure:

'| Impacted Files | Coverage Δ | |
|---|---|---|
| trunk/src/app/srs_app_rtc_source.hpp | 9.09% <ø> (ø) | |'

Translated to English while maintaining the markdown structure:

| trunk/src/app/srs_app_rtc_source.hpp | 9.09% <ø> (ø) | |
| trunk/src/app/srs_app_rtc_source.cpp | 12.47% <37.50%> (+0.24%) | ⬆️ |
| trunk/src/utest/srs_utest_rtc.cpp | 99.39% <100.00%> (+0.04%) | ⬆️ |


Continue to review full report at Codecov.

Legend - Click here to learn more
| Δ = absolute <relative> (impact), ø = not affected, ? = missing data |

Translated to English while maintaining the markdown structure:

| Δ = absolute <relative> (impact), ø = not affected, ? = missing data |

Powered by Codecov. Last update bc06394...ea569ab. Read the comment docs.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title RTC2RTMP Fix bugs for RTC2RTMP. Dec 4, 2021
@winlinvip winlinvip added this to the 4.0 milestone Dec 4, 2021
@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Dec 4, 2021
@winlinvip winlinvip merged commit f3c4023 into ossrs:4.0release Dec 4, 2021
winlinvip added a commit that referenced this pull request Dec 4, 2021
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants