Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: webrtc/media/engine/nullwebrtcvideoengine_unittest.cc

Issue 2948763002: Allow an external audio processing module to be used in WebRTC (Closed)
Patch Set: tracking linux32_rel issue Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/media/engine/nullwebrtcvideoengine.h" 11 #include "webrtc/media/engine/nullwebrtcvideoengine.h"
12 #include "webrtc/media/engine/webrtcvoiceengine.h" 12 #include "webrtc/media/engine/webrtcvoiceengine.h"
13 #include "webrtc/modules/audio_processing/include/audio_processing.h"
13 #include "webrtc/test/gtest.h" 14 #include "webrtc/test/gtest.h"
14 #include "webrtc/test/mock_audio_decoder_factory.h" 15 #include "webrtc/test/mock_audio_decoder_factory.h"
15 #include "webrtc/test/mock_audio_encoder_factory.h" 16 #include "webrtc/test/mock_audio_encoder_factory.h"
16 17
17 namespace cricket { 18 namespace cricket {
18 19
19 class WebRtcMediaEngineNullVideo 20 class WebRtcMediaEngineNullVideo
20 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { 21 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
21 public: 22 public:
22 WebRtcMediaEngineNullVideo( 23 WebRtcMediaEngineNullVideo(
23 webrtc::AudioDeviceModule* adm, 24 webrtc::AudioDeviceModule* adm,
24 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& 25 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
25 audio_encoder_factory, 26 audio_encoder_factory,
26 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& 27 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
27 audio_decoder_factory, 28 audio_decoder_factory,
28 WebRtcVideoEncoderFactory* video_encoder_factory, 29 WebRtcVideoEncoderFactory* video_encoder_factory,
29 WebRtcVideoDecoderFactory* video_decoder_factory) 30 WebRtcVideoDecoderFactory* video_decoder_factory)
30 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( 31 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
31 adm, 32 adm,
32 audio_encoder_factory, 33 audio_encoder_factory,
33 audio_decoder_factory, 34 audio_decoder_factory,
34 nullptr) { 35 nullptr,
36 webrtc::AudioProcessing::Create()) {
35 video_.SetExternalDecoderFactory(video_decoder_factory); 37 video_.SetExternalDecoderFactory(video_decoder_factory);
36 video_.SetExternalEncoderFactory(video_encoder_factory); 38 video_.SetExternalEncoderFactory(video_encoder_factory);
37 } 39 }
38 }; 40 };
39 41
40 // Simple test to check if NullWebRtcVideoEngine implements the methods 42 // Simple test to check if NullWebRtcVideoEngine implements the methods
41 // required by CompositeMediaEngine. 43 // required by CompositeMediaEngine.
42 TEST(NullWebRtcVideoEngineTest, CheckInterface) { 44 TEST(NullWebRtcVideoEngineTest, CheckInterface) {
43 WebRtcMediaEngineNullVideo engine( 45 WebRtcMediaEngineNullVideo engine(
44 nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), 46 nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
45 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, nullptr); 47 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, nullptr);
46 EXPECT_TRUE(engine.Init()); 48 EXPECT_TRUE(engine.Init());
47 } 49 }
48 50
49 } // namespace cricket 51 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698