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

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

Issue 2466463005: Support (E)AC3 passthrough
Patch Set: Improve CastMediaClient::IsSupportedPassthroughAudio() Created 4 years, 1 month 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 8ca720e10431b4ba1349eef5ecb7eda716ddd98f..9529b095b9daa5e56516bd064e33a52f59560d0c 100644
--- a/media/mojo/common/media_type_converters.cc
+++ b/media/mojo/common/media_type_converters.cc
@@ -304,6 +304,14 @@ TypeConverter<scoped_refptr<media::AudioBuffer>, media::mojom::AudioBufferPtr>::
if (input->end_of_stream)
return media::AudioBuffer::CreateEOSBuffer();
+ if (input->sample_format == media::kSampleFormatRaw) {
+ uint8_t* data = input->data.data();
+ return media::AudioBuffer::CopyFrom(
+ input->sample_format, input->channel_layout, input->channel_count,
+ input->sample_rate, input->frame_count, &data, input->timestamp,
+ input->data.size());
+ }
+
// 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);

Powered by Google App Engine
This is Rietveld 408576698