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 | |
| 11 | #include "testing/gtest/include/gtest/gtest.h" |
| 12 | |
kjellander@webrtc.org | 5ad1297 | 2016-02-12 06:39:40 +0100 | [diff] [blame] | 13 | #include "webrtc/media/engine/nullwebrtcvideoengine.h" |
| 14 | #include "webrtc/media/engine/webrtcvoiceengine.h" |
ossu | c54071d | 2016-08-17 02:45:41 -0700 | [diff] [blame^] | 15 | #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 16 | |
| 17 | namespace cricket { |
| 18 | |
| 19 | class WebRtcMediaEngineNullVideo |
| 20 | : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { |
| 21 | public: |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 22 | WebRtcMediaEngineNullVideo( |
| 23 | webrtc::AudioDeviceModule* adm, |
| 24 | const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 25 | audio_decoder_factory, |
| 26 | WebRtcVideoEncoderFactory* video_encoder_factory, |
| 27 | WebRtcVideoDecoderFactory* video_decoder_factory) |
| 28 | : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
| 29 | adm, audio_decoder_factory) { |
| 30 | video_.SetExternalDecoderFactory(video_decoder_factory); |
| 31 | video_.SetExternalEncoderFactory(video_encoder_factory); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 32 | } |
| 33 | }; |
| 34 | |
| 35 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 36 | // required by CompositeMediaEngine. |
| 37 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
ossu | c54071d | 2016-08-17 02:45:41 -0700 | [diff] [blame^] | 38 | WebRtcMediaEngineNullVideo engine( |
| 39 | nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, |
| 40 | nullptr); |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 41 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | } // namespace cricket |