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

Side by Side Diff: media/base/audio_push_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, 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
« no previous file with comments | « media/base/audio_pull_fifo_unittest.cc ('k') | media/base/audio_push_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUSH_FIFO_H_ 5 #ifndef MEDIA_BASE_AUDIO_PUSH_FIFO_H_
6 #define MEDIA_BASE_AUDIO_PUSH_FIFO_H_ 6 #define MEDIA_BASE_AUDIO_PUSH_FIFO_H_
7 7
8 #include <memory>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "media/base/audio_bus.h" 12 #include "media/base/audio_bus.h"
12 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
13 14
14 namespace media { 15 namespace media {
15 16
16 // Yet another FIFO for audio data that re-buffers audio to a desired buffer 17 // Yet another FIFO for audio data that re-buffers audio to a desired buffer
17 // size. Unlike AudioFifo and AudioBlockFifo, this FIFO cannot overflow: The 18 // size. Unlike AudioFifo and AudioBlockFifo, this FIFO cannot overflow: The
18 // client is required to provide a callback that is called synchronously during 19 // client is required to provide a callback that is called synchronously during
19 // a push whenever enough data becomes available. This implementation 20 // a push whenever enough data becomes available. This implementation
20 // eliminates redundant memory copies when the input buffer size always matches 21 // eliminates redundant memory copies when the input buffer size always matches
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // frames plus padded zero samples. If there are no frames currently 56 // frames plus padded zero samples. If there are no frames currently
56 // enqueued, OutputCallback is not run. 57 // enqueued, OutputCallback is not run.
57 void Flush(); 58 void Flush();
58 59
59 private: 60 private:
60 const OutputCallback callback_; 61 const OutputCallback callback_;
61 62
62 int frames_per_buffer_; 63 int frames_per_buffer_;
63 64
64 // Queue of frames pending for delivery. 65 // Queue of frames pending for delivery.
65 scoped_ptr<AudioBus> audio_queue_; 66 std::unique_ptr<AudioBus> audio_queue_;
66 int queued_frames_; 67 int queued_frames_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(AudioPushFifo); 69 DISALLOW_COPY_AND_ASSIGN(AudioPushFifo);
69 }; 70 };
70 71
71 } // namespace media 72 } // namespace media
72 73
73 #endif // MEDIA_BASE_AUDIO_PUSH_FIFO_H_ 74 #endif // MEDIA_BASE_AUDIO_PUSH_FIFO_H_
OLDNEW
« no previous file with comments | « media/base/audio_pull_fifo_unittest.cc ('k') | media/base/audio_push_fifo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698