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

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

Issue 1760273003: Added unittests for VideoDecoderConfig conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | media/mojo/common/media_type_converters_unittest.cc » ('j') | 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 476d1b4588ff2fcd63fd5396523f0725299c73a5..5735cb0f55ba8dad32688c386a6cb86deefffb23 100644
--- a/media/mojo/common/media_type_converters.cc
+++ b/media/mojo/common/media_type_converters.cc
@@ -477,8 +477,7 @@ media::interfaces::AudioDecoderConfigPtr TypeConverter<
static_cast<media::interfaces::ChannelLayout>(input.channel_layout());
config->samples_per_second = input.samples_per_second();
if (!input.extra_data().empty()) {
- std::vector<uint8_t> extra_data = input.extra_data();
- config->extra_data.Swap(&extra_data);
+ config->extra_data = mojo::Array<uint8_t>::From(input.extra_data());
}
config->seek_preroll_usec = input.seek_preroll().InMicroseconds();
config->codec_delay = input.codec_delay();
@@ -518,7 +517,9 @@ media::interfaces::VideoDecoderConfigPtr TypeConverter<
config->coded_size = Size::From(input.coded_size());
config->visible_rect = Rect::From(input.visible_rect());
config->natural_size = Size::From(input.natural_size());
- config->extra_data = mojo::Array<uint8_t>::From(input.extra_data());
+ if (!input.extra_data().empty()) {
+ config->extra_data = mojo::Array<uint8_t>::From(input.extra_data());
+ }
config->is_encrypted = input.is_encrypted();
return config;
}
« no previous file with comments | « no previous file | media/mojo/common/media_type_converters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698