| Index: media/base/audio_bus.h
|
| diff --git a/media/base/audio_bus.h b/media/base/audio_bus.h
|
| index c5b161f0236082728db2bd97b25ba9de7a9e1c60..c78486e5e00aa5f00ce567275f0025681778ec21 100644
|
| --- a/media/base/audio_bus.h
|
| +++ b/media/base/audio_bus.h
|
| @@ -8,6 +8,7 @@
|
| #include <vector>
|
|
|
| #include "base/memory/aligned_memory.h"
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "media/base/media_export.h"
|
|
|
| @@ -110,12 +111,13 @@ class MEDIA_EXPORT AudioBus {
|
|
|
| virtual ~AudioBus();
|
|
|
| - private:
|
| + protected:
|
| AudioBus(int channels, int frames);
|
| AudioBus(int channels, int frames, float* data);
|
| AudioBus(int frames, const std::vector<float*>& channel_data);
|
| explicit AudioBus(int channels);
|
|
|
| + private:
|
| // Helper method for building |channel_data_| from a block of memory. |data|
|
| // must be at least BlockSize() bytes in size.
|
| void BuildChannelData(int channels, int aligned_frame, float* data);
|
| @@ -132,6 +134,24 @@ class MEDIA_EXPORT AudioBus {
|
| DISALLOW_COPY_AND_ASSIGN(AudioBus);
|
| };
|
|
|
| +// RefCounted version of AudioBus. This is not meant for general use. Only use
|
| +// this when your lifetime requirements make it impossible to use an
|
| +// AudioBus scoped_ptr.
|
| +class MEDIA_EXPORT AudioBusRefCounted
|
| + : public media::AudioBus,
|
| + public base::RefCountedThreadSafe<AudioBusRefCounted> {
|
| + public:
|
| + static scoped_refptr<AudioBusRefCounted> Create(int channels, int frames);
|
| +
|
| + private:
|
| + friend class base::RefCountedThreadSafe<AudioBusRefCounted>;
|
| +
|
| + AudioBusRefCounted(int channels, int frames);
|
| + virtual ~AudioBusRefCounted();
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted);
|
| +};
|
| +
|
| } // namespace media
|
|
|
| #endif // MEDIA_BASE_AUDIO_BUS_H_
|
|
|