mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] fix illegal access to IceTransport's member function in lambda
This commit is contained in:
@@ -130,18 +130,29 @@ void IceTransport::InitializeChannels(
|
||||
audio_channel_send_->Initialize(rtp::PAYLOAD_TYPE::OPUS);
|
||||
data_channel_send_->Initialize(rtp::PAYLOAD_TYPE::DATA);
|
||||
|
||||
std::weak_ptr<IceTransport> weak_self = shared_from_this();
|
||||
video_channel_receive_ = std::make_unique<VideoChannelReceive>(
|
||||
ice_agent_, ice_io_statistics_,
|
||||
[this](VideoFrame &video_frame) { OnReceiveCompleteFrame(video_frame); });
|
||||
[this, weak_self](VideoFrame &video_frame) {
|
||||
if (auto self = weak_self.lock()) {
|
||||
OnReceiveCompleteFrame(video_frame);
|
||||
}
|
||||
});
|
||||
|
||||
audio_channel_receive_ = std::make_unique<AudioChannelReceive>(
|
||||
ice_agent_, ice_io_statistics_, [this](const char *data, size_t size) {
|
||||
OnReceiveCompleteAudio(data, size);
|
||||
ice_agent_, ice_io_statistics_,
|
||||
[this, weak_self](const char *data, size_t size) {
|
||||
if (auto self = weak_self.lock()) {
|
||||
OnReceiveCompleteAudio(data, size);
|
||||
}
|
||||
});
|
||||
|
||||
data_channel_receive_ = std::make_unique<DataChannelReceive>(
|
||||
ice_agent_, ice_io_statistics_, [this](const char *data, size_t size) {
|
||||
OnReceiveCompleteData(data, size);
|
||||
ice_agent_, ice_io_statistics_,
|
||||
[this, weak_self](const char *data, size_t size) {
|
||||
if (auto self = weak_self.lock()) {
|
||||
OnReceiveCompleteData(data, size);
|
||||
}
|
||||
});
|
||||
|
||||
video_channel_receive_->Initialize(video_codec_payload_type_);
|
||||
|
||||
Reference in New Issue
Block a user