diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index 8ffc959d70..47a51d12b7 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -14,7 +14,6 @@ if (is_android) { group("android") { if (!build_with_chromium && is_android) { public_deps = [ - ":libjingle_peerconnection_datachannelonly_so", ":libjingle_peerconnection_jni", ":libjingle_peerconnection_so", ":libwebrtc", @@ -118,7 +117,6 @@ if (is_android) { ":default_video_codec_factory_jni", ":java_audio_device_module_jni", ":legacy_hwcodecs_jni", - ":media_jni", ":peerconnection_jni", ":video_jni", "../../api:create_peerconnection_factory", @@ -157,31 +155,6 @@ if (is_android) { output_extension = "so" } - # The modular build targets can be used to build WebRTC with different - # functionalities. The users can choose either the real implemenation or the - # null implementation of the audio/video modules based on their requirments. - rtc_shared_library("libjingle_peerconnection_datachannelonly_so") { - sources = [ - "src/jni/jni_onload.cc", - ] - - suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] - configs += [ "//build/config/android:hide_all_but_jni" ] - - deps = [ - ":base_jni", - ":libjingle_peerconnection_metrics_default_jni", - ":null_audio_jni", - ":null_media_jni", - ":null_video_jni", - ":peerconnection_jni", - "../../pc:peerconnection", - "../../rtc_base", - "../../rtc_base:rtc_base_approved", - ] - output_extension = "so" - } - ####################### # Public Java modules # ####################### @@ -567,7 +540,6 @@ if (is_android) { "src/jni/jni_helpers.h", "src/jni/pc/audio.h", "src/jni/pc/logging.cc", - "src/jni/pc/media.h", "src/jni/pc/video.h", ] @@ -778,14 +750,18 @@ if (is_android) { ":native_api_jni", ":native_api_stacktrace", "..:media_constraints", + "../../api:callfactory_api", "../../api:libjingle_peerconnection_api", "../../api:rtc_event_log_output_file", "../../api/video_codecs:video_codecs_api", + "../../call:call_interfaces", "../../logging:rtc_event_log_api", "../../logging:rtc_event_log_impl_base", + "../../media:rtc_audio_video", "../../media:rtc_data", "../../media:rtc_media_base", "../../modules/audio_device", + "../../modules/audio_processing:api", "../../modules/utility", "../../pc:peerconnection", "../../rtc_base", @@ -1029,56 +1005,6 @@ if (is_android) { ] } - rtc_static_library("null_audio_jni") { - sources = [ - "src/jni/pc/null_audio.cc", - ] - - deps = [ - ":base_jni", - ] - } - - rtc_static_library("null_video_jni") { - sources = [ - "src/jni/pc/null_video.cc", - ] - - deps = [ - ":base_jni", - "../../api/video_codecs:video_codecs_api", - ] - } - - rtc_static_library("null_media_jni") { - sources = [ - "src/jni/pc/null_media.cc", - ] - - deps = [ - ":base_jni", - ] - } - - rtc_static_library("media_jni") { - sources = [ - "src/jni/pc/media.cc", - ] - - deps = [ - ":base_jni", - "../../api:callfactory_api", - "../../api/video_codecs:video_codecs_api", - "../../call:call_interfaces", - "../../logging:rtc_event_log_api", - "../../logging:rtc_event_log_impl_base", - "../../media:rtc_audio_video", - "../../modules/audio_device", - "../../modules/audio_processing", - "../../modules/audio_processing:api", - ] - } - # Internal code that is needed by native_api_jni. The code cannot be placed in # base_jni because native_api_jni depends on the code (and base_jni depends on # native_api_jni). @@ -1544,7 +1470,6 @@ if (is_android) { ":audio_jni", ":base_jni", ":generated_native_unittests_jni", - ":media_jni", ":native_api_audio_device_module", ":native_api_base", ":native_api_codecs", diff --git a/sdk/android/src/jni/pc/media.cc b/sdk/android/src/jni/pc/media.cc deleted file mode 100644 index e2da4ec216..0000000000 --- a/sdk/android/src/jni/pc/media.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 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 "sdk/android/src/jni/pc/media.h" - -#include - -#include "api/call/call_factory_interface.h" -#include "api/video_codecs/video_decoder_factory.h" -#include "api/video_codecs/video_encoder_factory.h" -#include "logging/rtc_event_log/rtc_event_log_factory.h" -#include "media/engine/webrtc_media_engine.h" -#include "modules/audio_device/include/audio_device.h" -#include "modules/audio_processing/include/audio_processing.h" - -namespace webrtc { -namespace jni { - -CallFactoryInterface* CreateCallFactory() { - return webrtc::CreateCallFactory().release(); -} - -RtcEventLogFactoryInterface* CreateRtcEventLogFactory() { - return webrtc::CreateRtcEventLogFactory().release(); -} - -cricket::MediaEngineInterface* CreateMediaEngine( - rtc::scoped_refptr adm, - rtc::scoped_refptr audio_encoder_factory, - rtc::scoped_refptr audio_decoder_factory, - std::unique_ptr video_encoder_factory, - std::unique_ptr video_decoder_factory, - rtc::scoped_refptr audio_mixer, - rtc::scoped_refptr audio_processor) { - return cricket::WebRtcMediaEngineFactory::Create( - adm, audio_encoder_factory, audio_decoder_factory, - std::move(video_encoder_factory), std::move(video_decoder_factory), - audio_mixer, audio_processor) - .release(); -} - -} // namespace jni -} // namespace webrtc diff --git a/sdk/android/src/jni/pc/media.h b/sdk/android/src/jni/pc/media.h deleted file mode 100644 index f7012805fb..0000000000 --- a/sdk/android/src/jni/pc/media.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef SDK_ANDROID_SRC_JNI_PC_MEDIA_H_ -#define SDK_ANDROID_SRC_JNI_PC_MEDIA_H_ - -#include - -#include "api/scoped_refptr.h" - -namespace webrtc { -class AudioDeviceModule; -class CallFactoryInterface; -class AudioEncoderFactory; -class AudioDecoderFactory; -class RtcEventLogFactoryInterface; -class AudioMixer; -class AudioProcessing; -class VideoEncoderFactory; -class VideoDecoderFactory; -} // namespace webrtc - -namespace cricket { -class MediaEngineInterface; -} // namespace cricket - -namespace webrtc { -namespace jni { - -CallFactoryInterface* CreateCallFactory(); -RtcEventLogFactoryInterface* CreateRtcEventLogFactory(); - -cricket::MediaEngineInterface* CreateMediaEngine( - rtc::scoped_refptr adm, - rtc::scoped_refptr audio_encoder_factory, - rtc::scoped_refptr audio_decoder_factory, - std::unique_ptr video_encoder_factory, - std::unique_ptr video_decoder_factory, - rtc::scoped_refptr audio_mixer, - rtc::scoped_refptr audio_processor); - -} // namespace jni -} // namespace webrtc - -#endif // SDK_ANDROID_SRC_JNI_PC_MEDIA_H_ diff --git a/sdk/android/src/jni/pc/null_audio.cc b/sdk/android/src/jni/pc/null_audio.cc deleted file mode 100644 index 8d3e496018..0000000000 --- a/sdk/android/src/jni/pc/null_audio.cc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 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 "sdk/android/src/jni/pc/audio.h" - -namespace webrtc { -namespace jni { - -rtc::scoped_refptr CreateAudioDecoderFactory() { - return nullptr; -} - -rtc::scoped_refptr CreateAudioEncoderFactory() { - return nullptr; -} - -rtc::scoped_refptr CreateAudioProcessing() { - return nullptr; -} - -} // namespace jni -} // namespace webrtc diff --git a/sdk/android/src/jni/pc/null_media.cc b/sdk/android/src/jni/pc/null_media.cc deleted file mode 100644 index c59c476d51..0000000000 --- a/sdk/android/src/jni/pc/null_media.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 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 "sdk/android/src/jni/pc/media.h" - -namespace webrtc { -namespace jni { - -CallFactoryInterface* CreateCallFactory() { - return nullptr; -} - -RtcEventLogFactoryInterface* CreateRtcEventLogFactory() { - return nullptr; -} - -cricket::MediaEngineInterface* CreateMediaEngine( - rtc::scoped_refptr adm, - rtc::scoped_refptr audio_encoder_factory, - rtc::scoped_refptr audio_decoder_factory, - std::unique_ptr video_encoder_factory, - std::unique_ptr video_decoder_factory, - rtc::scoped_refptr audio_mixer, - rtc::scoped_refptr audio_processor) { - return nullptr; -} - -} // namespace jni -} // namespace webrtc diff --git a/sdk/android/src/jni/pc/null_video.cc b/sdk/android/src/jni/pc/null_video.cc deleted file mode 100644 index 54a401d605..0000000000 --- a/sdk/android/src/jni/pc/null_video.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 "sdk/android/src/jni/pc/video.h" - -#include "api/video_codecs/video_decoder_factory.h" -#include "api/video_codecs/video_encoder_factory.h" - -namespace webrtc { -namespace jni { - -VideoEncoderFactory* CreateVideoEncoderFactory( - JNIEnv* jni, - const JavaRef& j_encoder_factory) { - return nullptr; -} - -VideoDecoderFactory* CreateVideoDecoderFactory( - JNIEnv* jni, - const JavaRef& j_decoder_factory) { - return nullptr; -} - -void* CreateVideoSource(JNIEnv* env, - rtc::Thread* signaling_thread, - rtc::Thread* worker_thread, - jboolean is_screencast, - jboolean align_timestamps) { - return nullptr; -} - -} // namespace jni -} // namespace webrtc diff --git a/sdk/android/src/jni/pc/peer_connection_factory.cc b/sdk/android/src/jni/pc/peer_connection_factory.cc index 044bc0e70d..64af0afd99 100644 --- a/sdk/android/src/jni/pc/peer_connection_factory.cc +++ b/sdk/android/src/jni/pc/peer_connection_factory.cc @@ -21,7 +21,13 @@ #include "modules/utility/include/jvm_android.h" // We don't depend on the audio processing module implementation. // The user may pass in a nullptr. -#include "modules/audio_processing/include/audio_processing.h" // nogncheck +#include "api/call/call_factory_interface.h" +#include "api/video_codecs/video_decoder_factory.h" +#include "api/video_codecs/video_encoder_factory.h" +#include "logging/rtc_event_log/rtc_event_log_factory.h" +#include "media/engine/webrtc_media_engine.h" +#include "modules/audio_device/include/audio_device.h" +#include "modules/audio_processing/include/audio_processing.h" #include "rtc_base/event_tracer.h" #include "rtc_base/system/thread_registry.h" #include "rtc_base/thread.h" @@ -33,7 +39,6 @@ #include "sdk/android/src/jni/pc/android_network_monitor.h" #include "sdk/android/src/jni/pc/audio.h" #include "sdk/android/src/jni/pc/ice_candidate.h" -#include "sdk/android/src/jni/pc/media.h" #include "sdk/android/src/jni/pc/owned_factory_and_threads.h" #include "sdk/android/src/jni/pc/peer_connection.h" #include "sdk/android/src/jni/pc/ssl_certificate_verifier_wrapper.h" @@ -291,17 +296,19 @@ ScopedJavaLocalRef CreatePeerConnectionFactoryForJava( } rtc::scoped_refptr audio_mixer = nullptr; - std::unique_ptr call_factory(CreateCallFactory()); - std::unique_ptr rtc_event_log_factory( - CreateRtcEventLogFactory()); + std::unique_ptr call_factory = + webrtc::CreateCallFactory(); + std::unique_ptr rtc_event_log_factory = + webrtc::CreateRtcEventLogFactory(); - std::unique_ptr media_engine(CreateMediaEngine( - audio_device_module, audio_encoder_factory, audio_decoder_factory, - std::unique_ptr( - CreateVideoEncoderFactory(jni, jencoder_factory)), - std::unique_ptr( - CreateVideoDecoderFactory(jni, jdecoder_factory)), - audio_mixer, audio_processor)); + std::unique_ptr media_engine = + cricket::WebRtcMediaEngineFactory::Create( + audio_device_module, audio_encoder_factory, audio_decoder_factory, + std::unique_ptr( + CreateVideoEncoderFactory(jni, jencoder_factory)), + std::unique_ptr( + CreateVideoDecoderFactory(jni, jdecoder_factory)), + audio_mixer, audio_processor); PeerConnectionFactoryDependencies dependencies; dependencies.network_thread = network_thread.get(); dependencies.worker_thread = worker_thread.get();