diff --git a/webrtc/media/base/videoframe.h b/webrtc/media/base/videoframe.h index 156da25112..f61445bfe7 100644 --- a/webrtc/media/base/videoframe.h +++ b/webrtc/media/base/videoframe.h @@ -55,14 +55,6 @@ class VideoFrame { // Indicates the rotation angle in degrees. virtual webrtc::VideoRotation rotation() const = 0; - // Return a copy of frame which has its pending rotation applied. The - // ownership of the returned frame is held by this frame. - - // TODO(nisse): Deprecated, no longer used within webrtc. Should be - // deleted as soon as downstream applications are updated. Use - // webrtc::I420Buffer::Rotate instead. - virtual const VideoFrame* GetCopyWithRotationApplied() const = 0; - // Tests if sample is valid. Returns true if valid. // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc index ecae7b1b22..f35a45ac6c 100644 --- a/webrtc/media/engine/webrtcvideoframe.cc +++ b/webrtc/media/engine/webrtcvideoframe.cc @@ -166,52 +166,4 @@ void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) { rotation_ = webrtc::kVideoRotation_0; } -const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const { - // If the frame is not rotated, the caller should reuse this frame instead of - // making a redundant copy. - if (rotation() == webrtc::kVideoRotation_0) { - return this; - } - - // If the video frame is backed up by a native handle, it resides in the GPU - // memory which we can't rotate here. The assumption is that the renderers - // which uses GPU to render should be able to rotate themselves. - RTC_DCHECK(!video_frame_buffer()->native_handle()); - - if (rotated_frame_) { - return rotated_frame_.get(); - } - - int current_width = width(); - int current_height = height(); - - int rotated_width = current_width; - int rotated_height = current_height; - if (rotation() == webrtc::kVideoRotation_90 || - rotation() == webrtc::kVideoRotation_270) { - std::swap(rotated_width, rotated_height); - } - - rtc::scoped_refptr buffer = - new rtc::RefCountedObject(rotated_width, - rotated_height); - - // TODO(guoweis): Add a function in webrtc_libyuv.cc to convert from - // VideoRotation to libyuv::RotationMode. - int ret = libyuv::I420Rotate( - video_frame_buffer_->DataY(), video_frame_buffer_->StrideY(), - video_frame_buffer_->DataU(), video_frame_buffer_->StrideU(), - video_frame_buffer_->DataV(), video_frame_buffer_->StrideV(), - buffer->MutableDataY(), buffer->StrideY(), buffer->MutableDataU(), - buffer->StrideU(), buffer->MutableDataV(), buffer->StrideV(), - current_width, current_height, - static_cast(rotation())); - if (ret == 0) { - rotated_frame_.reset(new WebRtcVideoFrame( - buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_)); - } - - return rotated_frame_.get(); -} - } // namespace cricket diff --git a/webrtc/media/engine/webrtcvideoframe.h b/webrtc/media/engine/webrtcvideoframe.h index 9228476286..d0034e27cd 100644 --- a/webrtc/media/engine/webrtcvideoframe.h +++ b/webrtc/media/engine/webrtcvideoframe.h @@ -93,8 +93,6 @@ class WebRtcVideoFrame : public VideoFrame { webrtc::VideoRotation rotation() const override; - const VideoFrame* GetCopyWithRotationApplied() const override; - protected: // Creates a frame from a raw sample with FourCC |format| and size |w| x |h|. // |h| can be negative indicating a vertically flipped image.