diff --git a/common_video/include/video_frame_buffer.h b/common_video/include/video_frame_buffer.h index 4542fa23c2..f813851b9a 100644 --- a/common_video/include/video_frame_buffer.h +++ b/common_video/include/video_frame_buffer.h @@ -20,43 +20,6 @@ namespace webrtc { -// Deprecated. Please use WrapI420Buffer(...) instead. -class WrappedI420Buffer : public I420BufferInterface { - public: - WrappedI420Buffer(int width, - int height, - const uint8_t* y_plane, - int y_stride, - const uint8_t* u_plane, - int u_stride, - const uint8_t* v_plane, - int v_stride, - const rtc::Callback0& no_longer_used); - int width() const override; - int height() const override; - - const uint8_t* DataY() const override; - const uint8_t* DataU() const override; - const uint8_t* DataV() const override; - int StrideY() const override; - int StrideU() const override; - int StrideV() const override; - - private: - friend class rtc::RefCountedObject; - ~WrappedI420Buffer() override; - - const int width_; - const int height_; - const uint8_t* const y_plane_; - const uint8_t* const u_plane_; - const uint8_t* const v_plane_; - const int y_stride_; - const int u_stride_; - const int v_stride_; - rtc::Callback0 no_longer_used_cb_; -}; - rtc::scoped_refptr WrapI420Buffer( int width, int height, diff --git a/common_video/video_frame_buffer.cc b/common_video/video_frame_buffer.cc index 2cd0b290f1..f4f138fccb 100644 --- a/common_video/video_frame_buffer.cc +++ b/common_video/video_frame_buffer.cc @@ -203,57 +203,6 @@ rtc::scoped_refptr I010BufferBase::ToI420() { } // namespace -WrappedI420Buffer::WrappedI420Buffer(int width, - int height, - const uint8_t* y_plane, - int y_stride, - const uint8_t* u_plane, - int u_stride, - const uint8_t* v_plane, - int v_stride, - const rtc::Callback0& no_longer_used) - : width_(width), - height_(height), - y_plane_(y_plane), - u_plane_(u_plane), - v_plane_(v_plane), - y_stride_(y_stride), - u_stride_(u_stride), - v_stride_(v_stride), - no_longer_used_cb_(no_longer_used) {} - -WrappedI420Buffer::~WrappedI420Buffer() { - no_longer_used_cb_(); -} - -int WrappedI420Buffer::width() const { - return width_; -} - -int WrappedI420Buffer::height() const { - return height_; -} - -const uint8_t* WrappedI420Buffer::DataY() const { - return y_plane_; -} -const uint8_t* WrappedI420Buffer::DataU() const { - return u_plane_; -} -const uint8_t* WrappedI420Buffer::DataV() const { - return v_plane_; -} - -int WrappedI420Buffer::StrideY() const { - return y_stride_; -} -int WrappedI420Buffer::StrideU() const { - return u_stride_; -} -int WrappedI420Buffer::StrideV() const { - return v_stride_; -} - rtc::scoped_refptr WrapI420Buffer( int width, int height, diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc index 73d45837af..e213223ca4 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -323,13 +323,11 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, // without copying the underlying buffer. if (av_frame_->width != i420_buffer->width() || av_frame_->height != i420_buffer->height()) { - rtc::scoped_refptr cropped_buf( - new rtc::RefCountedObject( - av_frame_->width, av_frame_->height, - i420_buffer->DataY(), i420_buffer->StrideY(), - i420_buffer->DataU(), i420_buffer->StrideU(), - i420_buffer->DataV(), i420_buffer->StrideV(), - rtc::KeepRefUntilDone(i420_buffer))); + rtc::scoped_refptr cropped_buf = WrapI420Buffer( + av_frame_->width, av_frame_->height, i420_buffer->DataY(), + i420_buffer->StrideY(), i420_buffer->DataU(), i420_buffer->StrideU(), + i420_buffer->DataV(), i420_buffer->StrideV(), + rtc::KeepRefUntilDone(i420_buffer)); VideoFrame cropped_frame = VideoFrame::Builder() .set_video_frame_buffer(cropped_buf) diff --git a/test/frame_generator.cc b/test/frame_generator.cc index acd63f9312..f6fd285c1a 100644 --- a/test/frame_generator.cc +++ b/test/frame_generator.cc @@ -390,11 +390,11 @@ class ScrollingImageFrameGenerator : public FrameGenerator { (pixels_scrolled_x / 2); current_frame_ = webrtc::VideoFrame( - new rtc::RefCountedObject( - target_width_, target_height_, &i420_buffer->DataY()[offset_y], - i420_buffer->StrideY(), &i420_buffer->DataU()[offset_u], - i420_buffer->StrideU(), &i420_buffer->DataV()[offset_v], - i420_buffer->StrideV(), KeepRefUntilDone(i420_buffer)), + WrapI420Buffer(target_width_, target_height_, + &i420_buffer->DataY()[offset_y], i420_buffer->StrideY(), + &i420_buffer->DataU()[offset_u], i420_buffer->StrideU(), + &i420_buffer->DataV()[offset_v], i420_buffer->StrideV(), + KeepRefUntilDone(i420_buffer)), kVideoRotation_0, 0); }