1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/cast/cast_config.h"
10 // TODO(miu): Revisit code factoring of these structs. There are a number of
11 // common elements between them all, so it might be reasonable to only have one
12 // or two structs; or, at least a common base class.
14 // TODO(miu): Make sure all POD members are initialized by ctors. Policy
15 // decision: Reasonable defaults or use invalid placeholder values to expose
18 // TODO(miu): Provide IsValidConfig() functions?
20 // TODO(miu): Throughout the code, there is a lot of copy-and-paste of the same
21 // calculations based on these config values. So, why don't we add methods to
22 // these classes to centralize the logic?
24 VideoSenderConfig::VideoSenderConfig()
26 incoming_feedback_ssrc(0),
27 rtcp_interval(kDefaultRtcpIntervalMs
),
29 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs
)),
31 use_external_encoder(false),
34 congestion_control_back_off(kDefaultCongestionControlBackOff
),
37 start_bitrate(5000000),
38 max_qp(kDefaultMaxQp
),
39 min_qp(kDefaultMinQp
),
40 max_frame_rate(kDefaultMaxFrameRate
),
41 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers
),
42 codec(CODEC_VIDEO_VP8
),
43 number_of_encode_threads(1) {}
45 VideoSenderConfig::~VideoSenderConfig() {}
47 AudioSenderConfig::AudioSenderConfig()
49 incoming_feedback_ssrc(0),
50 rtcp_interval(kDefaultRtcpIntervalMs
),
52 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs
)),
54 use_external_encoder(false),
58 codec(CODEC_AUDIO_OPUS
) {}
60 AudioSenderConfig::~AudioSenderConfig() {}
62 FrameReceiverConfig::FrameReceiverConfig()
65 rtcp_interval(kDefaultRtcpIntervalMs
),
66 rtp_max_delay_ms(kDefaultRtpMaxDelayMs
),
71 codec(CODEC_UNKNOWN
) {}
73 FrameReceiverConfig::~FrameReceiverConfig() {}