Removing encoder reset. Function did not make sence.
Review URL: https://webrtc-codereview.appspot.com/391005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1674 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
567d507707
commit
52fd98d876
@ -527,7 +527,7 @@ WebRtc_Word32 VideoFilePlayerImpl::StopPlayingFile()
|
|||||||
CriticalSectionScoped lock( _critSec);
|
CriticalSectionScoped lock( _critSec);
|
||||||
|
|
||||||
_decodedVideoFrames = 0;
|
_decodedVideoFrames = 0;
|
||||||
_videoDecoder.Reset();
|
_videoDecoder.ResetDecoder();
|
||||||
|
|
||||||
return FilePlayerImpl::StopPlayingFile();
|
return FilePlayerImpl::StopPlayingFile();
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,6 @@ WebRtc_Word32 AviRecorder::StopRecording()
|
|||||||
_timeEvent.StopTimer();
|
_timeEvent.StopTimer();
|
||||||
|
|
||||||
StopThread();
|
StopThread();
|
||||||
_videoEncoder->Reset();
|
|
||||||
return FileRecorderImpl::StopRecording();
|
return FileRecorderImpl::StopRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -30,10 +30,9 @@ VideoCoder::~VideoCoder()
|
|||||||
VideoCodingModule::Destroy(_vcm);
|
VideoCodingModule::Destroy(_vcm);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCoder::Reset()
|
WebRtc_Word32 VideoCoder::ResetDecoder()
|
||||||
{
|
{
|
||||||
_vcm->ResetDecoder();
|
_vcm->ResetDecoder();
|
||||||
_vcm->ResetEncoder();
|
|
||||||
|
|
||||||
_vcm->InitializeSender();
|
_vcm->InitializeSender();
|
||||||
_vcm->InitializeReceiver();
|
_vcm->InitializeReceiver();
|
||||||
@ -108,7 +107,7 @@ WebRtc_Word32 VideoCoder::Encode(const VideoFrame& videoFrame,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word8 VideoCoder::DefaultPayloadType(const WebRtc_Word8* plName)
|
WebRtc_Word8 VideoCoder::DefaultPayloadType(const char* plName)
|
||||||
{
|
{
|
||||||
VideoCodec tmpCodec;
|
VideoCodec tmpCodec;
|
||||||
WebRtc_Word32 numberOfCodecs = _vcm->NumberOfCodecs();
|
WebRtc_Word32 numberOfCodecs = _vcm->NumberOfCodecs();
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -23,7 +23,7 @@ public:
|
|||||||
VideoCoder(WebRtc_UWord32 instanceID);
|
VideoCoder(WebRtc_UWord32 instanceID);
|
||||||
~VideoCoder();
|
~VideoCoder();
|
||||||
|
|
||||||
WebRtc_Word32 Reset();
|
WebRtc_Word32 ResetDecoder();
|
||||||
|
|
||||||
WebRtc_Word32 SetEncodeCodec(VideoCodec& videoCodecInst,
|
WebRtc_Word32 SetEncodeCodec(VideoCodec& videoCodecInst,
|
||||||
WebRtc_UWord32 numberOfCores,
|
WebRtc_UWord32 numberOfCores,
|
||||||
@ -41,7 +41,7 @@ public:
|
|||||||
WebRtc_Word32 Encode(const VideoFrame& videoFrame,
|
WebRtc_Word32 Encode(const VideoFrame& videoFrame,
|
||||||
EncodedVideoData& videoEncodedData);
|
EncodedVideoData& videoEncodedData);
|
||||||
|
|
||||||
WebRtc_Word8 DefaultPayloadType(const WebRtc_Word8* plName);
|
WebRtc_Word8 DefaultPayloadType(const char* plName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// VCMReceiveCallback function.
|
// VCMReceiveCallback function.
|
||||||
|
@ -65,12 +65,6 @@ public:
|
|||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||||
virtual WebRtc_Word32 Release();
|
virtual WebRtc_Word32 Release();
|
||||||
|
|
||||||
// Reset encoder state and prepare for a new call.
|
|
||||||
//
|
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
|
||||||
// <0 - Error
|
|
||||||
virtual WebRtc_Word32 Reset();
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetRates(WebRtc_UWord32 /*newBitRate*/,
|
virtual WebRtc_Word32 SetRates(WebRtc_UWord32 /*newBitRate*/,
|
||||||
WebRtc_UWord32 /*frameRate*/)
|
WebRtc_UWord32 /*frameRate*/)
|
||||||
{return WEBRTC_VIDEO_CODEC_OK;}
|
{return WEBRTC_VIDEO_CODEC_OK;}
|
||||||
|
@ -45,17 +45,6 @@ I420Encoder::Release()
|
|||||||
return WEBRTC_VIDEO_CODEC_OK;
|
return WEBRTC_VIDEO_CODEC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
|
||||||
I420Encoder::Reset()
|
|
||||||
{
|
|
||||||
if (!_inited)
|
|
||||||
{
|
|
||||||
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
|
||||||
}
|
|
||||||
return WEBRTC_VIDEO_CODEC_OK;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
WebRtc_Word32
|
WebRtc_Word32
|
||||||
I420Encoder::InitEncode(const VideoCodec* codecSettings,
|
I420Encoder::InitEncode(const VideoCodec* codecSettings,
|
||||||
WebRtc_Word32 /*numberOfCores*/,
|
WebRtc_Word32 /*numberOfCores*/,
|
||||||
|
@ -115,11 +115,6 @@ public:
|
|||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||||
virtual WebRtc_Word32 Release() = 0;
|
virtual WebRtc_Word32 Release() = 0;
|
||||||
|
|
||||||
// Reset encoder state and prepare for a new call.
|
|
||||||
//
|
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
|
||||||
virtual WebRtc_Word32 Reset() = 0;
|
|
||||||
|
|
||||||
// Inform the encoder about the packet loss and round trip time on the
|
// Inform the encoder about the packet loss and round trip time on the
|
||||||
// network used to decide the best pattern and signaling.
|
// network used to decide the best pattern and signaling.
|
||||||
//
|
//
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -373,7 +373,6 @@ UnitTest::Perform()
|
|||||||
VideoBufferToRawImage(_inputVideoBuffer, inputImage);
|
VideoBufferToRawImage(_inputVideoBuffer, inputImage);
|
||||||
EXPECT_TRUE(_encoder->Encode(inputImage, NULL, &videoFrameType )
|
EXPECT_TRUE(_encoder->Encode(inputImage, NULL, &videoFrameType )
|
||||||
== WEBRTC_VIDEO_CODEC_UNINITIALIZED);
|
== WEBRTC_VIDEO_CODEC_UNINITIALIZED);
|
||||||
EXPECT_TRUE(_encoder->Reset() == WEBRTC_VIDEO_CODEC_UNINITIALIZED);
|
|
||||||
|
|
||||||
//-- InitEncode() errors --
|
//-- InitEncode() errors --
|
||||||
// Null pointer.
|
// Null pointer.
|
||||||
@ -475,7 +474,6 @@ UnitTest::Perform()
|
|||||||
EXPECT_TRUE(_encoder->Encode(inputImage, NULL, &videoFrameType) ==
|
EXPECT_TRUE(_encoder->Encode(inputImage, NULL, &videoFrameType) ==
|
||||||
WEBRTC_VIDEO_CODEC_OK);
|
WEBRTC_VIDEO_CODEC_OK);
|
||||||
WaitForEncodedFrame();
|
WaitForEncodedFrame();
|
||||||
EXPECT_TRUE(_encoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
|
||||||
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
||||||
_encoder->Encode(inputImage, NULL, &videoFrameType);
|
_encoder->Encode(inputImage, NULL, &videoFrameType);
|
||||||
frameLength = WaitForEncodedFrame();
|
frameLength = WaitForEncodedFrame();
|
||||||
@ -679,7 +677,6 @@ UnitTest::Perform()
|
|||||||
_inst.maxBitrate = 0;
|
_inst.maxBitrate = 0;
|
||||||
|
|
||||||
//-- Timestamp propagation --
|
//-- Timestamp propagation --
|
||||||
EXPECT_TRUE(_encoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
|
||||||
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
||||||
EXPECT_TRUE(_decoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_decoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
||||||
EXPECT_TRUE(_decoder->InitDecode(&_inst, 1) == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_decoder->InitDecode(&_inst, 1) == WEBRTC_VIDEO_CODEC_OK);
|
||||||
@ -745,7 +742,6 @@ UnitTest::RateControlTests()
|
|||||||
// Do not specify maxBitRate (as in ViE).
|
// Do not specify maxBitRate (as in ViE).
|
||||||
_inst.maxBitrate = 0;
|
_inst.maxBitrate = 0;
|
||||||
//-- Verify rate control --
|
//-- Verify rate control --
|
||||||
EXPECT_TRUE(_encoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
|
||||||
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_encoder->InitEncode(&_inst, 1, 1440) == WEBRTC_VIDEO_CODEC_OK);
|
||||||
EXPECT_TRUE(_decoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_decoder->Reset() == WEBRTC_VIDEO_CODEC_OK);
|
||||||
EXPECT_TRUE(_decoder->InitDecode(&_inst, 1) == WEBRTC_VIDEO_CODEC_OK);
|
EXPECT_TRUE(_decoder->InitDecode(&_inst, 1) == WEBRTC_VIDEO_CODEC_OK);
|
||||||
@ -759,7 +755,6 @@ UnitTest::RateControlTests()
|
|||||||
{
|
{
|
||||||
_bitRate = bitRate[i];
|
_bitRate = bitRate[i];
|
||||||
int totalBytes = 0;
|
int totalBytes = 0;
|
||||||
_encoder->Reset();
|
|
||||||
_inst.startBitrate = _bitRate;
|
_inst.startBitrate = _bitRate;
|
||||||
_encoder->InitEncode(&_inst, 4, 1440);
|
_encoder->InitEncode(&_inst, 4, 1440);
|
||||||
_decoder->Reset();
|
_decoder->Reset();
|
||||||
|
@ -39,14 +39,6 @@ class VP8Encoder : public VideoEncoder {
|
|||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||||
virtual int Release();
|
virtual int Release();
|
||||||
|
|
||||||
// Reset encoder state and prepare for a new call.
|
|
||||||
//
|
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
|
||||||
// <0 - Errors:
|
|
||||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
|
||||||
// WEBRTC_VIDEO_CODEC_ERROR
|
|
||||||
virtual int Reset();
|
|
||||||
|
|
||||||
// Initialize the encoder with the information from the codecSettings
|
// Initialize the encoder with the information from the codecSettings
|
||||||
//
|
//
|
||||||
// Input:
|
// Input:
|
||||||
|
@ -91,24 +91,6 @@ int VP8Encoder::Release() {
|
|||||||
return WEBRTC_VIDEO_CODEC_OK;
|
return WEBRTC_VIDEO_CODEC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int VP8Encoder::Reset() {
|
|
||||||
if (!inited_) {
|
|
||||||
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
|
||||||
}
|
|
||||||
if (encoder_ != NULL) {
|
|
||||||
if (vpx_codec_destroy(encoder_)) {
|
|
||||||
return WEBRTC_VIDEO_CODEC_MEMORY;
|
|
||||||
}
|
|
||||||
delete encoder_;
|
|
||||||
encoder_ = NULL;
|
|
||||||
}
|
|
||||||
timestamp_ = 0;
|
|
||||||
encoder_ = new vpx_codec_ctx_t;
|
|
||||||
rps_->Init();
|
|
||||||
|
|
||||||
return InitAndSetControlSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
int VP8Encoder::SetRates(uint32_t new_bitrate_kbit, uint32_t new_framerate) {
|
int VP8Encoder::SetRates(uint32_t new_bitrate_kbit, uint32_t new_framerate) {
|
||||||
if (!inited_) {
|
if (!inited_) {
|
||||||
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -91,13 +91,6 @@ public:
|
|||||||
// < 0, on error.
|
// < 0, on error.
|
||||||
virtual WebRtc_Word32 InitializeSender() = 0;
|
virtual WebRtc_Word32 InitializeSender() = 0;
|
||||||
|
|
||||||
// Resets the encoder state to the same state as when the encoder
|
|
||||||
// was created.
|
|
||||||
//
|
|
||||||
// Return value : VCM_OK, on success.
|
|
||||||
// < 0, on error.
|
|
||||||
virtual WebRtc_Word32 ResetEncoder() = 0;
|
|
||||||
|
|
||||||
// Registers a codec to be used for encoding. Calling this
|
// Registers a codec to be used for encoding. Calling this
|
||||||
// API multiple times overwrites any previously registered codecs.
|
// API multiple times overwrites any previously registered codecs.
|
||||||
//
|
//
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -33,15 +33,6 @@ VCMGenericEncoder::~VCMGenericEncoder()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
|
||||||
VCMGenericEncoder::Reset()
|
|
||||||
{
|
|
||||||
_bitRate = 0;
|
|
||||||
_frameRate = 0;
|
|
||||||
_VCMencodedFrameCallback = NULL;
|
|
||||||
return _encoder.Reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
WebRtc_Word32 VCMGenericEncoder::Release()
|
WebRtc_Word32 VCMGenericEncoder::Release()
|
||||||
{
|
{
|
||||||
_bitRate = 0;
|
_bitRate = 0;
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -81,10 +81,6 @@ public:
|
|||||||
VCMGenericEncoder(VideoEncoder& encoder, bool internalSource = false);
|
VCMGenericEncoder(VideoEncoder& encoder, bool internalSource = false);
|
||||||
~VCMGenericEncoder();
|
~VCMGenericEncoder();
|
||||||
/**
|
/**
|
||||||
* Reset the encoder state, prepare for a new call
|
|
||||||
*/
|
|
||||||
WebRtc_Word32 Reset();
|
|
||||||
/**
|
|
||||||
* Free encoder memory
|
* Free encoder memory
|
||||||
*/
|
*/
|
||||||
WebRtc_Word32 Release();
|
WebRtc_Word32 Release();
|
||||||
|
@ -344,22 +344,6 @@ VideoCodingModuleImpl::InitializeSender()
|
|||||||
return VCM_OK;
|
return VCM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes sure the encoder is in its initial state.
|
|
||||||
WebRtc_Word32
|
|
||||||
VideoCodingModuleImpl::ResetEncoder()
|
|
||||||
{
|
|
||||||
WEBRTC_TRACE(webrtc::kTraceModuleCall,
|
|
||||||
webrtc::kTraceVideoCoding,
|
|
||||||
VCMId(_id),
|
|
||||||
"ResetEncoder()");
|
|
||||||
CriticalSectionScoped cs(_sendCritSect);
|
|
||||||
if (_encoder != NULL)
|
|
||||||
{
|
|
||||||
return _encoder->Reset();
|
|
||||||
}
|
|
||||||
return VCM_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register the send codec to be used.
|
// Register the send codec to be used.
|
||||||
WebRtc_Word32
|
WebRtc_Word32
|
||||||
VideoCodingModuleImpl::RegisterSendCodec(const VideoCodec* sendCodec,
|
VideoCodingModuleImpl::RegisterSendCodec(const VideoCodec* sendCodec,
|
||||||
|
@ -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
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -81,9 +81,6 @@ public:
|
|||||||
// Initialize send codec
|
// Initialize send codec
|
||||||
virtual WebRtc_Word32 InitializeSender();
|
virtual WebRtc_Word32 InitializeSender();
|
||||||
|
|
||||||
// Makes sure the encoder is in its initial state.
|
|
||||||
virtual WebRtc_Word32 ResetEncoder();
|
|
||||||
|
|
||||||
// Register the send codec to be used.
|
// Register the send codec to be used.
|
||||||
virtual WebRtc_Word32 RegisterSendCodec(const VideoCodec* sendCodec,
|
virtual WebRtc_Word32 RegisterSendCodec(const VideoCodec* sendCodec,
|
||||||
WebRtc_UWord32 numberOfCores,
|
WebRtc_UWord32 numberOfCores,
|
||||||
|
Loading…
Reference in New Issue
Block a user