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

Side by Side Diff: Source/core/platform/audio/AudioFIFO.h

Issue 14628008: Require use of AudioBus::create() to avoid ref-counting issues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Require use of Created 7 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 | « Source/core/platform/audio/AudioBus.cpp ('k') | Source/core/platform/audio/AudioFIFO.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Number of frames of data that are currently in the FIFO. 48 // Number of frames of data that are currently in the FIFO.
49 size_t framesInFifo() const { return m_framesInFifo; } 49 size_t framesInFifo() const { return m_framesInFifo; }
50 50
51 private: 51 private:
52 // Update the FIFO index by the step, with appropriate wrapping around the e ndpoint. 52 // Update the FIFO index by the step, with appropriate wrapping around the e ndpoint.
53 int updateIndex(int index, int step) { return (index + step) % m_fifoLength; } 53 int updateIndex(int index, int step) { return (index + step) % m_fifoLength; }
54 54
55 void findWrapLengths(size_t index, size_t providerSize, size_t& part1Length, size_t& part2Length); 55 void findWrapLengths(size_t index, size_t providerSize, size_t& part1Length, size_t& part2Length);
56 56
57 // The FIFO itself. In reality, the FIFO is a circular buffer. 57 // The FIFO itself. In reality, the FIFO is a circular buffer.
58 AudioBus m_fifoAudioBus; 58 RefPtr<AudioBus> m_fifoAudioBus;
59 59
60 // The total available space in the FIFO. 60 // The total available space in the FIFO.
61 size_t m_fifoLength; 61 size_t m_fifoLength;
62 62
63 // The number of actual elements in the FIFO 63 // The number of actual elements in the FIFO
64 size_t m_framesInFifo; 64 size_t m_framesInFifo;
65 65
66 // Where to start reading from the FIFO. 66 // Where to start reading from the FIFO.
67 size_t m_readIndex; 67 size_t m_readIndex;
68 68
69 // Where to start writing to the FIFO. 69 // Where to start writing to the FIFO.
70 size_t m_writeIndex; 70 size_t m_writeIndex;
71 }; 71 };
72 72
73 } // namespace WebCore 73 } // namespace WebCore
74 74
75 #endif // AudioFIFO.h 75 #endif // AudioFIFO.h
OLDNEW
« no previous file with comments | « Source/core/platform/audio/AudioBus.cpp ('k') | Source/core/platform/audio/AudioFIFO.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698