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 <X11/XKBlib.h> | 5 #include <X11/XKBlib.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 |
(...skipping 19 matching lines...) Expand all Loading... |
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" |
34 #include "media/tools/player_x11/x11_video_renderer.h" | 34 #include "media/tools/player_x11/x11_video_renderer.h" |
35 | 35 |
36 static Display* g_display = NULL; | 36 static Display* g_display = NULL; |
37 static Window g_window = 0; | 37 static Window g_window = 0; |
38 static bool g_running = false; | 38 static bool g_running = false; |
39 | 39 |
40 media::AudioManager* g_audio_manager = NULL; | 40 AudioManager* g_audio_manager = NULL; |
41 | 41 |
42 media::VideoRendererBase* g_video_renderer = NULL; | 42 media::VideoRendererBase* g_video_renderer = NULL; |
43 | 43 |
44 scoped_refptr<media::FileDataSource> CreateFileDataSource( | 44 scoped_refptr<media::FileDataSource> CreateFileDataSource( |
45 const std::string& file) { | 45 const std::string& file) { |
46 scoped_refptr<media::FileDataSource> file_data_source( | 46 scoped_refptr<media::FileDataSource> file_data_source( |
47 new media::FileDataSource()); | 47 new media::FileDataSource()); |
48 CHECK_EQ(file_data_source->Initialize(file), media::PIPELINE_OK); | 48 CHECK_EQ(file_data_source->Initialize(file), media::PIPELINE_OK); |
49 return file_data_source; | 49 return file_data_source; |
50 } | 50 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 << " [--audio]" | 231 << " [--audio]" |
232 << " [--alsa-device=DEVICE]" | 232 << " [--alsa-device=DEVICE]" |
233 << " [--use-gl]" | 233 << " [--use-gl]" |
234 << " [--streaming]" << std::endl | 234 << " [--streaming]" << std::endl |
235 << " Press [ESC] to stop" << std::endl | 235 << " Press [ESC] to stop" << std::endl |
236 << " Press [SPACE] to toggle pause/play" << std::endl | 236 << " Press [SPACE] to toggle pause/play" << std::endl |
237 << " Press mouse left button to seek" << std::endl; | 237 << " Press mouse left button to seek" << std::endl; |
238 return 1; | 238 return 1; |
239 } | 239 } |
240 | 240 |
241 scoped_ptr<media::AudioManager> audio_manager(media::AudioManager::Create()); | 241 scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); |
242 g_audio_manager = audio_manager.get(); | 242 g_audio_manager = audio_manager.get(); |
243 | 243 |
244 logging::InitLogging( | 244 logging::InitLogging( |
245 NULL, | 245 NULL, |
246 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 246 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
247 logging::LOCK_LOG_FILE, // Ignored. | 247 logging::LOCK_LOG_FILE, // Ignored. |
248 logging::DELETE_OLD_LOG_FILE, // Ignored. | 248 logging::DELETE_OLD_LOG_FILE, // Ignored. |
249 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 249 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
250 | 250 |
251 // Install the signal handler. | 251 // Install the signal handler. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Release callback which releases video renderer. Do this before cleaning up | 299 // Release callback which releases video renderer. Do this before cleaning up |
300 // X below since the video renderer has some X cleanup duties as well. | 300 // X below since the video renderer has some X cleanup duties as well. |
301 paint_cb.Reset(); | 301 paint_cb.Reset(); |
302 | 302 |
303 XDestroyWindow(g_display, g_window); | 303 XDestroyWindow(g_display, g_window); |
304 XCloseDisplay(g_display); | 304 XCloseDisplay(g_display); |
305 g_audio_manager = NULL; | 305 g_audio_manager = NULL; |
306 | 306 |
307 return 0; | 307 return 0; |
308 } | 308 } |
OLD | NEW |