2016-01-26 13:07:54 -08:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
2016-01-26 13:07:54 -08:00
|
|
|
*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2016-01-26 13:07:54 -08:00
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "media/engine/nullwebrtcvideoengine.h"
|
|
|
|
|
#include "media/engine/webrtcvoiceengine.h"
|
|
|
|
|
#include "modules/audio_processing/include/audio_processing.h"
|
|
|
|
|
#include "test/gtest.h"
|
|
|
|
|
#include "test/mock_audio_decoder_factory.h"
|
|
|
|
|
#include "test/mock_audio_encoder_factory.h"
|
2016-01-26 13:07:54 -08:00
|
|
|
|
|
|
|
|
namespace cricket {
|
|
|
|
|
|
|
|
|
|
class WebRtcMediaEngineNullVideo
|
|
|
|
|
: public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
|
|
|
|
|
public:
|
2016-06-13 07:34:51 -07:00
|
|
|
WebRtcMediaEngineNullVideo(
|
|
|
|
|
webrtc::AudioDeviceModule* adm,
|
2017-05-02 06:46:30 -07:00
|
|
|
const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
|
|
|
|
|
audio_encoder_factory,
|
2016-06-13 07:34:51 -07:00
|
|
|
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
|
2017-09-12 04:42:15 -07:00
|
|
|
audio_decoder_factory)
|
2016-06-13 07:34:51 -07:00
|
|
|
: CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
|
2017-09-12 04:42:15 -07:00
|
|
|
std::forward_as_tuple(adm,
|
|
|
|
|
audio_encoder_factory,
|
|
|
|
|
audio_decoder_factory,
|
|
|
|
|
nullptr,
|
|
|
|
|
webrtc::AudioProcessing::Create()),
|
|
|
|
|
std::forward_as_tuple()) {}
|
2016-01-26 13:07:54 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Simple test to check if NullWebRtcVideoEngine implements the methods
|
|
|
|
|
// required by CompositeMediaEngine.
|
|
|
|
|
TEST(NullWebRtcVideoEngineTest, CheckInterface) {
|
2016-08-17 02:45:41 -07:00
|
|
|
WebRtcMediaEngineNullVideo engine(
|
2017-05-02 06:46:30 -07:00
|
|
|
nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
2017-09-12 04:42:15 -07:00
|
|
|
webrtc::MockAudioDecoderFactory::CreateUnusedFactory());
|
2016-03-30 23:28:51 -07:00
|
|
|
EXPECT_TRUE(engine.Init());
|
2016-01-26 13:07:54 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace cricket
|