Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: media/cast/cast_config.cc

Issue 2068133005: Refactoring: Use enum for RtpPayloadType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to Patch 2. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/cast_config.h ('k') | media/cast/net/cast_transport_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 { 7 namespace {
8 8
9 const float kDefaultCongestionControlBackOff = 0.875f; 9 const float kDefaultCongestionControlBackOff = 0.875f;
10 10
(...skipping 26 matching lines...) Expand all
37 37
38 // TODO(miu): Throughout the code, there is a lot of copy-and-paste of the same 38 // TODO(miu): Throughout the code, there is a lot of copy-and-paste of the same
39 // calculations based on these config values. So, why don't we add methods to 39 // calculations based on these config values. So, why don't we add methods to
40 // these classes to centralize the logic? 40 // these classes to centralize the logic?
41 41
42 VideoSenderConfig::VideoSenderConfig() 42 VideoSenderConfig::VideoSenderConfig()
43 : ssrc(0), 43 : ssrc(0),
44 receiver_ssrc(0), 44 receiver_ssrc(0),
45 max_playout_delay( 45 max_playout_delay(
46 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), 46 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)),
47 rtp_payload_type(0), 47 rtp_payload_type(RtpPayloadType::UNKNOWN),
48 use_external_encoder(false), 48 use_external_encoder(false),
49 congestion_control_back_off(kDefaultCongestionControlBackOff), 49 congestion_control_back_off(kDefaultCongestionControlBackOff),
50 max_bitrate(kDefaultMaxVideoKbps * 1000), 50 max_bitrate(kDefaultMaxVideoKbps * 1000),
51 min_bitrate(kDefaultMinVideoKbps * 1000), 51 min_bitrate(kDefaultMinVideoKbps * 1000),
52 start_bitrate(kDefaultMaxVideoKbps * 1000), 52 start_bitrate(kDefaultMaxVideoKbps * 1000),
53 max_qp(kDefaultMaxQp), 53 max_qp(kDefaultMaxQp),
54 min_qp(kDefaultMinQp), 54 min_qp(kDefaultMinQp),
55 max_cpu_saver_qp(kDefaultMaxCpuSaverQp), 55 max_cpu_saver_qp(kDefaultMaxCpuSaverQp),
56 max_frame_rate(kDefaultMaxFrameRate), 56 max_frame_rate(kDefaultMaxFrameRate),
57 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers), 57 max_number_of_video_buffers_used(kDefaultNumberOfVideoBuffers),
58 codec(CODEC_VIDEO_VP8), 58 codec(CODEC_VIDEO_VP8),
59 number_of_encode_threads(1) {} 59 number_of_encode_threads(1) {}
60 60
61 VideoSenderConfig::VideoSenderConfig(const VideoSenderConfig& other) = default; 61 VideoSenderConfig::VideoSenderConfig(const VideoSenderConfig& other) = default;
62 62
63 VideoSenderConfig::~VideoSenderConfig() {} 63 VideoSenderConfig::~VideoSenderConfig() {}
64 64
65 AudioSenderConfig::AudioSenderConfig() 65 AudioSenderConfig::AudioSenderConfig()
66 : ssrc(0), 66 : ssrc(0),
67 receiver_ssrc(0), 67 receiver_ssrc(0),
68 max_playout_delay( 68 max_playout_delay(
69 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)), 69 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs)),
70 rtp_payload_type(0), 70 rtp_payload_type(RtpPayloadType::UNKNOWN),
71 use_external_encoder(false), 71 use_external_encoder(false),
72 frequency(0), 72 frequency(0),
73 channels(0), 73 channels(0),
74 bitrate(kDefaultAudioEncoderBitrate), 74 bitrate(kDefaultAudioEncoderBitrate),
75 codec(CODEC_AUDIO_OPUS) {} 75 codec(CODEC_AUDIO_OPUS) {}
76 76
77 AudioSenderConfig::AudioSenderConfig(const AudioSenderConfig& other) = default; 77 AudioSenderConfig::AudioSenderConfig(const AudioSenderConfig& other) = default;
78 78
79 AudioSenderConfig::~AudioSenderConfig() {} 79 AudioSenderConfig::~AudioSenderConfig() {}
80 80
81 FrameReceiverConfig::FrameReceiverConfig() 81 FrameReceiverConfig::FrameReceiverConfig()
82 : receiver_ssrc(0), 82 : receiver_ssrc(0),
83 sender_ssrc(0), 83 sender_ssrc(0),
84 rtp_max_delay_ms(kDefaultRtpMaxDelayMs), 84 rtp_max_delay_ms(kDefaultRtpMaxDelayMs),
85 rtp_payload_type(0), 85 rtp_payload_type(RtpPayloadType::UNKNOWN),
86 rtp_timebase(0), 86 rtp_timebase(0),
87 channels(0), 87 channels(0),
88 target_frame_rate(0), 88 target_frame_rate(0),
89 codec(CODEC_UNKNOWN) {} 89 codec(CODEC_UNKNOWN) {}
90 90
91 FrameReceiverConfig::FrameReceiverConfig(const FrameReceiverConfig& other) = 91 FrameReceiverConfig::FrameReceiverConfig(const FrameReceiverConfig& other) =
92 default; 92 default;
93 93
94 FrameReceiverConfig::~FrameReceiverConfig() {} 94 FrameReceiverConfig::~FrameReceiverConfig() {}
95 95
96 } // namespace cast 96 } // namespace cast
97 } // namespace media 97 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/cast_config.h ('k') | media/cast/net/cast_transport_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698