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