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

Unified Diff: mojo/services/html_viewer/webmimeregistry_impl.cc

Issue 653213002: Implement MediaSource support for mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement! Created 6 years, 2 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
Index: mojo/services/html_viewer/webmimeregistry_impl.cc
diff --git a/mojo/services/html_viewer/webmimeregistry_impl.cc b/mojo/services/html_viewer/webmimeregistry_impl.cc
index 2faac176dedb38022cd271d0bb910ba795c61754..f054d5dc17301b95328345459a9b7437892ef179 100644
--- a/mojo/services/html_viewer/webmimeregistry_impl.cc
+++ b/mojo/services/html_viewer/webmimeregistry_impl.cc
@@ -8,6 +8,7 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -89,8 +90,14 @@ blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsMediaMIMEType(
bool WebMimeRegistryImpl::supportsMediaSourceMIMEType(
const blink::WebString& mime_type,
const blink::WebString& codecs) {
- NOTIMPLEMENTED();
- return false;
+ const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
+ if (mime_type_ascii.empty())
+ return false;
+
+ std::vector<std::string> parsed_codec_ids;
+ net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codec_ids, false);
+ return media::StreamParserFactory::IsTypeSupported(mime_type_ascii,
+ parsed_codec_ids);
}
bool WebMimeRegistryImpl::supportsEncryptedMediaMIMEType(

Powered by Google App Engine
This is Rietveld 408576698