Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / media / blink / null_encrypted_media_player_support.cc
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 #include "media/blink/null_encrypted_media_player_support.h"
6
7 #include "base/bind.h"
8 #include "third_party/WebKit/public/platform/WebContentDecryptionModule.h"
9 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
10
11 namespace media {
12
13 static void NeedKeyHandler(const std::string& type,
14                            const std::vector<uint8>& init_data) {
15   NOTIMPLEMENTED();
16 }
17
18 scoped_ptr<EncryptedMediaPlayerSupport>
19 NullEncryptedMediaPlayerSupport::Create(blink::WebMediaPlayerClient* client) {
20   return scoped_ptr<EncryptedMediaPlayerSupport>(
21       new NullEncryptedMediaPlayerSupport());
22 }
23
24 NullEncryptedMediaPlayerSupport::NullEncryptedMediaPlayerSupport() {
25 }
26
27 NullEncryptedMediaPlayerSupport::~NullEncryptedMediaPlayerSupport() {
28 }
29
30 blink::WebMediaPlayer::MediaKeyException
31 NullEncryptedMediaPlayerSupport::GenerateKeyRequest(
32     blink::WebLocalFrame* frame,
33     const blink::WebString& key_system,
34     const unsigned char* init_data,
35     unsigned init_data_length) {
36   return blink::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported;
37 }
38
39 blink::WebMediaPlayer::MediaKeyException
40 NullEncryptedMediaPlayerSupport::AddKey(
41     const blink::WebString& key_system,
42     const unsigned char* key,
43     unsigned key_length,
44     const unsigned char* init_data,
45     unsigned init_data_length,
46     const blink::WebString& session_id) {
47   return blink::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported;
48 }
49
50 blink::WebMediaPlayer::MediaKeyException
51 NullEncryptedMediaPlayerSupport::CancelKeyRequest(
52     const blink::WebString& key_system,
53     const blink::WebString& session_id) {
54   return blink::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported;
55 }
56
57 void NullEncryptedMediaPlayerSupport::SetInitialContentDecryptionModule(
58     blink::WebContentDecryptionModule* initial_cdm) {
59 }
60
61 void NullEncryptedMediaPlayerSupport::SetContentDecryptionModule(
62     blink::WebContentDecryptionModule* cdm) {
63 }
64
65 void NullEncryptedMediaPlayerSupport::SetContentDecryptionModule(
66     blink::WebContentDecryptionModule* cdm,
67     blink::WebContentDecryptionModuleResult result) {
68   result.completeWithError(
69       blink::WebContentDecryptionModuleExceptionNotSupportedError,
70       0,
71       "Null MediaKeys object is not supported.");
72 }
73
74 Demuxer::NeedKeyCB NullEncryptedMediaPlayerSupport::CreateNeedKeyCB() {
75   return base::Bind(&NeedKeyHandler);
76 }
77
78 SetDecryptorReadyCB
79 NullEncryptedMediaPlayerSupport::CreateSetDecryptorReadyCB() {
80   return SetDecryptorReadyCB();
81 }
82
83 void NullEncryptedMediaPlayerSupport::OnPipelineDecryptError() {
84 }
85
86 }  // namespace media