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

Unified Diff: chromecast/browser/media/cma_message_filter_host.cc

Issue 1306843003: CmaMediaPipelineClient to watch media pipeline status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Doc Created 5 years, 3 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 | « chromecast/browser/media/cma_message_filter_host.h ('k') | chromecast/browser/media/media_pipeline_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/media/cma_message_filter_host.cc
diff --git a/chromecast/browser/media/cma_message_filter_host.cc b/chromecast/browser/media/cma_message_filter_host.cc
index 71ea3201d095ce7af0134bf08926373b6dff0fdd..5503448d82ba488ecb496890d557cdcce90f8757 100644
--- a/chromecast/browser/media/cma_message_filter_host.cc
+++ b/chromecast/browser/media/cma_message_filter_host.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
#include "base/sync_socket.h"
+#include "chromecast/browser/media/cma_media_pipeline_client.h"
#include "chromecast/browser/media/media_pipeline_host.h"
#include "chromecast/common/media/cma_messages.h"
#include "chromecast/media/base/media_message_loop.h"
@@ -299,10 +300,10 @@ void UpdateVideoSurfaceHost(int surface_id, const gfx::QuadF& quad) {
CmaMessageFilterHost::CmaMessageFilterHost(
int render_process_id,
- const CreateDeviceComponentsCB& create_device_components_cb)
+ scoped_refptr<CmaMediaPipelineClient> client)
: content::BrowserMessageFilter(CastMediaMsgStart),
process_id_(render_process_id),
- create_device_components_cb_(create_device_components_cb),
+ client_(client),
task_runner_(MediaMessageLoop::GetTaskRunner()),
weak_factory_(this) {
weak_this_ = weak_factory_.GetWeakPtr();
@@ -380,14 +381,21 @@ void CmaMessageFilterHost::CreateMedia(int media_id, LoadType load_type) {
client.error_cb = ::media::BindToCurrentLoop(
base::Bind(&CmaMessageFilterHost::OnPlaybackError,
weak_this_, media_id, media::kNoTrackId));
+ client.pipeline_backend_created_cb = base::Bind(
+ &CmaMediaPipelineClient::OnMediaPipelineBackendCreated, client_);
+ client.pipeline_backend_destroyed_cb = base::Bind(
+ &CmaMediaPipelineClient::OnMediaPipelineBackendDestroyed, client_);
+
task_runner_->PostTask(
FROM_HERE,
base::Bind(&SetMediaPipeline,
process_id_, media_id, media_pipeline_host.get()));
task_runner_->PostTask(
- FROM_HERE, base::Bind(&MediaPipelineHost::Initialize,
- base::Unretained(media_pipeline_host.get()),
- load_type, client, create_device_components_cb_));
+ FROM_HERE,
+ base::Bind(&MediaPipelineHost::Initialize,
+ base::Unretained(media_pipeline_host.get()), load_type, client,
+ base::Bind(&CmaMediaPipelineClient::CreateMediaPipelineBackend,
+ client_)));
std::pair<MediaPipelineMap::iterator, bool> ret =
media_pipelines_.insert(
std::make_pair(media_id, media_pipeline_host.release()));
« no previous file with comments | « chromecast/browser/media/cma_message_filter_host.h ('k') | chromecast/browser/media/media_pipeline_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698