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

Side by Side Diff: media/base/audio_buffer_converter.h

Issue 245523002: Merge 264918 "Fix the output request size for AudioBufferConvert..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1916/src/
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | media/base/audio_buffer_converter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_BASE_AUDIO_BUFFER_CONVERTER 5 #ifndef MEDIA_BASE_AUDIO_BUFFER_CONVERTER
6 #define MEDIA_BASE_AUDIO_BUFFER_CONVERTER 6 #define MEDIA_BASE_AUDIO_BUFFER_CONVERTER
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 24 matching lines...) Expand all
35 // This should only be called this is HasNextBuffer() returns true. 35 // This should only be called this is HasNextBuffer() returns true.
36 scoped_refptr<AudioBuffer> GetNextBuffer(); 36 scoped_refptr<AudioBuffer> GetNextBuffer();
37 37
38 // Reset internal state. 38 // Reset internal state.
39 void Reset(); 39 void Reset();
40 40
41 // Reset internal timestamp state. Upon the next AddInput() call, our base 41 // Reset internal timestamp state. Upon the next AddInput() call, our base
42 // timestamp will be set to match the input buffer. 42 // timestamp will be set to match the input buffer.
43 void ResetTimestampState(); 43 void ResetTimestampState();
44 44
45 int input_buffer_size_for_testing() const {
46 return input_params_.frames_per_buffer();
47 }
48 int input_frames_left_for_testing() const {
49 return input_frames_;
50 }
51
45 private: 52 private:
46 // Callback to provide data to the AudioConverter 53 // Callback to provide data to the AudioConverter
47 virtual double ProvideInput(AudioBus* audio_bus, 54 virtual double ProvideInput(AudioBus* audio_bus,
48 base::TimeDelta buffer_delay) OVERRIDE; 55 base::TimeDelta buffer_delay) OVERRIDE;
49 56
50 // Reset the converter in response to a configuration change. 57 // Reset the converter in response to a configuration change.
51 void ResetConverter(const scoped_refptr<AudioBuffer>& input_buffer); 58 void ResetConverter(const scoped_refptr<AudioBuffer>& input_buffer);
52 59
53 // Perform conversion if we have enough data. 60 // Perform conversion if we have enough data.
54 void ConvertIfPossible(); 61 void ConvertIfPossible();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // full AudioBuses in ProvideInput()? 99 // full AudioBuses in ProvideInput()?
93 bool is_flushing_; 100 bool is_flushing_;
94 101
95 // The AudioConverter which does the real work here. 102 // The AudioConverter which does the real work here.
96 scoped_ptr<AudioConverter> audio_converter_; 103 scoped_ptr<AudioConverter> audio_converter_;
97 }; 104 };
98 105
99 } // namespace media 106 } // namespace media
100 107
101 #endif // MEDIA_BASE_AUDIO_BUFFER_CONVERTER 108 #endif // MEDIA_BASE_AUDIO_BUFFER_CONVERTER
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_buffer_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698