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

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

Issue 835683002: media: Always define |cdm_id| in CdmContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef MEDIA_BASE_CDM_CONTEXT_H_ 5 #ifndef MEDIA_BASE_CDM_CONTEXT_H_
6 #define MEDIA_BASE_CDM_CONTEXT_H_ 6 #define MEDIA_BASE_CDM_CONTEXT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 class Decryptor; 14 class Decryptor;
15 15
16 // An interface representing the context that a media pipeline needs from a 16 // An interface representing the context that a media pipeline needs from a
17 // content decryption module (CDM) to decrypt (and decode) encrypted buffers. 17 // content decryption module (CDM) to decrypt (and decode) encrypted buffers.
18 class MEDIA_EXPORT CdmContext { 18 class MEDIA_EXPORT CdmContext {
19 public: 19 public:
20 #if defined(ENABLE_BROWSER_CDMS) 20 // Indicates an invalid CDM ID. See GetCdmId() for details.
21 static const int kInvalidCdmId = 0; 21 static const int kInvalidCdmId = 0;
22 #endif
23 22
24 virtual ~CdmContext(); 23 virtual ~CdmContext();
25 24
26 // Gets the Decryptor object associated with the CDM. Returns NULL if no 25 // Gets the Decryptor object associated with the CDM. Returns NULL if the CDM
27 // Decryptor object is associated. The returned object is only guaranteed 26 // does not support a Decryptor. The returned object is only guaranteed to be
28 // to be valid during the CDM's lifetime. 27 // valid during the CDM's lifetime.
29 virtual Decryptor* GetDecryptor() = 0; 28 virtual Decryptor* GetDecryptor() = 0;
30 29
31 #if defined(ENABLE_BROWSER_CDMS) 30 // Returns a unique ID associated with the CDM, which can be used by the
32 // Returns the CDM ID associated with |this|. May be kInvalidCdmId if no CDM 31 // recipient of this CdmContext to locate the real CDM. This is useful when
33 // ID is associated. 32 // the CDM is hosted remotely, e.g. in a different process.
33 // Returns kInvalidCdmId if the CDM does not support an ID, e.g. the CDM only
34 // supports a Decryptor interface.
34 virtual int GetCdmId() const = 0; 35 virtual int GetCdmId() const = 0;
35 #endif
36 36
37 protected: 37 protected:
38 CdmContext(); 38 CdmContext();
39 39
40 private: 40 private:
41 DISALLOW_COPY_AND_ASSIGN(CdmContext); 41 DISALLOW_COPY_AND_ASSIGN(CdmContext);
42 }; 42 };
43 43
44 // Callback to notify that the CdmContext has been completely attached to 44 // Callback to notify that the CdmContext has been completely attached to
45 // the media pipeline. Parameter indicates whether the operation succeeded. 45 // the media pipeline. Parameter indicates whether the operation succeeded.
46 typedef base::Callback<void(bool)> CdmAttachedCB; 46 typedef base::Callback<void(bool)> CdmAttachedCB;
47 47
48 // A dummy implementation of CdmAttachedCB. 48 // A dummy implementation of CdmAttachedCB.
49 MEDIA_EXPORT void IgnoreCdmAttached(bool success); 49 MEDIA_EXPORT void IgnoreCdmAttached(bool success);
50 50
51 } // namespace media 51 } // namespace media
52 52
53 #endif // MEDIA_BASE_CDM_CONTEXT_H_ 53 #endif // MEDIA_BASE_CDM_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698