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
This commit is contained in:
pwestin@webrtc.org 2012-02-02 12:46:58 +00:00
parent 4ea57e5e26
commit fdf21c8c55
9 changed files with 5 additions and 135 deletions

View File

@ -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;

View File

@ -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()
{

View File

@ -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:

View File

@ -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();

View File

@ -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;

View File

@ -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*/)
{

View File

@ -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,

View File

@ -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()
{

View File

@ -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();