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

Side by Side Diff: media/base/decryptor_client.h

Issue 11226019: Encrypted Media: Replace DecryptorClient with key event callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: resolve ddorwin's comments Created 8 years 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_DECRYPTOR_CLIENT_H_
6 #define MEDIA_BASE_DECRYPTOR_CLIENT_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "media/base/decryptor.h"
12
13 namespace media {
14
15 // Interface used by a decryptor to fire key events.
16 // See: http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted- media.html#event-summary
17 class DecryptorClient {
18 public:
19 // Signals that a key has been added.
20 virtual void KeyAdded(const std::string& key_system,
21 const std::string& session_id) = 0;
22
23 // Signals that a key error occurred. The |system_code| is key
24 // system-dependent. For clear key system, the |system_code| is always zero.
25 virtual void KeyError(const std::string& key_system,
26 const std::string& session_id,
27 Decryptor::KeyError error_code,
28 int system_code) = 0;
29
30 // Signals that a key message has been generated.
31 virtual void KeyMessage(const std::string& key_system,
32 const std::string& session_id,
33 const std::string& message,
34 const std::string& default_url) = 0;
35
36 // Signals that a key is needed for decryption. |key_system| and |session_id|
37 // can be empty if the key system has not been selected.
38 // TODO(xhwang): Figure out if "type" is optional for NeedKey fired from the
39 // decoder.
40 virtual void NeedKey(const std::string& key_system,
41 const std::string& session_id,
42 const std::string& type,
43 scoped_array<uint8> init_data,
44 int init_data_length) = 0;
45
46 protected:
47 virtual ~DecryptorClient() {}
48 };
49
50 } // namespace media
51
52 #endif // MEDIA_BASE_DECRYPTOR_CLIENT_H_
OLDNEW
« media/base/decryptor.h ('K') | « media/base/decryptor.h ('k') | media/base/mock_filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698