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

Dominant Speaker Event #603

Merged
merged 42 commits into from Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b39a1c3
Dominant Speaker Event (#5)
SteveMcFarlin Jul 9, 2021
7493b0e
Adding attribution.
SteveMcFarlin Jul 12, 2021
203f9a3
Apply suggestions from code review
SteveMcFarlin Jul 13, 2021
b6c90ce
Apply suggestions from code review
SteveMcFarlin Jul 13, 2021
ecdb5ff
Revert changes to compile_commands_template.json
SteveMcFarlin Jul 13, 2021
ceb78dc
Moving Speaker class into ActiveSpeakerObserver
SteveMcFarlin Jul 14, 2021
997cac3
Fix formatting
SteveMcFarlin Jul 14, 2021
4c608ca
Add rust module support for active speaker observer
ggarber Jul 15, 2021
211c555
Rust ActiveSpeakerObserver implementation
Jul 15, 2021
b540030
Update worker/src/RTC/ActiveSpeakerObserver.cpp
SteveMcFarlin Jul 15, 2021
7d63a6a
Guard against producer that is not present in map.
SteveMcFarlin Jul 15, 2021
feb39ae
Remove unused temporary.
SteveMcFarlin Jul 15, 2021
1014cd0
Fix code
SteveMcFarlin Jul 15, 2021
9472177
Update src/ActiveSpeakerObserver.ts
ibc Jul 16, 2021
e17eecf
Update src/ActiveSpeakerObserver.ts
ibc Jul 16, 2021
52b848c
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
40a6ef9
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
7feda35
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
bc9c122
Apply suggestions from code review
ibc Jul 16, 2021
d914a5d
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
91a7ea4
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
94cc425
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
18e5067
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
cac4bf4
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
771f74d
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
c1897fd
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
9b1f1f1
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
84ee261
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
707b542
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
248b5fa
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
d13419b
Update worker/src/RTC/ActiveSpeakerObserver.cpp
ibc Jul 16, 2021
db9fa20
Guard against missing map item.
SteveMcFarlin Jul 16, 2021
3823558
Use iterator to avoid another lookup
SteveMcFarlin Jul 19, 2021
e174bea
Rebuild JS and TS map files.
SteveMcFarlin Jul 19, 2021
e75a400
Rebuild router JS and map file.
SteveMcFarlin Jul 19, 2021
09873f3
Apply suggestions from code review
SteveMcFarlin Jul 20, 2021
2428e87
Apply suggestions from code review.
SteveMcFarlin Jul 20, 2021
e9b5087
Change to signed integer.
SteveMcFarlin Jul 21, 2021
10112e7
Apply code suggestion from code review
SteveMcFarlin Jul 21, 2021
6b30e9b
Format
SteveMcFarlin Jul 22, 2021
fdc2215
Merge branch 'v3-dominant-speaker' of github.com:SteveMcFarlin/medias…
SteveMcFarlin Jul 22, 2021
83841f1
rust fmt
ggarber Jul 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions worker/src/Channel/ChannelNotifier.cpp
Expand Up @@ -44,6 +44,7 @@ namespace Channel
jsonNotification["targetId"] = targetId;
jsonNotification["event"] = event;
jsonNotification["data"] = data;

ChannelNotifier::channel->Send(jsonNotification);
}
} // namespace Channel
24 changes: 19 additions & 5 deletions worker/src/RTC/ActiveSpeakerObserver.cpp
Expand Up @@ -152,11 +152,11 @@ namespace RTC
MS_TRACE();

auto it = this->mapProducerSpeaker.find(producer->id);

if (it != this->mapProducerSpeaker.end())
{
auto& rtpObserver = it->second;

rtpObserver.speaker->paused = false;
}
}
Expand All @@ -165,7 +165,14 @@ namespace RTC
{
MS_TRACE();

this->mapProducerSpeaker[producer->id].speaker->paused = true;
auto it = this->mapProducerSpeaker.find(producer->id);

if (it != this->mapProducerSpeaker.end())
{
auto& rtpObserver = it->second;

rtpObserver.speaker->paused = true;
}
}

void ActiveSpeakerObserver::ReceiveRtpPacket(RTC::Producer* producer, RTC::RtpPacket* packet)
Expand All @@ -181,8 +188,15 @@ namespace RTC
if (!packet->ReadSsrcAudioLevel(volume, voice))
return;

uint64_t now = DepLibUV::GetTimeMs();
this->mapProducerSpeaker[producer->id].speaker->LevelChanged(volume, now);
auto it = this->mapProducerSpeaker.find(producer->id);

if (it != this->mapProducerSpeaker.end())
{
auto& rtpObserver = it->second;
uint64_t now = DepLibUV::GetTimeMs();

rtpObserver.speaker->paused = LevelChanged(volume, now);
SteveMcFarlin marked this conversation as resolved.
Show resolved Hide resolved
}
}

void ActiveSpeakerObserver::Paused()
Expand Down