jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "media/engine/nullwebrtcvideoengine.h" |
| 12 | #include "media/engine/webrtcvoiceengine.h" |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 13 | #include "modules/audio_device/include/mock_audio_device.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 14 | #include "modules/audio_processing/include/audio_processing.h" |
| 15 | #include "test/gtest.h" |
| 16 | #include "test/mock_audio_decoder_factory.h" |
| 17 | #include "test/mock_audio_encoder_factory.h" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 18 | |
| 19 | namespace cricket { |
| 20 | |
| 21 | class WebRtcMediaEngineNullVideo |
| 22 | : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { |
| 23 | public: |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 24 | WebRtcMediaEngineNullVideo( |
| 25 | webrtc::AudioDeviceModule* adm, |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 26 | const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
| 27 | audio_encoder_factory, |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 28 | const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 29 | audio_decoder_factory) |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 30 | : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 31 | std::forward_as_tuple(adm, |
| 32 | audio_encoder_factory, |
| 33 | audio_decoder_factory, |
| 34 | nullptr, |
| 35 | webrtc::AudioProcessing::Create()), |
| 36 | std::forward_as_tuple()) {} |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 40 | // required by CompositeMediaEngine. |
| 41 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 42 | testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm; |
ossu | c54071d | 2016-08-17 02:45:41 -0700 | [diff] [blame] | 43 | WebRtcMediaEngineNullVideo engine( |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 44 | &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 45 | webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 46 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | } // namespace cricket |