-
-
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
For #1637, #307, make webrtc audio work #1659
Conversation
} | ||
|
||
if (stream) { | ||
rtp_opus_muxer->frame_to_packet(shared_audio, format, stream); |
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 function returns an error without checking the error code, which can cause unknown behavior.
TRANS_BY_GPT3
|
||
rtp_opus_muxer = new SrsRtpOpusMuxer(); | ||
if (rtp_opus_muxer) { | ||
rtp_opus_muxer->initialize(); |
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 function returns an error without checking the error code, which can cause unknown behavior.
TRANS_BY_GPT3
return err; | ||
} | ||
|
||
srs_error_t SrsAudioRecode::recode(SrsSample *pkt, char **buf, int *buf_len, int &n) |
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 name is suggested to be changed to "transcode".
TRANS_BY_GPT3
trunk/src/app/srs_app_rtp.cpp
Outdated
stream->write_2bytes(sequence); | ||
// timestamp | ||
stream->write_4bytes(int32_t(timestamp)); | ||
timestamp += 960; |
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.
AAC may have different sampling rates, and I always feel like 960 may not work in certain situations.
TRANS_BY_GPT3
trunk/src/app/srs_app_rtp.hpp
Outdated
class SrsRtpOpusMuxer | ||
{ | ||
private: | ||
uint32_t timestamp; |
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.
I feel that this uint32_t has an overflow issue when running for a long time. Maybe this timestamp should be changed to a 64-bit one uniformly?
TRANS_BY_GPT3
@@ -73,6 +82,23 @@ class SrsRtpMuxer | |||
srs_error_t packet_stap_a(const std::string &sps, const std::string& pps, SrsSharedPtrMessage* shared_frame, std::vector<SrsRtpSharedPacket*>& rtp_packet_vec); | |||
}; | |||
|
|||
class SrsRtpOpusMuxer |
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.
Muxer and Demuxer are packaging and unpackaging, and the conversion from AAC to Opus should belong to the category of transcoding.
TRANS_BY_GPT3
FFMPEG and Opus library are merged in this PR: #1661
|
Codecov Report
@@ Coverage Diff @@
## feature/rtc #1659 +/- ##
===============================================
- Coverage 66.14% 65.63% -0.51%
===============================================
Files 107 108 +1
Lines 42262 42588 +326
===============================================
Hits 27954 27954
- Misses 14308 14634 +326 | 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.cpp | Continue to review full report at Codecov.
Translated to English while maintaining the markdown structure: '|
|
No description provided.