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

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

Issue 3008043002: Simplify passing video codec factories in media engine (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « webrtc/media/engine/nullwebrtcvideoengine.h ('k') | webrtc/media/engine/webrtcmediaengine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/modules/audio_processing/include/audio_processing.h"
14 #include "webrtc/test/gtest.h" 14 #include "webrtc/test/gtest.h"
15 #include "webrtc/test/mock_audio_decoder_factory.h" 15 #include "webrtc/test/mock_audio_decoder_factory.h"
16 #include "webrtc/test/mock_audio_encoder_factory.h" 16 #include "webrtc/test/mock_audio_encoder_factory.h"
17 17
18 namespace cricket { 18 namespace cricket {
19 19
20 class WebRtcMediaEngineNullVideo 20 class WebRtcMediaEngineNullVideo
21 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> { 21 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
22 public: 22 public:
23 WebRtcMediaEngineNullVideo( 23 WebRtcMediaEngineNullVideo(
24 webrtc::AudioDeviceModule* adm, 24 webrtc::AudioDeviceModule* adm,
25 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& 25 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
26 audio_encoder_factory, 26 audio_encoder_factory,
27 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& 27 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
28 audio_decoder_factory, 28 audio_decoder_factory)
29 WebRtcVideoEncoderFactory* video_encoder_factory,
30 WebRtcVideoDecoderFactory* video_decoder_factory)
31 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( 29 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
32 adm, 30 std::forward_as_tuple(adm,
33 audio_encoder_factory, 31 audio_encoder_factory,
34 audio_decoder_factory, 32 audio_decoder_factory,
35 nullptr, 33 nullptr,
36 webrtc::AudioProcessing::Create()) { 34 webrtc::AudioProcessing::Create()),
37 video_.SetExternalDecoderFactory(video_decoder_factory); 35 std::forward_as_tuple()) {}
38 video_.SetExternalEncoderFactory(video_encoder_factory);
39 }
40 }; 36 };
41 37
42 // Simple test to check if NullWebRtcVideoEngine implements the methods 38 // Simple test to check if NullWebRtcVideoEngine implements the methods
43 // required by CompositeMediaEngine. 39 // required by CompositeMediaEngine.
44 TEST(NullWebRtcVideoEngineTest, CheckInterface) { 40 TEST(NullWebRtcVideoEngineTest, CheckInterface) {
45 WebRtcMediaEngineNullVideo engine( 41 WebRtcMediaEngineNullVideo engine(
46 nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), 42 nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
47 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, nullptr); 43 webrtc::MockAudioDecoderFactory::CreateUnusedFactory());
48 EXPECT_TRUE(engine.Init()); 44 EXPECT_TRUE(engine.Init());
49 } 45 }
50 46
51 } // namespace cricket 47 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/nullwebrtcvideoengine.h ('k') | webrtc/media/engine/webrtcmediaengine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698