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

Side by Side Diff: content/browser/speech/audio_encoder.cc

Issue 11419224: Add missing (and remove superfluous) 'explicit' from constructors. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove non-straightforward changes Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
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 "content/browser/speech/audio_encoder.h" 5 #include "content/browser/speech/audio_encoder.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const char* const kContentTypeSpeex = "audio/x-speex-with-header-byte; rate="; 105 const char* const kContentTypeSpeex = "audio/x-speex-with-header-byte; rate=";
106 const int kSpeexEncodingQuality = 8; 106 const int kSpeexEncodingQuality = 8;
107 const int kMaxSpeexFrameLength = 110; // (44kbps rate sampled at 32kHz). 107 const int kMaxSpeexFrameLength = 110; // (44kbps rate sampled at 32kHz).
108 108
109 // Since the frame length gets written out as a byte in the encoded packet, 109 // Since the frame length gets written out as a byte in the encoded packet,
110 // make sure it is within the byte range. 110 // make sure it is within the byte range.
111 COMPILE_ASSERT(kMaxSpeexFrameLength <= 0xFF, invalidLength); 111 COMPILE_ASSERT(kMaxSpeexFrameLength <= 0xFF, invalidLength);
112 112
113 class SpeexEncoder : public AudioEncoder { 113 class SpeexEncoder : public AudioEncoder {
114 public: 114 public:
115 explicit SpeexEncoder(int sampling_rate, int bits_per_sample); 115 SpeexEncoder(int sampling_rate, int bits_per_sample);
116 virtual ~SpeexEncoder(); 116 virtual ~SpeexEncoder();
117 virtual void Encode(const AudioChunk& raw_audio) OVERRIDE; 117 virtual void Encode(const AudioChunk& raw_audio) OVERRIDE;
118 virtual void Flush() OVERRIDE {} 118 virtual void Flush() OVERRIDE {}
119 119
120 private: 120 private:
121 void* encoder_state_; 121 void* encoder_state_;
122 SpeexBits bits_; 122 SpeexBits bits_;
123 int samples_per_frame_; 123 int samples_per_frame_;
124 char encoded_frame_data_[kMaxSpeexFrameLength + 1]; // +1 for the frame size. 124 char encoded_frame_data_[kMaxSpeexFrameLength + 1]; // +1 for the frame size.
125 DISALLOW_COPY_AND_ASSIGN(SpeexEncoder); 125 DISALLOW_COPY_AND_ASSIGN(SpeexEncoder);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 AudioEncoder::~AudioEncoder() { 187 AudioEncoder::~AudioEncoder() {
188 } 188 }
189 189
190 scoped_refptr<AudioChunk> AudioEncoder::GetEncodedDataAndClear() { 190 scoped_refptr<AudioChunk> AudioEncoder::GetEncodedDataAndClear() {
191 return encoded_audio_buffer_.DequeueAll(); 191 return encoded_audio_buffer_.DequeueAll();
192 } 192 }
193 193
194 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/text_input_client_mac_unittest.mm ('k') | content/browser/trace_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698