OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <iostream> | 5 #include <iostream> |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <X11/keysym.h> | 7 #include <X11/keysym.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 media::MessageLoopFactory* message_loop_factory) { | 88 media::MessageLoopFactory* message_loop_factory) { |
89 // Initialize OpenMAX. | 89 // Initialize OpenMAX. |
90 if (CommandLine::ForCurrentProcess()->HasSwitch( | 90 if (CommandLine::ForCurrentProcess()->HasSwitch( |
91 switches::kEnableOpenMax) && | 91 switches::kEnableOpenMax) && |
92 !media::InitializeOpenMaxLibrary(FilePath())) { | 92 !media::InitializeOpenMaxLibrary(FilePath())) { |
93 std::cout << "Unable to initialize OpenMAX library."<< std::endl; | 93 std::cout << "Unable to initialize OpenMAX library."<< std::endl; |
94 return false; | 94 return false; |
95 } | 95 } |
96 | 96 |
97 // Load media libraries. | 97 // Load media libraries. |
98 if (!media::InitializeMediaLibrary(FilePath())) { | 98 media::InitializeMediaLibrary(FilePath()); |
| 99 if (!media::IsMediaLibraryInitialized()) { |
99 std::cout << "Unable to initialize the media library." << std::endl; | 100 std::cout << "Unable to initialize the media library." << std::endl; |
100 return false; | 101 return false; |
101 } | 102 } |
102 | 103 |
103 // Create our filter factories. | 104 // Create our filter factories. |
104 scoped_ptr<media::FilterCollection> collection( | 105 scoped_ptr<media::FilterCollection> collection( |
105 new media::FilterCollection()); | 106 new media::FilterCollection()); |
106 collection->AddDataSource(new media::FileDataSource()); | 107 collection->AddDataSource(new media::FileDataSource()); |
107 collection->AddDemuxer(new media::FFmpegDemuxer( | 108 collection->AddDemuxer(new media::FFmpegDemuxer( |
108 message_loop_factory->GetMessageLoop("DemuxThread"))); | 109 message_loop_factory->GetMessageLoop("DemuxThread"))); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 278 } |
278 | 279 |
279 // Cleanup tasks. | 280 // Cleanup tasks. |
280 message_loop_factory.reset(); | 281 message_loop_factory.reset(); |
281 | 282 |
282 thread->Stop(); | 283 thread->Stop(); |
283 XDestroyWindow(g_display, g_window); | 284 XDestroyWindow(g_display, g_window); |
284 XCloseDisplay(g_display); | 285 XCloseDisplay(g_display); |
285 return 0; | 286 return 0; |
286 } | 287 } |
OLD | NEW |