Remove static initializer in WebRtcVideoEngine2.
Blocks import into chromium.
R=tommi@webrtc.org
BUG=
Review URL: https://webrtc-codereview.appspot.com/18249004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@6954 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/media/webrtc/webrtcvideoengine2.cc b/media/webrtc/webrtcvideoengine2.cc
index 5bb9db4..ea53596 100644
--- a/media/webrtc/webrtcvideoengine2.cc
+++ b/media/webrtc/webrtcvideoengine2.cc
@@ -59,17 +59,14 @@
struct VideoCodecPref {
int payload_type;
+ int width;
+ int height;
const char* name;
int rtx_payload_type;
-} kDefaultVideoCodecPref = {100, kVp8CodecName, 96};
+} kDefaultVideoCodecPref = {100, 640, 400, kVp8CodecName, 96};
-VideoCodecPref kRedPref = {116, kRedCodecName, -1};
-VideoCodecPref kUlpfecPref = {117, kUlpfecCodecName, -1};
-
-// The formats are sorted by the descending order of width. We use the order to
-// find the next format for CPU and bandwidth adaptation.
-const VideoFormatPod kDefaultMaxVideoFormat = {
- 640, 400, FPS_TO_INTERVAL(kDefaultFramerate), FOURCC_ANY};
+VideoCodecPref kRedPref = {116, -1, -1, kRedCodecName, -1};
+VideoCodecPref kUlpfecPref = {117, -1, -1, kUlpfecCodecName, -1};
static bool FindFirstMatchingCodec(const std::vector<VideoCodec>& codecs,
const VideoCodec& requested_codec,
@@ -107,8 +104,8 @@
static VideoCodec DefaultVideoCodec() {
VideoCodec default_codec(kDefaultVideoCodecPref.payload_type,
kDefaultVideoCodecPref.name,
- kDefaultMaxVideoFormat.width,
- kDefaultMaxVideoFormat.height,
+ kDefaultVideoCodecPref.width,
+ kDefaultVideoCodecPref.height,
kDefaultFramerate,
0);
AddDefaultFeedbackParams(&default_codec);
@@ -285,13 +282,21 @@
}
}
-WebRtcVideoEngine2::WebRtcVideoEngine2() {
+WebRtcVideoEngine2::WebRtcVideoEngine2()
+ : default_codec_format_(kDefaultVideoCodecPref.width,
+ kDefaultVideoCodecPref.height,
+ FPS_TO_INTERVAL(kDefaultFramerate),
+ FOURCC_ANY) {
// Construct without a factory or voice engine.
Construct(NULL, NULL, new rtc::CpuMonitor(NULL));
}
WebRtcVideoEngine2::WebRtcVideoEngine2(
- WebRtcVideoChannelFactory* channel_factory) {
+ WebRtcVideoChannelFactory* channel_factory)
+ : default_codec_format_(kDefaultVideoCodecPref.width,
+ kDefaultVideoCodecPref.height,
+ FPS_TO_INTERVAL(kDefaultFramerate),
+ FOURCC_ANY) {
// Construct without a voice engine.
Construct(channel_factory, NULL, new rtc::CpuMonitor(NULL));
}
@@ -308,7 +313,6 @@
channel_factory_ = channel_factory;
video_codecs_ = DefaultVideoCodecs();
- default_codec_format_ = VideoFormat(kDefaultMaxVideoFormat);
rtp_header_extensions_.push_back(
RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension,