From 1599bfc9fc8a4f22c41c65aaef3107a8eba29450 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Wed, 24 Sep 2025 10:59:24 +0300 Subject: [PATCH] - always use (and depend on) resiprocate --- src/engine/endpoint/EP_AudioProvider.cpp | 5 +---- src/engine/media/CMakeLists.txt | 5 ----- src/engine/media/MT_AmrCodec.cpp | 14 +------------- src/engine/media/MT_AmrCodec.h | 9 +++------ src/engine/media/MT_AudioCodec.cpp | 14 ++------------ src/engine/media/MT_AudioCodec.h | 9 +-------- src/engine/media/MT_Codec.cpp | 4 +--- src/engine/media/MT_Codec.h | 6 +----- src/engine/media/MT_CodecList.cpp | 3 --- src/engine/media/MT_CodecList.h | 6 +----- 10 files changed, 11 insertions(+), 64 deletions(-) diff --git a/src/engine/endpoint/EP_AudioProvider.cpp b/src/engine/endpoint/EP_AudioProvider.cpp index 2a17d847..ed6c4278 100644 --- a/src/engine/endpoint/EP_AudioProvider.cpp +++ b/src/engine/endpoint/EP_AudioProvider.cpp @@ -99,7 +99,6 @@ void AudioProvider::updateSdpOffer(resip::SdpContents::Session::Medium& sdp, Sdp else sdp.addAttribute("crypto", resip::Data(createCryptoAttribute(mSrtpSuite))); } -#if defined(USE_RESIP_INTEGRATION) // Use CodecListPriority mCodecPriority adapter to work with codec priorities if (mAvailableCodecs.empty()) @@ -114,7 +113,7 @@ void AudioProvider::updateSdpOffer(resip::SdpContents::Session::Medium& sdp, Sdp if (mRemoteTelephoneCodec) sdp.addCodec(resip::SdpContents::Session::Codec::TelephoneEvent); } -#endif + // Publish stream state const char* attr = nullptr; @@ -229,10 +228,8 @@ bool AudioProvider::processSdpOffer(const resip::SdpContents::Session::Medium& m for (int localIndex=0; localIndex(new AmrNbCodec(mConfig)); } -#endif PCodec AmrNbCodec::CodecFactory::create() { return PCodec(new AmrNbCodec(mConfig)); @@ -483,8 +479,6 @@ int AmrWbCodec::CodecFactory::payloadType() return mConfig.mPayloadType; } -#ifdef USE_RESIP_INTEGRATION - void AmrWbCodec::CodecFactory::updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) {} @@ -498,8 +492,6 @@ void AmrWbCodec::CodecFactory::create(CodecMap& codecs) codecs[payloadType()] = std::shared_ptr(new AmrWbCodec(mConfig)); } -#endif - PCodec AmrWbCodec::CodecFactory::create() { return PCodec(new AmrWbCodec(mConfig)); @@ -706,8 +698,6 @@ int GsmEfrCodec::GsmEfrFactory::payloadType() return mPayloadType; } -#ifdef USE_RESIP_INTEGRATION - void GsmEfrCodec::GsmEfrFactory::updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) { @@ -723,8 +713,6 @@ void GsmEfrCodec::GsmEfrFactory::create(CodecMap& codecs) codecs[payloadType()] = std::shared_ptr(new GsmEfrCodec(mIuUP)); } -#endif - PCodec GsmEfrCodec::GsmEfrFactory::create() { return PCodec(new GsmEfrCodec(mIuUP)); diff --git a/src/engine/media/MT_AmrCodec.h b/src/engine/media/MT_AmrCodec.h index b2c9d6fb..00919fd0 100644 --- a/src/engine/media/MT_AmrCodec.h +++ b/src/engine/media/MT_AmrCodec.h @@ -43,11 +43,10 @@ public: int samplerate() override; int payloadType() override; -#ifdef USE_RESIP_INTEGRATION void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; void create(CodecMap& codecs) override; -#endif + PCodec create() override; protected: @@ -98,11 +97,10 @@ public: int samplerate() override; int payloadType() override; -#ifdef USE_RESIP_INTEGRATION void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; void create(CodecMap& codecs) override; -#endif + PCodec create() override; protected: @@ -140,11 +138,10 @@ public: int samplerate() override; int payloadType() override; -#ifdef USE_RESIP_INTEGRATION void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; void create(CodecMap& codecs) override; -#endif + PCodec create() override; protected: diff --git a/src/engine/media/MT_AudioCodec.cpp b/src/engine/media/MT_AudioCodec.cpp index 564bcca5..19737e5f 100644 --- a/src/engine/media/MT_AudioCodec.cpp +++ b/src/engine/media/MT_AudioCodec.cpp @@ -58,18 +58,14 @@ int G729Codec::G729Factory::payloadType() return 18; } -#if defined(USE_RESIP_INTEGRATION) void G729Codec::G729Factory::updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) -{ -} +{} int G729Codec::G729Factory::processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) { return 0; } -#endif - PCodec G729Codec::G729Factory::create() { return std::make_shared(); @@ -241,7 +237,6 @@ OpusCodec::Params::Params() mTargetBitrate = OPUS_TARGET_BITRATE; } -#if defined(USE_RESIP_INTEGRATION) resip::Data OpusCodec::Params::toString() const { std::ostringstream oss; @@ -324,7 +319,7 @@ void OpusCodec::Params::parse(const resip::Data ¶ms) mPtime = strx::toInt(paramIter->mValue.c_str(), 20); } } -#endif + OpusCodec::OpusFactory::OpusFactory(int samplerate, int channels, int ptype) { mSamplerate = samplerate; @@ -352,7 +347,6 @@ int OpusCodec::OpusFactory::payloadType() return mPType; } -#if defined(USE_RESIP_INTEGRATION) void OpusCodec::OpusFactory::updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) { // Put opus codec record @@ -394,7 +388,6 @@ int OpusCodec::OpusFactory::processSdp(const resip::SdpContents::Session::Medium } return -1; } -#endif PCodec OpusCodec::OpusFactory::create() { @@ -719,7 +712,6 @@ PCodec IlbcCodec::IlbcFactory::create() return PCodec(new IlbcCodec(mPtime)); } -#if defined(USE_RESIP_INTEGRATION) void IlbcCodec::IlbcFactory::create(CodecMap& codecs) { codecs[mPType20ms] = PCodec(create()); @@ -781,8 +773,6 @@ int IlbcCodec::IlbcFactory::processSdp(const resip::SdpContents::Session::Medium return pt; } -#endif - // --- IsacCodec(s) --- #define ISAC_CODEC_NAME "ISAC" diff --git a/src/engine/media/MT_AudioCodec.h b/src/engine/media/MT_AudioCodec.h index 6fa1d449..6693ef9e 100644 --- a/src/engine/media/MT_AudioCodec.h +++ b/src/engine/media/MT_AudioCodec.h @@ -46,10 +46,9 @@ public: int samplerate() override; int payloadType() override; -#if defined(USE_RESIP_INTEGRATION) void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; -#endif + PCodec create() override; }; G729Codec(); @@ -82,10 +81,8 @@ public: int mPtime, mTargetBitrate, mExpectedPacketLoss; Params(); -#if defined(USE_RESIP_INTEGRATION) resip::Data toString() const; void parse(const resip::Data& params); -#endif }; class OpusFactory: public Factory @@ -103,10 +100,8 @@ public: int channels() override; int samplerate() override; int payloadType() override; -#if defined(USE_RESIP_INTEGRATION) void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction) override; -#endif PCodec create() override; }; @@ -146,11 +141,9 @@ public: const char* name(); int samplerate(); int payloadType(); -#if defined(USE_RESIP_INTEGRATION) void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction); int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction); void create(CodecMap& codecs); -#endif PCodec create(); }; diff --git a/src/engine/media/MT_Codec.cpp b/src/engine/media/MT_Codec.cpp index 1a08a42b..134291c7 100644 --- a/src/engine/media/MT_Codec.cpp +++ b/src/engine/media/MT_Codec.cpp @@ -11,8 +11,6 @@ int Codec::Factory::channels() { return 1; } - -#if defined(USE_RESIP_INTEGRATION) void Codec::Factory::create(CodecMap& codecs) { codecs[payloadType()] = std::shared_ptr(create()); @@ -38,4 +36,4 @@ int Codec::Factory::processSdp(const resip::SdpContents::Session::Medium::CodecC } return -1; } -#endif + diff --git a/src/engine/media/MT_Codec.h b/src/engine/media/MT_Codec.h index 8ddcf576..0dd04676 100644 --- a/src/engine/media/MT_Codec.h +++ b/src/engine/media/MT_Codec.h @@ -6,9 +6,7 @@ #ifndef __MT_CODEC_H #define __MT_CODEC_H -#if defined(USE_RESIP_INTEGRATION) -# include "resiprocate/resip/stack/SdpContents.hxx" -#endif +#include "resiprocate/resip/stack/SdpContents.hxx" #include "../helper/HL_Types.h" #include #include "../helper/HL_Pointer.h" @@ -36,14 +34,12 @@ public: virtual PCodec create() = 0; virtual int channels(); -#if defined(USE_RESIP_INTEGRATION) typedef std::map CodecMap; virtual void create(CodecMap& codecs); virtual void updateSdp(resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction); // Returns payload type from chosen codec if success. -1 is returned for negative result. virtual int processSdp(const resip::SdpContents::Session::Medium::CodecContainer& codecs, SdpDirection direction); resip::Codec resipCodec(); -#endif }; virtual ~Codec() {} virtual const char* name() = 0; diff --git a/src/engine/media/MT_CodecList.cpp b/src/engine/media/MT_CodecList.cpp index 059f6977..5776fece 100644 --- a/src/engine/media/MT_CodecList.cpp +++ b/src/engine/media/MT_CodecList.cpp @@ -206,7 +206,6 @@ CodecList::Settings::OpusSpec CodecList::Settings::OpusSpec::parse(const std::st return result; } -#if defined(USE_RESIP_INTEGRATION) static int findOctetMode(const char* line) { const char* param_name = "octet-align="; @@ -276,8 +275,6 @@ CodecList::Settings CodecList::Settings::parseSdp(const std::list& } return r; } -#endif - bool CodecList::Settings::operator == (const Settings& rhs) const { diff --git a/src/engine/media/MT_CodecList.h b/src/engine/media/MT_CodecList.h index 404f7b71..87855c0b 100644 --- a/src/engine/media/MT_CodecList.h +++ b/src/engine/media/MT_CodecList.h @@ -8,9 +8,7 @@ #include "../engine_config.h" -#if defined(USE_RESIP_INTEGRATION) -# include "resiprocate/resip/stack/SdpContents.hxx" -#endif +#include "resiprocate/resip/stack/SdpContents.hxx" #include "MT_Codec.h" #include @@ -105,9 +103,7 @@ public: static Settings DefaultSettings; - #if defined(USE_RESIP_INTEGRATION) static Settings parseSdp(const std::list& codeclist); - #endif bool operator == (const Settings& rhs) const; };