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

Side by Side Diff: webkit/media/filter_helpers.cc

Issue 9702041: Do not change video decoder collection unless it is indeed a media stream. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 "webkit/media/filter_helpers.h" 5 #include "webkit/media/filter_helpers.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "media/base/filter_collection.h" 8 #include "media/base/filter_collection.h"
9 #include "media/base/message_loop_factory.h" 9 #include "media/base/message_loop_factory.h"
10 #include "media/filters/chunk_demuxer_factory.h" 10 #include "media/filters/chunk_demuxer_factory.h"
(...skipping 17 matching lines...) Expand all
28 filter_collection->AddVideoDecoder(new media::FFmpegVideoDecoder( 28 filter_collection->AddVideoDecoder(new media::FFmpegVideoDecoder(
29 base::Bind(&media::MessageLoopFactory::GetMessageLoop, 29 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
30 base::Unretained(message_loop_factory), 30 base::Unretained(message_loop_factory),
31 "VideoDecoderThread"))); 31 "VideoDecoderThread")));
32 } 32 }
33 33
34 bool BuildMediaStreamCollection(const WebKit::WebURL& url, 34 bool BuildMediaStreamCollection(const WebKit::WebURL& url,
35 MediaStreamClient* client, 35 MediaStreamClient* client,
36 media::MessageLoopFactory* message_loop_factory, 36 media::MessageLoopFactory* message_loop_factory,
37 media::FilterCollection* filter_collection) { 37 media::FilterCollection* filter_collection) {
38 if (!client) 38 if (!client)
Ami GONE FROM CHROMIUM 2012/03/14 22:00:09 I thought this was what prevented non-mediastreams
39 return false; 39 return false;
40 40
41 scoped_refptr<media::VideoDecoder> video_decoder = client->GetVideoDecoder(
42 url, message_loop_factory);
43 if (!video_decoder)
44 return false;
45
41 // Remove any "traditional" decoders (e.g. GpuVideoDecoder) from the 46 // Remove any "traditional" decoders (e.g. GpuVideoDecoder) from the
42 // collection. 47 // collection.
43 // NOTE: http://crbug.com/110800 is about replacing this ad-hockery with 48 // NOTE: http://crbug.com/110800 is about replacing this ad-hockery with
44 // something more designed. 49 // something more designed.
45 scoped_refptr<media::VideoDecoder> old_videodecoder; 50 scoped_refptr<media::VideoDecoder> old_videodecoder;
46 do { 51 do {
47 filter_collection->SelectVideoDecoder(&old_videodecoder); 52 filter_collection->SelectVideoDecoder(&old_videodecoder);
48 } while (old_videodecoder); 53 } while (old_videodecoder);
49 54
50 scoped_refptr<media::VideoDecoder> video_decoder = client->GetVideoDecoder(
51 url, message_loop_factory);
52 if (!video_decoder)
53 return false;
54
55 filter_collection->AddVideoDecoder(video_decoder); 55 filter_collection->AddVideoDecoder(video_decoder);
56 56
57 // TODO(vrk/wjia): Setting true for local_source is under the assumption 57 // TODO(vrk/wjia): Setting true for local_source is under the assumption
58 // that the MediaStream represents a local webcam. This will need to 58 // that the MediaStream represents a local webcam. This will need to
59 // change in the future when GetVideoDecoder is no longer hardcoded to 59 // change in the future when GetVideoDecoder is no longer hardcoded to
60 // only return CaptureVideoDecoders. 60 // only return CaptureVideoDecoders.
61 scoped_ptr<media::DemuxerFactory> demuxer_factory( 61 scoped_ptr<media::DemuxerFactory> demuxer_factory(
62 new media::DummyDemuxerFactory(true, false, true)); 62 new media::DummyDemuxerFactory(true, false, true));
63 filter_collection->SetDemuxerFactory(demuxer_factory.Pass()); 63 filter_collection->SetDemuxerFactory(demuxer_factory.Pass());
64 64
(...skipping 21 matching lines...) Expand all
86 media::FilterCollection* filter_collection) { 86 media::FilterCollection* filter_collection) {
87 scoped_ptr<media::DemuxerFactory> demuxer_factory( 87 scoped_ptr<media::DemuxerFactory> demuxer_factory(
88 new media::FFmpegDemuxerFactory( 88 new media::FFmpegDemuxerFactory(
89 data_source, message_loop_factory->GetMessageLoop("PipelineThread"))); 89 data_source, message_loop_factory->GetMessageLoop("PipelineThread")));
90 filter_collection->SetDemuxerFactory(demuxer_factory.Pass()); 90 filter_collection->SetDemuxerFactory(demuxer_factory.Pass());
91 91
92 AddDefaultDecodersToCollection(message_loop_factory, filter_collection); 92 AddDefaultDecodersToCollection(message_loop_factory, filter_collection);
93 } 93 }
94 94
95 } // webkit_media 95 } // webkit_media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698