| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class AudioProcessor; | 45 class AudioProcessor; |
| 46 | 46 |
| 47 // AudioDSPKernelProcessor processes one input -> one output (N channels each) | 47 // AudioDSPKernelProcessor processes one input -> one output (N channels each) |
| 48 // It uses one AudioDSPKernel object per channel to do the processing, thus ther
e is no cross-channel processing. | 48 // It uses one AudioDSPKernel object per channel to do the processing, thus ther
e is no cross-channel processing. |
| 49 // Despite this limitation it turns out to be a very common and useful type of p
rocessor. | 49 // Despite this limitation it turns out to be a very common and useful type of p
rocessor. |
| 50 | 50 |
| 51 class PLATFORM_EXPORT AudioDSPKernelProcessor : public AudioProcessor { | 51 class PLATFORM_EXPORT AudioDSPKernelProcessor : public AudioProcessor { |
| 52 public: | 52 public: |
| 53 // numberOfChannels may be later changed if object is not yet in an "initial
ized" state | 53 // numberOfChannels may be later changed if object is not yet in an "initial
ized" state |
| 54 AudioDSPKernelProcessor(float sampleRate, unsigned numberOfChannels); | 54 AudioDSPKernelProcessor(float sampleRate, unsigned numberOfChannels); |
| 55 virtual ~AudioDSPKernelProcessor(); | |
| 56 | 55 |
| 57 // Subclasses create the appropriate type of processing kernel here. | 56 // Subclasses create the appropriate type of processing kernel here. |
| 58 // We'll call this to create a kernel for each channel. | 57 // We'll call this to create a kernel for each channel. |
| 59 virtual PassOwnPtr<AudioDSPKernel> createKernel() = 0; | 58 virtual PassOwnPtr<AudioDSPKernel> createKernel() = 0; |
| 60 | 59 |
| 61 // AudioProcessor methods | 60 // AudioProcessor methods |
| 62 virtual void initialize() OVERRIDE; | 61 virtual void initialize() OVERRIDE; |
| 63 virtual void uninitialize() OVERRIDE; | 62 virtual void uninitialize() OVERRIDE; |
| 64 virtual void process(const AudioBus* source, AudioBus* destination, size_t f
ramesToProcess) OVERRIDE; | 63 virtual void process(const AudioBus* source, AudioBus* destination, size_t f
ramesToProcess) OVERRIDE; |
| 65 virtual void reset() OVERRIDE; | 64 virtual void reset() OVERRIDE; |
| 66 virtual void setNumberOfChannels(unsigned) OVERRIDE; | 65 virtual void setNumberOfChannels(unsigned) OVERRIDE; |
| 67 virtual unsigned numberOfChannels() const OVERRIDE { return m_numberOfChanne
ls; } | 66 virtual unsigned numberOfChannels() const OVERRIDE { return m_numberOfChanne
ls; } |
| 68 | 67 |
| 69 virtual double tailTime() const OVERRIDE; | 68 virtual double tailTime() const OVERRIDE; |
| 70 virtual double latencyTime() const OVERRIDE; | 69 virtual double latencyTime() const OVERRIDE; |
| 71 | 70 |
| 72 protected: | 71 protected: |
| 73 Vector<OwnPtr<AudioDSPKernel> > m_kernels; | 72 Vector<OwnPtr<AudioDSPKernel> > m_kernels; |
| 74 mutable Mutex m_processLock; | 73 mutable Mutex m_processLock; |
| 75 bool m_hasJustReset; | 74 bool m_hasJustReset; |
| 76 }; | 75 }; |
| 77 | 76 |
| 78 } // namespace blink | 77 } // namespace blink |
| 79 | 78 |
| 80 #endif // AudioDSPKernelProcessor_h | 79 #endif // AudioDSPKernelProcessor_h |
| OLD | NEW |