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

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

Issue 894173002: Adds hook for content embedders to get media::BrowserCdm*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes CmaMessageFilterHost callback reference, rebase Created 5 years, 10 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.h » ('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 ae80db13e7a814a76714e020ab2cc36a98f6d570..246c03477af27840a1530fb76c8d7ed07a19711f 100644
--- a/chromecast/browser/media/cma_message_filter_host.cc
+++ b/chromecast/browser/media/cma_message_filter_host.cc
@@ -17,6 +17,7 @@
#include "chromecast/media/cma/pipeline/media_pipeline_client.h"
#include "chromecast/media/cma/pipeline/video_pipeline_client.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_process_host.h"
#include "media/base/bind_to_current_loop.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/quad_f.h"
@@ -164,7 +165,32 @@ void CmaMessageFilterHost::SetCdm(int media_id,
if (!media_pipeline)
return;
- FORWARD_CALL(media_pipeline, SetCdm, process_id_, render_frame_id, cdm_id);
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&CmaMessageFilterHost::SetCdmOnUiThread,
+ this, media_pipeline, render_frame_id, cdm_id));
+}
+
+void CmaMessageFilterHost::SetCdmOnUiThread(
+ MediaPipelineHost* media_pipeline,
+ int render_frame_id,
+ int cdm_id) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ content::RenderProcessHost* host =
+ content::RenderProcessHost::FromID(process_id_);
+ if (!host) {
+ LOG(ERROR) << "RenderProcessHost not alive for ID: " << process_id_;
+ return;
+ }
+
+ ::media::BrowserCdm* cdm = host->GetBrowserCdm(render_frame_id, cdm_id);
+ if (!cdm) {
+ LOG(ERROR) << "Could not find BrowserCdm (" << render_frame_id << ","
+ << cdm_id << ")";
+ return;
+ }
+ FORWARD_CALL(media_pipeline, SetCdm, cdm);
}
void CmaMessageFilterHost::CreateAvPipe(
« no previous file with comments | « chromecast/browser/media/cma_message_filter_host.h ('k') | chromecast/browser/media/media_pipeline_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698