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 <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 30 matching lines...) Expand all Loading... |
41 static Display* g_display = NULL; | 41 static Display* g_display = NULL; |
42 static Window g_window = 0; | 42 static Window g_window = 0; |
43 static bool g_running = false; | 43 static bool g_running = false; |
44 | 44 |
45 media::AudioManager* g_audio_manager = NULL; | 45 media::AudioManager* g_audio_manager = NULL; |
46 | 46 |
47 scoped_refptr<media::FileDataSource> CreateFileDataSource( | 47 scoped_refptr<media::FileDataSource> CreateFileDataSource( |
48 const std::string& file_path) { | 48 const std::string& file_path) { |
49 scoped_refptr<media::FileDataSource> file_data_source( | 49 scoped_refptr<media::FileDataSource> file_data_source( |
50 new media::FileDataSource()); | 50 new media::FileDataSource()); |
51 CHECK(file_data_source->Initialize(FilePath(file_path))); | 51 CHECK(file_data_source->Initialize(base::FilePath(file_path))); |
52 return file_data_source; | 52 return file_data_source; |
53 } | 53 } |
54 | 54 |
55 // Initialize X11. Returns true if successful. This method creates the X11 | 55 // Initialize X11. Returns true if successful. This method creates the X11 |
56 // window. Further initialization is done in X11VideoRenderer. | 56 // window. Further initialization is done in X11VideoRenderer. |
57 bool InitX11() { | 57 bool InitX11() { |
58 g_display = XOpenDisplay(NULL); | 58 g_display = XOpenDisplay(NULL); |
59 if (!g_display) { | 59 if (!g_display) { |
60 std::cout << "Error - cannot open display" << std::endl; | 60 std::cout << "Error - cannot open display" << std::endl; |
61 return false; | 61 return false; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // Release callback which releases video renderer. Do this before cleaning up | 291 // Release callback which releases video renderer. Do this before cleaning up |
292 // X below since the video renderer has some X cleanup duties as well. | 292 // X below since the video renderer has some X cleanup duties as well. |
293 paint_cb.Reset(); | 293 paint_cb.Reset(); |
294 | 294 |
295 XDestroyWindow(g_display, g_window); | 295 XDestroyWindow(g_display, g_window); |
296 XCloseDisplay(g_display); | 296 XCloseDisplay(g_display); |
297 g_audio_manager = NULL; | 297 g_audio_manager = NULL; |
298 | 298 |
299 return 0; | 299 return 0; |
300 } | 300 } |
OLD | NEW |