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

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

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 7 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
« no previous file with comments | « media/base/audio_discard_helper_unittest.cc ('k') | media/base/audio_fifo_unittest.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 (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_FIFO_H_ 5 #ifndef MEDIA_BASE_AUDIO_FIFO_H_
6 #define MEDIA_BASE_AUDIO_FIFO_H_ 6 #define MEDIA_BASE_AUDIO_FIFO_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "media/base/audio_bus.h" 11 #include "media/base/audio_bus.h"
10 #include "media/base/media_export.h" 12 #include "media/base/media_export.h"
11 13
12 namespace media { 14 namespace media {
13 15
14 // First-in first-out container for AudioBus elements. 16 // First-in first-out container for AudioBus elements.
15 // The maximum number of audio frames in the FIFO is set at construction and 17 // The maximum number of audio frames in the FIFO is set at construction and
16 // can not be extended dynamically. The allocated memory is utilized as a 18 // can not be extended dynamically. The allocated memory is utilized as a
17 // ring buffer. 19 // ring buffer.
(...skipping 18 matching lines...) Expand all
36 // Empties the FIFO without deallocating any memory. 38 // Empties the FIFO without deallocating any memory.
37 void Clear(); 39 void Clear();
38 40
39 // Number of actual audio frames in the FIFO. 41 // Number of actual audio frames in the FIFO.
40 int frames() const; 42 int frames() const;
41 43
42 int max_frames() const { return max_frames_; } 44 int max_frames() const { return max_frames_; }
43 45
44 private: 46 private:
45 // The actual FIFO is an audio bus implemented as a ring buffer. 47 // The actual FIFO is an audio bus implemented as a ring buffer.
46 scoped_ptr<AudioBus> audio_bus_; 48 std::unique_ptr<AudioBus> audio_bus_;
47 49
48 // Maximum number of elements the FIFO can contain. 50 // Maximum number of elements the FIFO can contain.
49 // This value is set by |frames| in the constructor. 51 // This value is set by |frames| in the constructor.
50 const int max_frames_; 52 const int max_frames_;
51 53
52 // Number of actual elements in the FIFO. 54 // Number of actual elements in the FIFO.
53 int frames_pushed_; 55 int frames_pushed_;
54 int frames_consumed_; 56 int frames_consumed_;
55 57
56 // Current read position. 58 // Current read position.
57 int read_pos_; 59 int read_pos_;
58 60
59 // Current write position. 61 // Current write position.
60 int write_pos_; 62 int write_pos_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(AudioFifo); 64 DISALLOW_COPY_AND_ASSIGN(AudioFifo);
63 }; 65 };
64 66
65 } // namespace media 67 } // namespace media
66 68
67 #endif // MEDIA_BASE_AUDIO_FIFO_H_ 69 #endif // MEDIA_BASE_AUDIO_FIFO_H_
OLDNEW
« no previous file with comments | « media/base/audio_discard_helper_unittest.cc ('k') | media/base/audio_fifo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698