Delete cricket::VideoFrame::GetCopyWithRotationApplied.
There are no known uses. Use in Chrome was eliminated in cl https://codereview.chromium.org/2293253003/ BUG=webrtc:5682 Review-Url: https://codereview.webrtc.org/2300953002 Cr-Commit-Position: refs/heads/master@{#14049}
This commit is contained in:
parent
1dd2335023
commit
c6b9da44c3
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user