From 9b178b73e9408076a13a13be4f9043be87aa6ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Thu, 12 Mar 2015 13:29:32 -0400 Subject: [PATCH] sip: remove deadcode Refs #66606 Change-Id: If9c0cc67f3cad573f4d424859d0e95611fea7be7 --- .../src/media/video/video_receive_thread.cpp | 2 - daemon/src/sip/sdp.cpp | 44 +------------------ daemon/src/sip/sipaccount.cpp | 11 ----- 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/daemon/src/media/video/video_receive_thread.cpp b/daemon/src/media/video/video_receive_thread.cpp index 9b4e01f06a..10bb00bb4d 100644 --- a/daemon/src/media/video/video_receive_thread.cpp +++ b/daemon/src/media/video/video_receive_thread.cpp @@ -104,8 +104,6 @@ bool VideoReceiveThread::setup() videoDecoder_->setIOContext(&sdpContext_); } - //videoDecoder_->setOptions(args_); - EXIT_IF_FAIL(!videoDecoder_->openInput(args_), "Could not open input \"%s\"", args_.input.c_str()); diff --git a/daemon/src/sip/sdp.cpp b/daemon/src/sip/sdp.cpp index 6cb0624721..1ca46c8e22 100644 --- a/daemon/src/sip/sdp.cpp +++ b/daemon/src/sip/sdp.cpp @@ -88,33 +88,6 @@ Sdp::~Sdp() #endif } -static bool -hasPayload(const std::vector<std::shared_ptr<AccountAudioCodecInfo>>& codecs, - int pt) -{ - return std::any_of(std::begin(codecs), std::end(codecs), - [pt](const std::shared_ptr<AccountAudioCodecInfo>& c) - { return c and c->systemCodecInfo.payloadType == (unsigned)pt; }); -} - -static bool -hasCodec(const std::vector<std::string> &codecs, const std::string &codec) -{ - return std::find(codecs.begin(), codecs.end(), codec) != codecs.end(); -} - -static std::string -rtpmapToString(pjmedia_sdp_rtpmap *rtpmap) -{ - std::ostringstream os; - const std::string enc(rtpmap->enc_name.ptr, rtpmap->enc_name.slen); - const std::string param(rtpmap->param.ptr, rtpmap->param.slen); - os << enc << "/" << rtpmap->clock_rate; - if (not param.empty()) - os << "/" << param; - return os.str(); -} - std::shared_ptr<AccountCodecInfo> Sdp::findCodecBySpec(const std::string &codec, const unsigned clockrate) const { @@ -654,10 +627,8 @@ Sdp::getMediaSlots(const pjmedia_sdp_session* session, bool remote) const break; } - if (not remote) { + if (not remote) descr.receiving_sdp = getFilteredSdp(session, i, descr.payload_type); - RING_WARN("Filtered SDP for local media #%u :\n%s", i, descr.receiving_sdp.c_str()); - } // get crypto info std::vector<std::string> crypto; @@ -684,19 +655,6 @@ Sdp::getMediaSlots() const return s; } -namespace -{ - vector<string> split(const string &s, char delim) - { - vector<string> elems; - stringstream ss(s); - string item; - while(getline(ss, item, delim)) - elems.push_back(item); - return elems; - } -} // end anonymous namespace - void Sdp::addZrtpAttribute(pjmedia_sdp_media* media, std::string hash) { /* Format: ":version value" */ diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index 28cf078797..2e10cf5696 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -243,17 +243,6 @@ SIPAccount::newOutgoingCall(const std::string& toUrl) /* fallback on local address */ if (not addrSdp) addrSdp = localAddress; - // Initialize the session using ULAW as default codec in case of early media - // The session should be ready to receive media once the first INVITE is sent, before - // the session initialization is completed - auto ac = std::static_pointer_cast<SystemAudioCodecInfo> - (getSystemCodecContainer()->searchCodecByName("PCMA", MEDIA_AUDIO)); - if (!ac) - throw VoipLinkException("Could not instantiate codec for early media"); - - std::vector<std::shared_ptr<SystemAudioCodecInfo>> audioCodecs; - audioCodecs.push_back(ac); - // Building the local SDP offer auto& sdp = call->getSDP(); -- GitLab