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

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

Issue 9597016: Fold media::MessageLoopFactoryImpl into media::MessageLoopFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 9 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
« no previous file with comments | « media/tools/player_wtl/movie.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <X11/keysym.h> 5 #include <X11/keysym.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <iostream> // NOLINT 9 #include <iostream> // NOLINT
10 10
11 #include "base/at_exit.h" 11 #include "base/at_exit.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/threading/platform_thread.h" 16 #include "base/threading/platform_thread.h"
17 #include "base/threading/thread.h" 17 #include "base/threading/thread.h"
18 #include "media/audio/audio_manager.h" 18 #include "media/audio/audio_manager.h"
19 #include "media/base/filter_collection.h" 19 #include "media/base/filter_collection.h"
20 #include "media/base/media.h" 20 #include "media/base/media.h"
21 #include "media/base/media_log.h" 21 #include "media/base/media_log.h"
22 #include "media/base/media_switches.h" 22 #include "media/base/media_switches.h"
23 #include "media/base/message_loop_factory_impl.h" 23 #include "media/base/message_loop_factory.h"
24 #include "media/base/pipeline.h" 24 #include "media/base/pipeline.h"
25 #include "media/base/video_frame.h" 25 #include "media/base/video_frame.h"
26 #include "media/filters/ffmpeg_audio_decoder.h" 26 #include "media/filters/ffmpeg_audio_decoder.h"
27 #include "media/filters/ffmpeg_demuxer_factory.h" 27 #include "media/filters/ffmpeg_demuxer_factory.h"
28 #include "media/filters/ffmpeg_video_decoder.h" 28 #include "media/filters/ffmpeg_video_decoder.h"
29 #include "media/filters/file_data_source.h" 29 #include "media/filters/file_data_source.h"
30 #include "media/filters/null_audio_renderer.h" 30 #include "media/filters/null_audio_renderer.h"
31 #include "media/filters/video_renderer_base.h" 31 #include "media/filters/video_renderer_base.h"
32 #include "media/tools/player_x11/data_source_logger.h" 32 #include "media/tools/player_x11/data_source_logger.h"
33 #include "media/tools/player_x11/gl_video_renderer.h" 33 #include "media/tools/player_x11/gl_video_renderer.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // Install the signal handler. 262 // Install the signal handler.
263 signal(SIGTERM, &TerminateHandler); 263 signal(SIGTERM, &TerminateHandler);
264 signal(SIGINT, &TerminateHandler); 264 signal(SIGINT, &TerminateHandler);
265 265
266 // Initialize X11. 266 // Initialize X11.
267 if (!InitX11()) 267 if (!InitX11())
268 return 1; 268 return 1;
269 269
270 // Initialize the pipeline thread and the pipeline. 270 // Initialize the pipeline thread and the pipeline.
271 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 271 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
272 new media::MessageLoopFactoryImpl()); 272 new media::MessageLoopFactory());
273 scoped_ptr<base::Thread> thread; 273 scoped_ptr<base::Thread> thread;
274 scoped_refptr<media::Pipeline> pipeline; 274 scoped_refptr<media::Pipeline> pipeline;
275 MessageLoop message_loop; 275 MessageLoop message_loop;
276 thread.reset(new base::Thread("PipelineThread")); 276 thread.reset(new base::Thread("PipelineThread"));
277 thread->Start(); 277 thread->Start();
278 278
279 PaintCB paint_cb; 279 PaintCB paint_cb;
280 if (command_line->HasSwitch("use-gl")) { 280 if (command_line->HasSwitch("use-gl")) {
281 paint_cb = base::Bind( 281 paint_cb = base::Bind(
282 &GlVideoRenderer::Paint, new GlVideoRenderer(g_display, g_window)); 282 &GlVideoRenderer::Paint, new GlVideoRenderer(g_display, g_window));
(...skipping 27 matching lines...) Expand all
310 // Release callback which releases video renderer. Do this before cleaning up 310 // Release callback which releases video renderer. Do this before cleaning up
311 // X below since the video renderer has some X cleanup duties as well. 311 // X below since the video renderer has some X cleanup duties as well.
312 paint_cb.Reset(); 312 paint_cb.Reset();
313 313
314 XDestroyWindow(g_display, g_window); 314 XDestroyWindow(g_display, g_window);
315 XCloseDisplay(g_display); 315 XCloseDisplay(g_display);
316 g_audio_manager = NULL; 316 g_audio_manager = NULL;
317 317
318 return 0; 318 return 0;
319 } 319 }
OLDNEW
« no previous file with comments | « media/tools/player_wtl/movie.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698