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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 base::Bind(&SetOpaque), | 129 base::Bind(&SetOpaque), |
130 true)); | 130 true)); |
131 collection->SetVideoRenderer(video_renderer.Pass()); | 131 collection->SetVideoRenderer(video_renderer.Pass()); |
132 | 132 |
133 ScopedVector<media::AudioDecoder> audio_decoders; | 133 ScopedVector<media::AudioDecoder> audio_decoders; |
134 audio_decoders.push_back(new media::FFmpegAudioDecoder(message_loop)); | 134 audio_decoders.push_back(new media::FFmpegAudioDecoder(message_loop)); |
135 scoped_ptr<media::AudioRenderer> audio_renderer(new media::AudioRendererImpl( | 135 scoped_ptr<media::AudioRenderer> audio_renderer(new media::AudioRendererImpl( |
136 message_loop, | 136 message_loop, |
137 new media::NullAudioSink(message_loop), | 137 new media::NullAudioSink(message_loop), |
138 audio_decoders.Pass(), | 138 audio_decoders.Pass(), |
139 media::SetDecryptorReadyCB())); | 139 media::SetDecryptorReadyCB(), |
| 140 true)); |
140 collection->SetAudioRenderer(audio_renderer.Pass()); | 141 collection->SetAudioRenderer(audio_renderer.Pass()); |
141 | 142 |
142 base::WaitableEvent event(true, false); | 143 base::WaitableEvent event(true, false); |
143 media::PipelineStatus status; | 144 media::PipelineStatus status; |
144 | 145 |
145 pipeline->Start( | 146 pipeline->Start( |
146 collection.Pass(), base::Closure(), media::PipelineStatusCB(), | 147 collection.Pass(), base::Closure(), media::PipelineStatusCB(), |
147 base::Bind(&SaveStatusAndSignal, &event, &status), | 148 base::Bind(&SaveStatusAndSignal, &event, &status), |
148 base::Bind(&OnBufferingState), base::Closure()); | 149 base::Bind(&OnBufferingState), base::Closure()); |
149 | 150 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // Release callback which releases video renderer. Do this before cleaning up | 303 // Release callback which releases video renderer. Do this before cleaning up |
303 // 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. |
304 paint_cb.Reset(); | 305 paint_cb.Reset(); |
305 | 306 |
306 XDestroyWindow(g_display, g_window); | 307 XDestroyWindow(g_display, g_window); |
307 XCloseDisplay(g_display); | 308 XCloseDisplay(g_display); |
308 g_audio_manager = NULL; | 309 g_audio_manager = NULL; |
309 | 310 |
310 return 0; | 311 return 0; |
311 } | 312 } |
OLD | NEW |