| 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 "media/tools/player_wtl/movie.h" | 5 #include "media/tools/player_wtl/movie.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "media/audio/audio_manager.h" | 10 #include "media/audio/audio_manager.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 scoped_refptr<FileDataSource> data_source = new FileDataSource(); | 73 scoped_refptr<FileDataSource> data_source = new FileDataSource(); |
| 74 if (data_source->Initialize(url_utf8) != PIPELINE_OK) { | 74 if (data_source->Initialize(url_utf8) != PIPELINE_OK) { |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Create filter collection. | 78 // Create filter collection. |
| 79 scoped_ptr<FilterCollection> collection(new FilterCollection()); | 79 scoped_ptr<FilterCollection> collection(new FilterCollection()); |
| 80 collection->SetDemuxerFactory(scoped_ptr<DemuxerFactory>( | 80 collection->SetDemuxerFactory(scoped_ptr<DemuxerFactory>( |
| 81 new FFmpegDemuxerFactory(data_source, pipeline_loop))); | 81 new FFmpegDemuxerFactory(data_source, pipeline_loop))); |
| 82 collection->AddAudioDecoder(new FFmpegAudioDecoder( | 82 collection->AddAudioDecoder(new FFmpegAudioDecoder( |
| 83 message_loop_factory_->GetMessageLoop("AudioDecoderThread"))); | 83 message_loop_factory_.get(), "AudioDecoderThread")); |
| 84 collection->AddVideoDecoder(new FFmpegVideoDecoder( | 84 collection->AddVideoDecoder(new FFmpegVideoDecoder( |
| 85 message_loop_factory_->GetMessageLoop("VideoDecoderThread"))); | 85 message_loop_factory_.get(), "VideoDecoderThread")); |
| 86 | 86 |
| 87 // TODO(vrk): Re-enabled audio. (crbug.com/112159) | 87 // TODO(vrk): Re-enabled audio. (crbug.com/112159) |
| 88 collection->AddAudioRenderer(new media::NullAudioRenderer()); | 88 collection->AddAudioRenderer(new media::NullAudioRenderer()); |
| 89 collection->AddVideoRenderer(video_renderer); | 89 collection->AddVideoRenderer(video_renderer); |
| 90 | 90 |
| 91 // Create and start our pipeline. | 91 // Create and start our pipeline. |
| 92 media::PipelineStatusNotification note; | 92 media::PipelineStatusNotification note; |
| 93 pipeline_->Start( | 93 pipeline_->Start( |
| 94 collection.Pass(), | 94 collection.Pass(), |
| 95 url_utf8, | 95 url_utf8, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void Movie::Close() { | 182 void Movie::Close() { |
| 183 if (pipeline_) { | 183 if (pipeline_) { |
| 184 pipeline_->Stop(media::PipelineStatusCB()); | 184 pipeline_->Stop(media::PipelineStatusCB()); |
| 185 pipeline_ = NULL; | 185 pipeline_ = NULL; |
| 186 } | 186 } |
| 187 | 187 |
| 188 message_loop_factory_.reset(); | 188 message_loop_factory_.reset(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace media | 191 } // namespace media |
| OLD | NEW |