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

Unified Diff: media/base/audio_buffer.h

Issue 2572573007: Use passthrough decoder for (E)AC3 formats (Closed)
Patch Set: Use BitReader to unpack header fileds Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: media/base/audio_buffer.h
diff --git a/media/base/audio_buffer.h b/media/base/audio_buffer.h
index d03a02ed4fcfa1ea7ffd2bbae91e0c669a37cb2a..530f86b578f7a8450fecbfc680d82f21c81bb84e 100644
--- a/media/base/audio_buffer.h
+++ b/media/base/audio_buffer.h
@@ -57,6 +57,19 @@ class MEDIA_EXPORT AudioBuffer
const uint8_t* const* data,
const base::TimeDelta timestamp);
+ // Create an AudioBuffer for compressed bitstream. Its channel data is copied
+ // from |data|, and the size is |data_size|. |data| must not be null and
+ // |frame_count| must be >= 0.
+ static scoped_refptr<AudioBuffer> CopyBitstreamFrom(
+ SampleFormat sample_format,
+ ChannelLayout channel_layout,
+ int channel_count,
+ int sample_rate,
+ int frame_count,
+ const uint8_t* const* data,
+ const size_t data_size,
+ const base::TimeDelta timestamp);
+
// 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,
@@ -65,6 +78,16 @@ class MEDIA_EXPORT AudioBuffer
int sample_rate,
int frame_count);
+ // Create an AudioBuffer for compressed bitstream. Buffer is allocated, but
+ // not initialized. Timestamp and duration are set to kNoTimestamp.
+ static scoped_refptr<AudioBuffer> CreateBitstreamBuffer(
+ SampleFormat sample_format,
+ ChannelLayout channel_layout,
+ int channel_count,
+ int sample_rate,
+ int frame_count,
+ size_t data_size);
+
// Create an empty AudioBuffer with |frame_count| frames.
static scoped_refptr<AudioBuffer> CreateEmptyBuffer(
ChannelLayout channel_layout,
@@ -117,6 +140,9 @@ class MEDIA_EXPORT AudioBuffer
// Return the sample rate.
int sample_rate() const { return sample_rate_; }
+ // Return the sample format.
+ SampleFormat sample_format() const { return sample_format_; }
+
// Return the channel layout.
ChannelLayout channel_layout() const { return channel_layout_; }
@@ -157,6 +183,7 @@ class MEDIA_EXPORT AudioBuffer
int frame_count,
bool create_buffer,
const uint8_t* const* data,
+ size_t data_size,
const base::TimeDelta timestamp);
virtual ~AudioBuffer();

Powered by Google App Engine
This is Rietveld 408576698