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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 render_loop_->PostTask(FROM_HERE, base::Bind( | 104 render_loop_->PostTask(FROM_HERE, base::Bind( |
105 &WebMediaPlayerProxy::PipelineEndedTask, this, status)); | 105 &WebMediaPlayerProxy::PipelineEndedTask, this, status)); |
106 } | 106 } |
107 | 107 |
108 void WebMediaPlayerProxy::PipelineErrorCallback(PipelineStatus error) { | 108 void WebMediaPlayerProxy::PipelineErrorCallback(PipelineStatus error) { |
109 DCHECK_NE(error, media::PIPELINE_OK); | 109 DCHECK_NE(error, media::PIPELINE_OK); |
110 render_loop_->PostTask(FROM_HERE, base::Bind( | 110 render_loop_->PostTask(FROM_HERE, base::Bind( |
111 &WebMediaPlayerProxy::PipelineErrorTask, this, error)); | 111 &WebMediaPlayerProxy::PipelineErrorTask, this, error)); |
112 } | 112 } |
113 | 113 |
| 114 void WebMediaPlayerProxy::PipelineReadyStateCallback( |
| 115 media::Pipeline::ReadyState readyState) { |
| 116 render_loop_->PostTask(FROM_HERE, base::Bind( |
| 117 &WebMediaPlayerProxy::PipelineReadyStateTask, this, readyState)); |
| 118 } |
| 119 |
114 void WebMediaPlayerProxy::RepaintTask() { | 120 void WebMediaPlayerProxy::RepaintTask() { |
115 DCHECK(render_loop_->BelongsToCurrentThread()); | 121 DCHECK(render_loop_->BelongsToCurrentThread()); |
116 { | 122 { |
117 base::AutoLock auto_lock(lock_); | 123 base::AutoLock auto_lock(lock_); |
118 --outstanding_repaints_; | 124 --outstanding_repaints_; |
119 DCHECK_GE(outstanding_repaints_, 0); | 125 DCHECK_GE(outstanding_repaints_, 0); |
120 } | 126 } |
121 if (webmediaplayer_) { | 127 if (webmediaplayer_) { |
122 webmediaplayer_->Repaint(); | 128 webmediaplayer_->Repaint(); |
123 } | 129 } |
(...skipping 16 matching lines...) Expand all Loading... |
140 if (webmediaplayer_) | 146 if (webmediaplayer_) |
141 webmediaplayer_->OnPipelineEnded(status); | 147 webmediaplayer_->OnPipelineEnded(status); |
142 } | 148 } |
143 | 149 |
144 void WebMediaPlayerProxy::PipelineErrorTask(PipelineStatus error) { | 150 void WebMediaPlayerProxy::PipelineErrorTask(PipelineStatus error) { |
145 DCHECK(render_loop_->BelongsToCurrentThread()); | 151 DCHECK(render_loop_->BelongsToCurrentThread()); |
146 if (webmediaplayer_) | 152 if (webmediaplayer_) |
147 webmediaplayer_->OnPipelineError(error); | 153 webmediaplayer_->OnPipelineError(error); |
148 } | 154 } |
149 | 155 |
| 156 void WebMediaPlayerProxy::PipelineReadyStateTask( |
| 157 media::Pipeline::ReadyState readyState) { |
| 158 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 159 if (webmediaplayer_) |
| 160 webmediaplayer_->OnPipelineReadyState(readyState); |
| 161 } |
| 162 |
150 void WebMediaPlayerProxy::SetOpaqueTask(bool opaque) { | 163 void WebMediaPlayerProxy::SetOpaqueTask(bool opaque) { |
151 DCHECK(render_loop_->BelongsToCurrentThread()); | 164 DCHECK(render_loop_->BelongsToCurrentThread()); |
152 if (webmediaplayer_) | 165 if (webmediaplayer_) |
153 webmediaplayer_->SetOpaque(opaque); | 166 webmediaplayer_->SetOpaque(opaque); |
154 } | 167 } |
155 | 168 |
156 void WebMediaPlayerProxy::GetCurrentFrame( | 169 void WebMediaPlayerProxy::GetCurrentFrame( |
157 scoped_refptr<media::VideoFrame>* frame_out) { | 170 scoped_refptr<media::VideoFrame>* frame_out) { |
158 if (frame_provider_) | 171 if (frame_provider_) |
159 frame_provider_->GetCurrentFrame(frame_out); | 172 frame_provider_->GetCurrentFrame(frame_out); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const std::string& session_id, | 324 const std::string& session_id, |
312 scoped_array<uint8> init_data, | 325 scoped_array<uint8> init_data, |
313 int init_data_size) { | 326 int init_data_size) { |
314 DCHECK(render_loop_->BelongsToCurrentThread()); | 327 DCHECK(render_loop_->BelongsToCurrentThread()); |
315 if (webmediaplayer_) | 328 if (webmediaplayer_) |
316 webmediaplayer_->OnNeedKey(key_system, session_id, | 329 webmediaplayer_->OnNeedKey(key_system, session_id, |
317 init_data.Pass(), init_data_size); | 330 init_data.Pass(), init_data_size); |
318 } | 331 } |
319 | 332 |
320 } // namespace webkit_media | 333 } // namespace webkit_media |
OLD | NEW |