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

For #1637, #307, make webrtc audio work #1659

Merged
merged 9 commits into from
Mar 22, 2020
Merged

Conversation

winlinvip
Copy link
Member

No description provided.

}

if (stream) {
rtp_opus_muxer->frame_to_packet(shared_audio, format, stream);
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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();
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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)
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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

stream->write_2bytes(sequence);
// timestamp
stream->write_4bytes(int32_t(timestamp));
timestamp += 960;
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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

class SrsRtpOpusMuxer
{
private:
uint32_t timestamp;
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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
Copy link
Member Author

@winlinvip winlinvip Mar 21, 2020

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

@winlinvip
Copy link
Member Author

winlinvip commented Mar 22, 2020

FFMPEG and Opus library are merged in this PR: #1661

TRANS_BY_GPT3

@codecov-io
Copy link

codecov-io commented Mar 22, 2020

Codecov Report

Merging #1659 into feature/rtc will decrease coverage by 0.50%.
The diff coverage is n/a.

Impacted file tree graph

@@               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 Δ | |
|---|---|---|
| trunk/src/protocol/srs_rtmp_stack.hpp | 85.18% <0.00%> (-3.28%) | ⬇️ |
| trunk/src/app/srs_app_config.cpp | 75.81% <0.00%> (-0.22%) | ⬇️ |
| trunk/src/app/srs_app_rtc.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.cpp | 0.64% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.hpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_http_api.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_rtc_conn.hpp | 0.00% <0.00%> (ø) | |
| trunk/src/kernel/srs_kernel_flv.cpp | 98.76% <0.00%> (ø) | |
| trunk/src/app/srs_app_audio_recode.cpp | 0.00% <0.00%> (ø) | |

'

Translated to English while maintaining the markdown structure:

'| trunk/src/app/srs_app_rtc.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.cpp | 0.64% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.hpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_http_api.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_rtc_conn.hpp | 0.00% <0.00%> (ø) | |
| trunk/src/kernel/srs_kernel_flv.cpp | 98.76% <0.00%> (ø) | |
| trunk/src/app/srs_app_audio_recode.cpp | 0.00% <0.00%> (ø) | |


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 0cd67a9...a912f04. Read the comment docs.

TRANS_BY_GPT3

@winlinvip winlinvip merged commit c00ffa5 into feature/rtc Mar 22, 2020
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants