[*] 优化
This commit is contained in:
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
public:
|
||||
RoomClient(acgist::MediaManager* mediaManager);
|
||||
virtual ~RoomClient();
|
||||
virtual ~RoomClient() override;
|
||||
|
||||
public:
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
public:
|
||||
RemoteClient(acgist::MediaManager* mediaManager);
|
||||
virtual ~RemoteClient();
|
||||
virtual ~RemoteClient() override;
|
||||
|
||||
public:
|
||||
// 添加消费者
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
static std::recursive_mutex clientMutex;
|
||||
|
||||
acgist::RemoteClient::RemoteClient(acgist::MediaManager* mediaManager) : RoomClient(mediaManager) {}
|
||||
acgist::RemoteClient::RemoteClient(acgist::MediaManager* mediaManager) : RoomClient(mediaManager) {
|
||||
}
|
||||
|
||||
acgist::RemoteClient::~RemoteClient() {
|
||||
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;
|
||||
this->consumers.erase(oldConsumer);
|
||||
}
|
||||
OH_LOG_INFO(LOG_APP, "添加新的消费者:%s", consumerId.data());
|
||||
this->consumers.insert({ consumerId, consumer });
|
||||
webrtc::MediaStreamTrackInterface* trackPointer = consumer->GetTrack();
|
||||
// TODO: 播放
|
||||
webrtc::MediaStreamTrackInterface* track = consumer->GetTrack();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user