mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35: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_);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "video_encoder_factory.h"
|
||||
#include "ws_client.h"
|
||||
|
||||
class IceTransport {
|
||||
class IceTransport : public std::enable_shared_from_this<IceTransport> {
|
||||
public:
|
||||
typedef enum { VIDEO = 96, AUDIO = 97, DATA = 127 } DATA_TYPE;
|
||||
typedef enum { H264 = 96, AV1 = 99 } VIDEO_TYPE;
|
||||
|
||||
Reference in New Issue
Block a user