OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 15 matching lines...) Expand all Loading... | |
26 #ifdef HAVE_WEBRTC_VIDEO | 26 #ifdef HAVE_WEBRTC_VIDEO |
27 : public CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine2> { | 27 : public CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine2> { |
28 #else | 28 #else |
29 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { | 29 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { |
30 #endif | 30 #endif |
31 public: | 31 public: |
32 WebRtcMediaEngine2(webrtc::AudioDeviceModule* adm, | 32 WebRtcMediaEngine2(webrtc::AudioDeviceModule* adm, |
33 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& | 33 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
34 audio_decoder_factory, | 34 audio_decoder_factory, |
35 WebRtcVideoEncoderFactory* video_encoder_factory, | 35 WebRtcVideoEncoderFactory* video_encoder_factory, |
36 WebRtcVideoDecoderFactory* video_decoder_factory) | 36 WebRtcVideoDecoderFactory* video_decoder_factory, |
37 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) | |
37 #ifdef HAVE_WEBRTC_VIDEO | 38 #ifdef HAVE_WEBRTC_VIDEO |
38 : CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine2>( | 39 : CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine2>( |
39 adm, audio_decoder_factory){ | 40 adm, |
41 audio_decoder_factory, | |
42 audio_mixer){ | |
40 #else | 43 #else |
41 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( | 44 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
42 adm, audio_decoder_factory) { | 45 adm, |
46 audio_decoder_factory, | |
47 audio_mixer) { | |
43 #endif | 48 #endif |
44 video_.SetExternalDecoderFactory(video_decoder_factory); | 49 video_.SetExternalDecoderFactory(video_decoder_factory); |
45 video_.SetExternalEncoderFactory(video_encoder_factory); | 50 video_.SetExternalEncoderFactory(video_encoder_factory); |
46 } | 51 } |
47 }; | 52 }; |
48 | 53 |
49 } // namespace cricket | 54 } // namespace cricket |
50 | 55 |
51 cricket::MediaEngineInterface* CreateWebRtcMediaEngine( | 56 cricket::MediaEngineInterface* CreateWebRtcMediaEngine( |
52 webrtc::AudioDeviceModule* adm, | 57 webrtc::AudioDeviceModule* adm, |
53 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& | 58 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
54 audio_decoder_factory, | 59 audio_decoder_factory, |
55 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 60 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
56 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) { | 61 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
57 return new cricket::WebRtcMediaEngine2( | 62 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
58 adm, audio_decoder_factory, video_encoder_factory, video_decoder_factory); | 63 return new cricket::WebRtcMediaEngine2(adm, audio_decoder_factory, |
64 video_encoder_factory, | |
65 video_decoder_factory, audio_mixer); | |
59 } | 66 } |
60 | 67 |
61 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) { | 68 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) { |
62 delete media_engine; | 69 delete media_engine; |
63 } | 70 } |
64 | 71 |
65 namespace cricket { | 72 namespace cricket { |
66 | 73 |
67 // TODO(ossu): Backwards-compatible interface. Will be deprecated once the | 74 // TODO(ossu): Backwards-compatible interface. Will be deprecated once the |
68 // audio decoder factory is fully plumbed and used throughout WebRTC. | 75 // audio decoder factory is fully plumbed and used throughout WebRTC. |
69 // See: crbug.com/webrtc/6000 | 76 // See: crbug.com/webrtc/6000 |
70 MediaEngineInterface* WebRtcMediaEngineFactory::Create( | 77 MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
71 webrtc::AudioDeviceModule* adm, | 78 webrtc::AudioDeviceModule* adm, |
72 WebRtcVideoEncoderFactory* video_encoder_factory, | 79 WebRtcVideoEncoderFactory* video_encoder_factory, |
73 WebRtcVideoDecoderFactory* video_decoder_factory) { | 80 WebRtcVideoDecoderFactory* video_decoder_factory, |
74 return CreateWebRtcMediaEngine(adm, | 81 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
75 webrtc::CreateBuiltinAudioDecoderFactory(), | 82 return CreateWebRtcMediaEngine( |
76 video_encoder_factory, video_decoder_factory); | 83 adm, webrtc::CreateBuiltinAudioDecoderFactory(), video_encoder_factory, |
the sun
2016/12/07 15:56:08
nit: git cl format, or manually stick to one way o
GeorgeZ
2016/12/07 18:28:17
I verified that this was adjusted by git cl format
| |
84 video_decoder_factory, audio_mixer); | |
77 } | 85 } |
78 | 86 |
79 // Used by PeerConnectionFactory to create a media engine passed into | 87 // Used by PeerConnectionFactory to create a media engine passed into |
80 // ChannelManager. | 88 // ChannelManager. |
81 MediaEngineInterface* WebRtcMediaEngineFactory::Create( | 89 MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
82 webrtc::AudioDeviceModule* adm, | 90 webrtc::AudioDeviceModule* adm, |
83 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& | 91 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
84 audio_decoder_factory, | 92 audio_decoder_factory, |
85 WebRtcVideoEncoderFactory* video_encoder_factory, | 93 WebRtcVideoEncoderFactory* video_encoder_factory, |
86 WebRtcVideoDecoderFactory* video_decoder_factory) { | 94 WebRtcVideoDecoderFactory* video_decoder_factory, |
95 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { | |
87 return CreateWebRtcMediaEngine(adm, audio_decoder_factory, | 96 return CreateWebRtcMediaEngine(adm, audio_decoder_factory, |
88 video_encoder_factory, video_decoder_factory); | 97 video_encoder_factory, video_decoder_factory, |
98 audio_mixer); | |
89 } | 99 } |
90 | 100 |
91 namespace { | 101 namespace { |
92 // Remove mutually exclusive extensions with lower priority. | 102 // Remove mutually exclusive extensions with lower priority. |
93 void DiscardRedundantExtensions( | 103 void DiscardRedundantExtensions( |
94 std::vector<webrtc::RtpExtension>* extensions, | 104 std::vector<webrtc::RtpExtension>* extensions, |
95 rtc::ArrayView<const char*> extensions_decreasing_prio) { | 105 rtc::ArrayView<const char*> extensions_decreasing_prio) { |
96 RTC_DCHECK(extensions); | 106 RTC_DCHECK(extensions); |
97 bool found = false; | 107 bool found = false; |
98 for (const char* uri : extensions_decreasing_prio) { | 108 for (const char* uri : extensions_decreasing_prio) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 static const char* kBweExtensionPriorities[] = { | 172 static const char* kBweExtensionPriorities[] = { |
163 webrtc::RtpExtension::kTransportSequenceNumberUri, | 173 webrtc::RtpExtension::kTransportSequenceNumberUri, |
164 webrtc::RtpExtension::kAbsSendTimeUri, | 174 webrtc::RtpExtension::kAbsSendTimeUri, |
165 webrtc::RtpExtension::kTimestampOffsetUri}; | 175 webrtc::RtpExtension::kTimestampOffsetUri}; |
166 DiscardRedundantExtensions(&result, kBweExtensionPriorities); | 176 DiscardRedundantExtensions(&result, kBweExtensionPriorities); |
167 } | 177 } |
168 | 178 |
169 return result; | 179 return result; |
170 } | 180 } |
171 } // namespace cricket | 181 } // namespace cricket |
OLD | NEW |