Deprecate VideoDecoder::Reset() and remove calls.
Removes calls to decoder reset and instead drops delta frames and requests keyframes until one arrives. BUG=webrtc:5475 R=stefan@webrtc.org TBR=mflodman@webrtc.org Review URL: https://codereview.webrtc.org/1647163002 . Cr-Commit-Position: refs/heads/master@{#11460}
This commit is contained in:
@ -147,10 +147,6 @@ I420Decoder::~I420Decoder() {
|
||||
Release();
|
||||
}
|
||||
|
||||
int I420Decoder::Reset() {
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
}
|
||||
|
||||
int I420Decoder::InitDecode(const VideoCodec* codecSettings,
|
||||
int /*numberOfCores */) {
|
||||
if (codecSettings == NULL) {
|
||||
|
||||
@ -131,12 +131,6 @@ class I420Decoder : public VideoDecoder {
|
||||
// <0 - Error
|
||||
int Release() override;
|
||||
|
||||
// Reset decoder state and prepare for a new call.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||
// <0 - Error
|
||||
int Reset() override;
|
||||
|
||||
private:
|
||||
static const uint8_t* ExtractHeader(const uint8_t* buffer,
|
||||
uint16_t* width,
|
||||
|
||||
@ -73,7 +73,6 @@ class MockVideoDecoder : public VideoDecoder {
|
||||
MOCK_METHOD1(RegisterDecodeCompleteCallback,
|
||||
int32_t(DecodedImageCallback* callback));
|
||||
MOCK_METHOD0(Release, int32_t());
|
||||
MOCK_METHOD0(Reset, int32_t());
|
||||
MOCK_METHOD0(Copy, VideoDecoder*());
|
||||
};
|
||||
|
||||
|
||||
@ -266,22 +266,4 @@ TEST_F(TestVp8Impl, MAYBE_DecodeWithACompleteKeyFrame) {
|
||||
EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36);
|
||||
}
|
||||
|
||||
TEST_F(TestVp8Impl, TestReset) {
|
||||
SetUpEncodeDecode();
|
||||
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, NULL));
|
||||
EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL));
|
||||
size_t length = CalcBufferSize(kI420, kWidth, kHeight);
|
||||
rtc::scoped_ptr<uint8_t[]> first_frame_buffer(new uint8_t[length]);
|
||||
ExtractBuffer(decoded_frame_, length, first_frame_buffer.get());
|
||||
|
||||
EXPECT_EQ(0, decoder_->Reset());
|
||||
|
||||
EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL));
|
||||
rtc::scoped_ptr<uint8_t[]> second_frame_buffer(new uint8_t[length]);
|
||||
ExtractBuffer(decoded_frame_, length, second_frame_buffer.get());
|
||||
|
||||
EXPECT_EQ(
|
||||
0, memcmp(second_frame_buffer.get(), first_frame_buffer.get(), length));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -1085,15 +1085,6 @@ VP8DecoderImpl::~VP8DecoderImpl() {
|
||||
Release();
|
||||
}
|
||||
|
||||
int VP8DecoderImpl::Reset() {
|
||||
if (!inited_) {
|
||||
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
||||
}
|
||||
InitDecode(&codec_, 1);
|
||||
propagation_cnt_ = -1;
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
}
|
||||
|
||||
int VP8DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) {
|
||||
int ret_val = Release();
|
||||
if (ret_val < 0) {
|
||||
|
||||
@ -136,7 +136,6 @@ class VP8DecoderImpl : public VP8Decoder {
|
||||
|
||||
int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override;
|
||||
int Release() override;
|
||||
int Reset() override;
|
||||
|
||||
const char* ImplementationName() const override;
|
||||
|
||||
|
||||
@ -840,14 +840,6 @@ VP9DecoderImpl::~VP9DecoderImpl() {
|
||||
}
|
||||
}
|
||||
|
||||
int VP9DecoderImpl::Reset() {
|
||||
if (!inited_) {
|
||||
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
|
||||
}
|
||||
InitDecode(&codec_, 1);
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
}
|
||||
|
||||
int VP9DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) {
|
||||
if (inst == NULL) {
|
||||
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
|
||||
|
||||
@ -149,8 +149,6 @@ class VP9DecoderImpl : public VP9Decoder {
|
||||
|
||||
int Release() override;
|
||||
|
||||
int Reset() override;
|
||||
|
||||
const char* ImplementationName() const override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user