Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: webrtc/api/peerconnectioninterface.h

Issue 2653343003: Add CreatePeerConnectionFactory overloads that take audio codec factory args (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "webrtc/api/rtpsenderinterface.h" 66 #include "webrtc/api/rtpsenderinterface.h"
67 #include "webrtc/api/statstypes.h" 67 #include "webrtc/api/statstypes.h"
68 #include "webrtc/api/umametrics.h" 68 #include "webrtc/api/umametrics.h"
69 #include "webrtc/base/fileutils.h" 69 #include "webrtc/base/fileutils.h"
70 #include "webrtc/base/network.h" 70 #include "webrtc/base/network.h"
71 #include "webrtc/base/rtccertificate.h" 71 #include "webrtc/base/rtccertificate.h"
72 #include "webrtc/base/rtccertificategenerator.h" 72 #include "webrtc/base/rtccertificategenerator.h"
73 #include "webrtc/base/socketaddress.h" 73 #include "webrtc/base/socketaddress.h"
74 #include "webrtc/base/sslstreamadapter.h" 74 #include "webrtc/base/sslstreamadapter.h"
75 #include "webrtc/media/base/mediachannel.h" 75 #include "webrtc/media/base/mediachannel.h"
76 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h"
76 #include "webrtc/p2p/base/portallocator.h" 77 #include "webrtc/p2p/base/portallocator.h"
77 78
78 namespace rtc { 79 namespace rtc {
79 class SSLIdentity; 80 class SSLIdentity;
80 class Thread; 81 class Thread;
81 } 82 }
82 83
83 namespace cricket { 84 namespace cricket {
84 class WebRtcVideoDecoderFactory; 85 class WebRtcVideoDecoderFactory;
85 class WebRtcVideoEncoderFactory; 86 class WebRtcVideoEncoderFactory;
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 // TODO(ivoc) Remove after Chrome is updated. 824 // TODO(ivoc) Remove after Chrome is updated.
824 virtual void StopRtcEventLog() = 0; 825 virtual void StopRtcEventLog() = 0;
825 826
826 protected: 827 protected:
827 // Dtor and ctor protected as objects shouldn't be created or deleted via 828 // Dtor and ctor protected as objects shouldn't be created or deleted via
828 // this interface. 829 // this interface.
829 PeerConnectionFactoryInterface() {} 830 PeerConnectionFactoryInterface() {}
830 ~PeerConnectionFactoryInterface() {} // NOLINT 831 ~PeerConnectionFactoryInterface() {} // NOLINT
831 }; 832 };
832 833
834 // TODO(ossu): Remove these and define a real builtin audio encoder factory
ossu 2017/01/26 12:53:53 I'd prefer if you put this in audio_encoder_factor
kwiberg-webrtc 2017/01/30 13:15:21 (We discussed this off-line, and agreed that I wou
ossu 2017/01/30 13:58:02 I'm not sure that's what I meant but it's not supe
kwiberg-webrtc 2017/01/30 20:55:25 Oh, sorry. So we agreed, but not on the same thing
835 // instead.
836 class AudioEncoderFactory : public rtc::RefCountInterface {};
837 inline rtc::scoped_refptr<AudioEncoderFactory>
838 CreateBuiltinAudioEncoderFactory() {
ossu 2017/01/30 13:58:02 I do find this particularly weird, though. I'd pre
kwiberg-webrtc 2017/01/30 20:55:25 Yes, exactly. It's just as simple for me to write
839 return nullptr;
840 }
841
833 // Create a new instance of PeerConnectionFactoryInterface. 842 // Create a new instance of PeerConnectionFactoryInterface.
834 // 843 //
835 // This method relies on the thread it's called on as the "signaling thread" 844 // This method relies on the thread it's called on as the "signaling thread"
836 // for the PeerConnectionFactory it creates. 845 // for the PeerConnectionFactory it creates.
837 // 846 //
838 // As such, if the current thread is not already running an rtc::Thread message 847 // As such, if the current thread is not already running an rtc::Thread message
839 // loop, an application using this method must eventually either call 848 // loop, an application using this method must eventually either call
840 // rtc::Thread::Current()->Run(), or call 849 // rtc::Thread::Current()->Run(), or call
841 // rtc::Thread::Current()->ProcessMessages() within the application's own 850 // rtc::Thread::Current()->ProcessMessages() within the application's own
842 // message loop. 851 // message loop.
852 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
853 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
854 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory);
855
856 // Deprecated variant of the above.
857 // TODO(kwiberg): Remove.
843 rtc::scoped_refptr<PeerConnectionFactoryInterface> 858 rtc::scoped_refptr<PeerConnectionFactoryInterface>
844 CreatePeerConnectionFactory(); 859 CreatePeerConnectionFactory();
845 860
846 // Create a new instance of PeerConnectionFactoryInterface. 861 // Create a new instance of PeerConnectionFactoryInterface.
847 // 862 //
848 // |network_thread|, |worker_thread| and |signaling_thread| are 863 // |network_thread|, |worker_thread| and |signaling_thread| are
849 // the only mandatory parameters. 864 // the only mandatory parameters.
850 // 865 //
851 // If non-null, ownership of |default_adm|, |encoder_factory| and 866 // If non-null, ownership of |default_adm|, |encoder_factory| and
852 // |decoder_factory| are transferred to the returned factory. 867 // |decoder_factory| are transferred to the returned factory.
853 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( 868 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
854 rtc::Thread* network_thread, 869 rtc::Thread* network_thread,
855 rtc::Thread* worker_thread, 870 rtc::Thread* worker_thread,
856 rtc::Thread* signaling_thread, 871 rtc::Thread* signaling_thread,
857 AudioDeviceModule* default_adm, 872 AudioDeviceModule* default_adm,
873 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
874 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
875 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
876 cricket::WebRtcVideoDecoderFactory* video_decoder_factory);
877
878 // Deprecated variant of the above.
879 // TODO(kwiberg): Remove.
880 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
881 rtc::Thread* network_thread,
882 rtc::Thread* worker_thread,
883 rtc::Thread* signaling_thread,
884 AudioDeviceModule* default_adm,
858 cricket::WebRtcVideoEncoderFactory* encoder_factory, 885 cricket::WebRtcVideoEncoderFactory* encoder_factory,
859 cricket::WebRtcVideoDecoderFactory* decoder_factory); 886 cricket::WebRtcVideoDecoderFactory* decoder_factory);
860 887
861 // Create a new instance of PeerConnectionFactoryInterface with external audio 888 // Create a new instance of PeerConnectionFactoryInterface with external audio
862 // mixer. 889 // mixer.
863 // 890 //
864 // If |audio_mixer| is null, an internal audio mixer will be created and used. 891 // If |audio_mixer| is null, an internal audio mixer will be created and used.
865 rtc::scoped_refptr<PeerConnectionFactoryInterface> 892 rtc::scoped_refptr<PeerConnectionFactoryInterface>
866 CreatePeerConnectionFactoryWithAudioMixer( 893 CreatePeerConnectionFactoryWithAudioMixer(
867 rtc::Thread* network_thread, 894 rtc::Thread* network_thread,
868 rtc::Thread* worker_thread, 895 rtc::Thread* worker_thread,
869 rtc::Thread* signaling_thread, 896 rtc::Thread* signaling_thread,
870 AudioDeviceModule* default_adm, 897 AudioDeviceModule* default_adm,
898 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
899 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
900 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
901 cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
902 rtc::scoped_refptr<AudioMixer> audio_mixer);
903
904 // Deprecated variant of the above.
905 // TODO(kwiberg): Remove.
906 rtc::scoped_refptr<PeerConnectionFactoryInterface>
907 CreatePeerConnectionFactoryWithAudioMixer(
908 rtc::Thread* network_thread,
909 rtc::Thread* worker_thread,
910 rtc::Thread* signaling_thread,
911 AudioDeviceModule* default_adm,
871 cricket::WebRtcVideoEncoderFactory* encoder_factory, 912 cricket::WebRtcVideoEncoderFactory* encoder_factory,
872 cricket::WebRtcVideoDecoderFactory* decoder_factory, 913 cricket::WebRtcVideoDecoderFactory* decoder_factory,
873 rtc::scoped_refptr<AudioMixer> audio_mixer); 914 rtc::scoped_refptr<AudioMixer> audio_mixer);
874 915
875 // Create a new instance of PeerConnectionFactoryInterface. 916 // Create a new instance of PeerConnectionFactoryInterface.
876 // Same thread is used as worker and network thread. 917 // Same thread is used as worker and network thread.
877 inline rtc::scoped_refptr<PeerConnectionFactoryInterface> 918 inline rtc::scoped_refptr<PeerConnectionFactoryInterface>
878 CreatePeerConnectionFactory( 919 CreatePeerConnectionFactory(
879 rtc::Thread* worker_and_network_thread, 920 rtc::Thread* worker_and_network_thread,
880 rtc::Thread* signaling_thread, 921 rtc::Thread* signaling_thread,
881 AudioDeviceModule* default_adm, 922 AudioDeviceModule* default_adm,
923 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
924 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
925 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
926 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) {
927 return CreatePeerConnectionFactory(
928 worker_and_network_thread, worker_and_network_thread, signaling_thread,
929 default_adm, audio_encoder_factory, audio_decoder_factory,
930 video_encoder_factory, video_decoder_factory);
931 }
932
933 // Deprecated variant of the above.
934 // TODO(kwiberg): Remove.
935 inline rtc::scoped_refptr<PeerConnectionFactoryInterface>
936 CreatePeerConnectionFactory(
937 rtc::Thread* worker_and_network_thread,
938 rtc::Thread* signaling_thread,
939 AudioDeviceModule* default_adm,
882 cricket::WebRtcVideoEncoderFactory* encoder_factory, 940 cricket::WebRtcVideoEncoderFactory* encoder_factory,
883 cricket::WebRtcVideoDecoderFactory* decoder_factory) { 941 cricket::WebRtcVideoDecoderFactory* decoder_factory) {
884 return CreatePeerConnectionFactory( 942 return CreatePeerConnectionFactory(
885 worker_and_network_thread, worker_and_network_thread, signaling_thread, 943 worker_and_network_thread, worker_and_network_thread, signaling_thread,
886 default_adm, encoder_factory, decoder_factory); 944 default_adm, encoder_factory, decoder_factory);
887 } 945 }
888 946
889 } // namespace webrtc 947 } // namespace webrtc
890 948
891 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ 949 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698