| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 if (!data_source->Initialize(url_utf8)) { | 72 if (!data_source->Initialize(url_utf8)) { |
| 73 return false; | 73 return false; |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Create filter collection. | 76 // Create filter collection. |
| 77 scoped_ptr<FilterCollection> collection(new FilterCollection()); | 77 scoped_ptr<FilterCollection> collection(new FilterCollection()); |
| 78 collection->SetDemuxer(new FFmpegDemuxer(pipeline_loop, data_source)); | 78 collection->SetDemuxer(new FFmpegDemuxer(pipeline_loop, data_source)); |
| 79 collection->AddAudioDecoder(new FFmpegAudioDecoder( | 79 collection->AddAudioDecoder(new FFmpegAudioDecoder( |
| 80 base::Bind(&MessageLoopFactory::GetMessageLoop, | 80 base::Bind(&MessageLoopFactory::GetMessageLoop, |
| 81 base::Unretained(message_loop_factory_.get()), | 81 base::Unretained(message_loop_factory_.get()), |
| 82 media::MessageLoopFactory::kAudioDecoder))); | 82 media::MessageLoopFactory::kDecoder))); |
| 83 collection->GetVideoDecoders()->push_back(new FFmpegVideoDecoder( | 83 collection->GetVideoDecoders()->push_back(new FFmpegVideoDecoder( |
| 84 base::Bind(&MessageLoopFactory::GetMessageLoop, | 84 base::Bind(&MessageLoopFactory::GetMessageLoop, |
| 85 base::Unretained(message_loop_factory_.get()), | 85 base::Unretained(message_loop_factory_.get()), |
| 86 media::MessageLoopFactory::kVideoDecoder), | 86 media::MessageLoopFactory::kDecoder), |
| 87 NULL)); | 87 NULL)); |
| 88 | 88 |
| 89 // TODO(vrk): Re-enabled audio. (crbug.com/112159) | 89 // TODO(vrk): Re-enabled audio. (crbug.com/112159) |
| 90 collection->AddAudioRenderer( | 90 collection->AddAudioRenderer( |
| 91 new media::AudioRendererImpl(new media::NullAudioSink())); | 91 new media::AudioRendererImpl(new media::NullAudioSink())); |
| 92 collection->AddVideoRenderer(video_renderer); | 92 collection->AddVideoRenderer(video_renderer); |
| 93 | 93 |
| 94 // Create and start our pipeline. | 94 // Create and start our pipeline. |
| 95 media::PipelineStatusNotification note; | 95 media::PipelineStatusNotification note; |
| 96 pipeline_->Start( | 96 pipeline_->Start( |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void Movie::Close() { | 184 void Movie::Close() { |
| 185 if (pipeline_) { | 185 if (pipeline_) { |
| 186 pipeline_->Stop(base::Closure()); | 186 pipeline_->Stop(base::Closure()); |
| 187 pipeline_ = NULL; | 187 pipeline_ = NULL; |
| 188 } | 188 } |
| 189 | 189 |
| 190 message_loop_factory_.reset(); | 190 message_loop_factory_.reset(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace media | 193 } // namespace media |
| OLD | NEW |