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" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 15 | |
| 16 | namespace cricket { |
| 17 | |
| 18 | class WebRtcMediaEngineNullVideo |
| 19 | : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { |
| 20 | public: |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 21 | WebRtcMediaEngineNullVideo( |
| 22 | webrtc::AudioDeviceModule* adm, |
| 23 | const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 24 | audio_decoder_factory, |
| 25 | WebRtcVideoEncoderFactory* video_encoder_factory, |
| 26 | WebRtcVideoDecoderFactory* video_decoder_factory) |
| 27 | : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
| 28 | adm, audio_decoder_factory) { |
| 29 | video_.SetExternalDecoderFactory(video_decoder_factory); |
| 30 | video_.SetExternalEncoderFactory(video_encoder_factory); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 31 | } |
| 32 | }; |
| 33 | |
| 34 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 35 | // required by CompositeMediaEngine. |
| 36 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
ossu | f93be58 | 2016-07-13 06:31:30 -0700 | [diff] [blame^] | 37 | WebRtcMediaEngineNullVideo engine(nullptr, nullptr, nullptr, nullptr); |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 38 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | } // namespace cricket |