Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: media/tools/player_wtl/movie.cc

Issue 10918022: Move AudioDecoder initialization into AudioRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698