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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 bool InitPipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop, | 104 bool InitPipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop, |
105 const scoped_refptr<media::DataSource>& data_source, | 105 const scoped_refptr<media::DataSource>& data_source, |
106 const PaintCB& paint_cb, | 106 const PaintCB& paint_cb, |
107 bool /* enable_audio */, | 107 bool /* enable_audio */, |
108 scoped_refptr<media::Pipeline>* pipeline, | 108 scoped_refptr<media::Pipeline>* pipeline, |
109 MessageLoop* paint_message_loop) { | 109 MessageLoop* paint_message_loop) { |
110 // Create our filter factories. | 110 // Create our filter factories. |
111 scoped_ptr<media::FilterCollection> collection( | 111 scoped_ptr<media::FilterCollection> collection( |
112 new media::FilterCollection()); | 112 new media::FilterCollection()); |
113 media::FFmpegNeedKeyCB need_key_cb = base::Bind(&NeedKey); | 113 media::FFmpegNeedKeyCB need_key_cb = base::Bind(&NeedKey); |
114 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source, | 114 scoped_ptr<Demuxer> demuxer(new media::FFmpegDemuxer( |
115 need_key_cb)); | 115 message_loop, data_source, need_key_cb)); |
116 | 116 collection->SetDemuxer(demuxer.Pass()); |
117 | 117 |
118 ScopedVector<media::VideoDecoder> video_decoders; | 118 ScopedVector<media::VideoDecoder> video_decoders; |
119 video_decoders.push_back(new media::FFmpegVideoDecoder(message_loop)); | 119 video_decoders.push_back(new media::FFmpegVideoDecoder(message_loop)); |
120 scoped_ptr<media::VideoRenderer> video_renderer(new media::VideoRendererBase( | 120 scoped_ptr<media::VideoRenderer> video_renderer(new media::VideoRendererBase( |
121 message_loop, | 121 message_loop, |
122 video_decoders.Pass(), | 122 video_decoders.Pass(), |
123 media::SetDecryptorReadyCB(), | 123 media::SetDecryptorReadyCB(), |
124 base::Bind(&Paint, paint_message_loop, paint_cb), | 124 base::Bind(&Paint, paint_message_loop, paint_cb), |
125 base::Bind(&SetOpaque), | 125 base::Bind(&SetOpaque), |
126 true)); | 126 true)); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // Release callback which releases video renderer. Do this before cleaning up | 301 // Release callback which releases video renderer. Do this before cleaning up |
302 // X below since the video renderer has some X cleanup duties as well. | 302 // X below since the video renderer has some X cleanup duties as well. |
303 paint_cb.Reset(); | 303 paint_cb.Reset(); |
304 | 304 |
305 XDestroyWindow(g_display, g_window); | 305 XDestroyWindow(g_display, g_window); |
306 XCloseDisplay(g_display); | 306 XCloseDisplay(g_display); |
307 g_audio_manager = NULL; | 307 g_audio_manager = NULL; |
308 | 308 |
309 return 0; | 309 return 0; |
310 } | 310 } |
OLD | NEW |