| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/cast/cast_config.h" | 5 #include "media/cast/cast_config.h" |
| 6 | 6 |
| 7 namespace media { | 7 namespace media { |
| 8 namespace cast { | 8 namespace cast { |
| 9 | 9 |
| 10 // TODO(miu): Revisit code factoring of these structs. There are a number of | 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 | 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. | 12 // or two structs; or, at least a common base class. |
| 13 | 13 |
| 14 // TODO(miu): Make sure all POD members are initialized by ctors. Policy | 14 // TODO(miu): Make sure all POD members are initialized by ctors. Policy |
| 15 // decision: Reasonable defaults or use invalid placeholder values to expose | 15 // decision: Reasonable defaults or use invalid placeholder values to expose |
| 16 // unset members? | 16 // unset members? |
| 17 | 17 |
| 18 // TODO(miu): Provide IsValidConfig() functions? | 18 // TODO(miu): Provide IsValidConfig() functions? |
| 19 | 19 |
| 20 // TODO(miu): Throughout the code, there is a lot of copy-and-paste of the same | 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 | 21 // calculations based on these config values. So, why don't we add methods to |
| 22 // these classes to centralize the logic? | 22 // these classes to centralize the logic? |
| 23 | 23 |
| 24 VideoSenderConfig::VideoSenderConfig() | 24 VideoSenderConfig::VideoSenderConfig() |
| 25 : ssrc(0), | 25 : ssrc(0), |
| 26 incoming_feedback_ssrc(0), | 26 incoming_feedback_ssrc(0), |
| 27 rtcp_interval(kDefaultRtcpIntervalMs), | 27 rtcp_interval(kDefaultRtcpIntervalMs), |
| 28 target_playout_delay( | 28 min_playout_delay( |
| 29 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), |
| 30 max_playout_delay( |
| 29 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), | 31 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), |
| 30 rtp_payload_type(0), | 32 rtp_payload_type(0), |
| 31 use_external_encoder(false), | 33 use_external_encoder(false), |
| 32 width(0), | 34 width(0), |
| 33 height(0), | 35 height(0), |
| 34 congestion_control_back_off(kDefaultCongestionControlBackOff), | 36 congestion_control_back_off(kDefaultCongestionControlBackOff), |
| 35 max_bitrate(5000000), | 37 max_bitrate(5000000), |
| 36 min_bitrate(1000000), | 38 min_bitrate(1000000), |
| 37 start_bitrate(5000000), | 39 start_bitrate(5000000), |
| 38 max_qp(kDefaultMaxQp), | 40 max_qp(kDefaultMaxQp), |
| 39 min_qp(kDefaultMinQp), | 41 min_qp(kDefaultMinQp), |
| 40 max_frame_rate(kDefaultMaxFrameRate), | 42 max_frame_rate(kDefaultMaxFrameRate), |
| 41 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers), | 43 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers), |
| 42 codec(CODEC_VIDEO_VP8), | 44 codec(CODEC_VIDEO_VP8), |
| 43 number_of_encode_threads(1) {} | 45 number_of_encode_threads(1) {} |
| 44 | 46 |
| 45 VideoSenderConfig::~VideoSenderConfig() {} | 47 VideoSenderConfig::~VideoSenderConfig() {} |
| 46 | 48 |
| 47 AudioSenderConfig::AudioSenderConfig() | 49 AudioSenderConfig::AudioSenderConfig() |
| 48 : ssrc(0), | 50 : ssrc(0), |
| 49 incoming_feedback_ssrc(0), | 51 incoming_feedback_ssrc(0), |
| 50 rtcp_interval(kDefaultRtcpIntervalMs), | 52 rtcp_interval(kDefaultRtcpIntervalMs), |
| 51 target_playout_delay( | 53 min_playout_delay( |
| 54 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), |
| 55 max_playout_delay( |
| 52 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), | 56 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), |
| 53 rtp_payload_type(0), | 57 rtp_payload_type(0), |
| 54 use_external_encoder(false), | 58 use_external_encoder(false), |
| 55 frequency(0), | 59 frequency(0), |
| 56 channels(0), | 60 channels(0), |
| 57 bitrate(0), | 61 bitrate(0), |
| 58 codec(CODEC_AUDIO_OPUS) {} | 62 codec(CODEC_AUDIO_OPUS) {} |
| 59 | 63 |
| 60 AudioSenderConfig::~AudioSenderConfig() {} | 64 AudioSenderConfig::~AudioSenderConfig() {} |
| 61 | 65 |
| 62 FrameReceiverConfig::FrameReceiverConfig() | 66 FrameReceiverConfig::FrameReceiverConfig() |
| 63 : feedback_ssrc(0), | 67 : feedback_ssrc(0), |
| 64 incoming_ssrc(0), | 68 incoming_ssrc(0), |
| 65 rtcp_interval(kDefaultRtcpIntervalMs), | 69 rtcp_interval(kDefaultRtcpIntervalMs), |
| 66 rtp_max_delay_ms(kDefaultRtpMaxDelayMs), | 70 rtp_max_delay_ms(kDefaultRtpMaxDelayMs), |
| 67 rtp_payload_type(0), | 71 rtp_payload_type(0), |
| 68 frequency(0), | 72 frequency(0), |
| 69 channels(0), | 73 channels(0), |
| 70 max_frame_rate(0), | 74 max_frame_rate(0), |
| 71 codec(CODEC_UNKNOWN) {} | 75 codec(CODEC_UNKNOWN) {} |
| 72 | 76 |
| 73 FrameReceiverConfig::~FrameReceiverConfig() {} | 77 FrameReceiverConfig::~FrameReceiverConfig() {} |
| 74 | 78 |
| 75 } // namespace cast | 79 } // namespace cast |
| 76 } // namespace media | 80 } // namespace media |
| OLD | NEW |