Move webrtc::CreatePeerConnectionFactory definition next to decl.
This CL moves webrtc::CreatePeerConnectionFactory definitions out of pc:create_pc_factory and merges it with its declaration in the api/ directory. In order to avoid circular dependencies a new build target is created: * api:create_peerconnection_factory Bug: webrtc:9862 Change-Id: Ie215c94460cba026f5bf7d11c9a5aa03792064af Reviewed-on: https://webrtc-review.googlesource.com/c/111186 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25744}
This commit is contained in:

committed by
Commit Bot

parent
d51b3553db
commit
2ff3f49700
@ -11,7 +11,163 @@
|
||||
#ifndef API_CREATE_PEERCONNECTION_FACTORY_H_
|
||||
#define API_CREATE_PEERCONNECTION_FACTORY_H_
|
||||
|
||||
// TODO(bugs.webrtc.org/9862): Move webrtc::CreatePeerConnectionFactory and
|
||||
// webrtc::CreatePeerConnectionFactoryWithAudioMixer here.
|
||||
#include <memory>
|
||||
|
||||
#include "api/audio/audio_mixer.h"
|
||||
#include "api/audio_codecs/audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/audio_encoder_factory.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/peerconnectioninterface.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "rtc_base/scoped_ref_ptr.h"
|
||||
|
||||
namespace cricket {
|
||||
class WebRtcVideoDecoderFactory;
|
||||
class WebRtcVideoEncoderFactory;
|
||||
} // namespace cricket
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class AudioDeviceModule;
|
||||
class AudioProcessing;
|
||||
class Thread;
|
||||
|
||||
#if defined(USE_BUILTIN_SW_CODECS)
|
||||
// Create a new instance of PeerConnectionFactoryInterface.
|
||||
//
|
||||
// This method relies on the thread it's called on as the "signaling thread"
|
||||
// for the PeerConnectionFactory it creates.
|
||||
//
|
||||
// As such, if the current thread is not already running an rtc::Thread message
|
||||
// loop, an application using this method must eventually either call
|
||||
// rtc::Thread::Current()->Run(), or call
|
||||
// rtc::Thread::Current()->ProcessMessages() within the application's own
|
||||
// message loop.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory);
|
||||
|
||||
// Create a new instance of PeerConnectionFactoryInterface.
|
||||
//
|
||||
// |network_thread|, |worker_thread| and |signaling_thread| are
|
||||
// the only mandatory parameters.
|
||||
//
|
||||
// If non-null, a reference is added to |default_adm|, and ownership of
|
||||
// |video_encoder_factory| and |video_decoder_factory| is transferred to the
|
||||
// returned factory.
|
||||
// TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this
|
||||
// ownership transfer and ref counting more obvious.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::Thread* network_thread,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
AudioDeviceModule* default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
||||
cricket::WebRtcVideoDecoderFactory* video_decoder_factory);
|
||||
|
||||
// Create a new instance of PeerConnectionFactoryInterface with optional
|
||||
// external audio mixed and audio processing modules.
|
||||
//
|
||||
// If |audio_mixer| is null, an internal audio mixer will be created and used.
|
||||
// If |audio_processing| is null, an internal audio processing module will be
|
||||
// created and used.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::Thread* network_thread,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
AudioDeviceModule* default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
||||
cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
|
||||
rtc::scoped_refptr<AudioMixer> audio_mixer,
|
||||
rtc::scoped_refptr<AudioProcessing> audio_processing);
|
||||
|
||||
// Create a new instance of PeerConnectionFactoryInterface with optional
|
||||
// external audio mixer, audio processing, and fec controller modules.
|
||||
//
|
||||
// If |audio_mixer| is null, an internal audio mixer will be created and used.
|
||||
// If |audio_processing| is null, an internal audio processing module will be
|
||||
// created and used.
|
||||
// If |fec_controller_factory| is null, an internal fec controller module will
|
||||
// be created and used.
|
||||
// If |network_controller_factory| is provided, it will be used if enabled via
|
||||
// field trial.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::Thread* network_thread,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
AudioDeviceModule* default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
||||
cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
|
||||
rtc::scoped_refptr<AudioMixer> audio_mixer,
|
||||
rtc::scoped_refptr<AudioProcessing> audio_processing,
|
||||
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory,
|
||||
std::unique_ptr<NetworkControllerFactoryInterface>
|
||||
network_controller_factory = nullptr);
|
||||
#endif // defined(USE_BUILTIN_SW_CODECS)
|
||||
|
||||
// Create a new instance of PeerConnectionFactoryInterface with optional video
|
||||
// codec factories. These video factories represents all video codecs, i.e. no
|
||||
// extra internal video codecs will be added.
|
||||
// When building WebRTC with rtc_use_builtin_sw_codecs = false, this is the
|
||||
// only available CreatePeerConnectionFactory overload.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::Thread* network_thread,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
rtc::scoped_refptr<AudioDeviceModule> default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
std::unique_ptr<VideoEncoderFactory> video_encoder_factory,
|
||||
std::unique_ptr<VideoDecoderFactory> video_decoder_factory,
|
||||
rtc::scoped_refptr<AudioMixer> audio_mixer,
|
||||
rtc::scoped_refptr<AudioProcessing> audio_processing);
|
||||
|
||||
#if defined(USE_BUILTIN_SW_CODECS)
|
||||
// Create a new instance of PeerConnectionFactoryInterface with external audio
|
||||
// mixer.
|
||||
//
|
||||
// If |audio_mixer| is null, an internal audio mixer will be created and used.
|
||||
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactoryWithAudioMixer(
|
||||
rtc::Thread* network_thread,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
AudioDeviceModule* default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
||||
cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
|
||||
rtc::scoped_refptr<AudioMixer> audio_mixer);
|
||||
|
||||
// Create a new instance of PeerConnectionFactoryInterface.
|
||||
// Same thread is used as worker and network thread.
|
||||
RTC_EXPORT inline rtc::scoped_refptr<PeerConnectionFactoryInterface>
|
||||
CreatePeerConnectionFactory(
|
||||
rtc::Thread* worker_and_network_thread,
|
||||
rtc::Thread* signaling_thread,
|
||||
AudioDeviceModule* default_adm,
|
||||
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
||||
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
||||
cricket::WebRtcVideoDecoderFactory* video_decoder_factory) {
|
||||
return CreatePeerConnectionFactory(
|
||||
worker_and_network_thread, worker_and_network_thread, signaling_thread,
|
||||
default_adm, audio_encoder_factory, audio_decoder_factory,
|
||||
video_encoder_factory, video_decoder_factory);
|
||||
}
|
||||
#endif // defined(USE_BUILTIN_SW_CODECS)
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_CREATE_PEERCONNECTION_FACTORY_H_
|
||||
|
Reference in New Issue
Block a user