| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 media::VideoRendererBase* g_video_renderer = NULL; | 47 media::VideoRendererBase* g_video_renderer = NULL; |
| 48 | 48 |
| 49 scoped_refptr<media::FileDataSource> CreateFileDataSource( | 49 scoped_refptr<media::FileDataSource> CreateFileDataSource( |
| 50 const std::string& file) { | 50 const std::string& file) { |
| 51 scoped_refptr<media::FileDataSource> file_data_source( | 51 scoped_refptr<media::FileDataSource> file_data_source( |
| 52 new media::FileDataSource()); | 52 new media::FileDataSource()); |
| 53 CHECK_EQ(file_data_source->Initialize(file), media::PIPELINE_OK); | 53 CHECK(file_data_source->Initialize(file)); |
| 54 return file_data_source; | 54 return file_data_source; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Initialize X11. Returns true if successful. This method creates the X11 | 57 // Initialize X11. Returns true if successful. This method creates the X11 |
| 58 // window. Further initialization is done in X11VideoRenderer. | 58 // window. Further initialization is done in X11VideoRenderer. |
| 59 bool InitX11() { | 59 bool InitX11() { |
| 60 g_display = XOpenDisplay(NULL); | 60 g_display = XOpenDisplay(NULL); |
| 61 if (!g_display) { | 61 if (!g_display) { |
| 62 std::cout << "Error - cannot open display" << std::endl; | 62 std::cout << "Error - cannot open display" << std::endl; |
| 63 return false; | 63 return false; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // Release callback which releases video renderer. Do this before cleaning up | 303 // Release callback which releases video renderer. Do this before cleaning up |
| 304 // X below since the video renderer has some X cleanup duties as well. | 304 // X below since the video renderer has some X cleanup duties as well. |
| 305 paint_cb.Reset(); | 305 paint_cb.Reset(); |
| 306 | 306 |
| 307 XDestroyWindow(g_display, g_window); | 307 XDestroyWindow(g_display, g_window); |
| 308 XCloseDisplay(g_display); | 308 XCloseDisplay(g_display); |
| 309 g_audio_manager = NULL; | 309 g_audio_manager = NULL; |
| 310 | 310 |
| 311 return 0; | 311 return 0; |
| 312 } | 312 } |
| OLD | NEW |