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

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

Issue 2572573007: Use passthrough decoder for (E)AC3 formats (Closed)
Patch Set: Use passthrough decoder for (E)AC3 formats Created 3 years, 8 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
« media/formats/ac3/ac3_util.cc ('K') | « media/formats/ac3/ac3_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50dd25fd4d34b2f7730aa7907d2f07255f4d2242..924c391c9c8a1b0b2e1f5aa1b09550aea6c1c293 100644
--- a/media/mojo/common/media_type_converters.cc
+++ b/media/mojo/common/media_type_converters.cc
@@ -311,6 +311,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/formats/ac3/ac3_util.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