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
@ -458,7 +458,7 @@ int32_t FilePlayerImpl::SetUpAudioDecoder()
|
|||||||
VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
|
VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
|
||||||
FileFormats fileFormat)
|
FileFormats fileFormat)
|
||||||
: FilePlayerImpl(instanceID, fileFormat),
|
: FilePlayerImpl(instanceID, fileFormat),
|
||||||
_videoDecoder(*new VideoCoder(instanceID)),
|
video_decoder_(new VideoCoder(instanceID)),
|
||||||
video_codec_info_(),
|
video_codec_info_(),
|
||||||
_decodedVideoFrames(0),
|
_decodedVideoFrames(0),
|
||||||
_encodedData(*new EncodedVideoData()),
|
_encodedData(*new EncodedVideoData()),
|
||||||
@ -468,8 +468,7 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
|
|||||||
_accumulatedRenderTimeMs(0),
|
_accumulatedRenderTimeMs(0),
|
||||||
_frameLengthMS(0),
|
_frameLengthMS(0),
|
||||||
_numberOfFramesRead(0),
|
_numberOfFramesRead(0),
|
||||||
_videoOnly(false)
|
_videoOnly(false) {
|
||||||
{
|
|
||||||
memset(&video_codec_info_, 0, sizeof(video_codec_info_));
|
memset(&video_codec_info_, 0, sizeof(video_codec_info_));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,7 +476,7 @@ VideoFilePlayerImpl::~VideoFilePlayerImpl()
|
|||||||
{
|
{
|
||||||
delete _critSec;
|
delete _critSec;
|
||||||
delete &_frameScaler;
|
delete &_frameScaler;
|
||||||
delete &_videoDecoder;
|
video_decoder_.reset();
|
||||||
delete &_encodedData;
|
delete &_encodedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,7 +522,7 @@ int32_t VideoFilePlayerImpl::StopPlayingFile()
|
|||||||
CriticalSectionScoped lock( _critSec);
|
CriticalSectionScoped lock( _critSec);
|
||||||
|
|
||||||
_decodedVideoFrames = 0;
|
_decodedVideoFrames = 0;
|
||||||
_videoDecoder.ResetDecoder();
|
video_decoder_.reset(new VideoCoder(_instanceID));
|
||||||
|
|
||||||
return FilePlayerImpl::StopPlayingFile();
|
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.
|
// Set the timestamp manually since there is no timestamp in the file.
|
||||||
// Update timestam according to 90 kHz stream.
|
// Update timestam according to 90 kHz stream.
|
||||||
_encodedData.timeStamp += (90000 / video_codec_info_.maxFramerate);
|
_encodedData.timeStamp += (90000 / video_codec_info_.maxFramerate);
|
||||||
retVal = _videoDecoder.Decode(videoFrame, _encodedData);
|
retVal = video_decoder_->Decode(videoFrame, _encodedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t renderTimeMs = TickTime::MillisecondTimestamp();
|
int64_t renderTimeMs = TickTime::MillisecondTimestamp();
|
||||||
@ -696,10 +695,9 @@ int32_t VideoFilePlayerImpl::SetUpVideoDecoder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t useNumberOfCores = 1;
|
int32_t useNumberOfCores = 1;
|
||||||
if(_videoDecoder.SetDecodeCodec(video_codec_info_, useNumberOfCores) != 0)
|
if (video_decoder_->SetDecodeCodec(video_codec_info_, useNumberOfCores) !=
|
||||||
{
|
0) {
|
||||||
WEBRTC_TRACE(
|
WEBRTC_TRACE(kTraceWarning,
|
||||||
kTraceWarning,
|
|
||||||
kTraceVideo,
|
kTraceVideo,
|
||||||
_instanceID,
|
_instanceID,
|
||||||
"FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
|
"FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
int32_t SetUpVideoDecoder();
|
int32_t SetUpVideoDecoder();
|
||||||
|
|
||||||
VideoCoder& _videoDecoder;
|
scoped_ptr<VideoCoder> video_decoder_;
|
||||||
VideoCodec video_codec_info_;
|
VideoCodec video_codec_info_;
|
||||||
int32_t _decodedVideoFrames;
|
int32_t _decodedVideoFrames;
|
||||||
|
|
||||||
|
@ -29,18 +29,6 @@ VideoCoder::~VideoCoder()
|
|||||||
VideoCodingModule::Destroy(_vcm);
|
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,
|
int32_t VideoCoder::SetEncodeCodec(VideoCodec& videoCodecInst,
|
||||||
uint32_t numberOfCores,
|
uint32_t numberOfCores,
|
||||||
uint32_t maxPayloadSize)
|
uint32_t maxPayloadSize)
|
||||||
|
@ -23,8 +23,6 @@ public:
|
|||||||
VideoCoder(uint32_t instanceID);
|
VideoCoder(uint32_t instanceID);
|
||||||
~VideoCoder();
|
~VideoCoder();
|
||||||
|
|
||||||
int32_t ResetDecoder();
|
|
||||||
|
|
||||||
int32_t SetEncodeCodec(VideoCodec& videoCodecInst,
|
int32_t SetEncodeCodec(VideoCodec& videoCodecInst,
|
||||||
uint32_t numberOfCores,
|
uint32_t numberOfCores,
|
||||||
uint32_t maxPayloadSize);
|
uint32_t maxPayloadSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user