[*] 优化
This commit is contained in:
@@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RoomClient(acgist::MediaManager* mediaManager);
|
RoomClient(acgist::MediaManager* mediaManager);
|
||||||
virtual ~RoomClient();
|
virtual ~RoomClient() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RemoteClient(acgist::MediaManager* mediaManager);
|
RemoteClient(acgist::MediaManager* mediaManager);
|
||||||
virtual ~RemoteClient();
|
virtual ~RemoteClient() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// 添加消费者
|
// 添加消费者
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
static std::recursive_mutex clientMutex;
|
static std::recursive_mutex clientMutex;
|
||||||
|
|
||||||
acgist::RemoteClient::RemoteClient(acgist::MediaManager* mediaManager) : RoomClient(mediaManager) {}
|
acgist::RemoteClient::RemoteClient(acgist::MediaManager* mediaManager) : RoomClient(mediaManager) {
|
||||||
|
}
|
||||||
|
|
||||||
acgist::RemoteClient::~RemoteClient() {
|
acgist::RemoteClient::~RemoteClient() {
|
||||||
for(auto iterator = this->consumers.begin(); iterator != this->consumers.end(); ++iterator) {
|
for(auto iterator = this->consumers.begin(); iterator != this->consumers.end(); ++iterator) {
|
||||||
@@ -27,10 +28,17 @@ bool acgist::RemoteClient::addConsumer(const std::string& consumerId, mediasoupc
|
|||||||
oldConsumer->second = nullptr;
|
oldConsumer->second = nullptr;
|
||||||
this->consumers.erase(oldConsumer);
|
this->consumers.erase(oldConsumer);
|
||||||
}
|
}
|
||||||
OH_LOG_INFO(LOG_APP, "添加新的消费者:%s", consumerId.data());
|
|
||||||
this->consumers.insert({ consumerId, consumer });
|
this->consumers.insert({ consumerId, consumer });
|
||||||
webrtc::MediaStreamTrackInterface* trackPointer = consumer->GetTrack();
|
webrtc::MediaStreamTrackInterface* track = consumer->GetTrack();
|
||||||
// TODO: 播放
|
OH_LOG_INFO(LOG_APP, "添加新的消费者:%s %s", consumerId.data(), track->kind().data());
|
||||||
|
if(track->kind() == webrtc::MediaStreamTrackInterface::kAudioKind) {
|
||||||
|
this->audioTrack = (webrtc::AudioTrackInterface*) track;
|
||||||
|
// TODO: old track
|
||||||
|
}
|
||||||
|
if(track->kind() == webrtc::MediaStreamTrackInterface::kVideoKind) {
|
||||||
|
this->videoTrack = (webrtc::VideoTrackInterface*) track;
|
||||||
|
// TODO: old track
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user