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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 7480032: Plumb media data from renderers up to MediaInternals in the browser process. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasing onto http://codereview.chromium.org/7491048 prior to (hopefully) relanding. Created 9 years, 4 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/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index ba3eedb608d899c6baa0caa2bc969742e0595766..30af6d66abd306a12c7f529665af0dd7ea616de3 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -12,6 +12,7 @@
#include "media/base/composite_data_source_factory.h"
#include "media/base/filter_collection.h"
#include "media/base/limits.h"
+#include "media/base/media_log.h"
#include "media/base/media_switches.h"
#include "media/base/pipeline_impl.h"
#include "media/base/video_frame.h"
@@ -319,7 +320,8 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
WebKit::WebMediaPlayerClient* client,
media::FilterCollection* collection,
media::MessageLoopFactory* message_loop_factory,
- MediaStreamClient* media_stream_client)
+ MediaStreamClient* media_stream_client,
+ media::MediaLog* media_log)
: network_state_(WebKit::WebMediaPlayer::Empty),
ready_state_(WebKit::WebMediaPlayer::HaveNothing),
main_loop_(NULL),
@@ -331,10 +333,12 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
playback_rate_(0.0f),
client_(client),
proxy_(NULL),
- media_stream_client_(media_stream_client) {
+ media_stream_client_(media_stream_client),
+ media_log_(media_log) {
// Saves the current message loop.
DCHECK(!main_loop_);
main_loop_ = MessageLoop::current();
+ media_log_->AddEventOfType(media::MediaLogEvent::CREATING);
}
bool WebMediaPlayerImpl::Initialize(
@@ -421,6 +425,7 @@ bool WebMediaPlayerImpl::Initialize(
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
+ media_log_->AddEventOfType(media::MediaLogEvent::DESTROYING);
Destroy();
// Finally tell the |main_loop_| we don't want to be notified of destruction
@@ -458,6 +463,8 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
url.spec(),
NewCallback(proxy_.get(),
&WebMediaPlayerImpl::Proxy::PipelineInitializationCallback));
+
+ media_log_->Load(url.spec());
}
void WebMediaPlayerImpl::cancelLoad() {
@@ -469,6 +476,8 @@ void WebMediaPlayerImpl::play() {
paused_ = false;
pipeline_->SetPlaybackRate(playback_rate_);
+
+ media_log_->AddEventOfType(media::MediaLogEvent::PLAY);
}
void WebMediaPlayerImpl::pause() {
@@ -477,6 +486,8 @@ void WebMediaPlayerImpl::pause() {
paused_ = true;
pipeline_->SetPlaybackRate(0.0f);
paused_time_ = pipeline_->GetCurrentTime();
+
+ media_log_->AddEventOfType(media::MediaLogEvent::PAUSE);
}
bool WebMediaPlayerImpl::supportsFullscreen() const {

Powered by Google App Engine
This is Rietveld 408576698