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/codec/audio_encoder_speex.h" | 5 #include "remoting/codec/audio_encoder_speex.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "remoting/proto/audio.pb.h" | 13 #include "remoting/proto/audio.pb.h" |
14 #include "third_party/speex/speex.h" | 14 #include "third_party/speex/include/speex/speex_callbacks.h" |
| 15 #include "third_party/speex/include/speex/speex_stereo.h" |
15 | 16 |
16 namespace { | 17 namespace { |
17 // A quality of 8 in wide band mode corresponds to 27,800 bits per second. | 18 // A quality of 8 in wide band mode corresponds to 27,800 bits per second. |
18 const int kSpeexHighQuality = 8; | 19 const int kSpeexHighQuality = 8; |
19 const int kEncodedDataBufferSize = 0xFF; | 20 const int kEncodedDataBufferSize = 0xFF; |
20 } // namespace | 21 } // namespace |
21 | 22 |
22 namespace remoting { | 23 namespace remoting { |
23 | 24 |
24 AudioEncoderSpeex::AudioEncoderSpeex() | 25 AudioEncoderSpeex::AudioEncoderSpeex() |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 124 } |
124 | 125 |
125 // Return NULL if there's nothing in the packet. | 126 // Return NULL if there's nothing in the packet. |
126 if (encoded_packet->data_size() == 0) | 127 if (encoded_packet->data_size() == 0) |
127 return scoped_ptr<AudioPacket>(); | 128 return scoped_ptr<AudioPacket>(); |
128 | 129 |
129 return encoded_packet.Pass(); | 130 return encoded_packet.Pass(); |
130 } | 131 } |
131 | 132 |
132 } // namespace remoting | 133 } // namespace remoting |
OLD | NEW |