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

Side by Side Diff: media/tools/player_x11/player_x11.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 <signal.h> 5 #include <signal.h>
6 6
7 #include <iostream> // NOLINT 7 #include <iostream> // NOLINT
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 collection->AddVideoRenderer(g_video_renderer); 133 collection->AddVideoRenderer(g_video_renderer);
134 134
135 collection->AddAudioRenderer( 135 collection->AddAudioRenderer(
136 new media::AudioRendererImpl(new media::NullAudioSink())); 136 new media::AudioRendererImpl(new media::NullAudioSink()));
137 137
138 // Create the pipeline and start it. 138 // Create the pipeline and start it.
139 *pipeline = new media::Pipeline(message_loop, new media::MediaLog()); 139 *pipeline = new media::Pipeline(message_loop, new media::MediaLog());
140 media::PipelineStatusNotification note; 140 media::PipelineStatusNotification note;
141 (*pipeline)->Start( 141 (*pipeline)->Start(
142 collection.Pass(), media::PipelineStatusCB(), media::PipelineStatusCB(), 142 collection.Pass(), media::PipelineStatusCB(), media::PipelineStatusCB(),
143 note.Callback()); 143 note.Callback(), media::Pipeline::ReadyStateCB());
144 144
145 // Wait until the pipeline is fully initialized. 145 // Wait until the pipeline is fully initialized.
146 note.Wait(); 146 note.Wait();
147 if (note.status() != media::PIPELINE_OK) { 147 if (note.status() != media::PIPELINE_OK) {
148 std::cout << "InitPipeline: " << note.status() << std::endl; 148 std::cout << "InitPipeline: " << note.status() << std::endl;
149 (*pipeline)->Stop(base::Closure()); 149 (*pipeline)->Stop(base::Closure());
150 return false; 150 return false;
151 } 151 }
152 152
153 // And start the playback. 153 // And start the playback.
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // Release callback which releases video renderer. Do this before cleaning up 304 // Release callback which releases video renderer. Do this before cleaning up
305 // X below since the video renderer has some X cleanup duties as well. 305 // X below since the video renderer has some X cleanup duties as well.
306 paint_cb.Reset(); 306 paint_cb.Reset();
307 307
308 XDestroyWindow(g_display, g_window); 308 XDestroyWindow(g_display, g_window);
309 XCloseDisplay(g_display); 309 XCloseDisplay(g_display);
310 g_audio_manager = NULL; 310 g_audio_manager = NULL;
311 311
312 return 0; 312 return 0;
313 } 313 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698