OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/media/audio_renderer_impl.h" | 5 #include "chrome/renderer/media/audio_renderer_impl.h" |
6 #include "chrome/renderer/media/data_source_impl.h" | 6 #include "chrome/renderer/media/data_source_impl.h" |
7 #include "chrome/renderer/media/video_renderer_impl.h" | 7 #include "chrome/renderer/media/video_renderer_impl.h" |
8 #include "chrome/renderer/render_view.h" | 8 #include "chrome/renderer/render_view.h" |
9 #include "chrome/renderer/webmediaplayer_delegate_impl.h" | 9 #include "chrome/renderer/webmediaplayer_delegate_impl.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 #include "media/filters/ffmpeg_demuxer.h" |
11 | 12 |
12 ///////////////////////////////////////////////////////////////////////////// | 13 ///////////////////////////////////////////////////////////////////////////// |
13 // Task to be posted on main thread that fire WebMediaPlayer methods. | 14 // Task to be posted on main thread that fire WebMediaPlayer methods. |
14 | 15 |
15 class NotifyWebMediaPlayerTask : public CancelableTask { | 16 class NotifyWebMediaPlayerTask : public CancelableTask { |
16 public: | 17 public: |
17 NotifyWebMediaPlayerTask(WebMediaPlayerDelegateImpl* delegate, | 18 NotifyWebMediaPlayerTask(WebMediaPlayerDelegateImpl* delegate, |
18 WebMediaPlayerMethod method) | 19 WebMediaPlayerMethod method) |
19 : delegate_(delegate), | 20 : delegate_(delegate), |
20 method_(method) {} | 21 method_(method) {} |
(...skipping 24 matching lines...) Expand all Loading... |
45 ready_state_(webkit_glue::WebMediaPlayer::DATA_UNAVAILABLE), | 46 ready_state_(webkit_glue::WebMediaPlayer::DATA_UNAVAILABLE), |
46 main_loop_(NULL), | 47 main_loop_(NULL), |
47 filter_factory_(new media::FilterFactoryCollection()), | 48 filter_factory_(new media::FilterFactoryCollection()), |
48 audio_renderer_(NULL), | 49 audio_renderer_(NULL), |
49 video_renderer_(NULL), | 50 video_renderer_(NULL), |
50 data_source_(NULL), | 51 data_source_(NULL), |
51 web_media_player_(NULL), | 52 web_media_player_(NULL), |
52 view_(view), | 53 view_(view), |
53 tasks_(kLastTaskIndex) { | 54 tasks_(kLastTaskIndex) { |
54 // TODO(hclam): Add filter factory for demuxer and decoders. | 55 // TODO(hclam): Add filter factory for demuxer and decoders. |
| 56 filter_factory_->AddFactory(media::FFmpegDemuxer::CreateFilterFactory()); |
55 filter_factory_->AddFactory(AudioRendererImpl::CreateFactory(this)); | 57 filter_factory_->AddFactory(AudioRendererImpl::CreateFactory(this)); |
56 filter_factory_->AddFactory(VideoRendererImpl::CreateFactory(this)); | 58 filter_factory_->AddFactory(VideoRendererImpl::CreateFactory(this)); |
57 filter_factory_->AddFactory(DataSourceImpl::CreateFactory(this)); | 59 filter_factory_->AddFactory(DataSourceImpl::CreateFactory(this)); |
58 } | 60 } |
59 | 61 |
60 WebMediaPlayerDelegateImpl::~WebMediaPlayerDelegateImpl() { | 62 WebMediaPlayerDelegateImpl::~WebMediaPlayerDelegateImpl() { |
61 // Stop the pipeline in the first place so we won't receive any more method | 63 // Stop the pipeline in the first place so we won't receive any more method |
62 // calls from it. | 64 // calls from it. |
63 pipeline_.Stop(); | 65 pipeline_.Stop(); |
64 | 66 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if(!tasks_[index]) { | 361 if(!tasks_[index]) { |
360 CancelableTask* task = new NotifyWebMediaPlayerTask(this, method); | 362 CancelableTask* task = new NotifyWebMediaPlayerTask(this, method); |
361 tasks_[index] = task; | 363 tasks_[index] = task; |
362 main_loop_->PostTask(FROM_HERE, task); | 364 main_loop_->PostTask(FROM_HERE, task); |
363 } | 365 } |
364 } | 366 } |
365 | 367 |
366 void WebMediaPlayerDelegateImpl::PostRepaintTask() { | 368 void WebMediaPlayerDelegateImpl::PostRepaintTask() { |
367 PostTask(kRepaintTaskIndex, &webkit_glue::WebMediaPlayer::Repaint); | 369 PostTask(kRepaintTaskIndex, &webkit_glue::WebMediaPlayer::Repaint); |
368 } | 370 } |
OLD | NEW |