OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "platform/drm/ContentDecryptionModule.h" | 32 #include "platform/drm/ContentDecryptionModule.h" |
33 | 33 |
34 #include "platform/NotImplemented.h" | 34 #include "platform/NotImplemented.h" |
35 #include "platform/drm/ContentDecryptionModuleSession.h" | 35 #include "platform/drm/ContentDecryptionModuleSession.h" |
36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 bool ContentDecryptionModule::supportsKeySystem(const String& keySystem) | |
41 { | |
42 // FIXME: Chromium should handle this, possibly using | |
43 // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType(). | |
44 notImplemented(); | |
45 return keySystem == "org.w3.clearkey"; | |
46 } | |
47 | |
48 PassOwnPtr<ContentDecryptionModule> ContentDecryptionModule::create(const String
& keySystem) | 40 PassOwnPtr<ContentDecryptionModule> ContentDecryptionModule::create(const String
& keySystem) |
49 { | 41 { |
50 ASSERT(!keySystem.isEmpty()); | 42 ASSERT(!keySystem.isEmpty()); |
51 OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(blink::Platform::cu
rrent()->createContentDecryptionModule(keySystem)); | 43 OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(blink::Platform::cu
rrent()->createContentDecryptionModule(keySystem)); |
52 if (!cdm) | 44 if (!cdm) |
53 return nullptr; | 45 return nullptr; |
54 return adoptPtr(new ContentDecryptionModule(cdm.release())); | 46 return adoptPtr(new ContentDecryptionModule(cdm.release())); |
55 } | 47 } |
56 | 48 |
57 ContentDecryptionModule::ContentDecryptionModule(PassOwnPtr<blink::WebContentDec
ryptionModule> cdm) | 49 ContentDecryptionModule::ContentDecryptionModule(PassOwnPtr<blink::WebContentDec
ryptionModule> cdm) |
58 : m_cdm(cdm) | 50 : m_cdm(cdm) |
59 { | 51 { |
60 ASSERT(m_cdm); | 52 ASSERT(m_cdm); |
61 } | 53 } |
62 | 54 |
63 ContentDecryptionModule::~ContentDecryptionModule() | 55 ContentDecryptionModule::~ContentDecryptionModule() |
64 { | 56 { |
65 } | 57 } |
66 | 58 |
67 bool ContentDecryptionModule::supportsMIMEType(const String& mimeType) | |
68 { | |
69 // FIXME: Chromium should handle this, possibly using | |
70 // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType(). | |
71 notImplemented(); | |
72 return mimeType == "video/webm"; | |
73 } | |
74 | |
75 PassOwnPtr<ContentDecryptionModuleSession> ContentDecryptionModule::createSessio
n(ContentDecryptionModuleSessionClient* client) | 59 PassOwnPtr<ContentDecryptionModuleSession> ContentDecryptionModule::createSessio
n(ContentDecryptionModuleSessionClient* client) |
76 { | 60 { |
77 return adoptPtr(new ContentDecryptionModuleSession(m_cdm.get(), client)); | 61 return adoptPtr(new ContentDecryptionModuleSession(m_cdm.get(), client)); |
78 } | 62 } |
79 | 63 |
80 } // namespace WebCore | 64 } // namespace WebCore |
OLD | NEW |