Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/webmediaplayer_proxy.h" | 5 #include "webkit/media/webmediaplayer_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "media/base/pipeline_status.h" | 10 #include "media/base/pipeline_status.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 if (frame_provider_) | 100 if (frame_provider_) |
| 101 frame_provider_->GetCurrentFrame(frame_out); | 101 frame_provider_->GetCurrentFrame(frame_out); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void WebMediaPlayerProxy::PutCurrentFrame( | 104 void WebMediaPlayerProxy::PutCurrentFrame( |
| 105 scoped_refptr<media::VideoFrame> frame) { | 105 scoped_refptr<media::VideoFrame> frame) { |
| 106 if (frame_provider_) | 106 if (frame_provider_) |
| 107 frame_provider_->PutCurrentFrame(frame); | 107 frame_provider_->PutCurrentFrame(frame); |
| 108 } | 108 } |
| 109 | 109 |
| 110 | |
| 111 void WebMediaPlayerProxy::KeyAdded(const std::string& key_system, | |
|
Ami GONE FROM CHROMIUM
2012/10/23 06:52:22
HELL YES
| |
| 112 const std::string& session_id) { | |
| 113 render_loop_->PostTask(FROM_HERE, base::Bind( | |
| 114 &WebMediaPlayerProxy::KeyAddedTask, this, key_system, session_id)); | |
| 115 } | |
| 116 | |
| 117 void WebMediaPlayerProxy::KeyError(const std::string& key_system, | |
| 118 const std::string& session_id, | |
| 119 media::Decryptor::KeyError error_code, | |
| 120 int system_code) { | |
| 121 render_loop_->PostTask(FROM_HERE, base::Bind( | |
| 122 &WebMediaPlayerProxy::KeyErrorTask, this, key_system, session_id, | |
| 123 error_code, system_code)); | |
| 124 } | |
| 125 | |
| 126 void WebMediaPlayerProxy::KeyMessage(const std::string& key_system, | |
| 127 const std::string& session_id, | |
| 128 scoped_array<uint8> message, | |
| 129 int message_length, | |
| 130 const std::string& default_url) { | |
| 131 render_loop_->PostTask(FROM_HERE, base::Bind( | |
| 132 &WebMediaPlayerProxy::KeyMessageTask, this, key_system, session_id, | |
| 133 base::Passed(&message), message_length, default_url)); | |
| 134 } | |
| 135 | |
| 136 void WebMediaPlayerProxy::NeedKey(const std::string& key_system, | |
| 137 const std::string& session_id, | |
| 138 scoped_array<uint8> init_data, | |
| 139 int init_data_size) { | |
| 140 render_loop_->PostTask(FROM_HERE, base::Bind( | |
| 141 &WebMediaPlayerProxy::NeedKeyTask, this, key_system, session_id, | |
| 142 base::Passed(&init_data), init_data_size)); | |
| 143 } | |
| 144 | |
| 145 void WebMediaPlayerProxy::KeyAddedTask(const std::string& key_system, | |
| 146 const std::string& session_id) { | |
| 147 DCHECK(render_loop_->BelongsToCurrentThread()); | |
| 148 if (webmediaplayer_) | |
| 149 webmediaplayer_->OnKeyAdded(key_system, session_id); | |
| 150 } | |
| 151 | |
| 152 void WebMediaPlayerProxy::KeyErrorTask(const std::string& key_system, | |
| 153 const std::string& session_id, | |
| 154 media::Decryptor::KeyError error_code, | |
| 155 int system_code) { | |
| 156 DCHECK(render_loop_->BelongsToCurrentThread()); | |
| 157 if (webmediaplayer_) | |
| 158 webmediaplayer_->OnKeyError(key_system, session_id, | |
| 159 error_code, system_code); | |
| 160 } | |
| 161 | |
| 162 void WebMediaPlayerProxy::KeyMessageTask(const std::string& key_system, | |
| 163 const std::string& session_id, | |
| 164 scoped_array<uint8> message, | |
| 165 int message_length, | |
| 166 const std::string& default_url) { | |
| 167 DCHECK(render_loop_->BelongsToCurrentThread()); | |
| 168 if (webmediaplayer_) | |
| 169 webmediaplayer_->OnKeyMessage(key_system, session_id, | |
| 170 message.Pass(), message_length, default_url); | |
| 171 } | |
| 172 | |
| 173 void WebMediaPlayerProxy::NeedKeyTask(const std::string& key_system, | |
| 174 const std::string& session_id, | |
| 175 scoped_array<uint8> init_data, | |
| 176 int init_data_size) { | |
| 177 DCHECK(render_loop_->BelongsToCurrentThread()); | |
| 178 if (webmediaplayer_) | |
| 179 webmediaplayer_->OnNeedKey(key_system, session_id, | |
| 180 init_data.Pass(), init_data_size); | |
| 181 } | |
| 182 | |
| 183 } // namespace webkit_media | 110 } // namespace webkit_media |
| OLD | NEW |