diff --git a/examples/streamer/main.cpp b/examples/streamer/main.cpp index ecdbfe168..75a509b36 100644 --- a/examples/streamer/main.cpp +++ b/examples/streamer/main.cpp @@ -211,16 +211,14 @@ shared_ptr addVideo(const shared_ptr pc, const auto rtpConfig = make_shared(ssrc, cname, payloadType, H264RtpPacketizer::defaultClockRate); // create packetizer auto packetizer = make_shared(NalUnit::Separator::Length, rtpConfig); - // create H264 handler - auto h264Handler = make_shared(packetizer); // add RTCP SR handler auto srReporter = make_shared(rtpConfig); - h264Handler->addToChain(srReporter); + packetizer->addToChain(srReporter); // add RTCP NACK handler auto nackResponder = make_shared(); - h264Handler->addToChain(nackResponder); + packetizer->addToChain(nackResponder); // set handler - track->setMediaHandler(h264Handler); + track->setMediaHandler(packetizer); track->onOpen(onOpen); auto trackData = make_shared(track, srReporter); return trackData; @@ -232,19 +230,17 @@ shared_ptr addAudio(const shared_ptr pc, const audio.addSSRC(ssrc, cname, msid, cname); auto track = pc->addTrack(audio); // create RTP configuration - auto rtpConfig = make_shared(ssrc, cname, payloadType, OpusRtpPacketizer::defaultClockRate); + auto rtpConfig = make_shared(ssrc, cname, payloadType, OpusRtpPacketizer::DefaultClockRate); // create packetizer auto packetizer = make_shared(rtpConfig); - // create opus handler - auto opusHandler = make_shared(packetizer); // add RTCP SR handler auto srReporter = make_shared(rtpConfig); - opusHandler->addToChain(srReporter); + packetizer->addToChain(srReporter); // add RTCP NACK handler auto nackResponder = make_shared(); - opusHandler->addToChain(nackResponder); + packetizer->addToChain(nackResponder); // set handler - track->setMediaHandler(opusHandler); + track->setMediaHandler(packetizer); track->onOpen(onOpen); auto trackData = make_shared(track, srReporter); return trackData; diff --git a/examples/streamer/stream.hpp b/examples/streamer/stream.hpp index 2565d18e8..d2b993723 100644 --- a/examples/streamer/stream.hpp +++ b/examples/streamer/stream.hpp @@ -26,7 +26,7 @@ class StreamSource { virtual rtc::binary getSample() = 0; }; -class Stream: std::enable_shared_from_this { +class Stream: public std::enable_shared_from_this { uint64_t startTime = 0; std::mutex mutex; DispatchQueue dispatchQueue = DispatchQueue("StreamQueue");