| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Load media libraries. | 110 // Load media libraries. |
| 111 if (!media::InitializeMediaLibrary(FilePath())) { | 111 if (!media::InitializeMediaLibrary(FilePath())) { |
| 112 std::cout << "Unable to initialize the media library." << std::endl; | 112 std::cout << "Unable to initialize the media library." << std::endl; |
| 113 return false; | 113 return false; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Create our filter factories. | 116 // Create our filter factories. |
| 117 scoped_ptr<media::FilterCollection> collection( | 117 scoped_ptr<media::FilterCollection> collection( |
| 118 new media::FilterCollection()); | 118 new media::FilterCollection()); |
| 119 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source)); | 119 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source)); |
| 120 collection->AddAudioDecoder(new media::FFmpegAudioDecoder( | 120 collection->GetAudioDecoders()->push_back(new media::FFmpegAudioDecoder( |
| 121 base::Bind(&media::MessageLoopFactory::GetMessageLoop, | 121 base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
| 122 base::Unretained(message_loop_factory), | 122 base::Unretained(message_loop_factory), |
| 123 media::MessageLoopFactory::kDecoder))); | 123 media::MessageLoopFactory::kDecoder))); |
| 124 collection->GetVideoDecoders()->push_back(new media::FFmpegVideoDecoder( | 124 collection->GetVideoDecoders()->push_back(new media::FFmpegVideoDecoder( |
| 125 base::Bind(&media::MessageLoopFactory::GetMessageLoop, | 125 base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
| 126 base::Unretained(message_loop_factory), | 126 base::Unretained(message_loop_factory), |
| 127 media::MessageLoopFactory::kDecoder), | 127 media::MessageLoopFactory::kDecoder), |
| 128 NULL)); | 128 NULL)); |
| 129 | 129 |
| 130 // Create our video renderer and save a reference to it for painting. | 130 // Create our video renderer and save a reference to it for painting. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Release callback which releases video renderer. Do this before cleaning up | 306 // Release callback which releases video renderer. Do this before cleaning up |
| 307 // X below since the video renderer has some X cleanup duties as well. | 307 // X below since the video renderer has some X cleanup duties as well. |
| 308 paint_cb.Reset(); | 308 paint_cb.Reset(); |
| 309 | 309 |
| 310 XDestroyWindow(g_display, g_window); | 310 XDestroyWindow(g_display, g_window); |
| 311 XCloseDisplay(g_display); | 311 XCloseDisplay(g_display); |
| 312 g_audio_manager = NULL; | 312 g_audio_manager = NULL; |
| 313 | 313 |
| 314 return 0; | 314 return 0; |
| 315 } | 315 } |
| OLD | NEW |