Fixing peerconnection reddish video issue
BUG=webrtc:6857
NOTRY=True
Review-Url: https://codereview.webrtc.org/2604323002
Cr-Commit-Position: refs/heads/master@{#16143}
diff --git a/webrtc/examples/peerconnection/client/linux/main_wnd.cc b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
index 3070719..067dde9 100644
--- a/webrtc/examples/peerconnection/client/linux/main_wnd.cc
+++ b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
@@ -531,7 +531,13 @@
}
SetSize(buffer->width(), buffer->height());
- libyuv::I420ToRGBA(buffer->DataY(), buffer->StrideY(),
+ // The order in the name of libyuv::I420To(ABGR,RGBA) is ambiguous because
+ // it doesn't tell you if it is referring to how it is laid out in memory as
+ // bytes or if endiannes is taken into account.
+ // This was supposed to be a call to libyuv::I420ToRGBA but it was resulting
+ // in a reddish video output (see https://bugs.webrtc.org/6857) because it
+ // was producing an unexpected byte order (ABGR, byte swapped).
+ libyuv::I420ToABGR(buffer->DataY(), buffer->StrideY(),
buffer->DataU(), buffer->StrideU(),
buffer->DataV(), buffer->StrideV(),
image_.get(), width_ * 4,