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

Side by Side Diff: content/browser/android/browser_media_player_manager.cc

Issue 23480036: Support creating secure decoder in MediaCodecBridge. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/browser_media_player_manager.h" 5 #include "content/browser/android/browser_media_player_manager.h"
6 6
7 #include "content/browser/android/content_view_core_impl.h" 7 #include "content/browser/android/content_view_core_impl.h"
8 #include "content/browser/android/media_resource_getter_impl.h" 8 #include "content/browser/android/media_resource_getter_impl.h"
9 #include "content/browser/web_contents/web_contents_view_android.h" 9 #include "content/browser/web_contents/web_contents_view_android.h"
10 #include "content/common/media/media_player_messages_android.h" 10 #include "content/common/media/media_player_messages_android.h"
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 509 }
510 } 510 }
511 } 511 }
512 512
513 void BrowserMediaPlayerManager::AddDrmBridge(int media_keys_id, 513 void BrowserMediaPlayerManager::AddDrmBridge(int media_keys_id,
514 const std::vector<uint8>& uuid) { 514 const std::vector<uint8>& uuid) {
515 DCHECK(!GetDrmBridge(media_keys_id)); 515 DCHECK(!GetDrmBridge(media_keys_id));
516 // TODO(qinmin): Pass the security level to MediaDrmBridge instead of using 516 // TODO(qinmin): Pass the security level to MediaDrmBridge instead of using
517 // the default L3. 517 // the default L3.
518 scoped_ptr<MediaDrmBridge> drm_bridge( 518 scoped_ptr<MediaDrmBridge> drm_bridge(
519 MediaDrmBridge::Create(media_keys_id, uuid, "L3", this)); 519 MediaDrmBridge::Create(media_keys_id, uuid, "L1", this));
xhwang 2013/09/05 21:28:00 I'll revert this change after the test is done.
520 DCHECK(drm_bridge) << "failed to create drm bridge. "; 520 if (!drm_bridge) {
521 DVLOG(1) << "failed to create drm bridge.";
522 return;
523 }
524
521 drm_bridges_.push_back(drm_bridge.release()); 525 drm_bridges_.push_back(drm_bridge.release());
522 } 526 }
523 527
524 void BrowserMediaPlayerManager::RemoveDrmBridge(int media_keys_id) { 528 void BrowserMediaPlayerManager::RemoveDrmBridge(int media_keys_id) {
525 for (ScopedVector<MediaDrmBridge>::iterator it = drm_bridges_.begin(); 529 for (ScopedVector<MediaDrmBridge>::iterator it = drm_bridges_.begin();
526 it != drm_bridges_.end(); ++it) { 530 it != drm_bridges_.end(); ++it) {
527 if ((*it)->media_keys_id() == media_keys_id) { 531 if ((*it)->media_keys_id() == media_keys_id) {
528 drm_bridges_.erase(it); 532 drm_bridges_.erase(it);
529 break; 533 break;
530 } 534 }
531 } 535 }
532 } 536 }
533 537
534 void BrowserMediaPlayerManager::OnSetMediaKeys(int player_id, 538 void BrowserMediaPlayerManager::OnSetMediaKeys(int player_id,
535 int media_keys_id) { 539 int media_keys_id) {
536 MediaPlayerAndroid* player = GetPlayer(player_id); 540 MediaPlayerAndroid* player = GetPlayer(player_id);
537 MediaDrmBridge* drm_bridge = GetDrmBridge(media_keys_id); 541 MediaDrmBridge* drm_bridge = GetDrmBridge(media_keys_id);
538 if (!player || !drm_bridge) { 542 if (!player || !drm_bridge) {
539 NOTREACHED() << "OnSetMediaKeys(): Player and MediaKeys must be present."; 543 DVLOG(1) << "OnSetMediaKeys(): Player and MediaKeys must be present.";
540 return; 544 return;
541 } 545 }
542 // TODO(qinmin): add the logic to decide whether we should create the 546 // TODO(qinmin): add the logic to decide whether we should create the
543 // fullscreen surface for EME lv1. 547 // fullscreen surface for EME lv1.
544 player->SetDrmBridge(drm_bridge); 548 player->SetDrmBridge(drm_bridge);
545 } 549 }
546 550
547 } // namespace content 551 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698