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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 10164017: Implement sourceAddId() & sourceRemoveId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 8 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
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/media/webmediaplayer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 1c236fb8dfd294e77c11ddf82edf74018bd60b57..77b86c2bd0f67f9665f6c1c41950a468f277d5e8 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -645,10 +645,39 @@ void WebMediaPlayerImpl::putCurrentFrame(
}
}
+#define COMPILE_ASSERT_MATCHING_STATUS_ENUM(webkit_name, chromium_name) \
+ COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayer::webkit_name) == \
+ static_cast<int>(media::ChunkDemuxer::chromium_name), \
+ mismatching_status_enums)
+COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddIdStatusOk, kOk);
+COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddIdStatusNotSupported, kNotSupported);
+COMPILE_ASSERT_MATCHING_STATUS_ENUM(AddIdStatusReachedIdLimit, kReachedIdLimit);
+
+WebKit::WebMediaPlayer::AddIdStatus WebMediaPlayerImpl::sourceAddId(
+ const WebKit::WebString& id,
+ const WebKit::WebString& type) {
+ DCHECK_EQ(main_loop_, MessageLoop::current());
+ return static_cast<WebKit::WebMediaPlayer::AddIdStatus>(
+ proxy_->DemuxerAddId(id.utf8().data(), type.utf8().data()));
+}
+
+bool WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) {
+ DCHECK(!id.isEmpty());
+ proxy_->DemuxerRemoveId(id.utf8().data());
+ return true;
+}
+
bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data,
unsigned length) {
+ return sourceAppend(WebKit::WebString::fromUTF8("DefaultSourceId"),
+ data, length);
+}
+
+bool WebMediaPlayerImpl::sourceAppend(const WebKit::WebString& id,
+ const unsigned char* data,
+ unsigned length) {
DCHECK_EQ(main_loop_, MessageLoop::current());
- return proxy_->DemuxerAppend(data, length);
+ return proxy_->DemuxerAppend(id.utf8().data(), data, length);
}
void WebMediaPlayerImpl::sourceEndOfStream(
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/media/webmediaplayer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698