OLD | NEW |
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 #include "content/renderer/media/crypto/encrypted_media_player_support_impl.h" | 5 #include "content/renderer/media/crypto/encrypted_media_player_support_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // so we keep it as simple as possible without breaking major use cases. | 116 // so we keep it as simple as possible without breaking major use cases. |
117 static std::string GuessInitDataType(const unsigned char* init_data, | 117 static std::string GuessInitDataType(const unsigned char* init_data, |
118 unsigned init_data_length) { | 118 unsigned init_data_length) { |
119 // Most WebM files use KeyId of 16 bytes. MP4 init data are always >16 bytes. | 119 // Most WebM files use KeyId of 16 bytes. MP4 init data are always >16 bytes. |
120 if (init_data_length == 16) | 120 if (init_data_length == 16) |
121 return "video/webm"; | 121 return "video/webm"; |
122 | 122 |
123 return "video/mp4"; | 123 return "video/mp4"; |
124 } | 124 } |
125 | 125 |
126 scoped_ptr<EncryptedMediaPlayerSupport> EncryptedMediaPlayerSupport::Create( | 126 scoped_ptr<EncryptedMediaPlayerSupport> EncryptedMediaPlayerSupportImpl::Create( |
127 blink::WebMediaPlayerClient* client) { | 127 blink::WebMediaPlayerClient* client) { |
128 return scoped_ptr<EncryptedMediaPlayerSupport>( | 128 return scoped_ptr<EncryptedMediaPlayerSupport>( |
129 new EncryptedMediaPlayerSupportImpl(client)); | 129 new EncryptedMediaPlayerSupportImpl(client)); |
130 } | 130 } |
131 | 131 |
132 EncryptedMediaPlayerSupportImpl::EncryptedMediaPlayerSupportImpl( | 132 EncryptedMediaPlayerSupportImpl::EncryptedMediaPlayerSupportImpl( |
133 blink::WebMediaPlayerClient* client) | 133 blink::WebMediaPlayerClient* client) |
134 : client_(client), | 134 : client_(client), |
135 web_cdm_(NULL) { | 135 web_cdm_(NULL) { |
136 } | 136 } |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 if (web_cdm_) { | 463 if (web_cdm_) { |
464 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); | 464 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); |
465 return; | 465 return; |
466 } | 466 } |
467 | 467 |
468 decryptor_ready_cb_ = decryptor_ready_cb; | 468 decryptor_ready_cb_ = decryptor_ready_cb; |
469 } | 469 } |
470 | 470 |
471 } // namespace content | 471 } // namespace content |
OLD | NEW |