Remove use of vcm->ResetDecoder from modules/utility.
R=asapersson@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2203006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4750 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
62b816afcf
commit
8fa436bd65
@ -457,8 +457,8 @@ int32_t FilePlayerImpl::SetUpAudioDecoder()
|
||||
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
|
||||
VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
|
||||
FileFormats fileFormat)
|
||||
: FilePlayerImpl(instanceID,fileFormat),
|
||||
_videoDecoder(*new VideoCoder(instanceID)),
|
||||
: FilePlayerImpl(instanceID, fileFormat),
|
||||
video_decoder_(new VideoCoder(instanceID)),
|
||||
video_codec_info_(),
|
||||
_decodedVideoFrames(0),
|
||||
_encodedData(*new EncodedVideoData()),
|
||||
@ -468,16 +468,15 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
|
||||
_accumulatedRenderTimeMs(0),
|
||||
_frameLengthMS(0),
|
||||
_numberOfFramesRead(0),
|
||||
_videoOnly(false)
|
||||
{
|
||||
memset(&video_codec_info_, 0, sizeof(video_codec_info_));
|
||||
_videoOnly(false) {
|
||||
memset(&video_codec_info_, 0, sizeof(video_codec_info_));
|
||||
}
|
||||
|
||||
VideoFilePlayerImpl::~VideoFilePlayerImpl()
|
||||
{
|
||||
delete _critSec;
|
||||
delete &_frameScaler;
|
||||
delete &_videoDecoder;
|
||||
video_decoder_.reset();
|
||||
delete &_encodedData;
|
||||
}
|
||||
|
||||
@ -523,7 +522,7 @@ int32_t VideoFilePlayerImpl::StopPlayingFile()
|
||||
CriticalSectionScoped lock( _critSec);
|
||||
|
||||
_decodedVideoFrames = 0;
|
||||
_videoDecoder.ResetDecoder();
|
||||
video_decoder_.reset(new VideoCoder(_instanceID));
|
||||
|
||||
return FilePlayerImpl::StopPlayingFile();
|
||||
}
|
||||
@ -578,7 +577,7 @@ int32_t VideoFilePlayerImpl::GetVideoFromFile(I420VideoFrame& videoFrame)
|
||||
// Set the timestamp manually since there is no timestamp in the file.
|
||||
// Update timestam according to 90 kHz stream.
|
||||
_encodedData.timeStamp += (90000 / video_codec_info_.maxFramerate);
|
||||
retVal = _videoDecoder.Decode(videoFrame, _encodedData);
|
||||
retVal = video_decoder_->Decode(videoFrame, _encodedData);
|
||||
}
|
||||
|
||||
int64_t renderTimeMs = TickTime::MillisecondTimestamp();
|
||||
@ -696,14 +695,13 @@ int32_t VideoFilePlayerImpl::SetUpVideoDecoder()
|
||||
}
|
||||
|
||||
int32_t useNumberOfCores = 1;
|
||||
if(_videoDecoder.SetDecodeCodec(video_codec_info_, useNumberOfCores) != 0)
|
||||
{
|
||||
WEBRTC_TRACE(
|
||||
kTraceWarning,
|
||||
kTraceVideo,
|
||||
_instanceID,
|
||||
"FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
|
||||
video_codec_info_.plName);
|
||||
if (video_decoder_->SetDecodeCodec(video_codec_info_, useNumberOfCores) !=
|
||||
0) {
|
||||
WEBRTC_TRACE(kTraceWarning,
|
||||
kTraceVideo,
|
||||
_instanceID,
|
||||
"FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
|
||||
video_codec_info_.plName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
private:
|
||||
int32_t SetUpVideoDecoder();
|
||||
|
||||
VideoCoder& _videoDecoder;
|
||||
scoped_ptr<VideoCoder> video_decoder_;
|
||||
VideoCodec video_codec_info_;
|
||||
int32_t _decodedVideoFrames;
|
||||
|
||||
|
@ -29,18 +29,6 @@ VideoCoder::~VideoCoder()
|
||||
VideoCodingModule::Destroy(_vcm);
|
||||
}
|
||||
|
||||
int32_t VideoCoder::ResetDecoder()
|
||||
{
|
||||
_vcm->ResetDecoder();
|
||||
|
||||
_vcm->InitializeSender();
|
||||
_vcm->InitializeReceiver();
|
||||
|
||||
_vcm->RegisterTransportCallback(this);
|
||||
_vcm->RegisterReceiveCallback(this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t VideoCoder::SetEncodeCodec(VideoCodec& videoCodecInst,
|
||||
uint32_t numberOfCores,
|
||||
uint32_t maxPayloadSize)
|
||||
|
@ -23,8 +23,6 @@ public:
|
||||
VideoCoder(uint32_t instanceID);
|
||||
~VideoCoder();
|
||||
|
||||
int32_t ResetDecoder();
|
||||
|
||||
int32_t SetEncodeCodec(VideoCodec& videoCodecInst,
|
||||
uint32_t numberOfCores,
|
||||
uint32_t maxPayloadSize);
|
||||
|
Loading…
Reference in New Issue
Block a user