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

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

Issue 14348007: Reland: Remove reference counting from media::VideoDecoder and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 8 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
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | webkit/media/filter_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 collection->SetDemuxer(new media::FFmpegDemuxer(message_loop, data_source,
115 need_key_cb)); 115 need_key_cb));
116 collection->GetVideoDecoders()->push_back(new media::FFmpegVideoDecoder(
117 message_loop));
118 116
119 // Create our video renderer and save a reference to it for painting. 117
118 ScopedVector<media::VideoDecoder> video_decoders;
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 media::SetDecryptorReadyCB(), 123 media::SetDecryptorReadyCB(),
123 base::Bind(&Paint, paint_message_loop, paint_cb), 124 base::Bind(&Paint, paint_message_loop, paint_cb),
124 base::Bind(&SetOpaque), 125 base::Bind(&SetOpaque),
125 true)); 126 true));
126 collection->SetVideoRenderer(video_renderer.Pass()); 127 collection->SetVideoRenderer(video_renderer.Pass());
127 128
128 ScopedVector<media::AudioDecoder> audio_decoders; 129 ScopedVector<media::AudioDecoder> audio_decoders;
129 audio_decoders.push_back(new media::FFmpegAudioDecoder(message_loop)); 130 audio_decoders.push_back(new media::FFmpegAudioDecoder(message_loop));
130 scoped_ptr<media::AudioRenderer> audio_renderer(new media::AudioRendererImpl( 131 scoped_ptr<media::AudioRenderer> audio_renderer(new media::AudioRendererImpl(
131 message_loop, 132 message_loop,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // Release callback which releases video renderer. Do this before cleaning up 301 // Release callback which releases video renderer. Do this before cleaning up
301 // 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.
302 paint_cb.Reset(); 303 paint_cb.Reset();
303 304
304 XDestroyWindow(g_display, g_window); 305 XDestroyWindow(g_display, g_window);
305 XCloseDisplay(g_display); 306 XCloseDisplay(g_display);
306 g_audio_manager = NULL; 307 g_audio_manager = NULL;
307 308
308 return 0; 309 return 0;
309 } 310 }
OLDNEW
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | webkit/media/filter_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698