From fdf21c8c5575fd61703313e070c183011b7d937b Mon Sep 17 00:00:00 2001 From: "pwestin@webrtc.org" Date: Thu, 2 Feb 2012 12:46:58 +0000 Subject: [PATCH] Removed dead version code. Review URL: https://webrtc-codereview.appspot.com/377003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1594 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../codecs/i420/main/interface/i420.h | 16 +-------- .../codecs/i420/main/source/i420.cc | 23 +------------ .../codecs/interface/video_codec_interface.h | 14 +------- .../codecs/vp8/main/interface/vp8.h | 15 --------- .../codecs/vp8/main/source/vp8.cc | 16 --------- .../codecs/vp8/main/test/unit_test.cc | 14 +------- .../codecs/vp8/main/test/unit_test.h | 3 +- .../main/source/codec_database.cc | 33 ------------------- .../video_coding/main/source/codec_database.h | 6 ---- 9 files changed, 5 insertions(+), 135 deletions(-) diff --git a/src/modules/video_coding/codecs/i420/main/interface/i420.h b/src/modules/video_coding/codecs/i420/main/interface/i420.h index 9f4dee770..7c36fe840 100644 --- a/src/modules/video_coding/codecs/i420/main/interface/i420.h +++ b/src/modules/video_coding/codecs/i420/main/interface/i420.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -83,20 +83,6 @@ public: WebRtc_Word32 /*size*/) {return WEBRTC_VIDEO_CODEC_OK;} -// Get version number for the codec. -// -// Input: -// - version : Pointer to allocated char buffer. -// - length : Length of provided char buffer. -// -// Output: -// - version : Version number string written to char buffer. -// -// Return value : >0 - Length of written string. -// <0 - Error - static WebRtc_Word32 VersionStatic(WebRtc_Word8 *version, WebRtc_Word32 length); - virtual WebRtc_Word32 Version(WebRtc_Word8 *version, WebRtc_Word32 length) const; - private: bool _inited; EncodedImage _encodedImage; diff --git a/src/modules/video_coding/codecs/i420/main/source/i420.cc b/src/modules/video_coding/codecs/i420/main/source/i420.cc index 3c886cc41..460a021e2 100644 --- a/src/modules/video_coding/codecs/i420/main/source/i420.cc +++ b/src/modules/video_coding/codecs/i420/main/source/i420.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -32,27 +32,6 @@ I420Encoder::~I420Encoder() } } -WebRtc_Word32 -I420Encoder::VersionStatic(WebRtc_Word8* version, WebRtc_Word32 length) -{ - const WebRtc_Word8* str= "I420 version 1.1.0\n"; - WebRtc_Word32 verLen = (WebRtc_Word32)strlen(str); - if(verLen > length) - { - return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; - } - strncpy(version, str,length); - return verLen; -} - -WebRtc_Word32 -I420Encoder::Version(WebRtc_Word8 *version, WebRtc_Word32 length) const -{ - return VersionStatic(version, length); -} - - - WebRtc_Word32 I420Encoder::Release() { diff --git a/src/modules/video_coding/codecs/interface/video_codec_interface.h b/src/modules/video_coding/codecs/interface/video_codec_interface.h index 7b7f8223c..1c73469c6 100644 --- a/src/modules/video_coding/codecs/interface/video_codec_interface.h +++ b/src/modules/video_coding/codecs/interface/video_codec_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -77,18 +77,6 @@ class VideoEncoder public: virtual ~VideoEncoder() {}; - // Get the encoder version. - // - // Input: - // - length : Length of the version buffer. - // - // Output: - // - version : Buffer where the version string will be written. - // - // Return value : Number of bytes written to the version buffer. - // < 0 on failure. - virtual WebRtc_Word32 Version(WebRtc_Word8 *version, WebRtc_Word32 length) const = 0; - // Initialize the encoder with the information from the VideoCodec. // // Input: diff --git a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h index 855fbeb95..652991d33 100644 --- a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h +++ b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h @@ -111,21 +111,6 @@ class VP8Encoder : public VideoEncoder { // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate); - // Get version number for the codec. - // - // Input: - // - version : Pointer to allocated char buffer. - // - length : Length of provided char buffer. - // - // Output: - // - version : Version number string written to char buffer. - // - // Return value : >0 - Length of written string. - // <0 - WEBRTC_VIDEO_CODEC_ERR_SIZE - virtual int Version(char *version, int length) const; - - static int VersionStatic(char *version, int length); - private: VP8Encoder(); diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc index 3a2153435..0f29843f9 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -60,22 +60,6 @@ VP8Encoder::~VP8Encoder() { delete rps_; } -int VP8Encoder::VersionStatic(char* version, int length) { - const char* str = vpx_codec_iface_name(vpx_codec_vp8_cx()); - int verLen = (int)strlen(str); - // Accounting for "\0" and "\n" (to be added a bit later) - if (verLen + 2 > length) { - return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; - } - strcpy(version, str); - strcat(version, "\n"); - return (verLen + 2); -} - -int VP8Encoder::Version(char *version, int length) const { - return VersionStatic(version, length); -} - int VP8Encoder::Release() { if (encoded_image_._buffer != NULL) { delete [] encoded_image_._buffer; diff --git a/src/modules/video_coding/codecs/vp8/main/test/unit_test.cc b/src/modules/video_coding/codecs/vp8/main/test/unit_test.cc index 35cd8718d..5ba35ec17 100644 --- a/src/modules/video_coding/codecs/vp8/main/test/unit_test.cc +++ b/src/modules/video_coding/codecs/vp8/main/test/unit_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -31,18 +31,6 @@ UnitTest(name, description) { } -void -VP8UnitTest::Print() -{ - WebRtc_Word8 versionStr[64]; - - // GetVersion tests. - - EXPECT_TRUE(_encoder->Version(versionStr, sizeof(versionStr)) > 0); -// printf("\n%s", versionStr); -// UnitTest::Print(); -} - WebRtc_UWord32 VP8UnitTest::CodecSpecific_SetBitrate(WebRtc_UWord32 bitRate, WebRtc_UWord32 /*frameRate*/) { diff --git a/src/modules/video_coding/codecs/vp8/main/test/unit_test.h b/src/modules/video_coding/codecs/vp8/main/test/unit_test.h index 5e6652d48..e9287e61d 100644 --- a/src/modules/video_coding/codecs/vp8/main/test/unit_test.h +++ b/src/modules/video_coding/codecs/vp8/main/test/unit_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -19,7 +19,6 @@ public: VP8UnitTest(); VP8UnitTest(std::string name, std::string description); virtual void Perform(); - virtual void Print(); protected: virtual WebRtc_UWord32 CodecSpecific_SetBitrate(WebRtc_UWord32 bitRate, diff --git a/src/modules/video_coding/main/source/codec_database.cc b/src/modules/video_coding/main/source/codec_database.cc index 0175cd368..6f818953d 100644 --- a/src/modules/video_coding/main/source/codec_database.cc +++ b/src/modules/video_coding/main/source/codec_database.cc @@ -79,39 +79,6 @@ VCMCodecDataBase::~VCMCodecDataBase() Reset(); } -WebRtc_Word32 -VCMCodecDataBase::Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const -{ - VCMGenericEncoder* encoder = NULL; - VideoCodec settings; - WebRtc_Word32 ret; - for (int i = 0; i < VCMCodecDataBase::NumberOfCodecs(); i++) - { - ret = VCMCodecDataBase::Codec(i, &settings); - if (ret < 0) - { - return ret; - } - encoder = CreateEncoder(settings.codecType); - if (encoder == NULL) - { - return VCM_MEMORY; - } - ret = encoder->_encoder.Version(&version[position], remainingBufferInBytes); - if (ret < 0) - { - return ret; - } - remainingBufferInBytes -= ret; - position += ret; - delete &encoder->_encoder; - delete encoder; - } - return VCM_OK; -} - WebRtc_Word32 VCMCodecDataBase::Reset() { diff --git a/src/modules/video_coding/main/source/codec_database.h b/src/modules/video_coding/main/source/codec_database.h index 73ba444cc..aab8229ae 100644 --- a/src/modules/video_coding/main/source/codec_database.h +++ b/src/modules/video_coding/main/source/codec_database.h @@ -58,12 +58,6 @@ public: VCMCodecDataBase(WebRtc_Word32 id); ~VCMCodecDataBase(); /** - * Fills "version" with the version of all codecs supported. - */ - WebRtc_Word32 Version(WebRtc_Word8* version, - WebRtc_UWord32& remainingBufferInBytes, - WebRtc_UWord32& position) const; - /** * Release codecdatabase - release all memory for both send and receive side */ WebRtc_Word32 Reset();