Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / media / cast / cast_config.cc
blobe361f158c49964ea43bed553693d00c964938fd7
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"
7 namespace media {
8 namespace cast {
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
16 // unset members?
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()
25 : ssrc(0),
26 receiver_ssrc(0),
27 max_playout_delay(
28 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)),
29 rtp_payload_type(0),
30 use_external_encoder(false),
31 congestion_control_back_off(kDefaultCongestionControlBackOff),
32 max_bitrate(5000000),
33 min_bitrate(1000000),
34 start_bitrate(5000000),
35 max_qp(kDefaultMaxQp),
36 min_qp(kDefaultMinQp),
37 max_frame_rate(kDefaultMaxFrameRate),
38 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers),
39 codec(CODEC_VIDEO_VP8),
40 number_of_encode_threads(1) {}
42 VideoSenderConfig::~VideoSenderConfig() {}
44 AudioSenderConfig::AudioSenderConfig()
45 : ssrc(0),
46 receiver_ssrc(0),
47 max_playout_delay(
48 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)),
49 rtp_payload_type(0),
50 use_external_encoder(false),
51 frequency(0),
52 channels(0),
53 bitrate(0),
54 codec(CODEC_AUDIO_OPUS) {}
56 AudioSenderConfig::~AudioSenderConfig() {}
58 FrameReceiverConfig::FrameReceiverConfig()
59 : receiver_ssrc(0),
60 sender_ssrc(0),
61 rtp_max_delay_ms(kDefaultRtpMaxDelayMs),
62 rtp_payload_type(0),
63 rtp_timebase(0),
64 channels(0),
65 target_frame_rate(0),
66 codec(CODEC_UNKNOWN) {}
68 FrameReceiverConfig::~FrameReceiverConfig() {}
70 } // namespace cast
71 } // namespace media