OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 588 matching lines...) Loading... |
599 (bmi_.bmiHeader.biBitCount >> 3); | 599 (bmi_.bmiHeader.biBitCount >> 3); |
600 image_.reset(new uint8_t[bmi_.bmiHeader.biSizeImage]); | 600 image_.reset(new uint8_t[bmi_.bmiHeader.biSizeImage]); |
601 } | 601 } |
602 | 602 |
603 void MainWnd::VideoRenderer::OnFrame( | 603 void MainWnd::VideoRenderer::OnFrame( |
604 const webrtc::VideoFrame& video_frame) { | 604 const webrtc::VideoFrame& video_frame) { |
605 | 605 |
606 { | 606 { |
607 AutoLock<VideoRenderer> lock(this); | 607 AutoLock<VideoRenderer> lock(this); |
608 | 608 |
609 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer( | 609 rtc::scoped_refptr<webrtc::I420BufferInterface> buffer( |
610 video_frame.video_frame_buffer()); | 610 video_frame.video_frame_buffer()->ToI420()); |
611 if (video_frame.rotation() != webrtc::kVideoRotation_0) { | 611 if (video_frame.rotation() != webrtc::kVideoRotation_0) { |
612 buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation()); | 612 buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation()); |
613 } | 613 } |
614 | 614 |
615 SetSize(buffer->width(), buffer->height()); | 615 SetSize(buffer->width(), buffer->height()); |
616 | 616 |
617 RTC_DCHECK(image_.get() != NULL); | 617 RTC_DCHECK(image_.get() != NULL); |
618 libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), | 618 libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), |
619 buffer->DataU(), buffer->StrideU(), | 619 buffer->DataU(), buffer->StrideU(), |
620 buffer->DataV(), buffer->StrideV(), | 620 buffer->DataV(), buffer->StrideV(), |
621 image_.get(), | 621 image_.get(), |
622 bmi_.bmiHeader.biWidth * | 622 bmi_.bmiHeader.biWidth * |
623 bmi_.bmiHeader.biBitCount / 8, | 623 bmi_.bmiHeader.biBitCount / 8, |
624 buffer->width(), buffer->height()); | 624 buffer->width(), buffer->height()); |
625 } | 625 } |
626 InvalidateRect(wnd_, NULL, TRUE); | 626 InvalidateRect(wnd_, NULL, TRUE); |
627 } | 627 } |
OLD | NEW |