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

Side by Side Diff: media/tools/player_x11/player_x11.cc

Issue 11428095: Pass in media message loop to VideoRendererBase and enforce calling on the right thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 scoped_ptr<media::FilterCollection> collection( 111 scoped_ptr<media::FilterCollection> collection(
112 new media::FilterCollection()); 112 new media::FilterCollection());
113 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source)); 113 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source));
114 collection->GetAudioDecoders()->push_back(new media::FFmpegAudioDecoder( 114 collection->GetAudioDecoders()->push_back(new media::FFmpegAudioDecoder(
115 message_loop)); 115 message_loop));
116 collection->GetVideoDecoders()->push_back(new media::FFmpegVideoDecoder( 116 collection->GetVideoDecoders()->push_back(new media::FFmpegVideoDecoder(
117 message_loop, NULL)); 117 message_loop, NULL));
118 118
119 // Create our video renderer and save a reference to it for painting. 119 // Create our video renderer and save a reference to it for painting.
120 g_video_renderer = new media::VideoRendererBase( 120 g_video_renderer = new media::VideoRendererBase(
121 message_loop,
121 base::Bind(&Paint, paint_message_loop, paint_cb), 122 base::Bind(&Paint, paint_message_loop, paint_cb),
122 base::Bind(&SetOpaque), 123 base::Bind(&SetOpaque),
123 true); 124 true);
124 collection->AddVideoRenderer(g_video_renderer); 125 collection->AddVideoRenderer(g_video_renderer);
125 126
126 collection->AddAudioRenderer( 127 collection->AddAudioRenderer(
127 new media::AudioRendererImpl(new media::NullAudioSink())); 128 new media::AudioRendererImpl(new media::NullAudioSink()));
128 129
129 // Create the pipeline and start it. 130 // Create the pipeline and start it.
130 *pipeline = new media::Pipeline(message_loop, new media::MediaLog()); 131 *pipeline = new media::Pipeline(message_loop, new media::MediaLog());
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Release callback which releases video renderer. Do this before cleaning up 298 // Release callback which releases video renderer. Do this before cleaning up
298 // X below since the video renderer has some X cleanup duties as well. 299 // X below since the video renderer has some X cleanup duties as well.
299 paint_cb.Reset(); 300 paint_cb.Reset();
300 301
301 XDestroyWindow(g_display, g_window); 302 XDestroyWindow(g_display, g_window);
302 XCloseDisplay(g_display); 303 XCloseDisplay(g_display);
303 g_audio_manager = NULL; 304 g_audio_manager = NULL;
304 305
305 return 0; 306 return 0;
306 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698