Remove ViE external encryption API.
BUG= R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/8079005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5525 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -22,7 +22,6 @@ LOCAL_SRC_FILES:= \
|
||||
vie_autotest_base.cc \
|
||||
vie_autotest_capture.cc \
|
||||
vie_autotest_codec.cc \
|
||||
vie_autotest_encryption.cc \
|
||||
vie_autotest_file.cc \
|
||||
vie_autotest_image_process.cc \
|
||||
vie_autotest_loopback.cc \
|
||||
|
||||
@ -64,7 +64,6 @@ void ViEAutoTest::ViEStandardTest()
|
||||
ViEBaseStandardTest();
|
||||
ViECaptureStandardTest();
|
||||
ViECodecStandardTest();
|
||||
ViEEncryptionStandardTest();
|
||||
ViEImageProcessStandardTest();
|
||||
ViERenderStandardTest();
|
||||
ViERtpRtcpStandardTest();
|
||||
@ -75,7 +74,6 @@ void ViEAutoTest::ViEExtendedTest()
|
||||
ViEBaseExtendedTest();
|
||||
ViECaptureExtendedTest();
|
||||
ViECodecExtendedTest();
|
||||
ViEEncryptionExtendedTest();
|
||||
ViEImageProcessExtendedTest();
|
||||
ViERenderExtendedTest();
|
||||
ViERtpRtcpExtendedTest();
|
||||
@ -86,7 +84,6 @@ void ViEAutoTest::ViEAPITest()
|
||||
ViEBaseAPITest();
|
||||
ViECaptureAPITest();
|
||||
ViECodecAPITest();
|
||||
ViEEncryptionAPITest();
|
||||
ViEImageProcessAPITest();
|
||||
ViERenderAPITest();
|
||||
ViERtpRtcpAPITest();
|
||||
|
||||
@ -62,10 +62,6 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
|
||||
vieAutoTest.ViECodecStandardTest();
|
||||
break;
|
||||
|
||||
case 5: //encryption
|
||||
vieAutoTest.ViEEncryptionStandardTest();
|
||||
break;
|
||||
|
||||
case 6: // image process
|
||||
vieAutoTest.ViEImageProcessStandardTest();
|
||||
break;
|
||||
@ -101,10 +97,6 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
|
||||
vieAutoTest.ViECodecAPITest();
|
||||
break;
|
||||
|
||||
case 5: //encryption
|
||||
vieAutoTest.ViEEncryptionAPITest();
|
||||
break;
|
||||
|
||||
case 6: // image process
|
||||
vieAutoTest.ViEImageProcessAPITest();
|
||||
break;
|
||||
@ -142,10 +134,6 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
|
||||
vieAutoTest.ViECodecExtendedTest();
|
||||
break;
|
||||
|
||||
case 5: //encryption
|
||||
vieAutoTest.ViEEncryptionExtendedTest();
|
||||
break;
|
||||
|
||||
case 6: // image process
|
||||
vieAutoTest.ViEImageProcessExtendedTest();
|
||||
break;
|
||||
|
||||
@ -1,203 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
//
|
||||
// vie_autotest_encryption.cc
|
||||
//
|
||||
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
|
||||
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest_defines.h"
|
||||
|
||||
#include "webrtc/video_engine/test/libvietest/include/tb_capture_device.h"
|
||||
#include "webrtc/video_engine/test/libvietest/include/tb_external_transport.h"
|
||||
#include "webrtc/video_engine/test/libvietest/include/tb_interfaces.h"
|
||||
#include "webrtc/video_engine/test/libvietest/include/tb_video_channel.h"
|
||||
|
||||
class ViEAutotestEncryption: public webrtc::Encryption
|
||||
{
|
||||
public:
|
||||
ViEAutotestEncryption()
|
||||
{
|
||||
}
|
||||
~ViEAutotestEncryption()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void encrypt(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in, int* bytes_out)
|
||||
{
|
||||
for (int i = 0; i < bytes_in; i++)
|
||||
{
|
||||
out_data[i] = ~in_data[i];
|
||||
}
|
||||
assert(*bytes_out >= bytes_in + 2);
|
||||
*bytes_out = bytes_in + 2;
|
||||
out_data[bytes_in] = 'a';
|
||||
out_data[bytes_in + 1] = 'b';
|
||||
}
|
||||
|
||||
virtual void decrypt(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in, int* bytes_out)
|
||||
{
|
||||
for (int i = 0; i < bytes_in - 2; i++)
|
||||
{
|
||||
out_data[i] = ~in_data[i];
|
||||
}
|
||||
assert(*bytes_out >= bytes_in - 2);
|
||||
*bytes_out = bytes_in - 2;
|
||||
}
|
||||
|
||||
virtual void encrypt_rtcp(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in,
|
||||
int* bytes_out)
|
||||
{
|
||||
for (int i = 0; i < bytes_in; i++)
|
||||
{
|
||||
out_data[i] = ~in_data[i];
|
||||
}
|
||||
assert(*bytes_out >= bytes_in + 2);
|
||||
*bytes_out = bytes_in + 2;
|
||||
out_data[bytes_in] = 'a';
|
||||
out_data[bytes_in + 1] = 'b';
|
||||
}
|
||||
|
||||
virtual void decrypt_rtcp(int channel_no, unsigned char* in_data,
|
||||
unsigned char* out_data, int bytes_in,
|
||||
int* bytes_out)
|
||||
{
|
||||
for (int i = 0; i < bytes_in - 2; i++)
|
||||
{
|
||||
out_data[i] = ~in_data[i];
|
||||
}
|
||||
assert(*bytes_out >= bytes_in - 2);
|
||||
*bytes_out = bytes_in - 2;
|
||||
}
|
||||
};
|
||||
|
||||
void ViEAutoTest::ViEEncryptionStandardTest()
|
||||
{
|
||||
//***************************************************************
|
||||
// Begin create/initialize WebRTC Video Engine for testing
|
||||
//***************************************************************
|
||||
|
||||
// Create VIE
|
||||
TbInterfaces ViE("ViEEncryptionStandardTest");
|
||||
// Create a video channel
|
||||
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8);
|
||||
|
||||
// Create a capture device
|
||||
TbCaptureDevice tbCapture(ViE);
|
||||
tbCapture.ConnectTo(tbChannel.videoChannel);
|
||||
|
||||
tbChannel.StartReceive();
|
||||
|
||||
tbChannel.StartSend();
|
||||
|
||||
RenderCaptureDeviceAndOutputStream(&ViE, &tbChannel, &tbCapture);
|
||||
|
||||
//
|
||||
// External encryption
|
||||
//
|
||||
ViEAutotestEncryption testEncryption;
|
||||
// Note(qhogpat): StartSend fails, not sure if this is intentional.
|
||||
EXPECT_NE(0, ViE.base->StartSend(tbChannel.videoChannel));
|
||||
EXPECT_EQ(0, ViE.encryption->RegisterExternalEncryption(
|
||||
tbChannel.videoChannel, testEncryption));
|
||||
ViETest::Log(
|
||||
"External encryption/decryption added, you should still see video");
|
||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||
EXPECT_EQ(0, ViE.encryption->DeregisterExternalEncryption(
|
||||
tbChannel.videoChannel));
|
||||
|
||||
//***************************************************************
|
||||
// Testing finished. Tear down Video Engine
|
||||
//***************************************************************
|
||||
}
|
||||
|
||||
void ViEAutoTest::ViEEncryptionExtendedTest()
|
||||
{
|
||||
//***************************************************************
|
||||
// Begin create/initialize WebRTC Video Engine for testing
|
||||
//***************************************************************
|
||||
|
||||
// Create VIE
|
||||
TbInterfaces ViE("ViEEncryptionExtendedTest");
|
||||
// Create a video channel
|
||||
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8);
|
||||
|
||||
// Create a capture device
|
||||
TbCaptureDevice tbCapture(ViE);
|
||||
tbCapture.ConnectTo(tbChannel.videoChannel);
|
||||
|
||||
tbChannel.StartReceive();
|
||||
tbChannel.StartSend();
|
||||
|
||||
RenderCaptureDeviceAndOutputStream(&ViE, &tbChannel, &tbCapture);
|
||||
|
||||
//***************************************************************
|
||||
// Engine ready. Begin testing class
|
||||
//***************************************************************
|
||||
|
||||
//
|
||||
// External encryption
|
||||
//
|
||||
ViEAutotestEncryption testEncryption;
|
||||
EXPECT_EQ(0, ViE.encryption->RegisterExternalEncryption(
|
||||
tbChannel.videoChannel, testEncryption));
|
||||
ViETest::Log(
|
||||
"External encryption/decryption added, you should still see video");
|
||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||
EXPECT_EQ(0, ViE.encryption->DeregisterExternalEncryption(
|
||||
tbChannel.videoChannel));
|
||||
|
||||
//***************************************************************
|
||||
// Testing finished. Tear down Video Engine
|
||||
//***************************************************************
|
||||
}
|
||||
|
||||
void ViEAutoTest::ViEEncryptionAPITest()
|
||||
{
|
||||
//***************************************************************
|
||||
// Begin create/initialize WebRTC Video Engine for testing
|
||||
//***************************************************************
|
||||
|
||||
//***************************************************************
|
||||
// Engine ready. Begin testing class
|
||||
//***************************************************************
|
||||
|
||||
// Create VIE
|
||||
TbInterfaces ViE("ViEEncryptionAPITest");
|
||||
// Create a video channel
|
||||
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8);
|
||||
|
||||
// Create a capture device
|
||||
TbCaptureDevice tbCapture(ViE);
|
||||
// Connect to channel
|
||||
tbCapture.ConnectTo(tbChannel.videoChannel);
|
||||
|
||||
//
|
||||
// External encryption
|
||||
//
|
||||
|
||||
ViEAutotestEncryption testEncryption;
|
||||
EXPECT_EQ(0, ViE.encryption->RegisterExternalEncryption(
|
||||
tbChannel.videoChannel, testEncryption));
|
||||
EXPECT_NE(0, ViE.encryption->RegisterExternalEncryption(
|
||||
tbChannel.videoChannel, testEncryption));
|
||||
EXPECT_EQ(0, ViE.encryption->DeregisterExternalEncryption(
|
||||
tbChannel.videoChannel));
|
||||
EXPECT_EQ(0, ViE.encryption->DeregisterExternalEncryption(
|
||||
tbChannel.videoChannel));
|
||||
|
||||
//***************************************************************
|
||||
// Testing finished. Tear down Video Engine
|
||||
//***************************************************************
|
||||
}
|
||||
@ -29,7 +29,7 @@ ViEAutoTestMain::ViEAutoTestMain() {
|
||||
index_to_test_method_map_[1] = "RunsBaseTestWithoutErrors";
|
||||
index_to_test_method_map_[2] = "RunsCaptureTestWithoutErrors";
|
||||
index_to_test_method_map_[3] = "RunsCodecTestWithoutErrors";
|
||||
index_to_test_method_map_[4] = "RunsEncryptionTestWithoutErrors";
|
||||
index_to_test_method_map_[4] = "[unused]";
|
||||
index_to_test_method_map_[5] = "RunsImageProcessTestWithoutErrors";
|
||||
index_to_test_method_map_[6] = "RunsNetworkTestWithoutErrors";
|
||||
index_to_test_method_map_[7] = "RunsRenderTestWithoutErrors";
|
||||
|
||||
Reference in New Issue
Block a user