2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
11 #include "webrtc/video_engine/test/libvietest/include/tb_interfaces.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "webrtc/test/testsupport/fileutils.h"
16 TbInterfaces::TbInterfaces(const std::string& test_name) :
26 std::string complete_path =
27 webrtc::test::OutputPath() + test_name + "_trace.txt";
29 video_engine = webrtc::VideoEngine::Create();
30 EXPECT_TRUE(video_engine != NULL);
32 EXPECT_EQ(0, video_engine->SetTraceFile(complete_path.c_str()));
33 EXPECT_EQ(0, video_engine->SetTraceFilter(webrtc::kTraceAll));
35 base = webrtc::ViEBase::GetInterface(video_engine);
36 EXPECT_TRUE(base != NULL);
38 EXPECT_EQ(0, base->Init());
40 capture = webrtc::ViECapture::GetInterface(video_engine);
41 EXPECT_TRUE(capture != NULL);
43 rtp_rtcp = webrtc::ViERTP_RTCP::GetInterface(video_engine);
44 EXPECT_TRUE(rtp_rtcp != NULL);
46 render = webrtc::ViERender::GetInterface(video_engine);
47 EXPECT_TRUE(render != NULL);
49 codec = webrtc::ViECodec::GetInterface(video_engine);
50 EXPECT_TRUE(codec != NULL);
52 network = webrtc::ViENetwork::GetInterface(video_engine);
53 EXPECT_TRUE(network != NULL);
55 image_process = webrtc::ViEImageProcess::GetInterface(video_engine);
56 EXPECT_TRUE(image_process != NULL);
59 TbInterfaces::~TbInterfaces(void)
61 EXPECT_EQ(0, image_process->Release());
63 EXPECT_EQ(0, codec->Release());
65 EXPECT_EQ(0, capture->Release());
67 EXPECT_EQ(0, render->Release());
69 EXPECT_EQ(0, rtp_rtcp->Release());
71 EXPECT_EQ(0, network->Release());
73 EXPECT_EQ(0, base->Release());
75 EXPECT_TRUE(webrtc::VideoEngine::Delete(video_engine)) <<
76 "Since we have released all interfaces at this point, deletion "
77 "should be successful.";