| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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/glue/webmediaplayer_impl.h" | 5 #include "webkit/glue/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "media/filters/ffmpeg_audio_decoder.h" | 9 #include "media/filters/ffmpeg_audio_decoder.h" |
| 10 #include "media/filters/ffmpeg_demuxer.h" | 10 #include "media/filters/ffmpeg_demuxer.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 pipeline_->SetPlaybackRate(playback_rate_); | 191 pipeline_->SetPlaybackRate(playback_rate_); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void WebMediaPlayerImpl::pause() { | 194 void WebMediaPlayerImpl::pause() { |
| 195 DCHECK(MessageLoop::current() == main_loop_); | 195 DCHECK(MessageLoop::current() == main_loop_); |
| 196 | 196 |
| 197 paused_ = true; | 197 paused_ = true; |
| 198 pipeline_->SetPlaybackRate(0.0f); | 198 pipeline_->SetPlaybackRate(0.0f); |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool WebMediaPlayerImpl::supportsFullscreen() const { |
| 202 DCHECK(MessageLoop::current() == main_loop_); |
| 203 return true; |
| 204 } |
| 205 |
| 206 bool WebMediaPlayerImpl::supportsSave() const { |
| 207 DCHECK(MessageLoop::current() == main_loop_); |
| 208 return true; |
| 209 } |
| 210 |
| 201 void WebMediaPlayerImpl::seek(float seconds) { | 211 void WebMediaPlayerImpl::seek(float seconds) { |
| 202 DCHECK(MessageLoop::current() == main_loop_); | 212 DCHECK(MessageLoop::current() == main_loop_); |
| 203 | 213 |
| 204 // Try to preserve as much accuracy as possible. | 214 // Try to preserve as much accuracy as possible. |
| 205 float microseconds = seconds * base::Time::kMicrosecondsPerSecond; | 215 float microseconds = seconds * base::Time::kMicrosecondsPerSecond; |
| 206 if (seconds != 0) | 216 if (seconds != 0) |
| 207 pipeline_->Seek( | 217 pipeline_->Seek( |
| 208 base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)), | 218 base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)), |
| 209 NewCallback(proxy_.get(), | 219 NewCallback(proxy_.get(), |
| 210 &WebMediaPlayerImpl::Proxy::PipelineSeekCallback)); | 220 &WebMediaPlayerImpl::Proxy::PipelineSeekCallback)); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 423 } |
| 414 } | 424 } |
| 415 | 425 |
| 416 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 426 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
| 417 DCHECK(MessageLoop::current() == main_loop_); | 427 DCHECK(MessageLoop::current() == main_loop_); |
| 418 DCHECK(client_); | 428 DCHECK(client_); |
| 419 return client_; | 429 return client_; |
| 420 } | 430 } |
| 421 | 431 |
| 422 } // namespace webkit_glue | 432 } // namespace webkit_glue |
| OLD | NEW |