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

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

Issue 10918098: Introduce AudioOutputResampler for browser side resampling. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unittests! Bugs! Created 8 years, 3 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
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 #ifndef MEDIA_BASE_AUDIO_PULL_FIFO_H_ 5 #ifndef MEDIA_BASE_AUDIO_PULL_FIFO_H_
6 #define MEDIA_BASE_AUDIO_PULL_FIFO_H_ 6 #define MEDIA_BASE_AUDIO_PULL_FIFO_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "media/base/audio_fifo.h" 9 #include "media/base/audio_fifo.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
(...skipping 18 matching lines...) Expand all
29 // length |frames| audio frames. 29 // length |frames| audio frames.
30 AudioPullFifo(int channels, int frames, const ReadCB& read_cb); 30 AudioPullFifo(int channels, int frames, const ReadCB& read_cb);
31 virtual ~AudioPullFifo(); 31 virtual ~AudioPullFifo();
32 32
33 // Consumes |frames_to_consume| audio frames from the FIFO and copies 33 // Consumes |frames_to_consume| audio frames from the FIFO and copies
34 // them to |destination|. 34 // them to |destination|.
35 // If the FIFO does not have enough data, we ask the producer to give us more 35 // If the FIFO does not have enough data, we ask the producer to give us more
36 // data to fulfill the request using the ReadCB implementation. 36 // data to fulfill the request using the ReadCB implementation.
37 void Consume(AudioBus* destination, int frames_to_consume); 37 void Consume(AudioBus* destination, int frames_to_consume);
38 38
39 void Clear() { fifo_->Clear(); }
scherkus (not reviewing) 2012/09/10 12:47:47 docs + de-inline (it's not a simple getter)
DaleCurtis 2012/09/10 14:05:51 Not my change, will be removed by rebase against h
40
39 private: 41 private:
40 // Attempt to fulfill the request using what is available in the FIFO. 42 // Attempt to fulfill the request using what is available in the FIFO.
41 // Append new data to the |destination| starting at |write_pos|. 43 // Append new data to the |destination| starting at |write_pos|.
42 void ReadFromFifo( 44 void ReadFromFifo(
43 AudioBus* destination, int* frames_to_provide, int* write_pos); 45 AudioBus* destination, int* frames_to_provide, int* write_pos);
44 46
45 // Source of data to the FIFO. 47 // Source of data to the FIFO.
46 ReadCB read_cb_; 48 ReadCB read_cb_;
47 49
48 // The actual FIFO. 50 // The actual FIFO.
49 scoped_ptr<AudioFifo> fifo_; 51 scoped_ptr<AudioFifo> fifo_;
50 52
51 // Temporary audio bus to hold the data from the producer. 53 // Temporary audio bus to hold the data from the producer.
52 scoped_ptr<AudioBus> bus_; 54 scoped_ptr<AudioBus> bus_;
53 55
54 DISALLOW_COPY_AND_ASSIGN(AudioPullFifo); 56 DISALLOW_COPY_AND_ASSIGN(AudioPullFifo);
55 }; 57 };
56 58
57 } // namespace media 59 } // namespace media
58 60
59 #endif // MEDIA_BASE_AUDIO_PULL_FIFO_H_ 61 #endif // MEDIA_BASE_AUDIO_PULL_FIFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698