summaryrefslogtreecommitdiff
path: root/media/base/audio_buffer.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-03-21 14:25:57 +0000
committerTorne (Richard Coles) <torne@google.com>2014-03-21 14:25:57 +0000
commit23730a6e56a168d1879203e4b3819bb36e3d8f1f (patch)
tree4b72bdd217f9beda1d1b975e21c9d646a9664c48 /media/base/audio_buffer.h
parent6d6d338a36340632714f2aab9a266979b71c3442 (diff)
downloadchromium_org-23730a6e56a168d1879203e4b3819bb36e3d8f1f.tar.gz
Merge from Chromium at DEPS revision 258528
This commit was generated by merge_to_master.py. Change-Id: Id197cbdde2c2881915f096c0426c741416884783
Diffstat (limited to 'media/base/audio_buffer.h')
-rw-r--r--media/base/audio_buffer.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/media/base/audio_buffer.h b/media/base/audio_buffer.h
index 5d0391070e..cd2047de8b 100644
--- a/media/base/audio_buffer.h
+++ b/media/base/audio_buffer.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
+#include "media/base/channel_layout.h"
#include "media/base/media_export.h"
#include "media/base/sample_format.h"
@@ -36,7 +37,8 @@ class MEDIA_EXPORT AudioBuffer
//
// TODO(jrummell): Compute duration rather than pass it in.
static scoped_refptr<AudioBuffer> CopyFrom(SampleFormat sample_format,
- int channel_count,
+ ChannelLayout channel_layout,
+ int sample_rate,
int frame_count,
const uint8* const* data,
const base::TimeDelta timestamp,
@@ -45,12 +47,14 @@ class MEDIA_EXPORT AudioBuffer
// Create an AudioBuffer with |frame_count| frames. Buffer is allocated, but
// not initialized. Timestamp and duration are set to kNoTimestamp().
static scoped_refptr<AudioBuffer> CreateBuffer(SampleFormat sample_format,
- int channel_count,
+ ChannelLayout channel_layout,
+ int sample_rate,
int frame_count);
// Create an empty AudioBuffer with |frame_count| frames.
static scoped_refptr<AudioBuffer> CreateEmptyBuffer(
- int channel_count,
+ ChannelLayout channel_layout,
+ int sample_rate,
int frame_count,
const base::TimeDelta timestamp,
const base::TimeDelta duration);
@@ -86,6 +90,12 @@ class MEDIA_EXPORT AudioBuffer
// Return the number of frames held.
int frame_count() const { return adjusted_frame_count_; }
+ // Return the sample rate.
+ int sample_rate() const { return sample_rate_; }
+
+ // Return the channel layout.
+ ChannelLayout channel_layout() const { return channel_layout_; }
+
// Access to constructor parameters.
base::TimeDelta timestamp() const { return timestamp_; }
base::TimeDelta duration() const { return duration_; }
@@ -112,7 +122,8 @@ class MEDIA_EXPORT AudioBuffer
// data is copied. If |create_buffer| is false, no data buffer is created (or
// copied to).
AudioBuffer(SampleFormat sample_format,
- int channel_count,
+ ChannelLayout channel_layout,
+ int sample_rate,
int frame_count,
bool create_buffer,
const uint8* const* data,
@@ -122,7 +133,9 @@ class MEDIA_EXPORT AudioBuffer
virtual ~AudioBuffer();
const SampleFormat sample_format_;
+ const ChannelLayout channel_layout_;
const int channel_count_;
+ const int sample_rate_;
int adjusted_frame_count_;
int trim_start_;
const bool end_of_stream_;