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}
This commit is contained in:
Lu Liu 2017-12-20 18:37:17 +00:00 committed by Commit Bot
parent e7f769c440
commit ec8410796a
7 changed files with 9 additions and 52 deletions

View File

@ -7,7 +7,6 @@
# be found in the AUTHORS file in the root of the source tree. # be found in the AUTHORS file in the root of the source tree.
import("../webrtc.gni") import("../webrtc.gni")
if (is_android) { if (is_android) {
import("//build/config/android/config.gni") import("//build/config/android/config.gni")
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
@ -653,7 +652,6 @@ if (is_win || is_android) {
"unityplugin/classreferenceholder.h", "unityplugin/classreferenceholder.h",
"unityplugin/jni_onload.cc", "unityplugin/jni_onload.cc",
] ]
suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
} }
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -672,11 +670,8 @@ if (is_win || is_android) {
"../api:video_frame_api", "../api:video_frame_api",
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../media:rtc_internal_video_codecs",
"../media:rtc_media", "../media:rtc_media",
"../media:rtc_media_base", "../media:rtc_media_base",
"../modules/audio_device:audio_device",
"../modules/audio_processing:audio_processing",
"../modules/video_capture:video_capture_module", "../modules/video_capture:video_capture_module",
"../pc:libjingle_peerconnection", "../pc:libjingle_peerconnection",
"../rtc_base:rtc_base", "../rtc_base:rtc_base",

View File

@ -4,7 +4,6 @@ include_rules = [
"+media", "+media",
"+modules/audio_device", "+modules/audio_device",
"+modules/video_capture", "+modules/video_capture",
"+modules/audio_processing",
"+p2p", "+p2p",
"+pc", "+pc",
"+third_party/libyuv", "+third_party/libyuv",

View File

@ -1,2 +1 @@
gyzhou@chromium.org gyzhou@chromium.org
qiangchen@chromium.org

View File

@ -16,16 +16,8 @@
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/test/fakeconstraints.h" #include "api/test/fakeconstraints.h"
#include "api/videosourceproxy.h" #include "api/videosourceproxy.h"
#include "media/engine/stereocodecfactory.h"
#include "media/engine/webrtcvideocapturerfactory.h" #include "media/engine/webrtcvideocapturerfactory.h"
#include "media/engine/webrtcvideodecoderfactory.h"
#include "media/engine/webrtcvideoencoderfactory.h"
#include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h"
#include "modules/audio_device/include/audio_device.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/video_capture/video_capture_factory.h" #include "modules/video_capture/video_capture_factory.h"
#include "rtc_base/ptr_util.h"
#if defined(WEBRTC_ANDROID) #if defined(WEBRTC_ANDROID)
#include "examples/unityplugin/classreferenceholder.h" #include "examples/unityplugin/classreferenceholder.h"
@ -102,14 +94,7 @@ bool SimplePeerConnection::InitializePeerConnection(const char** turn_urls,
g_peer_connection_factory = webrtc::CreatePeerConnectionFactory( g_peer_connection_factory = webrtc::CreatePeerConnectionFactory(
g_worker_thread.get(), g_worker_thread.get(), g_signaling_thread.get(), g_worker_thread.get(), g_worker_thread.get(), g_signaling_thread.get(),
nullptr, webrtc::CreateBuiltinAudioEncoderFactory(), nullptr, webrtc::CreateBuiltinAudioEncoderFactory(),
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr);
std::unique_ptr<webrtc::VideoEncoderFactory>(
new webrtc::StereoEncoderFactory(
rtc::MakeUnique<webrtc::InternalEncoderFactory>())),
std::unique_ptr<webrtc::VideoDecoderFactory>(
new webrtc::StereoDecoderFactory(
rtc::MakeUnique<webrtc::InternalDecoderFactory>())),
nullptr, nullptr);
} }
if (!g_peer_connection_factory.get()) { if (!g_peer_connection_factory.get()) {
DeletePeerConnection(); DeletePeerConnection();

View File

@ -24,13 +24,12 @@ static std::map<int, rtc::scoped_refptr<SimplePeerConnection>>
int CreatePeerConnection(const char** turn_urls, int CreatePeerConnection(const char** turn_urls,
const int no_of_urls, const int no_of_urls,
const char* username, const char* username,
const char* credential, const char* credential) {
bool mandatory_receive_video) {
g_peer_connection_map[g_peer_connection_id] = g_peer_connection_map[g_peer_connection_id] =
new rtc::RefCountedObject<SimplePeerConnection>(); new rtc::RefCountedObject<SimplePeerConnection>();
if (!g_peer_connection_map[g_peer_connection_id]->InitializePeerConnection( if (!g_peer_connection_map[g_peer_connection_id]->InitializePeerConnection(
turn_urls, no_of_urls, username, credential, mandatory_receive_video)) turn_urls, no_of_urls, username, credential, false))
return -1; return -1;
return g_peer_connection_id++; return g_peer_connection_id++;

View File

@ -19,11 +19,9 @@
typedef void (*I420FRAMEREADY_CALLBACK)(const uint8_t* data_y, typedef void (*I420FRAMEREADY_CALLBACK)(const uint8_t* data_y,
const uint8_t* data_u, const uint8_t* data_u,
const uint8_t* data_v, const uint8_t* data_v,
const uint8_t* data_a,
int stride_y, int stride_y,
int stride_u, int stride_u,
int stride_v, int stride_v,
int stride_a,
uint32_t width, uint32_t width,
uint32_t height); uint32_t height);
typedef void (*LOCALDATACHANNELREADY_CALLBACK)(); typedef void (*LOCALDATACHANNELREADY_CALLBACK)();
@ -49,8 +47,7 @@ extern "C" {
WEBRTC_PLUGIN_API int CreatePeerConnection(const char** turn_urls, WEBRTC_PLUGIN_API int CreatePeerConnection(const char** turn_urls,
const int no_of_urls, const int no_of_urls,
const char* username, const char* username,
const char* credential, const char* credential);
bool mandatory_receive_video);
// Close a peerconnection. // Close a peerconnection.
WEBRTC_PLUGIN_API bool ClosePeerConnection(int peer_connection_id); WEBRTC_PLUGIN_API bool ClosePeerConnection(int peer_connection_id);
// Add a audio stream. If audio_only is true, the stream only has an audio // Add a audio stream. If audio_only is true, the stream only has an audio

View File

@ -17,28 +17,11 @@ void VideoObserver::SetVideoCallback(I420FRAMEREADY_CALLBACK callback) {
void VideoObserver::OnFrame(const webrtc::VideoFrame& frame) { void VideoObserver::OnFrame(const webrtc::VideoFrame& frame) {
std::unique_lock<std::mutex> lock(mutex); std::unique_lock<std::mutex> lock(mutex);
if (!OnI420FrameReady) rtc::scoped_refptr<webrtc::PlanarYuvBuffer> buffer(
return; frame.video_frame_buffer()->ToI420());
if (OnI420FrameReady) {
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer( OnI420FrameReady(buffer->DataY(), buffer->DataU(), buffer->DataV(),
frame.video_frame_buffer()); buffer->StrideY(), buffer->StrideU(), buffer->StrideV(),
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(),
frame.width(), frame.height()); frame.width(), frame.height());
} }
} }