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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 const webrtc::VideoFrame& video_frame) { | 524 const webrtc::VideoFrame& video_frame) { |
525 gdk_threads_enter(); | 525 gdk_threads_enter(); |
526 | 526 |
527 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer( | 527 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer( |
528 video_frame.video_frame_buffer()); | 528 video_frame.video_frame_buffer()); |
529 if (video_frame.rotation() != webrtc::kVideoRotation_0) { | 529 if (video_frame.rotation() != webrtc::kVideoRotation_0) { |
530 buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation()); | 530 buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation()); |
531 } | 531 } |
532 SetSize(buffer->width(), buffer->height()); | 532 SetSize(buffer->width(), buffer->height()); |
533 | 533 |
534 libyuv::I420ToRGBA(buffer->DataY(), buffer->StrideY(), | 534 // The order in the name of libyuv::I420To(ABGR,RGBA) is ambiguous because |
| 535 // it doesn't tell you if it is referring to how it is laid out in memory as |
| 536 // bytes or if endiannes is taken into account. |
| 537 // This was supposed to be a call to libyuv::I420ToRGBA but it was resulting |
| 538 // in a reddish video output (see https://bugs.webrtc.org/6857) because it |
| 539 // was producing an unexpected byte order (ABGR, byte swapped). |
| 540 libyuv::I420ToABGR(buffer->DataY(), buffer->StrideY(), |
535 buffer->DataU(), buffer->StrideU(), | 541 buffer->DataU(), buffer->StrideU(), |
536 buffer->DataV(), buffer->StrideV(), | 542 buffer->DataV(), buffer->StrideV(), |
537 image_.get(), width_ * 4, | 543 image_.get(), width_ * 4, |
538 buffer->width(), buffer->height()); | 544 buffer->width(), buffer->height()); |
539 | 545 |
540 gdk_threads_leave(); | 546 gdk_threads_leave(); |
541 | 547 |
542 g_idle_add(Redraw, main_wnd_); | 548 g_idle_add(Redraw, main_wnd_); |
543 } | 549 } |
OLD | NEW |