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

Unified Diff: media/base/audio_buffer.h

Issue 2572573007: Use passthrough decoder for (E)AC3 formats (Closed)
Patch Set: Sanity checks Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_codec_util.cc ('k') | media/base/audio_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_buffer.h
diff --git a/media/base/audio_buffer.h b/media/base/audio_buffer.h
index e97e2c23fd1e129db527fea552708382cc32a3b8..0503466859423d49aa34f09cbb20891d8754d0ef 100644
--- a/media/base/audio_buffer.h
+++ b/media/base/audio_buffer.h
@@ -64,6 +64,20 @@ class MEDIA_EXPORT AudioBuffer
const base::TimeDelta timestamp,
scoped_refptr<AudioBufferMemoryPool> pool = nullptr);
+ // 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,
+ scoped_refptr<AudioBufferMemoryPool> pool = nullptr);
+
// Create an AudioBuffer with |frame_count| frames. Buffer is allocated, but
// not initialized. Timestamp and duration are set to kNoTimestamp. For
// optimal efficiency when many buffers are being created, a
@@ -76,6 +90,17 @@ class MEDIA_EXPORT AudioBuffer
int frame_count,
scoped_refptr<AudioBufferMemoryPool> pool = nullptr);
+ // 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,
+ scoped_refptr<AudioBufferMemoryPool> pool = nullptr);
+
// Create an empty AudioBuffer with |frame_count| frames.
static scoped_refptr<AudioBuffer> CreateEmptyBuffer(
ChannelLayout channel_layout,
@@ -119,6 +144,9 @@ class MEDIA_EXPORT AudioBuffer
// Even if |start| is zero, timestamp() is not adjusted, only duration().
void TrimRange(int start, int end);
+ // Return true if the buffer contains compressed bitstream.
+ bool IsBitstreamFormat();
+
// Return the number of channels.
int channel_count() const { return channel_count_; }
@@ -168,6 +196,7 @@ class MEDIA_EXPORT AudioBuffer
int frame_count,
bool create_buffer,
const uint8_t* const* data,
+ const size_t data_size,
const base::TimeDelta timestamp,
scoped_refptr<AudioBufferMemoryPool> pool);
« no previous file with comments | « media/base/android/media_codec_util.cc ('k') | media/base/audio_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698