Made it possible to render custom call output to file.
This is to enable quality tests using the custom call. BUG= TESTED=locally Review URL: https://webrtc-codereview.appspot.com/1093005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3483 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -14,10 +14,13 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "gflags/gflags.h"
|
||||||
#include "video_engine/test/auto_test/interface/vie_autotest.h"
|
#include "video_engine/test/auto_test/interface/vie_autotest.h"
|
||||||
#include "video_engine/test/auto_test/interface/vie_autotest_defines.h"
|
#include "video_engine/test/auto_test/interface/vie_autotest_defines.h"
|
||||||
#include "video_engine/test/auto_test/primitives/choice_helpers.h"
|
#include "video_engine/test/auto_test/primitives/choice_helpers.h"
|
||||||
|
#include "video_engine/test/auto_test/primitives/general_primitives.h"
|
||||||
#include "video_engine/test/auto_test/primitives/input_helpers.h"
|
#include "video_engine/test/auto_test/primitives/input_helpers.h"
|
||||||
|
#include "video_engine/test/libvietest/include/vie_to_file_renderer.h"
|
||||||
|
|
||||||
#define VCM_RED_PAYLOAD_TYPE 96
|
#define VCM_RED_PAYLOAD_TYPE 96
|
||||||
#define VCM_ULPFEC_PAYLOAD_TYPE 97
|
#define VCM_ULPFEC_PAYLOAD_TYPE 97
|
||||||
@ -37,6 +40,10 @@
|
|||||||
#define DEFAULT_VIDEO_PROTECTION_METHOD "None"
|
#define DEFAULT_VIDEO_PROTECTION_METHOD "None"
|
||||||
#define DEFAULT_TEMPORAL_LAYER "0"
|
#define DEFAULT_TEMPORAL_LAYER "0"
|
||||||
|
|
||||||
|
DEFINE_string(render_custom_call_remote_to, "", "Specify to render the remote "
|
||||||
|
"stream of a custom call to the provided filename instead of showing it in "
|
||||||
|
"window 2. The file will end up in the default output directory (out/).");
|
||||||
|
|
||||||
enum StatisticsType {
|
enum StatisticsType {
|
||||||
kSendStatistic,
|
kSendStatistic,
|
||||||
kReceivedStatistic
|
kReceivedStatistic
|
||||||
@ -442,11 +449,23 @@ int ViEAutoTest::ViECustomCall() {
|
|||||||
"ERROR: %s at line %d",
|
"ERROR: %s at line %d",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
error = vie_renderer->AddRenderer(video_channel, _window2, 1, 0.0, 0.0, 1.0,
|
|
||||||
1.0);
|
ViEToFileRenderer file_renderer;
|
||||||
number_of_errors += ViETest::TestError(error == 0,
|
if (FLAGS_render_custom_call_remote_to == "") {
|
||||||
"ERROR: %s at line %d",
|
error = vie_renderer->AddRenderer(video_channel, _window2, 1, 0.0, 0.0,
|
||||||
__FUNCTION__, __LINE__);
|
1.0, 1.0);
|
||||||
|
number_of_errors += ViETest::TestError(error == 0,
|
||||||
|
"ERROR: %s at line %d",
|
||||||
|
__FUNCTION__, __LINE__);
|
||||||
|
} else {
|
||||||
|
std::string output_path = ViETest::GetResultOutputPath();
|
||||||
|
std::string filename = FLAGS_render_custom_call_remote_to;
|
||||||
|
ViETest::Log("Rendering remote stream to %s: you will not see any output "
|
||||||
|
"in the second window.", (output_path + filename).c_str());
|
||||||
|
|
||||||
|
file_renderer.PrepareForRendering(output_path, filename);
|
||||||
|
RenderToFile(vie_renderer, video_channel, &file_renderer);
|
||||||
|
}
|
||||||
error = vie_network->SetSendDestination(video_channel, ip_address.c_str(),
|
error = vie_network->SetSendDestination(video_channel, ip_address.c_str(),
|
||||||
video_tx_port);
|
video_tx_port);
|
||||||
number_of_errors += ViETest::TestError(error == 0,
|
number_of_errors += ViETest::TestError(error == 0,
|
||||||
@ -655,6 +674,11 @@ int ViEAutoTest::ViECustomCall() {
|
|||||||
number_of_errors += ViETest::TestError(error == 0,
|
number_of_errors += ViETest::TestError(error == 0,
|
||||||
"ERROR: %s at line %d",
|
"ERROR: %s at line %d",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
|
assert(FLAGS_render_custom_call_remote_to == "" &&
|
||||||
|
"Not implemented to change video capture device when "
|
||||||
|
"rendering to file!");
|
||||||
|
|
||||||
error = vie_capture->StartCapture(capture_id);
|
error = vie_capture->StartCapture(capture_id);
|
||||||
number_of_errors += ViETest::TestError(error == 0,
|
number_of_errors += ViETest::TestError(error == 0,
|
||||||
"ERROR: %s at line %d",
|
"ERROR: %s at line %d",
|
||||||
@ -850,6 +874,9 @@ int ViEAutoTest::ViECustomCall() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FLAGS_render_custom_call_remote_to != "")
|
||||||
|
file_renderer.StopRendering();
|
||||||
|
|
||||||
// Testing finished. Tear down Voice and Video Engine.
|
// Testing finished. Tear down Voice and Video Engine.
|
||||||
// Tear down the VoE first.
|
// Tear down the VoE first.
|
||||||
error = voe_base->StopReceive(audio_channel);
|
error = voe_base->StopReceive(audio_channel);
|
||||||
|
Reference in New Issue
Block a user