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

Unified Diff: webkit/media/webmediasourceclient_impl.cc

Issue 12713004: Add Chromium-side changes for MediaSource::isTypeSupported() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Exclude StreamParserFactory for Android Created 7 years, 9 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: webkit/media/webmediasourceclient_impl.cc
diff --git a/webkit/media/webmediasourceclient_impl.cc b/webkit/media/webmediasourceclient_impl.cc
index 2f84c0f1447c8634eeef6de0ad16acaed39d814c..dbe388a88b4567ce1c2bb879a9d97f552d48c8ea 100644
--- a/webkit/media/webmediasourceclient_impl.cc
+++ b/webkit/media/webmediasourceclient_impl.cc
@@ -6,6 +6,7 @@
#include "base/guid.h"
#include "media/filters/chunk_demuxer.h"
+#include "media/filters/stream_parser_factory.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSourceBuffer.h"
@@ -84,9 +85,17 @@ void WebSourceBufferImpl::removedFromMediaSource() {
demuxer_ = NULL;
}
+bool WebMediaSourceClientImpl::isTypeSupported(
+ const std::string& type,
+ const std::vector<std::string>& codecs) {
+ return media::StreamParserFactory::IsTypeSupported(type, codecs);
+}
+
WebMediaSourceClientImpl::WebMediaSourceClientImpl(
- const scoped_refptr<media::ChunkDemuxer>& demuxer)
- : demuxer_(demuxer) {
+ const scoped_refptr<media::ChunkDemuxer>& demuxer,
+ media::LogCB log_cb)
+ : demuxer_(demuxer),
+ log_cb_(log_cb) {
DCHECK(demuxer_);
}
@@ -100,7 +109,7 @@ WebMediaSourceClient::AddStatus WebMediaSourceClientImpl::addSourceBuffer(
std::vector<std::string> new_codecs(codecs.size());
for (size_t i = 0; i < codecs.size(); ++i)
new_codecs[i] = codecs[i].utf8().data();
-
+ DCHECK(isTypeSupported(type.utf8().data(), new_codecs));
WebMediaSourceClient::AddStatus result =
static_cast<WebMediaSourceClient::AddStatus>(
demuxer_->AddId(id, type.utf8().data(), new_codecs));
« webkit/glue/simple_webmimeregistry_impl.cc ('K') | « webkit/media/webmediasourceclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698