2013-07-10 00:45:36 +00:00
|
|
|
/*
|
|
|
|
|
* libjingle
|
2015-01-20 21:36:13 +00:00
|
|
|
* Copyright 2011 Google Inc.
|
2013-07-10 00:45:36 +00:00
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
2015-01-20 21:36:13 +00:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
#ifndef TALK_APP_WEBRTC_PEERCONNECTIONFACTORY_H_
|
|
|
|
|
#define TALK_APP_WEBRTC_PEERCONNECTIONFACTORY_H_
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2015-08-11 10:33:13 +02:00
|
|
|
#include "talk/app/webrtc/dtlsidentitystore.h"
|
2015-10-15 07:26:07 -07:00
|
|
|
#include "talk/app/webrtc/mediacontroller.h"
|
2013-07-10 00:45:36 +00:00
|
|
|
#include "talk/app/webrtc/mediastreaminterface.h"
|
|
|
|
|
#include "talk/app/webrtc/peerconnectioninterface.h"
|
2014-08-13 17:26:08 +00:00
|
|
|
#include "talk/session/media/channelmanager.h"
|
2014-07-29 17:36:52 +00:00
|
|
|
#include "webrtc/base/scoped_ptr.h"
|
2015-08-11 10:33:13 +02:00
|
|
|
#include "webrtc/base/scoped_ref_ptr.h"
|
2014-07-29 17:36:52 +00:00
|
|
|
#include "webrtc/base/thread.h"
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-12-01 15:01:24 -08:00
|
|
|
namespace rtc {
|
|
|
|
|
class BasicNetworkManager;
|
|
|
|
|
class BasicPacketSocketFactory;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2015-08-11 10:33:13 +02:00
|
|
|
typedef rtc::RefCountedObject<DtlsIdentityStoreImpl>
|
|
|
|
|
RefCountedDtlsIdentityStore;
|
2015-03-04 22:17:38 +00:00
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
class PeerConnectionFactory : public PeerConnectionFactoryInterface {
|
2013-07-10 00:45:36 +00:00
|
|
|
public:
|
2013-10-25 21:18:33 +00:00
|
|
|
virtual void SetOptions(const Options& options) {
|
|
|
|
|
options_ = options;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-01 15:01:24 -08:00
|
|
|
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
|
|
|
|
|
const PeerConnectionInterface::RTCConfiguration& configuration,
|
|
|
|
|
const MediaConstraintsInterface* constraints,
|
|
|
|
|
rtc::scoped_ptr<cricket::PortAllocator> allocator,
|
|
|
|
|
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
|
|
|
|
|
PeerConnectionObserver* observer) override;
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
bool Initialize();
|
|
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
rtc::scoped_refptr<MediaStreamInterface>
|
|
|
|
|
CreateLocalMediaStream(const std::string& label) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
|
|
|
|
|
const MediaConstraintsInterface* constraints) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource(
|
2013-07-10 00:45:36 +00:00
|
|
|
cricket::VideoCapturer* capturer,
|
2015-01-12 08:30:16 +00:00
|
|
|
const MediaConstraintsInterface* constraints) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
rtc::scoped_refptr<VideoTrackInterface>
|
2013-07-10 00:45:36 +00:00
|
|
|
CreateVideoTrack(const std::string& id,
|
2015-01-12 08:30:16 +00:00
|
|
|
VideoSourceInterface* video_source) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-01-12 08:30:16 +00:00
|
|
|
rtc::scoped_refptr<AudioTrackInterface>
|
2013-07-10 00:45:36 +00:00
|
|
|
CreateAudioTrack(const std::string& id,
|
2015-01-12 08:30:16 +00:00
|
|
|
AudioSourceInterface* audio_source) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
Revert of Reland "Added option to specify a maximum file size when recording an AEC dump." (patchset #2 id:20001 of https://codereview.webrtc.org/1541633002/ )
Reason for revert:
Compile error on Android needs to be fixed before relanding.
Original issue's description:
> Reland "Added option to specify a maximum file size when recording an AEC dump.", commit ae2c5ad12afc8cc29fe9c59dea432b697b871a87.
>
> The revert of the original CL was commit 36d4c545007129446e551c45c17b25377dce89a4.
> Original review: https://codereview.webrtc.org/1413483003/
>
> The original CL changes a function on audio_processing.h that is used by Chrome, this CL adds back the old function.
>
> NOTRY=true
> TBR=glaznev@webrtc.org, henrik.lundin@webrtc.org, solenberg@google.com, henrikg@webrtc.org, perkj@webrtc.org
> BUG=webrtc:4741
>
> Committed: https://crrev.com/f4f5cb09277d5ef6aeac8341e5f54a055867803a
> Cr-Commit-Position: refs/heads/master@{#11093}
TBR=glaznev@webrtc.org,henrik.lundin@webrtc.org,solenberg@google.com,henrikg@webrtc.org,perkj@webrtc.org,kwiberg@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4741
Review URL: https://codereview.webrtc.org/1537213002
Cr-Commit-Position: refs/heads/master@{#11094}
2015-12-19 10:14:10 -08:00
|
|
|
bool StartAecDump(rtc::PlatformFile file) override;
|
2015-10-22 03:25:41 -07:00
|
|
|
void StopAecDump() override;
|
2015-10-16 02:22:18 -07:00
|
|
|
bool StartRtcEventLog(rtc::PlatformFile file) override;
|
|
|
|
|
void StopRtcEventLog() override;
|
2013-12-13 00:21:03 +00:00
|
|
|
|
2015-10-15 07:26:07 -07:00
|
|
|
virtual webrtc::MediaControllerInterface* CreateMediaController() const;
|
2014-07-29 17:36:52 +00:00
|
|
|
virtual rtc::Thread* signaling_thread();
|
|
|
|
|
virtual rtc::Thread* worker_thread();
|
2013-10-25 21:18:33 +00:00
|
|
|
const Options& options() const { return options_; }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
PeerConnectionFactory();
|
|
|
|
|
PeerConnectionFactory(
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::Thread* worker_thread,
|
|
|
|
|
rtc::Thread* signaling_thread,
|
2013-07-10 00:45:36 +00:00
|
|
|
AudioDeviceModule* default_adm,
|
|
|
|
|
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
|
|
|
|
|
cricket::WebRtcVideoDecoderFactory* video_decoder_factory);
|
|
|
|
|
virtual ~PeerConnectionFactory();
|
|
|
|
|
|
|
|
|
|
private:
|
2015-02-11 08:38:35 +00:00
|
|
|
cricket::MediaEngineInterface* CreateMediaEngine_w();
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
bool owns_ptrs_;
|
2015-01-12 08:30:16 +00:00
|
|
|
bool wraps_current_thread_;
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::Thread* signaling_thread_;
|
|
|
|
|
rtc::Thread* worker_thread_;
|
2013-10-25 21:18:33 +00:00
|
|
|
Options options_;
|
2013-07-10 00:45:36 +00:00
|
|
|
// External Audio device used for audio playback.
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::scoped_refptr<AudioDeviceModule> default_adm_;
|
|
|
|
|
rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
|
2013-07-10 00:45:36 +00:00
|
|
|
// External Video encoder factory. This can be NULL if the client has not
|
|
|
|
|
// injected any. In that case, video engine will use the internal SW encoder.
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::scoped_ptr<cricket::WebRtcVideoEncoderFactory>
|
2013-07-10 00:45:36 +00:00
|
|
|
video_encoder_factory_;
|
|
|
|
|
// External Video decoder factory. This can be NULL if the client has not
|
|
|
|
|
// injected any. In that case, video engine will use the internal SW decoder.
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::scoped_ptr<cricket::WebRtcVideoDecoderFactory>
|
2013-07-10 00:45:36 +00:00
|
|
|
video_decoder_factory_;
|
2015-12-01 15:01:24 -08:00
|
|
|
rtc::scoped_ptr<rtc::BasicNetworkManager> default_network_manager_;
|
|
|
|
|
rtc::scoped_ptr<rtc::BasicPacketSocketFactory> default_socket_factory_;
|
2015-03-04 22:17:38 +00:00
|
|
|
|
2015-08-11 10:33:13 +02:00
|
|
|
rtc::scoped_refptr<RefCountedDtlsIdentityStore> dtls_identity_store_;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // TALK_APP_WEBRTC_PEERCONNECTIONFACTORY_H_
|