OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test/utility/default_config.h" | 5 #include "media/cast/test/utility/default_config.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "media/cast/net/cast_transport_config.h" | 8 #include "media/cast/net/cast_transport_config.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 void CreateVideoEncodeAccelerator( | 12 void CreateVideoEncodeAccelerator( |
13 const media::cast::ReceiveVideoEncodeAcceleratorCallback& callback) { | 13 const media::cast::ReceiveVideoEncodeAcceleratorCallback& callback) { |
14 // Do nothing. | 14 // Do nothing. |
15 } | 15 } |
16 | 16 |
17 void CreateVideoEncodeMemory( | 17 void CreateVideoEncodeMemory( |
18 size_t size, | 18 size_t size, |
19 const media::cast::ReceiveVideoEncodeMemoryCallback& callback) { | 19 const media::cast::ReceiveVideoEncodeMemoryCallback& callback) { |
20 // Do nothing. | 20 // Do nothing. |
21 } | 21 } |
22 | 22 |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 namespace media { | 25 namespace media { |
26 namespace cast { | 26 namespace cast { |
27 | 27 |
28 FrameReceiverConfig GetDefaultAudioReceiverConfig() { | 28 FrameReceiverConfig GetDefaultAudioReceiverConfig() { |
29 FrameReceiverConfig config; | 29 FrameReceiverConfig config; |
30 config.feedback_ssrc = 2; | 30 config.receiver_ssrc = 2; |
31 config.incoming_ssrc = 1; | 31 config.sender_ssrc = 1; |
32 config.rtp_max_delay_ms = kDefaultRtpMaxDelayMs; | 32 config.rtp_max_delay_ms = kDefaultRtpMaxDelayMs; |
33 config.rtp_payload_type = 127; | 33 config.rtp_payload_type = 127; |
34 config.rtp_timebase = 48000; | 34 config.rtp_timebase = 48000; |
35 config.channels = 2; | 35 config.channels = 2; |
36 config.target_frame_rate = 100; // 10ms of signal per frame | 36 config.target_frame_rate = 100; // 10ms of signal per frame |
37 config.codec = media::cast::CODEC_AUDIO_OPUS; | 37 config.codec = media::cast::CODEC_AUDIO_OPUS; |
38 return config; | 38 return config; |
39 } | 39 } |
40 | 40 |
41 FrameReceiverConfig GetDefaultVideoReceiverConfig() { | 41 FrameReceiverConfig GetDefaultVideoReceiverConfig() { |
42 FrameReceiverConfig config; | 42 FrameReceiverConfig config; |
43 config.feedback_ssrc = 12; | 43 config.receiver_ssrc = 12; |
44 config.incoming_ssrc = 11; | 44 config.sender_ssrc = 11; |
45 config.rtp_max_delay_ms = kDefaultRtpMaxDelayMs; | 45 config.rtp_max_delay_ms = kDefaultRtpMaxDelayMs; |
46 config.rtp_payload_type = 96; | 46 config.rtp_payload_type = 96; |
47 config.rtp_timebase = kVideoFrequency; | 47 config.rtp_timebase = kVideoFrequency; |
48 config.channels = 1; | 48 config.channels = 1; |
49 config.target_frame_rate = kDefaultMaxFrameRate; | 49 config.target_frame_rate = kDefaultMaxFrameRate; |
50 config.codec = media::cast::CODEC_VIDEO_VP8; | 50 config.codec = media::cast::CODEC_VIDEO_VP8; |
51 return config; | 51 return config; |
52 } | 52 } |
53 | 53 |
54 AudioSenderConfig GetDefaultAudioSenderConfig() { | 54 AudioSenderConfig GetDefaultAudioSenderConfig() { |
55 FrameReceiverConfig recv_config = GetDefaultAudioReceiverConfig(); | 55 FrameReceiverConfig recv_config = GetDefaultAudioReceiverConfig(); |
56 AudioSenderConfig config; | 56 AudioSenderConfig config; |
57 config.ssrc = recv_config.incoming_ssrc; | 57 config.ssrc = recv_config.sender_ssrc; |
58 config.receiver_ssrc = recv_config.feedback_ssrc; | 58 config.receiver_ssrc = recv_config.receiver_ssrc; |
59 config.rtp_payload_type = recv_config.rtp_payload_type; | 59 config.rtp_payload_type = recv_config.rtp_payload_type; |
60 config.use_external_encoder = false; | 60 config.use_external_encoder = false; |
61 config.frequency = recv_config.rtp_timebase; | 61 config.frequency = recv_config.rtp_timebase; |
62 config.channels = recv_config.channels; | 62 config.channels = recv_config.channels; |
63 config.bitrate = kDefaultAudioEncoderBitrate; | 63 config.bitrate = kDefaultAudioEncoderBitrate; |
64 config.codec = recv_config.codec; | 64 config.codec = recv_config.codec; |
65 config.max_playout_delay = | 65 config.max_playout_delay = |
66 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs); | 66 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs); |
67 return config; | 67 return config; |
68 } | 68 } |
69 | 69 |
70 VideoSenderConfig GetDefaultVideoSenderConfig() { | 70 VideoSenderConfig GetDefaultVideoSenderConfig() { |
71 FrameReceiverConfig recv_config = GetDefaultVideoReceiverConfig(); | 71 FrameReceiverConfig recv_config = GetDefaultVideoReceiverConfig(); |
72 VideoSenderConfig config; | 72 VideoSenderConfig config; |
73 config.ssrc = recv_config.incoming_ssrc; | 73 config.ssrc = recv_config.sender_ssrc; |
74 config.receiver_ssrc = recv_config.feedback_ssrc; | 74 config.receiver_ssrc = recv_config.receiver_ssrc; |
75 config.rtp_payload_type = recv_config.rtp_payload_type; | 75 config.rtp_payload_type = recv_config.rtp_payload_type; |
76 config.use_external_encoder = false; | 76 config.use_external_encoder = false; |
77 config.max_bitrate = 4000000; | 77 config.max_bitrate = 4000000; |
78 config.min_bitrate = 2000000; | 78 config.min_bitrate = 2000000; |
79 config.start_bitrate = 4000000; | 79 config.start_bitrate = 4000000; |
80 config.max_frame_rate = recv_config.target_frame_rate; | 80 config.max_frame_rate = recv_config.target_frame_rate; |
81 config.max_number_of_video_buffers_used = 1; | 81 config.max_number_of_video_buffers_used = 1; |
82 config.codec = recv_config.codec; | 82 config.codec = recv_config.codec; |
83 config.number_of_encode_threads = 2; | 83 config.number_of_encode_threads = 2; |
84 config.max_playout_delay = | 84 config.max_playout_delay = |
85 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs); | 85 base::TimeDelta::FromMilliseconds(kDefaultRtpMaxDelayMs); |
86 return config; | 86 return config; |
87 } | 87 } |
88 | 88 |
89 CreateVideoEncodeAcceleratorCallback | 89 CreateVideoEncodeAcceleratorCallback |
90 CreateDefaultVideoEncodeAcceleratorCallback() { | 90 CreateDefaultVideoEncodeAcceleratorCallback() { |
91 return base::Bind(&CreateVideoEncodeAccelerator); | 91 return base::Bind(&CreateVideoEncodeAccelerator); |
92 } | 92 } |
93 | 93 |
94 CreateVideoEncodeMemoryCallback CreateDefaultVideoEncodeMemoryCallback() { | 94 CreateVideoEncodeMemoryCallback CreateDefaultVideoEncodeMemoryCallback() { |
95 return base::Bind(&CreateVideoEncodeMemory); | 95 return base::Bind(&CreateVideoEncodeMemory); |
96 } | 96 } |
97 | 97 |
98 } // namespace cast | 98 } // namespace cast |
99 } // namespace media | 99 } // namespace media |
OLD | NEW |