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
This commit is contained in:
andresp@webrtc.org 2013-05-14 08:02:25 +00:00
parent c9cb4fffac
commit 185bae4b6f
2 changed files with 17 additions and 16 deletions

View File

@ -35,6 +35,8 @@
namespace webrtc { namespace webrtc {
class Config;
class InStream class InStream
{ {
public: public:
@ -534,11 +536,6 @@ enum VideoCodecMode {
kScreensharing 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 // Common video codec properties
struct VideoCodec struct VideoCodec
{ {
@ -561,7 +558,10 @@ struct VideoCodec
SimulcastStream simulcastStream[kMaxSimulcastStreams]; SimulcastStream simulcastStream[kMaxSimulcastStreams];
VideoCodecMode mode; 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 // Bandwidth over-use detector options. These are used to drive

View File

@ -37,7 +37,6 @@ DEFINE_int32(init_delay, 0, "Initial delay in millisecond.");
DEFINE_bool(dtx, false, "Enable DTX at the sender side."); DEFINE_bool(dtx, false, "Enable DTX at the sender side.");
namespace webrtc { namespace webrtc {
namespace { namespace {
struct CodecConfig { struct CodecConfig {
@ -57,7 +56,6 @@ struct Config {
bool packet_loss; bool packet_loss;
}; };
}
class DelayTest { class DelayTest {
public: public:
@ -242,13 +240,8 @@ class DelayTest {
int encoding_sample_rate_hz_; int encoding_sample_rate_hz_;
}; };
} // namespace webrtc void RunTest() {
Config config;
int main(int argc, char* argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
webrtc::Config config;
strcpy(config.codec.name, FLAGS_codec.c_str()); strcpy(config.codec.name, FLAGS_codec.c_str());
config.codec.sample_rate_hz = FLAGS_sample_rate_hz; config.codec.sample_rate_hz = FLAGS_sample_rate_hz;
config.codec.num_channels = FLAGS_num_channels; config.codec.num_channels = FLAGS_num_channels;
@ -256,8 +249,16 @@ int main(int argc, char* argv[]) {
config.acm.fec = false; config.acm.fec = false;
config.packet_loss = false; config.packet_loss = false;
webrtc::DelayTest delay_test; DelayTest delay_test;
delay_test.SetUp(); delay_test.SetUp();
delay_test.Perform(&config, 1, 240, "delay_test"); delay_test.Perform(&config, 1, 240, "delay_test");
delay_test.TearDown(); delay_test.TearDown();
} }
} // namespace
} // namespace webrtc
int main(int argc, char* argv[]) {
using namespace webrtc;
google::ParseCommandLineFlags(&argc, &argv, true);
RunTest();
}