| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // A simple data source that keeps all data in memory. | 271 // A simple data source that keeps all data in memory. |
| 272 scoped_refptr<SimpleDataSource> simple_data_source( | 272 scoped_refptr<SimpleDataSource> simple_data_source( |
| 273 new SimpleDataSource(MessageLoop::current(), bridge_factory_simple)); | 273 new SimpleDataSource(MessageLoop::current(), bridge_factory_simple)); |
| 274 | 274 |
| 275 // A sophisticated data source that does memory caching. | 275 // A sophisticated data source that does memory caching. |
| 276 scoped_refptr<BufferedDataSource> buffered_data_source( | 276 scoped_refptr<BufferedDataSource> buffered_data_source( |
| 277 new BufferedDataSource(MessageLoop::current(), bridge_factory_buffered)); | 277 new BufferedDataSource(MessageLoop::current(), bridge_factory_buffered)); |
| 278 proxy_->SetDataSource(buffered_data_source); | 278 proxy_->SetDataSource(buffered_data_source); |
| 279 | 279 |
| 280 if (use_simple_data_source) { | 280 if (use_simple_data_source) { |
| 281 filter_collection_->AddDataSource(simple_data_source); | 281 filter_collection_->AddFilter(simple_data_source); |
| 282 filter_collection_->AddDataSource(buffered_data_source); | 282 filter_collection_->AddFilter(buffered_data_source); |
| 283 } else { | 283 } else { |
| 284 filter_collection_->AddDataSource(buffered_data_source); | 284 filter_collection_->AddFilter(buffered_data_source); |
| 285 filter_collection_->AddDataSource(simple_data_source); | 285 filter_collection_->AddFilter(simple_data_source); |
| 286 } | 286 } |
| 287 | 287 |
| 288 // Add in the default filter factories. | 288 // Add in the default filter factories. |
| 289 filter_collection_->AddDemuxer(new media::FFmpegDemuxer()); | 289 filter_collection_->AddFilter(new media::FFmpegDemuxer()); |
| 290 filter_collection_->AddAudioDecoder(new media::FFmpegAudioDecoder()); | 290 filter_collection_->AddFilter(new media::FFmpegAudioDecoder()); |
| 291 filter_collection_->AddVideoDecoder(new media::FFmpegVideoDecoder(NULL)); | 291 filter_collection_->AddFilter(new media::FFmpegVideoDecoder(NULL)); |
| 292 filter_collection_->AddAudioRenderer(new media::NullAudioRenderer()); | 292 filter_collection_->AddFilter(new media::NullAudioRenderer()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 WebMediaPlayerImpl::~WebMediaPlayerImpl() { | 295 WebMediaPlayerImpl::~WebMediaPlayerImpl() { |
| 296 Destroy(); | 296 Destroy(); |
| 297 | 297 |
| 298 // Finally tell the |main_loop_| we don't want to be notified of destruction | 298 // Finally tell the |main_loop_| we don't want to be notified of destruction |
| 299 // event. | 299 // event. |
| 300 if (main_loop_) { | 300 if (main_loop_) { |
| 301 main_loop_->RemoveDestructionObserver(this); | 301 main_loop_->RemoveDestructionObserver(this); |
| 302 } | 302 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 pipeline_stopped_.Signal(); | 793 pipeline_stopped_.Signal(); |
| 794 } | 794 } |
| 795 | 795 |
| 796 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 796 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
| 797 DCHECK(MessageLoop::current() == main_loop_); | 797 DCHECK(MessageLoop::current() == main_loop_); |
| 798 DCHECK(client_); | 798 DCHECK(client_); |
| 799 return client_; | 799 return client_; |
| 800 } | 800 } |
| 801 | 801 |
| 802 } // namespace webkit_glue | 802 } // namespace webkit_glue |
| OLD | NEW |