Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: media/tools/player_x11/player_x11.cc

Issue 9632024: Create video and audio decoder threads on demand. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Log an error when Initialize is called more than once. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <X11/XKBlib.h> 5 #include <X11/XKBlib.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <iostream> // NOLINT 9 #include <iostream> // NOLINT
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 std::cout << "Unable to initialize the media library." << std::endl; 117 std::cout << "Unable to initialize the media library." << std::endl;
118 return false; 118 return false;
119 } 119 }
120 120
121 // Create our filter factories. 121 // Create our filter factories.
122 scoped_ptr<media::FilterCollection> collection( 122 scoped_ptr<media::FilterCollection> collection(
123 new media::FilterCollection()); 123 new media::FilterCollection());
124 collection->SetDemuxerFactory(scoped_ptr<media::DemuxerFactory>( 124 collection->SetDemuxerFactory(scoped_ptr<media::DemuxerFactory>(
125 new media::FFmpegDemuxerFactory(data_source, message_loop))); 125 new media::FFmpegDemuxerFactory(data_source, message_loop)));
126 collection->AddAudioDecoder(new media::FFmpegAudioDecoder( 126 collection->AddAudioDecoder(new media::FFmpegAudioDecoder(
127 message_loop_factory->GetMessageLoop("AudioDecoderThread"))); 127 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
128 base::Unretained(message_loop_factory),
129 "AudioDecoderThread")));
128 collection->AddVideoDecoder(new media::FFmpegVideoDecoder( 130 collection->AddVideoDecoder(new media::FFmpegVideoDecoder(
129 message_loop_factory->GetMessageLoop("VideoDecoderThread"))); 131 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
132 base::Unretained(message_loop_factory),
133 "VideoDecoderThread")));
130 134
131 // Create our video renderer and save a reference to it for painting. 135 // Create our video renderer and save a reference to it for painting.
132 g_video_renderer = new media::VideoRendererBase( 136 g_video_renderer = new media::VideoRendererBase(
133 base::Bind(&Paint, paint_message_loop, paint_cb), 137 base::Bind(&Paint, paint_message_loop, paint_cb),
134 base::Bind(&SetOpaque)); 138 base::Bind(&SetOpaque));
135 collection->AddVideoRenderer(g_video_renderer); 139 collection->AddVideoRenderer(g_video_renderer);
136 140
137 collection->AddAudioRenderer(new media::NullAudioRenderer()); 141 collection->AddAudioRenderer(new media::NullAudioRenderer());
138 142
139 // Create the pipeline and start it. 143 // Create the pipeline and start it.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // Release callback which releases video renderer. Do this before cleaning up 314 // Release callback which releases video renderer. Do this before cleaning up
311 // X below since the video renderer has some X cleanup duties as well. 315 // X below since the video renderer has some X cleanup duties as well.
312 paint_cb.Reset(); 316 paint_cb.Reset();
313 317
314 XDestroyWindow(g_display, g_window); 318 XDestroyWindow(g_display, g_window);
315 XCloseDisplay(g_display); 319 XCloseDisplay(g_display);
316 g_audio_manager = NULL; 320 g_audio_manager = NULL;
317 321
318 return 0; 322 return 0;
319 } 323 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698