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

Unified Diff: content/browser/media/android/browser_media_player_manager.h

Issue 270373003: Separate RendererCdmManager from RendererMediaPlayerManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error on Windows Created 6 years, 7 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 | « no previous file | content/browser/media/android/browser_media_player_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/browser_media_player_manager.h
diff --git a/content/browser/media/android/browser_media_player_manager.h b/content/browser/media/android/browser_media_player_manager.h
index 308ed02f5b0598322e926eacdef366dda9501556..9859ea6024667cf239020c7c61be27dd1547ae52 100644
--- a/content/browser/media/android/browser_media_player_manager.h
+++ b/content/browser/media/android/browser_media_player_manager.h
@@ -35,11 +35,11 @@ class ContentViewCoreImpl;
class ExternalVideoSurfaceContainer;
class WebContents;
-// This class manages all the MediaPlayerAndroid objects. It receives
-// control operations from the the render process, and forwards
-// them to corresponding MediaPlayerAndroid object. Callbacks from
-// MediaPlayerAndroid objects are converted to IPCs and then sent to the
-// render process.
+// This class manages all the MediaPlayerAndroid and MediaDrmBridge objects.
+// It receives control operations from the the render process, and forwards
+// them to corresponding MediaPlayerAndroid or MediaDrmBridge object. Callbacks
+// from MediaPlayerAndroid and MediaDrmBridge objects are converted to IPCs and
+// then sent to the render process.
class CONTENT_EXPORT BrowserMediaPlayerManager
: public WebContentsObserver,
public media::MediaPlayerManager {
@@ -56,6 +56,8 @@ class CONTENT_EXPORT BrowserMediaPlayerManager
virtual ~BrowserMediaPlayerManager();
// WebContentsObserver overrides.
+ virtual bool OnMessageReceived(const IPC::Message& message,
+ RenderFrameHost* render_frame_host) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Fullscreen video playback controls.
@@ -165,8 +167,8 @@ class CONTENT_EXPORT BrowserMediaPlayerManager
media::MediaPlayerAndroid* player);
// Adds a new MediaDrmBridge for the given |key_system|, |cdm_id|, and
- // |frame_url|.
- void AddDrmBridge(int cdm_id,
+ // |frame_url|. Returns false when the MediaDrmBridge cannot be created/added.
+ bool AddDrmBridge(int cdm_id,
const std::string& key_system,
const GURL& frame_url);
@@ -213,12 +215,29 @@ class CONTENT_EXPORT BrowserMediaPlayerManager
void OnRequestExternalSurface(int player_id, const gfx::RectF& rect);
#endif // defined(VIDEO_HOLE)
+ int GetCdmRoutingId(int cdm_id);
+
// An array of managed players.
ScopedVector<media::MediaPlayerAndroid> players_;
// An array of managed media DRM bridges.
ScopedVector<media::MediaDrmBridge> drm_bridges_;
+ // The CDM routing ID of the last received CDM message.
+ // TODO(xhwang): This seems hacky. Find a more general way to handle IPC
+ // messages from RenderFrameObserver.
+ int current_cdm_routing_id_;
+
+ // RendererCdmManager implements RenderFrameObserver so the routing ID for
+ // each CDM could be different. Use this variable to track the CDM ID to
+ // routing ID mapping.
+ // RendererMediaPlayerManager implements RenderViewObserver so that we can
+ // always use routing_id() for all media player messages.
+ // TODO(xhwang): Update RendererMediaPlayerManager to use RenderFrameObserver.
+ // TODO(xhwang): Remove CDM ID from MediaDrmBridge, hide it and the CDM
+ // routing ID in a helper class.
+ std::map<int, int> cdm_to_routing_id_map_;
+
// Map from DrmBridge cdm_id to MediaPlayerAndroid player_id to indicate that
// the DrmBridge is set on the MediaPlayerAndroid object.
typedef std::map<int, int> DrmBridgePlayerMap;
« no previous file with comments | « no previous file | content/browser/media/android/browser_media_player_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698