Update I420Buffer to new VideoFrameBuffer interface
This is a follow-up cleanup for CL https://codereview.webrtc.org/2847383002/. BUG=webrtc:7632 TBR=stefan Review-Url: https://codereview.webrtc.org/2906053002 Cr-Commit-Position: refs/heads/master@{#18388}
This commit is contained in:
@ -160,8 +160,7 @@ void AVFoundationVideoCapturer::CaptureSampleBuffer(
|
||||
// Applying rotation is only supported for legacy reasons and performance is
|
||||
// not critical here.
|
||||
if (apply_rotation() && rotation != kVideoRotation_0) {
|
||||
buffer = I420Buffer::Rotate(*buffer->NativeToI420Buffer(),
|
||||
rotation);
|
||||
buffer = I420Buffer::Rotate(*buffer->ToI420(), rotation);
|
||||
if (rotation == kVideoRotation_90 || rotation == kVideoRotation_270) {
|
||||
std::swap(captured_width, captured_height);
|
||||
}
|
||||
|
||||
@ -53,7 +53,8 @@ void ObjcVideoTrackSource::OnCapturedFrame(RTCVideoFrame* frame) {
|
||||
// Adapted I420 frame.
|
||||
// TODO(magjed): Optimize this I420 path.
|
||||
rtc::scoped_refptr<I420Buffer> i420_buffer = I420Buffer::Create(adapted_width, adapted_height);
|
||||
i420_buffer->CropAndScaleFrom(*frame.videoBuffer, crop_x, crop_y, crop_width, crop_height);
|
||||
i420_buffer->CropAndScaleFrom(
|
||||
*frame.videoBuffer->ToI420(), crop_x, crop_y, crop_width, crop_height);
|
||||
buffer = i420_buffer;
|
||||
}
|
||||
|
||||
@ -61,7 +62,7 @@ void ObjcVideoTrackSource::OnCapturedFrame(RTCVideoFrame* frame) {
|
||||
// not critical here.
|
||||
webrtc::VideoRotation rotation = static_cast<webrtc::VideoRotation>(frame.rotation);
|
||||
if (apply_rotation() && rotation != kVideoRotation_0) {
|
||||
buffer = I420Buffer::Rotate(*buffer->NativeToI420Buffer(), rotation);
|
||||
buffer = I420Buffer::Rotate(*buffer->ToI420(), rotation);
|
||||
rotation = kVideoRotation_0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user