Remove unused VideoDecoder methods.
Removing VideoDecoder::Copy() and
VideoDecoder::SetCodecConfigParameters().
Also adding override to VP8DecoderImpl.
BUG=
R=mflodman@webrtc.org, stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/55409004
Cr-Commit-Position: refs/heads/master@{#9244}
diff --git a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
index e1a13df..f8204b5 100644
--- a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
+++ b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
@@ -102,11 +102,6 @@
int InitDecode(const VideoCodec* codecSettings,
int /*numberOfCores*/) override;
- int SetCodecConfigParameters(const uint8_t* /*buffer*/,
- int /*size*/) override {
- return WEBRTC_VIDEO_CODEC_OK;
- }
-
// Decode encoded image (as a part of a video stream). The decoded image
// will be returned to the user through the decode complete callback.
//
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
index c2127f0..7ab3691 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -1390,86 +1390,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-VideoDecoder* VP8DecoderImpl::Copy() {
- // Sanity checks.
- if (!inited_) {
- // Not initialized.
- assert(false);
- return NULL;
- }
- if (last_frame_width_ == 0 || last_frame_height_ == 0) {
- // Nothing has been decoded before; cannot clone.
- return NULL;
- }
- if (last_keyframe_._buffer == NULL) {
- // Cannot clone if we have no key frame to start with.
- return NULL;
- }
- // Create a new VideoDecoder object
- VP8DecoderImpl* copy = new VP8DecoderImpl;
-
- // Initialize the new decoder
- if (copy->InitDecode(&codec_, 1) != WEBRTC_VIDEO_CODEC_OK) {
- delete copy;
- return NULL;
- }
- // Inject last key frame into new decoder.
- if (vpx_codec_decode(copy->decoder_, last_keyframe_._buffer,
- last_keyframe_._length, NULL, VPX_DL_REALTIME)) {
- delete copy;
- return NULL;
- }
- // Allocate memory for reference image copy
- assert(last_frame_width_ > 0);
- assert(last_frame_height_ > 0);
- assert(image_format_ > VPX_IMG_FMT_NONE);
- // Check if frame format has changed.
- if (ref_frame_ &&
- (last_frame_width_ != static_cast<int>(ref_frame_->img.d_w) ||
- last_frame_height_ != static_cast<int>(ref_frame_->img.d_h) ||
- image_format_ != ref_frame_->img.fmt)) {
- vpx_img_free(&ref_frame_->img);
- delete ref_frame_;
- ref_frame_ = NULL;
- }
-
-
- if (!ref_frame_) {
- ref_frame_ = new vpx_ref_frame_t;
- // Setting alignment to 32 - as that ensures at least 16 for all
- // planes (32 for Y, 16 for U,V) - libvpx sets the requested stride
- // for the y plane, but only half of it to the u and v planes.
- if (!vpx_img_alloc(&ref_frame_->img,
- static_cast<vpx_img_fmt_t>(image_format_),
- last_frame_width_, last_frame_height_,
- kVp832ByteAlign)) {
- assert(false);
- delete copy;
- return NULL;
- }
- }
- const vpx_ref_frame_type_t type_vec[] = { VP8_LAST_FRAME, VP8_GOLD_FRAME,
- VP8_ALTR_FRAME };
- for (uint32_t ix = 0;
- ix < sizeof(type_vec) / sizeof(vpx_ref_frame_type_t); ++ix) {
- ref_frame_->frame_type = type_vec[ix];
- if (CopyReference(copy) < 0) {
- delete copy;
- return NULL;
- }
- }
- // Copy all member variables (that are not set in initialization).
- copy->feedback_mode_ = feedback_mode_;
- copy->image_format_ = image_format_;
- copy->last_keyframe_ = last_keyframe_; // Shallow copy.
- // Allocate memory. (Discard copied _buffer pointer.)
- copy->last_keyframe_._buffer = new uint8_t[last_keyframe_._size];
- memcpy(copy->last_keyframe_._buffer, last_keyframe_._buffer,
- last_keyframe_._length);
-
- return static_cast<VideoDecoder*>(copy);
-}
-
int VP8DecoderImpl::CopyReference(VP8DecoderImpl* copy) {
// The type of frame to copy should be set in ref_frame_->frame_type
// before the call to this function.
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
index d9c4f4b..fd5d606 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
@@ -128,21 +128,17 @@
virtual ~VP8DecoderImpl();
- virtual int InitDecode(const VideoCodec* inst, int number_of_cores);
+ int InitDecode(const VideoCodec* inst, int number_of_cores) override;
- virtual int Decode(const EncodedImage& input_image,
+ int Decode(const EncodedImage& input_image,
bool missing_frames,
const RTPFragmentationHeader* fragmentation,
const CodecSpecificInfo* codec_specific_info,
- int64_t /*render_time_ms*/);
+ int64_t /*render_time_ms*/) override;
- virtual int RegisterDecodeCompleteCallback(DecodedImageCallback* callback);
-
- virtual int Release();
-
- virtual int Reset();
-
- virtual VideoDecoder* Copy();
+ int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override;
+ int Release() override;
+ int Reset() override;
private:
// Copy reference image from this _decoder to the _decoder in copyTo. Set
diff --git a/webrtc/modules/video_coding/main/source/generic_decoder.cc b/webrtc/modules/video_coding/main/source/generic_decoder.cc
index 88bc75a..f8b45b5 100644
--- a/webrtc/modules/video_coding/main/source/generic_decoder.cc
+++ b/webrtc/modules/video_coding/main/source/generic_decoder.cc
@@ -186,11 +186,6 @@
return _decoder.Reset();
}
-int32_t VCMGenericDecoder::SetCodecConfigParameters(const uint8_t* buffer, int32_t size)
-{
- return _decoder.SetCodecConfigParameters(buffer, size);
-}
-
int32_t VCMGenericDecoder::RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback)
{
_callback = callback;
diff --git a/webrtc/modules/video_coding/main/source/generic_decoder.h b/webrtc/modules/video_coding/main/source/generic_decoder.h
index fab94bc..3befeb0 100644
--- a/webrtc/modules/video_coding/main/source/generic_decoder.h
+++ b/webrtc/modules/video_coding/main/source/generic_decoder.h
@@ -91,15 +91,6 @@
int32_t Reset();
/**
- * Codec configuration data sent out-of-band, i.e. in SIP call setup
- *
- * buffer pointer to the configuration data
- * size the size of the configuration data in bytes
- */
- int32_t SetCodecConfigParameters(const uint8_t* /*buffer*/,
- int32_t /*size*/);
-
- /**
* Set decode callback. Deregistering while decoding is illegal.
*/
int32_t RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback);
diff --git a/webrtc/video_decoder.h b/webrtc/video_decoder.h
index 6ebc392..d4770e7 100644
--- a/webrtc/video_decoder.h
+++ b/webrtc/video_decoder.h
@@ -62,13 +62,6 @@
virtual int32_t Release() = 0;
virtual int32_t Reset() = 0;
-
- virtual int32_t SetCodecConfigParameters(const uint8_t* /*buffer*/,
- int32_t /*size*/) {
- return -1;
- }
-
- virtual VideoDecoder* Copy() { return NULL; }
};
// Class used to wrap external VideoDecoders to provide a fallback option on