diff --git a/src/modules/audio_coding/main/interface/audio_coding_module.h b/src/modules/audio_coding/main/interface/audio_coding_module.h index 093dcdbf6..9acc8160e 100644 --- a/src/modules/audio_coding/main/interface/audio_coding_module.h +++ b/src/modules/audio_coding/main/interface/audio_coding_module.h @@ -80,25 +80,6 @@ class AudioCodingModule: public Module { // Utility functions // - /////////////////////////////////////////////////////////////////////////// - // WebRtc_Word32 GetVersion() - // Returns version of the module and its components. - // - // Outputs: - // -version : a buffer that the version string is stored. - // -remainBuffBytes : remaining size of the buffer "version" in - // bytes, excluding terminating-null. - // -position : the first character of the ACM version will - // written to version[position] and so on. - // - // Return value: - // -1 if failed to write the whole version string, - // 0 if succeeded. - // - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainBuffBytes, - WebRtc_UWord32& position); - /////////////////////////////////////////////////////////////////////////// // WebRtc_UWord8 NumberOfCodecs() // Returns number of supported codecs. diff --git a/src/modules/audio_coding/main/source/audio_coding_module.cc b/src/modules/audio_coding/main/source/audio_coding_module.cc index 9434d18c4..e4f5a5f7c 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module.cc +++ b/src/modules/audio_coding/main/source/audio_coding_module.cc @@ -33,42 +33,6 @@ AudioCodingModule::Destroy( delete static_cast (module); } -// Returns version of the module and its components. -WebRtc_Word32 -AudioCodingModule::GetVersion( - WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - WebRtc_Word32 len = position; - strncpy(&version[position], "AudioCodingModule 1.3.0\n", remainingBufferInBytes); - - position = static_cast(strlen(version)); - remainingBufferInBytes -= (position - len); - - // Get NetEQ version. - if(ACMNetEQ::GetVersion(version, - remainingBufferInBytes, position) < 0) - { - return -1; - } - - // Set position and size before calling ACMCodecDB::CodecsVersion - // to get versions of all codecs. - size_t current_position = position; - size_t current_remaining_bytes = remainingBufferInBytes; - if(ACMCodecDB::CodecsVersion(version, - ¤t_remaining_bytes, ¤t_position) < 0) - { - return -1; - } - - // Update position and size of version vector. - remainingBufferInBytes = current_remaining_bytes; - position = current_position; - return 0; -} - // Get number of supported codecs WebRtc_UWord8 AudioCodingModule::NumberOfCodecs() { diff --git a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc index b376c9685..0ad9958e5 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc +++ b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc @@ -289,23 +289,6 @@ AudioCodingModuleImpl::ChangeUniqueId( return 0; } -WebRtc_Word32 -AudioCodingModuleImpl::Version( - WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceAudioCoding, _id, - "Version()"); - if(version == NULL) - { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id, - "Input buffer is NULL"); - return -1; - } - return GetVersion(version, remainingBufferInBytes, position); -} - // returns the number of milliseconds until the module want a // worker thread to call Process WebRtc_Word32 diff --git a/src/modules/audio_coding/main/test/Tester.cpp b/src/modules/audio_coding/main/test/Tester.cpp index 20a7b7d2b..e35a0ecaa 100644 --- a/src/modules/audio_coding/main/test/Tester.cpp +++ b/src/modules/audio_coding/main/test/Tester.cpp @@ -109,14 +109,6 @@ TEST(AudioCodingModuleTest, RunAllTests) std::vector tests; PopulateTests(&tests); std::vector::iterator it; - WebRtc_Word8 version[5000]; - version[0] = '\0'; - - WebRtc_UWord32 remainingBufferInByte = 4999; - WebRtc_UWord32 position = 0; - AudioCodingModule::GetVersion(version, remainingBufferInByte, position); - - printf("%s\n", version); for (it=tests.begin() ; it < tests.end(); it++) { (*it)->Perform(); diff --git a/src/modules/audio_conference_mixer/interface/audio_conference_mixer.h b/src/modules/audio_conference_mixer/interface/audio_conference_mixer.h index be03d39a5..4914042df 100644 --- a/src/modules/audio_conference_mixer/interface/audio_conference_mixer.h +++ b/src/modules/audio_conference_mixer/interface/audio_conference_mixer.h @@ -38,11 +38,6 @@ public: static AudioConferenceMixer* Create(int id); virtual ~AudioConferenceMixer() {} - // Returns version of the module and its components - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position); - // Module functions virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id) = 0; virtual WebRtc_Word32 TimeUntilNextProcess() = 0 ; diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc index 359e13163..e9fa7a1bd 100644 --- a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc +++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc @@ -169,21 +169,6 @@ AudioConferenceMixerImpl::~AudioConferenceMixerImpl() assert(_audioFramePool == NULL); } -WebRtc_Word32 AudioConferenceMixerImpl::Version( - WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE( - kTraceModuleCall, - kTraceAudioMixerServer, - _id, - "Version(version%s,remainingBufferLengthInBytes:%d,position:%d)", - (version==NULL) ? ":NULL" : "", - remainingBufferInBytes,position); - return GetVersion(version,remainingBufferInBytes,position); -} - WebRtc_Word32 AudioConferenceMixerImpl::ChangeUniqueId(const WebRtc_Word32 id) { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, @@ -192,38 +177,6 @@ WebRtc_Word32 AudioConferenceMixerImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 AudioConferenceMixer::GetVersion( - WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - WEBRTC_TRACE( - kTraceModuleCall, - kTraceAudioMixerServer, - -1, - "Version(version%s,remainingBufferLengthInBytes:%d,position:%d)", - (version==NULL) ? "NULL" : "", - remainingBufferInBytes, - position); - if(version == NULL) - { - WEBRTC_TRACE(kTraceWarning, kTraceAudioMixerServer, -1, - "Invalid in argument to GetVersion()"); - return -1; - } - const char moduleVersion[] = VERSION_STRING; - if(remainingBufferInBytes < sizeof(moduleVersion)) - { - WEBRTC_TRACE(kTraceWarning, kTraceAudioMixerServer, -1, - "Too small buffer in GetVersion()"); - return -1; - } - strncpy(version, moduleVersion, sizeof(moduleVersion)); // null termination - remainingBufferInBytes -= sizeof(moduleVersion); - position += sizeof(moduleVersion); - return 0; -} - // Process should be called every kProcessPeriodicityInMs ms WebRtc_Word32 AudioConferenceMixerImpl::TimeUntilNextProcess() { diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h index 47d4307e1..441fa8138 100644 --- a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h +++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h @@ -21,8 +21,6 @@ #include "scoped_ptr.h" #include "time_scheduler.h" -#define VERSION_STRING "Audio Conference Mixer Module 1.1.0" - namespace webrtc { class AudioProcessing; class CriticalSectionWrapper; @@ -62,9 +60,6 @@ public: bool Init(); // Module functions - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); virtual WebRtc_Word32 TimeUntilNextProcess(); virtual WebRtc_Word32 Process(); diff --git a/src/modules/audio_device/main/source/audio_device_impl.cc b/src/modules/audio_device/main/source/audio_device_impl.cc index 9edb9159b..dc3cd9899 100644 --- a/src/modules/audio_device/main/source/audio_device_impl.cc +++ b/src/modules/audio_device/main/source/audio_device_impl.cc @@ -459,32 +459,6 @@ WebRtc_Word32 AudioDeviceModuleImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -// ---------------------------------------------------------------------------- -// Module::Version -// ---------------------------------------------------------------------------- - -WebRtc_Word32 AudioDeviceModuleImpl::Version(WebRtc_Word8* version, WebRtc_UWord32& remainingBufferInBytes, WebRtc_UWord32& position) const -{ - if (version == NULL) - { - WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, -1, "invalid buffer pointer in argument"); - return -1; - } - WebRtc_Word8 ourVersion[] = "AudioDevice 1.1.0"; - WebRtc_UWord32 ourLength = (WebRtc_UWord32)strlen(ourVersion); - if (remainingBufferInBytes < (ourLength + 1)) - { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, "version string requires %d bytes", (ourLength + 1)); - return -1; - } - memcpy(&version[position], ourVersion, ourLength); - version[position + ourLength] = '\0'; // null terminaion - remainingBufferInBytes -= (ourLength + 1); - position += (ourLength + 1); - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, -1, "version: %s", version); - return 0; -} - // ---------------------------------------------------------------------------- // Module::TimeUntilNextProcess // diff --git a/src/modules/audio_device/main/source/audio_device_impl.h b/src/modules/audio_device/main/source/audio_device_impl.h index 85e517a32..5edec0d29 100644 --- a/src/modules/audio_device/main/source/audio_device_impl.h +++ b/src/modules/audio_device/main/source/audio_device_impl.h @@ -43,9 +43,6 @@ public: public: // RefCountedModule virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); - virtual WebRtc_Word32 Version( - WebRtc_Word8 *version, WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; virtual WebRtc_Word32 TimeUntilNextProcess(); virtual WebRtc_Word32 Process(); diff --git a/src/modules/audio_device/main/test/audio_device_test_api.cc b/src/modules/audio_device/main/test/audio_device_test_api.cc index 12f17c720..22ac91af1 100644 --- a/src/modules/audio_device/main/test/audio_device_test_api.cc +++ b/src/modules/audio_device/main/test/audio_device_test_api.cc @@ -320,24 +320,6 @@ int api_test() processThread->RegisterModule(audioDevice); - // =============== - // Module::Version - // =============== - - WebRtc_Word8 version[256]; - WebRtc_UWord32 remainingBufferInBytes = 256; - WebRtc_UWord32 tooFewBytes = 10; - WebRtc_UWord32 position = 0; - - TEST(audioDevice->Version(version, tooFewBytes, position) == -1); - TEST(audioDevice->Version(NULL, remainingBufferInBytes, position) == -1); - - TEST(audioDevice->Version(version, remainingBufferInBytes, position) == 0); - TEST(position == 18); // assumes "AudioDevice x.y.z" + NULL - TEST(remainingBufferInBytes == (256-position)); - - TEST_LOG("Version: %s\n\n", version); - AudioDeviceModule::AudioLayer audioLayer = AudioDeviceModule::kPlatformDefaultAudio; TEST(audioDevice->ActiveAudioLayer(&audioLayer) == 0); diff --git a/src/modules/audio_device/main/test/func_test_manager.cc b/src/modules/audio_device/main/test/func_test_manager.cc index 4566da2ba..2ef1cdce2 100644 --- a/src/modules/audio_device/main/test/func_test_manager.cc +++ b/src/modules/audio_device/main/test/func_test_manager.cc @@ -616,14 +616,6 @@ WebRtc_Word32 FuncTestManager::Init() _audioTransport = new AudioTransportImpl(_audioDevice); TEST(_audioDevice->RegisterAudioCallback(_audioTransport) == 0); - WebRtc_Word8 version[256]; - WebRtc_UWord32 remainingBufferInBytes = 256; - WebRtc_UWord32 position = 0; - - // log version - TEST(_audioDevice->Version(version, remainingBufferInBytes, position) == 0); - TEST_LOG("Version: %s\n \n", version); - return 0; } diff --git a/src/modules/audio_processing/audio_processing_impl.cc b/src/modules/audio_processing/audio_processing_impl.cc index 8ce9c21e5..9702e9e4c 100644 --- a/src/modules/audio_processing/audio_processing_impl.cc +++ b/src/modules/audio_processing/audio_processing_impl.cc @@ -552,61 +552,6 @@ VoiceDetection* AudioProcessingImpl::voice_detection() const { return voice_detection_; } -WebRtc_Word32 AudioProcessingImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& bytes_remaining, WebRtc_UWord32& position) const { - if (version == NULL) { - /*WEBRTC_TRACE(webrtc::kTraceError, - webrtc::kTraceAudioProcessing, - -1, - "Null version pointer");*/ - return kNullPointerError; - } - memset(&version[position], 0, bytes_remaining); - - char my_version[] = "AudioProcessing 1.0.0"; - // Includes null termination. - WebRtc_UWord32 length = static_cast(strlen(my_version)); - if (bytes_remaining < length) { - /*WEBRTC_TRACE(webrtc::kTraceError, - webrtc::kTraceAudioProcessing, - -1, - "Buffer of insufficient length");*/ - return kBadParameterError; - } - memcpy(&version[position], my_version, length); - bytes_remaining -= length; - position += length; - - std::list::const_iterator it; - for (it = component_list_.begin(); it != component_list_.end(); it++) { - char component_version[256]; - strcpy(component_version, "\n"); - int err = (*it)->get_version(&component_version[1], - sizeof(component_version) - 1); - if (err != kNoError) { - return err; - } - if (strncmp(&component_version[1], "\0", 1) == 0) { - // Assume empty if first byte is NULL. - continue; - } - - length = static_cast(strlen(component_version)); - if (bytes_remaining < length) { - /*WEBRTC_TRACE(webrtc::kTraceError, - webrtc::kTraceAudioProcessing, - -1, - "Buffer of insufficient length");*/ - return kBadParameterError; - } - memcpy(&version[position], component_version, length); - bytes_remaining -= length; - position += length; - } - - return kNoError; -} - WebRtc_Word32 AudioProcessingImpl::ChangeUniqueId(const WebRtc_Word32 id) { CriticalSectionScoped crit_scoped(*crit_); /*WEBRTC_TRACE(webrtc::kTraceModuleCall, diff --git a/src/modules/audio_processing/audio_processing_impl.h b/src/modules/audio_processing/audio_processing_impl.h index 66d84a7b7..c1ab47638 100644 --- a/src/modules/audio_processing/audio_processing_impl.h +++ b/src/modules/audio_processing/audio_processing_impl.h @@ -80,9 +80,6 @@ class AudioProcessingImpl : public AudioProcessing { virtual VoiceDetection* voice_detection() const; // Module methods. - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); private: diff --git a/src/modules/audio_processing/test/process_test.cc b/src/modules/audio_processing/test/process_test.cc index 9fa2250c1..2023ddb13 100644 --- a/src/modules/audio_processing/test/process_test.cc +++ b/src/modules/audio_processing/test/process_test.cc @@ -127,7 +127,6 @@ void usage() { printf(" --quiet Suppress text output.\n"); printf(" --no_progress Suppress progress.\n"); printf(" --debug_file FILE Dump a debug recording.\n"); - printf(" --version Print version information and exit.\n"); } // void function for gtest. @@ -145,10 +144,6 @@ void void_main(int argc, char* argv[]) { AudioProcessing* apm = AudioProcessing::Create(0); ASSERT_TRUE(apm != NULL); - WebRtc_Word8 version[1024]; - WebRtc_UWord32 version_bytes_remaining = sizeof(version); - WebRtc_UWord32 version_position = 0; - const char* pb_filename = NULL; const char* far_filename = NULL; const char* near_filename = NULL; @@ -368,13 +363,6 @@ void void_main(int argc, char* argv[]) { } else if (strcmp(argv[i], "--no_progress") == 0) { progress = false; - } else if (strcmp(argv[i], "--version") == 0) { - ASSERT_EQ(apm->kNoError, apm->Version(version, - version_bytes_remaining, - version_position)); - printf("%s\n", version); - return; - } else if (strcmp(argv[i], "--debug_file") == 0) { i++; ASSERT_LT(i, argc) << "Specify filename after --debug_file"; diff --git a/src/modules/interface/module.h b/src/modules/interface/module.h index aae9322b7..a274d95ef 100644 --- a/src/modules/interface/module.h +++ b/src/modules/interface/module.h @@ -19,11 +19,6 @@ namespace webrtc { class Module { public: - // Returns version of the module and its components. - virtual int32_t Version(char* version, - uint32_t& remaining_buffer_in_bytes, - uint32_t& position) const = 0; - // Change the unique identifier of this object. virtual int32_t ChangeUniqueId(const int32_t id) = 0; diff --git a/src/modules/media_file/interface/media_file.h b/src/modules/media_file/interface/media_file.h index 66851d3ca..bc857ad7a 100644 --- a/src/modules/media_file/interface/media_file.h +++ b/src/modules/media_file/interface/media_file.h @@ -26,15 +26,6 @@ public: static MediaFile* CreateMediaFile(const WebRtc_Word32 id); static void DestroyMediaFile(MediaFile* module); - // Writes the version of the MediaFile to version. remainingBufferInBytes - // is both an input parameter and an output parameter. It indicates the size - // of version less messages in it. position is both an input parameter and - // an output parameter. It indicates the position of the NULL termination - // in the version string. - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position); - // Set the MediaFile instance identifier. virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id) = 0; diff --git a/src/modules/media_file/source/media_file_impl.cc b/src/modules/media_file/source/media_file_impl.cc index 7dec8f4ca..7dae24180 100644 --- a/src/modules/media_file/source/media_file_impl.cc +++ b/src/modules/media_file/source/media_file_impl.cc @@ -94,42 +94,6 @@ MediaFileImpl::~MediaFileImpl() delete _callbackCrit; } -WebRtc_Word32 MediaFileImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(kTraceModuleCall, kTraceFile, _id, - "Version(?,bufferLength:%d,position:%d)", - remainingBufferInBytes, position); - return GetVersion(version, remainingBufferInBytes, position); -} - -WebRtc_Word32 MediaFile::GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - WEBRTC_TRACE(kTraceModuleCall, kTraceFile, -1, - "GetVersion(?,bufferLength:%d,position:%d)", - remainingBufferInBytes, position); - if(version == NULL) - { - WEBRTC_TRACE(kTraceWarning, kTraceFile, -1, - "Invalid buffer pointer in argument to Version()"); - return -1; - } - const WebRtc_Word8 ourVersion[] = "MediaFile 1.0.0"; - const WebRtc_UWord32 ourLength =(WebRtc_UWord32)strlen(ourVersion); - if(remainingBufferInBytes <(ourLength + 1)) - { - return -1; - } - memcpy(&version[position], ourVersion, ourLength); - version[position + ourLength] = '\0'; - remainingBufferInBytes -=(ourLength + 1); - position +=(ourLength + 1); - return 0; -} - WebRtc_Word32 MediaFileImpl::ChangeUniqueId(const WebRtc_Word32 id) { WEBRTC_TRACE(kTraceModuleCall, kTraceFile, _id, "ChangeUniqueId(new id:%d)", diff --git a/src/modules/media_file/source/media_file_impl.h b/src/modules/media_file/source/media_file_impl.h index 1358246db..06e20d023 100644 --- a/src/modules/media_file/source/media_file_impl.h +++ b/src/modules/media_file/source/media_file_impl.h @@ -25,11 +25,6 @@ public: MediaFileImpl(const WebRtc_Word32 id); ~MediaFileImpl(); - // Module functions - WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); WebRtc_Word32 Process(); WebRtc_Word32 TimeUntilNextProcess(); diff --git a/src/modules/rtp_rtcp/interface/rtp_rtcp.h b/src/modules/rtp_rtcp/interface/rtp_rtcp.h index 09298f775..2a1aef37c 100644 --- a/src/modules/rtp_rtcp/interface/rtp_rtcp.h +++ b/src/modules/rtp_rtcp/interface/rtp_rtcp.h @@ -49,17 +49,6 @@ public: */ static void DestroyRtpRtcp(RtpRtcp* module); - /* - * Returns version of the module and its components - * - * version - buffer to which the version will be written - * remainingBufferInBytes - remaining number of WebRtc_Word8 in the version buffer - * position - position of the next empty WebRtc_Word8 in the version buffer - */ - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position); - /* * Change the unique identifier of this object * diff --git a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 6584d3346..d2da5b76a 100644 --- a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -170,44 +170,6 @@ ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl() delete _criticalSectionModulePtrsFeedback; } -WebRtc_Word32 -ModuleRtpRtcpImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(kTraceModuleCall, - kTraceRtpRtcp, - _id, - "Version(bufferLength:%d)", - remainingBufferInBytes); - return GetVersion(version, remainingBufferInBytes, position); -} - -WebRtc_Word32 RtpRtcp::GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - if(version == NULL) - { - WEBRTC_TRACE(kTraceWarning, - kTraceRtpRtcp, - -1, - "Invalid in argument to Version()"); - return -1; - } - WebRtc_Word8 ourVersion[] = "Module RTP RTCP 1.3.0"; - WebRtc_UWord32 ourLength = (WebRtc_UWord32)strlen(ourVersion); - if(remainingBufferInBytes < ourLength +1) - { - return -1; - } - memcpy(version, ourVersion, ourLength); - version[ourLength] = '\0'; // null terminaion - remainingBufferInBytes -= (ourLength + 1); - position += (ourLength + 1); - return 0; -} - WebRtc_Word32 ModuleRtpRtcpImpl::ChangeUniqueId(const WebRtc_Word32 id) { diff --git a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.h index f8f0aa275..e8222cf73 100644 --- a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -38,11 +38,6 @@ public: // get Module ID WebRtc_Word32 Id() {return _id;} - // Get Module version - WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); // De-muxing functionality for diff --git a/src/modules/udp_transport/source/udp_transport_impl.cc b/src/modules/udp_transport/source/udp_transport_impl.cc index e3556f873..b931bfe90 100644 --- a/src/modules/udp_transport/source/udp_transport_impl.cc +++ b/src/modules/udp_transport/source/udp_transport_impl.cc @@ -195,31 +195,6 @@ WebRtc_Word32 UdpTransportImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 UdpTransportImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(kTraceModuleCall, kTraceTransport, _id, "%s", __FUNCTION__); - if(version == NULL) - { - WEBRTC_TRACE(kTraceError, kTraceTransport, _id, - "Version pointer is NULL"); - return -1; - } - WebRtc_Word8 ourVersion[256] = "UdpTransport 1.1.0"; - WebRtc_Word32 ourLength = (WebRtc_Word32)strlen(ourVersion); - if((WebRtc_Word32)remainingBufferInBytes < ourLength +1) - { - WEBRTC_TRACE(kTraceWarning, kTraceTransport, _id, - "Version buffer not long enough"); - return -1; - } - memcpy(version, ourVersion, ourLength); - version[ourLength] = 0; - position += ourLength; - return 0; -} - WebRtc_Word32 UdpTransportImpl::TimeUntilNextProcess() { return 100; diff --git a/src/modules/udp_transport/source/udp_transport_impl.h b/src/modules/udp_transport/source/udp_transport_impl.h index dad4fb7be..7e0cd1bfe 100644 --- a/src/modules/udp_transport/source/udp_transport_impl.h +++ b/src/modules/udp_transport/source/udp_transport_impl.h @@ -28,9 +28,6 @@ public: // Module functions virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; virtual WebRtc_Word32 TimeUntilNextProcess(); virtual WebRtc_Word32 Process(); diff --git a/src/modules/video_capture/main/source/video_capture_impl.cc b/src/modules/video_capture/main/source/video_capture_impl.cc index b96cac1d4..48a36c887 100644 --- a/src/modules/video_capture/main/source/video_capture_impl.cc +++ b/src/modules/video_capture/main/source/video_capture_impl.cc @@ -36,38 +36,6 @@ VideoCaptureModule* VideoCaptureImpl::Create( return implementation; } -WebRtc_Word32 VideoCaptureImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceVideoCapture, _id, "Version(bufferLength:%u)", - (unsigned int) remainingBufferInBytes); - return GetVersion(version, remainingBufferInBytes, position); -} - -WebRtc_Word32 VideoCaptureImpl::GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - if (version == NULL) - { - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, -1, - "Invalid in argument to Version()"); - return -1; - } - WebRtc_Word8 ourVersion[] = "VideoCaptureModule 1.1.0"; - WebRtc_UWord32 ourLength = (WebRtc_UWord32) strlen(ourVersion); - if (remainingBufferInBytes < ourLength + 1) - { - return -1; - } - memcpy(version, ourVersion, ourLength); - version[ourLength] = '\0'; // null terminaion - remainingBufferInBytes -= (ourLength + 1); - position += (ourLength + 1); - return 0; -} - const WebRtc_UWord8* VideoCaptureImpl::CurrentDeviceName() const { return _deviceUniqueId; diff --git a/src/modules/video_capture/main/source/video_capture_impl.h b/src/modules/video_capture/main/source/video_capture_impl.h index 30c8c6ec5..eae3f395d 100644 --- a/src/modules/video_capture/main/source/video_capture_impl.h +++ b/src/modules/video_capture/main/source/video_capture_impl.h @@ -50,19 +50,9 @@ public: static DeviceInfo* CreateDeviceInfo(const WebRtc_Word32 id); - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position); - - - // Implements Module declared functions. virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - //Call backs virtual WebRtc_Word32 RegisterCaptureDataCallback(VideoCaptureDataCallback& dataCallback); virtual WebRtc_Word32 DeRegisterCaptureDataCallback(); diff --git a/src/modules/video_coding/main/source/video_coding_impl.cc b/src/modules/video_coding/main/source/video_coding_impl.cc index ed04d04ed..bf5c2e610 100644 --- a/src/modules/video_coding/main/source/video_coding_impl.cc +++ b/src/modules/video_coding/main/source/video_coding_impl.cc @@ -229,51 +229,6 @@ VideoCodingModuleImpl::Process() return returnValue; } -// Returns version of the module and its components -WebRtc_Word32 -VideoCodingModuleImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(webrtc::kTraceModuleCall, - webrtc::kTraceVideoCoding, - VCMId(_id), - "Version()"); - if (version == NULL) - { - WEBRTC_TRACE(webrtc::kTraceWarning, - webrtc::kTraceVideoCoding, - VCMId(_id), - "Invalid buffer pointer in argument to Version()"); - return VCM_PARAMETER_ERROR; - } - WebRtc_Word8 ourVersion[] = "VideoCodingModule 1.1.0\n"; - WebRtc_UWord32 ourLength = (WebRtc_UWord32)strlen(ourVersion); - if (remainingBufferInBytes < ourLength) - { - return VCM_MEMORY; - } - memcpy(&version[position], ourVersion, ourLength); - remainingBufferInBytes -= ourLength; - position += ourLength; - - // Safe to truncate here. - WebRtc_Word32 ret = _codecDataBase.Version(version, - remainingBufferInBytes, - position); - if (ret < 0) - { - return ret; - } - // Ensure the strlen call is safe by terminating at the end of version. - version[position + remainingBufferInBytes - 1] = '\0'; - ourLength = (WebRtc_UWord32)strlen(&version[position]); - remainingBufferInBytes -= (ourLength + 1); // include null termination. - position += (ourLength + 1); - - return VCM_OK; -} - WebRtc_Word32 VideoCodingModuleImpl::Id() const { diff --git a/src/modules/video_coding/main/source/video_coding_impl.h b/src/modules/video_coding/main/source/video_coding_impl.h index 9f0fb2f0a..8276179bf 100644 --- a/src/modules/video_coding/main/source/video_coding_impl.h +++ b/src/modules/video_coding/main/source/video_coding_impl.h @@ -63,11 +63,6 @@ public: virtual ~VideoCodingModuleImpl(); - // Returns version of the module and its components - WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - WebRtc_Word32 Id() const; // Change the unique identifier of this object diff --git a/src/modules/video_coding/main/test/codec_database_test.cc b/src/modules/video_coding/main/test/codec_database_test.cc index c8829e82b..158401265 100644 --- a/src/modules/video_coding/main/test/codec_database_test.cc +++ b/src/modules/video_coding/main/test/codec_database_test.cc @@ -104,11 +104,6 @@ CodecDataBaseTest::Perform(CmdArgs& args) /************************/ VideoCodec sendCodec, receiveCodec; TEST(VideoCodingModule::NumberOfCodecs() > 0); - WebRtc_Word8 version[512]; - WebRtc_UWord32 length = 512; - WebRtc_UWord32 position = 0; - TEST(_vcm->Version(version, length, position) == VCM_OK); - printf("%s", version); _vcm->InitializeReceiver(); _vcm->InitializeSender(); VCMDecodeCompleteCallback *_decodeCallback = new VCMDecodeCompleteCallback(_decodedFile); diff --git a/src/modules/video_processing/main/interface/video_processing.h b/src/modules/video_processing/main/interface/video_processing.h index 0ffc5b2df..512cace03 100644 --- a/src/modules/video_processing/main/interface/video_processing.h +++ b/src/modules/video_processing/main/interface/video_processing.h @@ -89,27 +89,6 @@ public: */ static void Destroy(VideoProcessingModule* module); - /** - Retrieves the version of the module and its components. - - \param[in,out] version - Buffer to which the null-terminated version string will be copied. - - \param[in,out] remainingBufferInBytes - Bytes remaining between the supplied position and the end of the buffer. - This will reflect the new remaining size at return. - - \param[in,out] position - Position in bytes within the buffer to place the version string. This - will reflect the first byte position following the version string at - return. - - \return 0 on success, -1 on failure. - */ - static WebRtc_Word32 GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position); - /** Not supported. */ diff --git a/src/modules/video_processing/main/source/video_processing_impl.cc b/src/modules/video_processing/main/source/video_processing_impl.cc index 05eb5de6b..ae5dc95a3 100644 --- a/src/modules/video_processing/main/source/video_processing_impl.cc +++ b/src/modules/video_processing/main/source/video_processing_impl.cc @@ -80,17 +80,6 @@ VideoProcessingModuleImpl::ChangeUniqueId(const WebRtc_Word32 id) return VPM_OK; } -WebRtc_Word32 -VideoProcessingModuleImpl::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - CriticalSectionScoped mutex(_mutex); - WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceVideoPreocessing, _id, "Version(bufferLength:%d)", - remainingBufferInBytes); - return GetVersion(version, remainingBufferInBytes, position); -} - WebRtc_Word32 VideoProcessingModuleImpl::Id() const { @@ -98,32 +87,6 @@ VideoProcessingModuleImpl::Id() const return _id; } -WebRtc_Word32 -VideoProcessingModule::GetVersion(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) -{ - if (version == NULL) - { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, -1, - "Null version pointer"); - return -1; - } - WebRtc_Word8 ourVersion[] = "VideoProcessingModule 1.1.0"; - WebRtc_UWord32 ourLength = (WebRtc_UWord32)sizeof(ourVersion); // Includes null termination. - if (remainingBufferInBytes < ourLength) - { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, -1, - "Buffer of insufficient length"); - return VPM_PARAMETER_ERROR; - } - memcpy(&version[position], ourVersion, ourLength); - remainingBufferInBytes -= ourLength; - position += ourLength; - - return VPM_OK; -} - VideoProcessingModuleImpl::VideoProcessingModuleImpl(const WebRtc_Word32 id) : _id(id), _mutex(*CriticalSectionWrapper::CreateCriticalSection()) diff --git a/src/modules/video_processing/main/source/video_processing_impl.h b/src/modules/video_processing/main/source/video_processing_impl.h index 50ff91679..3170ab133 100644 --- a/src/modules/video_processing/main/source/video_processing_impl.h +++ b/src/modules/video_processing/main/source/video_processing_impl.h @@ -30,10 +30,6 @@ public: virtual ~VideoProcessingModuleImpl(); - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - WebRtc_Word32 Id() const; virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id); diff --git a/src/modules/video_processing/main/test/unit_test/unit_test.cc b/src/modules/video_processing/main/test/unit_test/unit_test.cc index 32c31129c..ea00e6c17 100644 --- a/src/modules/video_processing/main/test/unit_test/unit_test.cc +++ b/src/modules/video_processing/main/test/unit_test/unit_test.cc @@ -60,31 +60,6 @@ void VideoProcessingModuleTest::TearDown() _vpm = NULL; } -TEST_F(VideoProcessingModuleTest, GetVersionTest) -{ - WebRtc_Word8 version[255]; - WebRtc_UWord32 remainingBuffer = sizeof(version); - WebRtc_UWord32 position = 0; - - EXPECT_EQ(-1, VideoProcessingModule::GetVersion(NULL, remainingBuffer, - position)); - EXPECT_EQ(-1, _vpm->GetVersion(NULL, remainingBuffer, position)); - - WebRtc_UWord32 badRemainingBuffer = 5; - EXPECT_EQ(-3, VideoProcessingModule::GetVersion(version, badRemainingBuffer, - position)); - EXPECT_EQ(-3, _vpm->GetVersion(version, badRemainingBuffer, position)); - - EXPECT_EQ(0, VideoProcessingModule::GetVersion(version, remainingBuffer, - position)); - EXPECT_EQ(remainingBuffer, sizeof(version) - position); - printf("\n%s\n\n", version); - - EXPECT_EQ(0, _vpm->GetVersion(&version[position], remainingBuffer, - position)); - EXPECT_EQ(remainingBuffer, sizeof(version) - position); -} - TEST_F(VideoProcessingModuleTest, HandleNullBuffer) { VideoProcessingModule::FrameStats stats; diff --git a/src/modules/video_render/main/interface/video_render.h b/src/modules/video_render/main/interface/video_render.h index 3ae77cd95..42fce7020 100644 --- a/src/modules/video_render/main/interface/video_render.h +++ b/src/modules/video_render/main/interface/video_render.h @@ -51,17 +51,6 @@ public: */ static void DestroyVideoRender(VideoRender* module); - /* - * Returns version of the module and its components - * - * version - buffer to which the version will be written - * remainingBufferInBytes - remaining number of WebRtc_Word8 in the version buffer - * position - position of the next empty WebRtc_Word8 in the version buffer - */ - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const = 0; - /* * Change the unique identifier of this object * diff --git a/src/modules/video_render/main/source/video_render_impl.cc b/src/modules/video_render/main/source/video_render_impl.cc index 748ea876f..acda2bc2f 100644 --- a/src/modules/video_render/main/source/video_render_impl.cc +++ b/src/modules/video_render/main/source/video_render_impl.cc @@ -328,33 +328,6 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl() } } -WebRtc_Word32 ModuleVideoRenderImpl::Version( - WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, _id, - "%s", __FUNCTION__); - if (version == NULL) - { - WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, - "Version pointer is NULL"); - return -1; - } - WebRtc_Word8 ourVersion[256] = "VideoRender 1.1.0"; - WebRtc_Word32 ourLength = (WebRtc_Word32) strlen(ourVersion); - if ((WebRtc_Word32) remainingBufferInBytes < ourLength + 1) - { - WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, _id, - "Version buffer not long enough"); - return -1; - } - memcpy(version, ourVersion, ourLength); - version[ourLength] = 0; // null terminaion - position += ourLength; - return 0; -} - WebRtc_Word32 ModuleVideoRenderImpl::ChangeUniqueId(const WebRtc_Word32 id) { WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, _id, diff --git a/src/modules/video_render/main/source/video_render_impl.h b/src/modules/video_render/main/source/video_render_impl.h index ddc0fc75f..16f934edf 100644 --- a/src/modules/video_render/main/source/video_render_impl.h +++ b/src/modules/video_render/main/source/video_render_impl.h @@ -36,13 +36,6 @@ public: virtual ~ModuleVideoRenderImpl(); - /* - * Returns version of the module and its components - */ - virtual WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - /* * Change the unique identifier of this object */ diff --git a/src/video_engine/vie_base_impl.cc b/src/video_engine/vie_base_impl.cc index 929e76de7..ee9649800 100644 --- a/src/video_engine/vie_base_impl.cc +++ b/src/video_engine/vie_base_impl.cc @@ -436,7 +436,6 @@ int ViEBaseImpl::GetVersion(char version[1024]) { acc_len += len; assert(acc_len < kViEVersionMaxMessageSize); -#ifdef WEBRTC_EXTERNAL_TRANSPORT len = AddExternalTransportBuild(version_ptr); if (len == -1) { SetLastError(kViEBaseUnknownError); @@ -445,63 +444,6 @@ int ViEBaseImpl::GetVersion(char version[1024]) { version_ptr += len; acc_len += len; assert(acc_len < kViEVersionMaxMessageSize); -#endif - - len = AddVCMVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); - -#ifndef WEBRTC_EXTERNAL_TRANSPORT - len = AddSocketModuleVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); -#endif - - len = AddRtpRtcpModuleVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); - - len = AddVideoCaptureVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); - - len = AddRenderVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); - - len = AddVideoProcessingVersion(version_ptr); - if (len == -1) { - SetLastError(kViEBaseUnknownError); - return -1; - } - version_ptr += len; - acc_len += len; - assert(acc_len < kViEVersionMaxMessageSize); memcpy(version, version_buf, acc_len); version[acc_len] = '\0'; @@ -523,63 +465,12 @@ WebRtc_Word32 ViEBaseImpl::AddViEVersion(char* str) const { return sprintf(str, "VideoEngine 3.1.0\n"); } -#ifdef WEBRTC_EXTERNAL_TRANSPORT WebRtc_Word32 ViEBaseImpl::AddExternalTransportBuild(char* str) const { +#ifdef WEBRTC_EXTERNAL_TRANSPORT return sprintf(str, "External transport build\n"); -} -#endif - -WebRtc_Word32 ViEBaseImpl::AddModuleVersion(webrtc::Module* module, - char* str) const { - WebRtc_Word8 version[kViEMaxModuleVersionSize]; - WebRtc_UWord32 remaining_buffer_in_bytes(kViEMaxModuleVersionSize); - WebRtc_UWord32 position(0); - if (module && module->Version(version, remaining_buffer_in_bytes, position) - == 0) { - return sprintf(str, "%s\n", version); - } - return -1; -} - -WebRtc_Word32 ViEBaseImpl::AddVCMVersion(char* str) const { - webrtc::VideoCodingModule* vcm_ptr = - webrtc::VideoCodingModule::Create(instance_id_); - int len = AddModuleVersion(vcm_ptr, str); - webrtc::VideoCodingModule::Destroy(vcm_ptr); - return len; -} - -WebRtc_Word32 ViEBaseImpl::AddVideoCaptureVersion(char* str) const { +#else return 0; -} - -WebRtc_Word32 ViEBaseImpl::AddVideoProcessingVersion(char* str) const { - webrtc::VideoProcessingModule* video_ptr = - webrtc::VideoProcessingModule::Create(instance_id_); - int len = AddModuleVersion(video_ptr, str); - webrtc::VideoProcessingModule::Destroy(video_ptr); - return len; -} -WebRtc_Word32 ViEBaseImpl::AddRenderVersion(char* str) const { - return 0; -} - -#ifndef WEBRTC_EXTERNAL_TRANSPORT -WebRtc_Word32 ViEBaseImpl::AddSocketModuleVersion(char* str) const { - WebRtc_UWord8 num_sock_threads(1); - UdpTransport* transport = UdpTransport::Create(instance_id_, - num_sock_threads); - int len = AddModuleVersion(transport, str); - UdpTransport::Destroy(transport); - return len; -} #endif - -WebRtc_Word32 ViEBaseImpl::AddRtpRtcpModuleVersion(char* str) const { - RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(-1, true); - int len = AddModuleVersion(rtp_rtcp, str); - RtpRtcp::DestroyRtpRtcp(rtp_rtcp); - return len; } } // namespace webrtc diff --git a/src/video_engine/vie_base_impl.h b/src/video_engine/vie_base_impl.h index a96140513..8ed878064 100644 --- a/src/video_engine/vie_base_impl.h +++ b/src/video_engine/vie_base_impl.h @@ -84,17 +84,7 @@ class ViEBaseImpl // Version functions. WebRtc_Word32 AddViEVersion(char* str) const; WebRtc_Word32 AddBuildInfo(char* str) const; -#ifdef WEBRTC_EXTERNAL_TRANSPORT WebRtc_Word32 AddExternalTransportBuild(char* str) const; -#else - WebRtc_Word32 AddSocketModuleVersion(char* str) const; -#endif - WebRtc_Word32 AddModuleVersion(webrtc::Module* module, char* str) const; - WebRtc_Word32 AddVCMVersion(char* str) const; - WebRtc_Word32 AddVideoCaptureVersion(char* str) const; - WebRtc_Word32 AddVideoProcessingVersion(char* str) const; - WebRtc_Word32 AddRenderVersion(char* str) const; - WebRtc_Word32 AddRtpRtcpModuleVersion(char* str) const; }; } // namespace webrtc diff --git a/src/voice_engine/main/source/channel.cc b/src/voice_engine/main/source/channel.cc index c27acde53..dc563b9c9 100644 --- a/src/voice_engine/main/source/channel.cc +++ b/src/voice_engine/main/source/channel.cc @@ -1383,21 +1383,7 @@ Channel::Init() "Channel::Init() modules not registered"); return -1; } - - // --- Log module versions - - Utility::TraceModuleVersion(VoEId(_instanceId,_channelId), - _audioCodingModule); -#ifndef WEBRTC_EXTERNAL_TRANSPORT - Utility::TraceModuleVersion(VoEId(_instanceId,_channelId), - _socketTransportModule); -#endif -#ifdef WEBRTC_SRTP - Utility::TraceModuleVersion(VoEId(_instanceId,_channelId), _srtpModule); -#endif - Utility::TraceModuleVersion(VoEId(_instanceId,_channelId), _rtpRtcpModule); - - // --- ACM initialization + // --- ACM initialization if ((_audioCodingModule.InitializeReceiver() == -1) || #ifdef WEBRTC_CODEC_AVT diff --git a/src/voice_engine/main/source/utility.cc b/src/voice_engine/main/source/utility.cc index 0513af3fc..6e70156ba 100644 --- a/src/voice_engine/main/source/utility.cc +++ b/src/voice_engine/main/source/utility.cc @@ -94,27 +94,6 @@ void Utility::ScaleWithSat(WebRtc_Word16 vector[], float scale, } } -void Utility::TraceModuleVersion(const WebRtc_Word32 id, - const Module& module) -{ - WebRtc_Word8 version[Utility::kMaxVersionSize] = { 0 }; - WebRtc_UWord32 remainingBufferInBytes = Utility::kMaxVersionSize; - WebRtc_UWord32 position = 0; - if (module.Version(version, remainingBufferInBytes, position) == 0) - { - WebRtc_Word8* ptr(NULL); - while ((ptr = strchr(version, '\t')) != NULL) - { - *ptr = ' '; - } - while ((ptr = strchr(version, '\n')) != NULL) - { - *ptr = ' '; - } - WEBRTC_TRACE(kTraceInfo, kTraceVoice, id, "%s", version); - } -} - } // namespace voe } // namespace webrtc diff --git a/src/voice_engine/main/source/utility.h b/src/voice_engine/main/source/utility.h index bb6f6d5f9..084ddf429 100644 --- a/src/voice_engine/main/source/utility.h +++ b/src/voice_engine/main/source/utility.h @@ -47,12 +47,6 @@ public: static void ScaleWithSat(WebRtc_Word16 vector[], float scale, WebRtc_UWord16 len); - - static void TraceModuleVersion(const WebRtc_Word32 id, - const Module& module); - -private: - enum {kMaxVersionSize = 640}; }; } // namespace voe diff --git a/src/voice_engine/main/source/voe_base_impl.cc b/src/voice_engine/main/source/voe_base_impl.cc index 723c92290..65ac21f53 100644 --- a/src/voice_engine/main/source/voe_base_impl.cc +++ b/src/voice_engine/main/source/voe_base_impl.cc @@ -508,9 +508,6 @@ int VoEBaseImpl::Init(AudioDeviceModule* external_adm) "Init() failed to create the AP module"); return -1; } - voe::Utility::TraceModuleVersion(VoEId(_instanceId, -1), - *_audioProcessingModulePtr); - // Ensure that mixers in both directions has access to the created APM _transmitMixerPtr->SetAudioProcessingModule(_audioProcessingModulePtr); _outputMixerPtr->SetAudioProcessingModule(_audioProcessingModulePtr); @@ -1250,13 +1247,12 @@ int VoEBaseImpl::GetVersion(char version[1024]) len = AddExternalTransportBuild(versionPtr); if (len == -1) { - return -1; + return -1; } versionPtr += len; accLen += len; assert(accLen < kVoiceEngineVersionMaxMessageSize); #endif - #ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT len = AddExternalRecAndPlayoutBuild(versionPtr); if (len == -1) @@ -1266,83 +1262,7 @@ int VoEBaseImpl::GetVersion(char version[1024]) versionPtr += len; accLen += len; assert(accLen < kVoiceEngineVersionMaxMessageSize); -#endif - - len = AddADMVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); - -#ifndef WEBRTC_EXTERNAL_TRANSPORT - len = AddSocketModuleVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); -#endif - -#ifdef WEBRTC_SRTP - len = AddSRTPModuleVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); -#endif - - len = AddRtpRtcpModuleVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); - - len = AddConferenceMixerVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); - - len = AddAudioProcessingModuleVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); - - len = AddACMVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); - - len = AddSPLIBVersion(versionPtr); - if (len == -1) - { - return -1; - } - versionPtr += len; - accLen += len; - assert(accLen < kVoiceEngineVersionMaxMessageSize); + #endif memcpy(version, versionBuf, accLen); version[accLen] = '\0'; @@ -1385,14 +1305,6 @@ WebRtc_Word32 VoEBaseImpl::AddVoEVersion(char* str) const return sprintf(str, "VoiceEngine 4.1.0\n"); } -WebRtc_Word32 VoEBaseImpl::AddSPLIBVersion(char* str) const -{ - char version[16]; - unsigned int len(16); - WebRtcSpl_get_version(version, len); - return sprintf(str, "SPLIB\t%s\n", version); -} - #ifdef WEBRTC_EXTERNAL_TRANSPORT WebRtc_Word32 VoEBaseImpl::AddExternalTransportBuild(char* str) const { @@ -1407,91 +1319,6 @@ WebRtc_Word32 VoEBaseImpl::AddExternalRecAndPlayoutBuild(char* str) const } #endif -WebRtc_Word32 VoEBaseImpl::AddModuleVersion(Module* module, char* str) const -{ - WebRtc_Word8 version[kVoiceEngineMaxModuleVersionSize]; - WebRtc_UWord32 remainingBufferInBytes(kVoiceEngineMaxModuleVersionSize); - WebRtc_UWord32 position(0); - if (module->Version(version, remainingBufferInBytes, position) == 0) - { - return sprintf(str, "%s\n", version); - } - return -1; -} - -WebRtc_Word32 VoEBaseImpl::AddADMVersion(char* str) const -{ - AudioDeviceModule* admPtr(_audioDevicePtr); - if (_audioDevicePtr == NULL) - { - admPtr = AudioDeviceModuleImpl::Create(-1); - } - admPtr->AddRef(); - int len = AddModuleVersion(admPtr, str); - admPtr->Release(); - return len; -} - -int VoEBaseImpl::AddAudioProcessingModuleVersion(char* str) const -{ - AudioProcessing* vpmPtr(_audioProcessingModulePtr); - if (_audioProcessingModulePtr == NULL) - { - vpmPtr = AudioProcessing::Create(-1); - } - int len = AddModuleVersion(vpmPtr, str); - if (_audioProcessingModulePtr == NULL) - { - AudioProcessing::Destroy(vpmPtr); - } - return len; -} - -WebRtc_Word32 VoEBaseImpl::AddACMVersion(char* str) const -{ - AudioCodingModule* acmPtr = AudioCodingModule::Create(-1); - int len = AddModuleVersion(acmPtr, str); - AudioCodingModule::Destroy(acmPtr); - return len; -} - -WebRtc_Word32 VoEBaseImpl::AddConferenceMixerVersion(char* str) const -{ - AudioConferenceMixer* mixerPtr = AudioConferenceMixer::Create(-1); - int len = AddModuleVersion(mixerPtr, str); - delete mixerPtr; - return len; -} - -#ifndef WEBRTC_EXTERNAL_TRANSPORT -WebRtc_Word32 VoEBaseImpl::AddSocketModuleVersion(char* str) const -{ - WebRtc_UWord8 numSockThreads(1); - UdpTransport* socketPtr = UdpTransport::Create(-1, numSockThreads); - int len = AddModuleVersion(socketPtr, str); - UdpTransport::Destroy(socketPtr); - return len; -} -#endif - -#ifdef WEBRTC_SRTP -WebRtc_Word32 VoEBaseImpl::AddSRTPModuleVersion(char* str) const -{ - SrtpModule* srtpPtr = SrtpModule::CreateSrtpModule(-1); - int len = AddModuleVersion(srtpPtr, str); - SrtpModule::DestroySrtpModule(srtpPtr); - return len; -} -#endif - -WebRtc_Word32 VoEBaseImpl::AddRtpRtcpModuleVersion(char* str) const -{ - RtpRtcp* rtpRtcpPtr = RtpRtcp::CreateRtpRtcp(-1, true); - int len = AddModuleVersion(rtpRtcpPtr, str); - RtpRtcp::DestroyRtpRtcp(rtpRtcpPtr); - return len; -} - int VoEBaseImpl::LastError() { WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1), diff --git a/src/voice_engine/main/source/voe_base_impl.h b/src/voice_engine/main/source/voe_base_impl.h index cbc2beb47..922187db2 100644 --- a/src/voice_engine/main/source/voe_base_impl.h +++ b/src/voice_engine/main/source/voe_base_impl.h @@ -132,23 +132,10 @@ private: WebRtc_Word32 AddVoEVersion(char* str) const; #ifdef WEBRTC_EXTERNAL_TRANSPORT WebRtc_Word32 AddExternalTransportBuild(char* str) const; -#else - WebRtc_Word32 AddSocketModuleVersion(char* str) const; #endif #ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT WebRtc_Word32 AddExternalRecAndPlayoutBuild(char* str) const; #endif - WebRtc_Word32 AddModuleVersion(Module* module, char* str) const; - WebRtc_Word32 AddADMVersion(char* str) const; - int AddAudioProcessingModuleVersion(char* str) const; - WebRtc_Word32 AddACMVersion(char* str) const; - WebRtc_Word32 AddConferenceMixerVersion(char* str) const; -#ifdef WEBRTC_SRTP - WebRtc_Word32 AddSRTPModuleVersion(char* str) const; -#endif - WebRtc_Word32 AddRtpRtcpModuleVersion(char* str) const; - WebRtc_Word32 AddSPLIBVersion(char* str) const; - VoiceEngineObserver* _voiceEngineObserverPtr; CriticalSectionWrapper& _callbackCritSect;