diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 04:47:31 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 04:47:31 +0000 |
commit | f1ca6dfe8f214f66dd7ab58d8bc30fe1e8553352 (patch) | |
tree | 5107ccd0d038153d126a1d3e842dd042944f31f3 /media/tools/player_x11 | |
parent | c2e45bf3a3207e2072c78804b012309de511275a (diff) | |
download | chromium_src-f1ca6dfe8f214f66dd7ab58d8bc30fe1e8553352.zip chromium_src-f1ca6dfe8f214f66dd7ab58d8bc30fe1e8553352.tar.gz chromium_src-f1ca6dfe8f214f66dd7ab58d8bc30fe1e8553352.tar.bz2 |
Take advantage of the new Pass() machinery on scoped_ptr{,_malloc}.
Pass() was announced in
https://groups.google.com/a/chromium.org/d/topic/chromium-dev/RTd7rNxHjqk/discussion
This CL replaces comments about ownership transfer (in all files whose paths
contain media/) with the explicit passing of the appropriate scoper.
The exceptions that are not touched by this CL:
- scoped_refptr<> doesn't support Pass() and so is untouched.
- media/audio code defines its own callback machinery, mimicking the old-style
callbacks (pass by pointer, explicit deletes). I think that whole pile needs
to be replaced with new-style (Bind) callbacks, so left it alone for now.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/9015015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools/player_x11')
-rw-r--r-- | media/tools/player_x11/player_x11.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc index ee4d9ab..11188db 100644 --- a/media/tools/player_x11/player_x11.cc +++ b/media/tools/player_x11/player_x11.cc @@ -113,8 +113,9 @@ bool InitPipeline(MessageLoop* message_loop, scoped_ptr<media::FilterCollection> collection( new media::FilterCollection()); collection->SetDemuxerFactory( - new media::FFmpegDemuxerFactory( - new media::FileDataSourceFactory(), message_loop)); + scoped_ptr<media::DemuxerFactory>( + new media::FFmpegDemuxerFactory(scoped_ptr<media::DataSourceFactory>( + new media::FileDataSourceFactory()), message_loop))); collection->AddAudioDecoder(new media::FFmpegAudioDecoder( message_loop_factory->GetMessageLoop("AudioDecoderThread"))); collection->AddVideoDecoder(new media::FFmpegVideoDecoder( @@ -136,7 +137,7 @@ bool InitPipeline(MessageLoop* message_loop, // Create the pipeline and start it. *pipeline = new media::PipelineImpl(message_loop, new media::MediaLog()); media::PipelineStatusNotification note; - (*pipeline)->Start(collection.release(), filename, note.Callback()); + (*pipeline)->Start(collection.Pass(), filename, note.Callback()); // Wait until the pipeline is fully initialized. note.Wait(); |