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 <algorithm> | 5 #include <algorithm> |
6 #include <climits> | 6 #include <climits> |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <cstdio> | 8 #include <cstdio> |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 FrameReceiverConfig GetVideoReceiverConfig() { | 146 FrameReceiverConfig GetVideoReceiverConfig() { |
147 FrameReceiverConfig video_config = GetDefaultVideoReceiverConfig(); | 147 FrameReceiverConfig video_config = GetDefaultVideoReceiverConfig(); |
148 GetVideoSsrcs(&video_config); | 148 GetVideoSsrcs(&video_config); |
149 GetVideoPayloadtype(&video_config); | 149 GetVideoPayloadtype(&video_config); |
150 video_config.rtp_max_delay_ms = 300; | 150 video_config.rtp_max_delay_ms = 300; |
151 return video_config; | 151 return video_config; |
152 } | 152 } |
153 | 153 |
154 AudioParameters ToAudioParameters(const FrameReceiverConfig& config) { | 154 AudioParameters ToAudioParameters(const FrameReceiverConfig& config) { |
155 const int samples_in_10ms = config.frequency / 100; | 155 const int samples_in_10ms = config.rtp_timebase / 100; |
156 return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 156 return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
157 GuessChannelLayout(config.channels), | 157 GuessChannelLayout(config.channels), |
158 config.frequency, 32, samples_in_10ms); | 158 config.rtp_timebase, 32, samples_in_10ms); |
159 } | 159 } |
160 | 160 |
161 // An InProcessReceiver that renders video frames to a LinuxOutputWindow and | 161 // An InProcessReceiver that renders video frames to a LinuxOutputWindow and |
162 // audio frames via Chromium's audio stack. | 162 // audio frames via Chromium's audio stack. |
163 // | 163 // |
164 // InProcessReceiver pushes audio and video frames to this subclass, and these | 164 // InProcessReceiver pushes audio and video frames to this subclass, and these |
165 // frames are pushed into a queue. Then, for audio, the Chromium audio stack | 165 // frames are pushed into a queue. Then, for audio, the Chromium audio stack |
166 // will make polling calls on a separate, unknown thread whereby audio frames | 166 // will make polling calls on a separate, unknown thread whereby audio frames |
167 // are pulled out of the audio queue as needed. For video, however, NaivePlayer | 167 // are pulled out of the audio queue as needed. For video, however, NaivePlayer |
168 // is responsible for scheduling updates to the screen itself. For both, the | 168 // is responsible for scheduling updates to the screen itself. For both, the |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 audio_config, | 591 audio_config, |
592 video_config, | 592 video_config, |
593 window_width, | 593 window_width, |
594 window_height); | 594 window_height); |
595 player.Start(); | 595 player.Start(); |
596 | 596 |
597 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). | 597 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). |
598 NOTREACHED(); | 598 NOTREACHED(); |
599 return 0; | 599 return 0; |
600 } | 600 } |
OLD | NEW |