| 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 |
| 11 #include "webrtc/examples/peerconnection/client/main_wnd.h" | 11 #include "webrtc/examples/peerconnection/client/main_wnd.h" |
| 12 | 12 |
| 13 #include <math.h> | 13 #include <math.h> |
| 14 | 14 |
| 15 #include "libyuv/convert_argb.h" |
| 15 #include "webrtc/examples/peerconnection/client/defaults.h" | 16 #include "webrtc/examples/peerconnection/client/defaults.h" |
| 16 #include "webrtc/base/arraysize.h" | 17 #include "webrtc/base/arraysize.h" |
| 17 #include "webrtc/base/common.h" | 18 #include "webrtc/base/common.h" |
| 18 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
| 19 | 20 |
| 20 ATOM MainWnd::wnd_class_ = 0; | 21 ATOM MainWnd::wnd_class_ = 0; |
| 21 const wchar_t MainWnd::kClassName[] = L"WebRTC_MainWnd"; | 22 const wchar_t MainWnd::kClassName[] = L"WebRTC_MainWnd"; |
| 22 | 23 |
| 23 using rtc::sprintfn; | 24 using rtc::sprintfn; |
| 24 | 25 |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 604 |
| 604 { | 605 { |
| 605 AutoLock<VideoRenderer> lock(this); | 606 AutoLock<VideoRenderer> lock(this); |
| 606 | 607 |
| 607 const cricket::VideoFrame* frame = | 608 const cricket::VideoFrame* frame = |
| 608 video_frame.GetCopyWithRotationApplied(); | 609 video_frame.GetCopyWithRotationApplied(); |
| 609 | 610 |
| 610 SetSize(frame->width(), frame->height()); | 611 SetSize(frame->width(), frame->height()); |
| 611 | 612 |
| 612 ASSERT(image_.get() != NULL); | 613 ASSERT(image_.get() != NULL); |
| 613 frame->ConvertToRgbBuffer(cricket::FOURCC_ARGB, | 614 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer( |
| 614 image_.get(), | 615 frame->video_frame_buffer()); |
| 615 bmi_.bmiHeader.biSizeImage, | 616 libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), |
| 616 bmi_.bmiHeader.biWidth * | 617 buffer->DataU(), buffer->StrideU(), |
| 617 bmi_.bmiHeader.biBitCount / 8); | 618 buffer->DataV(), buffer->StrideV(), |
| 619 image_.get(), |
| 620 bmi_.bmiHeader.biWidth * |
| 621 bmi_.bmiHeader.biBitCount / 8 |
| 622 buffer->width(), buffer->height()); |
| 618 } | 623 } |
| 619 InvalidateRect(wnd_, NULL, TRUE); | 624 InvalidateRect(wnd_, NULL, TRUE); |
| 620 } | 625 } |
| OLD | NEW |