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 "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 "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "media/base/filter_collection.h" | 9 #include "media/base/filter_collection.h" |
10 #include "media/base/media_switches.h" | 10 #include "media/base/media_switches.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 new media::FFmpegAudioDecoder(message_loop); | 34 new media::FFmpegAudioDecoder(message_loop); |
35 filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder); | 35 filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder); |
36 | 36 |
37 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 37 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
38 if (cmd_line->HasSwitch(switches::kEnableOpusPlayback)) { | 38 if (cmd_line->HasSwitch(switches::kEnableOpusPlayback)) { |
39 scoped_refptr<media::OpusAudioDecoder> opus_audio_decoder = | 39 scoped_refptr<media::OpusAudioDecoder> opus_audio_decoder = |
40 new media::OpusAudioDecoder(message_loop); | 40 new media::OpusAudioDecoder(message_loop); |
41 filter_collection->GetAudioDecoders()->push_back(opus_audio_decoder); | 41 filter_collection->GetAudioDecoders()->push_back(opus_audio_decoder); |
42 } | 42 } |
43 | 43 |
| 44 if (cmd_line->HasSwitch(switches::kEnableVp9Playback) || |
| 45 cmd_line->HasSwitch(switches::kEnableVp8AlphaPlayback)) { |
| 46 scoped_refptr<media::VpxVideoDecoder> vpx_video_decoder = |
| 47 new media::VpxVideoDecoder(message_loop); |
| 48 filter_collection->GetVideoDecoders()->push_back(vpx_video_decoder); |
| 49 } |
| 50 |
44 scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder = | 51 scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder = |
45 new media::FFmpegVideoDecoder(message_loop); | 52 new media::FFmpegVideoDecoder(message_loop); |
46 filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder); | 53 filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder); |
47 | 54 |
48 if (cmd_line->HasSwitch(switches::kEnableVp9Playback)) { | |
49 scoped_refptr<media::VpxVideoDecoder> vpx_video_decoder = | |
50 new media::VpxVideoDecoder(message_loop); | |
51 filter_collection->GetVideoDecoders()->push_back(vpx_video_decoder); | |
52 } | |
53 } | 55 } |
54 | 56 |
55 bool BuildMediaStreamCollection( | 57 bool BuildMediaStreamCollection( |
56 const WebKit::WebURL& url, | 58 const WebKit::WebURL& url, |
57 MediaStreamClient* client, | 59 MediaStreamClient* client, |
58 const scoped_refptr<base::MessageLoopProxy>& message_loop, | 60 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
59 media::FilterCollection* filter_collection) { | 61 media::FilterCollection* filter_collection) { |
60 if (!client) | 62 if (!client) |
61 return false; | 63 return false; |
62 | 64 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const scoped_refptr<media::DataSource>& data_source, | 97 const scoped_refptr<media::DataSource>& data_source, |
96 const scoped_refptr<base::MessageLoopProxy>& message_loop, | 98 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
97 media::FilterCollection* filter_collection) { | 99 media::FilterCollection* filter_collection) { |
98 filter_collection->SetDemuxer(new media::FFmpegDemuxer( | 100 filter_collection->SetDemuxer(new media::FFmpegDemuxer( |
99 message_loop, data_source)); | 101 message_loop, data_source)); |
100 | 102 |
101 AddDefaultDecodersToCollection(message_loop, filter_collection); | 103 AddDefaultDecodersToCollection(message_loop, filter_collection); |
102 } | 104 } |
103 | 105 |
104 } // webkit_media | 106 } // webkit_media |
OLD | NEW |