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" |
| 13 | #include "modules/audio_processing/include/audio_processing.h" |
| 14 | #include "test/gtest.h" |
| 15 | #include "test/mock_audio_decoder_factory.h" |
| 16 | #include "test/mock_audio_encoder_factory.h" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 17 | |
| 18 | namespace cricket { |
| 19 | |
| 20 | class WebRtcMediaEngineNullVideo |
| 21 | : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { |
| 22 | public: |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 23 | WebRtcMediaEngineNullVideo( |
| 24 | webrtc::AudioDeviceModule* adm, |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 25 | const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
| 26 | audio_encoder_factory, |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 27 | const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 28 | audio_decoder_factory) |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 29 | : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 30 | std::forward_as_tuple(adm, |
| 31 | audio_encoder_factory, |
| 32 | audio_decoder_factory, |
| 33 | nullptr, |
| 34 | webrtc::AudioProcessing::Create()), |
| 35 | std::forward_as_tuple()) {} |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 39 | // required by CompositeMediaEngine. |
| 40 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
ossu | c54071d | 2016-08-17 02:45:41 -0700 | [diff] [blame] | 41 | WebRtcMediaEngineNullVideo engine( |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 42 | nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), |
magjed | 2475ae2 | 2017-09-12 04:42:15 -0700 | [diff] [blame] | 43 | webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 44 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | } // namespace cricket |