Revert "Add Alpha Channel Support For WebRTC Unity Plugin"
This reverts commit 7ed2af5b461387191de2456cba906dd5d25766b6.
Reason for revert: breaking buildbot
Original change's description:
> Add Alpha Channel Support For WebRTC Unity Plugin
>
> This CL make webrtc unity plugin compatible with alpha channel support.
>
> Bug: webrtc:8645
> Change-Id: I3250aede47b31c4685e57d11fb2b2e86b824f9c4
> Reviewed-on: https://webrtc-review.googlesource.com/32325
> Commit-Queue: Qiang Chen <qiangchen@chromium.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: George Zhou <gyzhou@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#21394}
TBR=magjed@webrtc.org,gyzhou@chromium.org,qiangchen@chromium.org
Change-Id: I6994d7e87170f97216886a747548a988ca71b7d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8645
Reviewed-on: https://webrtc-review.googlesource.com/35420
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21396}
diff --git a/examples/unityplugin/video_observer.cc b/examples/unityplugin/video_observer.cc
index a78ef57..821acd6 100644
--- a/examples/unityplugin/video_observer.cc
+++ b/examples/unityplugin/video_observer.cc
@@ -17,28 +17,11 @@
void VideoObserver::OnFrame(const webrtc::VideoFrame& frame) {
std::unique_lock<std::mutex> lock(mutex);
- if (!OnI420FrameReady)
- return;
-
- rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(
- frame.video_frame_buffer());
-
- if (buffer->type() != webrtc::VideoFrameBuffer::Type::kI420A) {
- rtc::scoped_refptr<webrtc::I420BufferInterface> i420_buffer =
- buffer->ToI420();
- OnI420FrameReady(i420_buffer->DataY(), i420_buffer->DataU(),
- i420_buffer->DataV(), nullptr, i420_buffer->StrideY(),
- i420_buffer->StrideU(), i420_buffer->StrideV(), 0,
- frame.width(), frame.height());
-
- } else {
- // The buffer has alpha channel.
- webrtc::I420ABufferInterface* i420a_buffer = buffer->GetI420A();
-
- OnI420FrameReady(i420a_buffer->DataY(), i420a_buffer->DataU(),
- i420a_buffer->DataV(), i420a_buffer->DataA(),
- i420a_buffer->StrideY(), i420a_buffer->StrideU(),
- i420a_buffer->StrideV(), i420a_buffer->StrideA(),
+ rtc::scoped_refptr<webrtc::PlanarYuvBuffer> buffer(
+ frame.video_frame_buffer()->ToI420());
+ if (OnI420FrameReady) {
+ OnI420FrameReady(buffer->DataY(), buffer->DataU(), buffer->DataV(),
+ buffer->StrideY(), buffer->StrideU(), buffer->StrideV(),
frame.width(), frame.height());
}
}