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

Unified Diff: media/mojo/common/media_type_converters.cc

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/mojo/common/media_type_converters.cc
diff --git a/media/mojo/common/media_type_converters.cc b/media/mojo/common/media_type_converters.cc
index 33842624ebd8dbb720a6eca8027b498a8f17aff5..387939426b0d84a00a35bb23412664870cdf43cf 100644
--- a/media/mojo/common/media_type_converters.cc
+++ b/media/mojo/common/media_type_converters.cc
@@ -307,6 +307,14 @@ TypeConverter<scoped_refptr<media::AudioBuffer>, media::mojom::AudioBufferPtr>::
if (input->end_of_stream)
return media::AudioBuffer::CreateEOSBuffer();
+ if (IsBitstream(input->sample_format)) {
+ uint8_t* data = input->data.data();
+ return media::AudioBuffer::CopyBitstreamFrom(
+ input->sample_format, input->channel_layout, input->channel_count,
+ input->sample_rate, input->frame_count, &data, input->data.size(),
+ input->timestamp);
+ }
+
// Setup channel pointers. AudioBuffer::CopyFrom() will only use the first
// one in the case of interleaved data.
std::vector<const uint8_t*> channel_ptrs(input->channel_count, nullptr);
« media/filters/android/media_codec_audio_decoder.cc ('K') | « media/formats/ac3/ac3_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698