Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: webrtc/media/engine/webrtcvideoframe.cc

Issue 2300953002: Delete cricket::VideoFrame::GetCopyWithRotationApplied. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoframe.cc
diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc
index ecae7b1b22030ad4c9854a264a8258868ef0c7ae..f35a45ac6c3a767f2d8b7a0c3c6cbeda5dfcdad5 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<webrtc::I420Buffer> buffer =
- new rtc::RefCountedObject<webrtc::I420Buffer>(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<libyuv::RotationMode>(rotation()));
- if (ret == 0) {
- rotated_frame_.reset(new WebRtcVideoFrame(
- buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_));
- }
-
- return rotated_frame_.get();
-}
-
} // namespace cricket
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698