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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 collection->AddAudioRenderer( | 88 collection->AddAudioRenderer( |
89 new media::AudioRendererImpl(new media::NullAudioSink())); | 89 new media::AudioRendererImpl(new media::NullAudioSink())); |
90 collection->AddVideoRenderer(video_renderer); | 90 collection->AddVideoRenderer(video_renderer); |
91 | 91 |
92 // Create and start our pipeline. | 92 // Create and start our pipeline. |
93 media::PipelineStatusNotification note; | 93 media::PipelineStatusNotification note; |
94 pipeline_->Start( | 94 pipeline_->Start( |
95 collection.Pass(), | 95 collection.Pass(), |
96 media::PipelineStatusCB(), | 96 media::PipelineStatusCB(), |
97 media::PipelineStatusCB(), | 97 media::PipelineStatusCB(), |
98 note.Callback()); | 98 note.Callback(), |
| 99 media::Pipeline::ReadyStateCB()); |
99 | 100 |
100 // Wait until the pipeline is fully initialized. | 101 // Wait until the pipeline is fully initialized. |
101 note.Wait(); | 102 note.Wait(); |
102 if (note.status() != PIPELINE_OK) | 103 if (note.status() != PIPELINE_OK) |
103 return false; | 104 return false; |
104 pipeline_->SetPlaybackRate(play_rate_); | 105 pipeline_->SetPlaybackRate(play_rate_); |
105 return true; | 106 return true; |
106 } | 107 } |
107 | 108 |
108 void Movie::Play(float rate) { | 109 void Movie::Play(float rate) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 void Movie::Close() { | 182 void Movie::Close() { |
182 if (pipeline_) { | 183 if (pipeline_) { |
183 pipeline_->Stop(base::Closure()); | 184 pipeline_->Stop(base::Closure()); |
184 pipeline_ = NULL; | 185 pipeline_ = NULL; |
185 } | 186 } |
186 | 187 |
187 message_loop_factory_.reset(); | 188 message_loop_factory_.reset(); |
188 } | 189 } |
189 | 190 |
190 } // namespace media | 191 } // namespace media |
OLD | NEW |