OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/audio_capturer_linux.h" | 5 #include "remoting/host/audio_capturer_linux.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "remoting/proto/audio.pb.h" | 10 #include "remoting/proto/audio.pb.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 data->data().size() / sizeof(int16))) { | 57 data->data().size() / sizeof(int16))) { |
58 return; | 58 return; |
59 } | 59 } |
60 | 60 |
61 scoped_ptr<AudioPacket> packet(new AudioPacket()); | 61 scoped_ptr<AudioPacket> packet(new AudioPacket()); |
62 packet->add_data(data->data()); | 62 packet->add_data(data->data()); |
63 packet->set_encoding(AudioPacket::ENCODING_RAW); | 63 packet->set_encoding(AudioPacket::ENCODING_RAW); |
64 packet->set_sampling_rate(AudioPipeReader::kSamplingRate); | 64 packet->set_sampling_rate(AudioPipeReader::kSamplingRate); |
65 packet->set_bytes_per_sample(AudioPipeReader::kBytesPerSample); | 65 packet->set_bytes_per_sample(AudioPipeReader::kBytesPerSample); |
66 packet->set_channels(AudioPipeReader::kChannels); | 66 packet->set_channels(AudioPipeReader::kChannels); |
67 callback_.Run(packet.Pass()); | 67 callback_.Run(std::move(packet)); |
dcheng
2015/12/22 17:48:20
Don't forget to #include <utility> where appropria
Sergey Ulanov
2015/12/22 18:11:03
scoped_ptr.h includes <utility> already, so I don'
| |
68 } | 68 } |
69 | 69 |
70 bool AudioCapturer::IsSupported() { | 70 bool AudioCapturer::IsSupported() { |
71 return g_pulseaudio_pipe_sink_reader.Get().get() != nullptr; | 71 return g_pulseaudio_pipe_sink_reader.Get().get() != nullptr; |
72 } | 72 } |
73 | 73 |
74 scoped_ptr<AudioCapturer> AudioCapturer::Create() { | 74 scoped_ptr<AudioCapturer> AudioCapturer::Create() { |
75 scoped_refptr<AudioPipeReader> reader = | 75 scoped_refptr<AudioPipeReader> reader = |
76 g_pulseaudio_pipe_sink_reader.Get(); | 76 g_pulseaudio_pipe_sink_reader.Get(); |
77 if (!reader.get()) | 77 if (!reader.get()) |
78 return nullptr; | 78 return nullptr; |
79 return make_scoped_ptr(new AudioCapturerLinux(reader)); | 79 return make_scoped_ptr(new AudioCapturerLinux(reader)); |
80 } | 80 } |
81 | 81 |
82 } // namespace remoting | 82 } // namespace remoting |
OLD | NEW |