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> | |
6 #include <X11/Xlib.h> | |
7 #include <signal.h> | 5 #include <signal.h> |
8 | 6 |
9 #include <iostream> // NOLINT | 7 #include <iostream> // NOLINT |
10 | 8 |
11 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
12 #include "base/bind.h" | 10 #include "base/bind.h" |
13 #include "base/command_line.h" | 11 #include "base/command_line.h" |
14 #include "base/file_path.h" | 12 #include "base/file_path.h" |
15 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
16 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
17 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
18 #include "media/audio/audio_manager.h" | 16 #include "media/audio/audio_manager.h" |
19 #include "media/audio/null_audio_sink.h" | 17 #include "media/audio/null_audio_sink.h" |
20 #include "media/base/filter_collection.h" | 18 #include "media/base/filter_collection.h" |
21 #include "media/base/media.h" | 19 #include "media/base/media.h" |
22 #include "media/base/media_log.h" | 20 #include "media/base/media_log.h" |
23 #include "media/base/media_switches.h" | 21 #include "media/base/media_switches.h" |
24 #include "media/base/message_loop_factory.h" | 22 #include "media/base/message_loop_factory.h" |
25 #include "media/base/pipeline.h" | 23 #include "media/base/pipeline.h" |
26 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
27 #include "media/filters/audio_renderer_impl.h" | 25 #include "media/filters/audio_renderer_impl.h" |
28 #include "media/filters/ffmpeg_audio_decoder.h" | 26 #include "media/filters/ffmpeg_audio_decoder.h" |
29 #include "media/filters/ffmpeg_demuxer.h" | 27 #include "media/filters/ffmpeg_demuxer.h" |
30 #include "media/filters/ffmpeg_video_decoder.h" | 28 #include "media/filters/ffmpeg_video_decoder.h" |
31 #include "media/filters/file_data_source.h" | 29 #include "media/filters/file_data_source.h" |
32 #include "media/filters/video_renderer_base.h" | 30 #include "media/filters/video_renderer_base.h" |
33 #include "media/tools/player_x11/data_source_logger.h" | 31 #include "media/tools/player_x11/data_source_logger.h" |
| 32 |
| 33 // Include X11 headers here because X11/Xlib.h #define's Status |
| 34 // which causes compiler errors with Status enum declarations |
| 35 // in media::DemuxerStream & media::AudioDecoder. |
| 36 #include <X11/XKBlib.h> |
| 37 #include <X11/Xlib.h> |
34 #include "media/tools/player_x11/gl_video_renderer.h" | 38 #include "media/tools/player_x11/gl_video_renderer.h" |
35 #include "media/tools/player_x11/x11_video_renderer.h" | 39 #include "media/tools/player_x11/x11_video_renderer.h" |
36 | 40 |
37 static Display* g_display = NULL; | 41 static Display* g_display = NULL; |
38 static Window g_window = 0; | 42 static Window g_window = 0; |
39 static bool g_running = false; | 43 static bool g_running = false; |
40 | 44 |
41 media::AudioManager* g_audio_manager = NULL; | 45 media::AudioManager* g_audio_manager = NULL; |
42 | 46 |
43 media::VideoRendererBase* g_video_renderer = NULL; | 47 media::VideoRendererBase* g_video_renderer = NULL; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Release callback which releases video renderer. Do this before cleaning up | 303 // 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. | 304 // X below since the video renderer has some X cleanup duties as well. |
301 paint_cb.Reset(); | 305 paint_cb.Reset(); |
302 | 306 |
303 XDestroyWindow(g_display, g_window); | 307 XDestroyWindow(g_display, g_window); |
304 XCloseDisplay(g_display); | 308 XCloseDisplay(g_display); |
305 g_audio_manager = NULL; | 309 g_audio_manager = NULL; |
306 | 310 |
307 return 0; | 311 return 0; |
308 } | 312 } |
OLD | NEW |