OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_PLAYER_TRACKER_H_ | |
6 #define MEDIA_BASE_PLAYER_TRACKER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/callback.h" | |
10 #include "media/base/media_export.h" | |
11 | |
12 namespace media { | |
13 | |
14 // An interface that helps CDMs notify players when a new decryption key becomes | |
ddorwin
2014/05/30 20:50:05
nit: "An interface for players to register to be n
xhwang
2014/06/02 20:11:43
Done.
| |
15 // available or when the CDM is destroyed. | |
16 class MEDIA_EXPORT PlayerTracker { | |
17 public: | |
18 PlayerTracker(); | |
ddorwin
2014/05/30 20:50:05
ditto
xhwang
2014/06/02 20:11:43
Done.
| |
19 virtual ~PlayerTracker(); | |
20 | |
21 // Registers player callbacks with the CDM. | |
22 // - |new_key_cb| is fired when a new decryption key becomes available. | |
23 // - |cdm_destroyed_cb| is fired when the CDM is destroyed. | |
ddorwin
2014/05/30 20:50:05
ditto on the name
xhwang
2014/06/02 20:11:43
Done.
| |
24 // Returns a registration ID which can be used to unregister a player. | |
25 virtual int RegisterPlayer(const base::Closure& new_key_cb, | |
26 const base::Closure& cdm_destroyed_cb) = 0; | |
damienv1
2014/05/30 15:10:15
There is an implicit assumption that the CDM and t
xhwang
2014/05/30 17:18:53
The current plan is to use this only for BrowserCd
ddorwin
2014/05/30 20:50:05
Can we add DCHECKs on the thread?
xhwang
2014/06/02 20:11:43
Done.
| |
27 | |
28 // Unregisters a previously registered player. This should be called when | |
29 // the CDM is detached from the player (e.g. setMediaKeys(0)), or when the | |
30 // player is destroyed. | |
31 virtual void UnregisterPlayer(int registration_id) = 0; | |
32 | |
33 private: | |
34 DISALLOW_COPY_AND_ASSIGN(PlayerTracker); | |
35 }; | |
36 | |
37 } // namespace media | |
38 | |
39 #endif // MEDIA_BASE_PLAYER_TRACKER_H_ | |
OLD | NEW |