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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return false; | 90 return false; |
91 } | 91 } |
92 | 92 |
93 // Load media libraries. | 93 // Load media libraries. |
94 if (!media::InitializeMediaLibrary(FilePath())) { | 94 if (!media::InitializeMediaLibrary(FilePath())) { |
95 std::cout << "Unable to initialize the media library." << std::endl; | 95 std::cout << "Unable to initialize the media library." << std::endl; |
96 return false; | 96 return false; |
97 } | 97 } |
98 | 98 |
99 // Create our filter factories. | 99 // Create our filter factories. |
100 scoped_ptr<media::MediaFilterCollection> collection( | 100 scoped_ptr<media::FilterCollection> collection( |
101 new media::MediaFilterCollection()); | 101 new media::FilterCollection()); |
102 collection->AddDataSource(new media::FileDataSource()); | 102 collection->AddDataSource(new media::FileDataSource()); |
103 collection->AddDemuxer(new media::FFmpegDemuxer()); | 103 collection->AddDemuxer(new media::FFmpegDemuxer()); |
104 collection->AddAudioDecoder(new media::FFmpegAudioDecoder()); | 104 collection->AddAudioDecoder(new media::FFmpegAudioDecoder()); |
105 if (CommandLine::ForCurrentProcess()->HasSwitch( | 105 if (CommandLine::ForCurrentProcess()->HasSwitch( |
106 switches::kEnableOpenMax)) { | 106 switches::kEnableOpenMax)) { |
107 collection->AddVideoDecoder(new media::OmxVideoDecoder(NULL)); | 107 collection->AddVideoDecoder(new media::OmxVideoDecoder(NULL)); |
108 } else { | 108 } else { |
109 collection->AddVideoDecoder(new media::FFmpegVideoDecoder(NULL)); | 109 collection->AddVideoDecoder(new media::FFmpegVideoDecoder(NULL)); |
110 } | 110 } |
111 collection->AddVideoRenderer(new Renderer(g_display, | 111 collection->AddVideoRenderer(new Renderer(g_display, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } else{ | 262 } else{ |
263 std::cout << "Pipeline initialization failed..." << std::endl; | 263 std::cout << "Pipeline initialization failed..." << std::endl; |
264 } | 264 } |
265 | 265 |
266 // Cleanup tasks. | 266 // Cleanup tasks. |
267 thread->Stop(); | 267 thread->Stop(); |
268 XDestroyWindow(g_display, g_window); | 268 XDestroyWindow(g_display, g_window); |
269 XCloseDisplay(g_display); | 269 XCloseDisplay(g_display); |
270 return 0; | 270 return 0; |
271 } | 271 } |
OLD | NEW |