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}
28 lines
1.0 KiB
C++
28 lines
1.0 KiB
C++
/*
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "examples/unityplugin/video_observer.h"
|
|
|
|
void VideoObserver::SetVideoCallback(I420FRAMEREADY_CALLBACK callback) {
|
|
std::lock_guard<std::mutex> lock(mutex);
|
|
OnI420FrameReady = callback;
|
|
}
|
|
|
|
void VideoObserver::OnFrame(const webrtc::VideoFrame& frame) {
|
|
std::unique_lock<std::mutex> lock(mutex);
|
|
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());
|
|
}
|
|
}
|