mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 15:48:03 +00:00
Added Description::addSSRC
This commit is contained in:
@ -65,11 +65,13 @@ int main() {
|
||||
auto session = std::make_shared<rtc::RtcpSession>();
|
||||
track->setRtcpHandler(session);
|
||||
|
||||
const rtc::SSRC targetSSRC = 15;
|
||||
|
||||
track->onMessage(
|
||||
[&receivers](rtc::binary message) {
|
||||
// This is an RTP packet
|
||||
auto rtp = (rtc::RTP*) message.data();
|
||||
rtp->ssrc = htonl(15);
|
||||
rtp->ssrc = htonl(targetSSRC);
|
||||
for (auto pc : receivers) {
|
||||
if (pc->track != nullptr && pc->track->isOpen()) {
|
||||
pc->track->send(message);
|
||||
@ -109,6 +111,8 @@ int main() {
|
||||
media.setBitrate(
|
||||
3000); // Request 3Mbps (Browsers do not encode more than 2.5MBps from a webcam)
|
||||
|
||||
media.addSSRC(targetSSRC, "video-send");
|
||||
|
||||
pc->track = pc->conn->addTrack(media);
|
||||
pc->conn->setLocalDescription();
|
||||
|
||||
|
Reference in New Issue
Block a user