From 185bae4b6fb8b78dbfc2cfbd8a5c2d71091f2233 Mon Sep 17 00:00:00 2001 From: "andresp@webrtc.org" Date: Tue, 14 May 2013 08:02:25 +0000 Subject: [PATCH] Replace ExtraCodecOptions with new Config class that supports multiple settings at once. R=niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1452004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4017 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/common_types.h | 12 +++++------ .../audio_coding/main/test/delay_test.cc | 21 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/webrtc/common_types.h b/webrtc/common_types.h index 5001da297..525dcf9b8 100644 --- a/webrtc/common_types.h +++ b/webrtc/common_types.h @@ -35,6 +35,8 @@ namespace webrtc { +class Config; + class InStream { public: @@ -534,11 +536,6 @@ enum VideoCodecMode { kScreensharing }; -// When using an external encoder/decoder one may need to specify extra -// options. This struct definition is left for the external implementation. -// TODO(andresp): Support for multiple external encoder/decoders. -struct ExtraCodecOptions; - // Common video codec properties struct VideoCodec { @@ -561,7 +558,10 @@ struct VideoCodec SimulcastStream simulcastStream[kMaxSimulcastStreams]; VideoCodecMode mode; - ExtraCodecOptions* extra_options; + + // When using an external encoder/decoder this allows to pass + // extra options without requiring webrtc to be aware of them. + Config* extra_options; }; // Bandwidth over-use detector options. These are used to drive diff --git a/webrtc/modules/audio_coding/main/test/delay_test.cc b/webrtc/modules/audio_coding/main/test/delay_test.cc index 2cc166153..bfe612824 100644 --- a/webrtc/modules/audio_coding/main/test/delay_test.cc +++ b/webrtc/modules/audio_coding/main/test/delay_test.cc @@ -37,7 +37,6 @@ DEFINE_int32(init_delay, 0, "Initial delay in millisecond."); DEFINE_bool(dtx, false, "Enable DTX at the sender side."); namespace webrtc { - namespace { struct CodecConfig { @@ -57,7 +56,6 @@ struct Config { bool packet_loss; }; -} class DelayTest { public: @@ -242,13 +240,8 @@ class DelayTest { int encoding_sample_rate_hz_; }; -} // namespace webrtc - -int main(int argc, char* argv[]) { - - google::ParseCommandLineFlags(&argc, &argv, true); - - webrtc::Config config; +void RunTest() { + Config config; strcpy(config.codec.name, FLAGS_codec.c_str()); config.codec.sample_rate_hz = FLAGS_sample_rate_hz; config.codec.num_channels = FLAGS_num_channels; @@ -256,8 +249,16 @@ int main(int argc, char* argv[]) { config.acm.fec = false; config.packet_loss = false; - webrtc::DelayTest delay_test; + DelayTest delay_test; delay_test.SetUp(); delay_test.Perform(&config, 1, 240, "delay_test"); delay_test.TearDown(); } +} // namespace +} // namespace webrtc + +int main(int argc, char* argv[]) { + using namespace webrtc; + google::ParseCommandLineFlags(&argc, &argv, true); + RunTest(); +}