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

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

Issue 10854151: Allow transitioning to HAVE_METADATA before pipeline initialization completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments and fix tests. Created 8 years, 4 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698