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