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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Open the file. | 69 // Open the file. |
70 std::string url_utf8 = WideToUTF8(string16(url)); | 70 std::string url_utf8 = WideToUTF8(string16(url)); |
71 scoped_refptr<FileDataSource> data_source = new FileDataSource(); | 71 scoped_refptr<FileDataSource> data_source = new FileDataSource(); |
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->GetAudioDecoders()->push_back(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::kAudioDecoder))); |
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::kVideoDecoder), |
87 NULL)); | 87 NULL)); |
88 | 88 |
89 // TODO(vrk): Re-enabled audio. (crbug.com/112159) | 89 // TODO(vrk): Re-enabled audio. (crbug.com/112159) |
(...skipping 94 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 |