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

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

Issue 11468018: Add libvpx wrapper to media to support VP9 video decoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add work around for lack of VP9 in ffmpeg. Created 8 years 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
« media/filters/vpx_video_decoder.cc ('K') | « media/media.gyp ('k') | 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 "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"
11 #include "media/filters/chunk_demuxer.h" 11 #include "media/filters/chunk_demuxer.h"
12 #include "media/filters/decrypting_audio_decoder.h" 12 #include "media/filters/decrypting_audio_decoder.h"
13 #include "media/filters/decrypting_video_decoder.h" 13 #include "media/filters/decrypting_video_decoder.h"
14 #include "media/filters/dummy_demuxer.h" 14 #include "media/filters/dummy_demuxer.h"
15 #include "media/filters/ffmpeg_audio_decoder.h" 15 #include "media/filters/ffmpeg_audio_decoder.h"
16 #include "media/filters/ffmpeg_demuxer.h" 16 #include "media/filters/ffmpeg_demuxer.h"
17 #include "media/filters/ffmpeg_video_decoder.h" 17 #include "media/filters/ffmpeg_video_decoder.h"
18 #include "media/filters/opus_audio_decoder.h" 18 #include "media/filters/opus_audio_decoder.h"
19 #include "media/filters/vpx_video_decoder.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
20 #include "webkit/media/crypto/proxy_decryptor.h" 21 #include "webkit/media/crypto/proxy_decryptor.h"
21 #include "webkit/media/media_stream_client.h" 22 #include "webkit/media/media_stream_client.h"
22 23
23 namespace webkit_media { 24 namespace webkit_media {
24 25
25 // Constructs and adds the default audio/video decoders to |filter_collection|. 26 // Constructs and adds the default audio/video decoders to |filter_collection|.
26 // Note that decoders in the |filter_collection| are ordered. The first 27 // Note that decoders in the |filter_collection| are ordered. The first
27 // audio/video decoder in the |filter_collection| that supports the input 28 // audio/video decoder in the |filter_collection| that supports the input
28 // audio/video stream will be selected as the audio/video decoder in the media 29 // audio/video stream will be selected as the audio/video decoder in the media
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // encrypted. For now FFmpegVideoDecoder can also do decryption 64 // encrypted. For now FFmpegVideoDecoder can also do decryption
64 // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode) 65 // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode)
65 // to FFmpegVideoDecoder. Fix this order when we move decryption out of 66 // to FFmpegVideoDecoder. Fix this order when we move decryption out of
66 // FFmpegVideoDecoder. 67 // FFmpegVideoDecoder.
67 filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder); 68 filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder);
68 } 69 }
69 70
70 scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder = 71 scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder =
71 new media::FFmpegVideoDecoder(message_loop, proxy_decryptor); 72 new media::FFmpegVideoDecoder(message_loop, proxy_decryptor);
72 filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder); 73 filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);
74
75 if (cmd_line->HasSwitch(switches::kEnableVp9Playback)) {
76 scoped_refptr<media::VpxVideoDecoder> vpx_video_decoder =
77 new media::VpxVideoDecoder(message_loop);
78 filter_collection->GetVideoDecoders()->push_back(vpx_video_decoder);
79 }
73 } 80 }
74 81
75 bool BuildMediaStreamCollection( 82 bool BuildMediaStreamCollection(
76 const WebKit::WebURL& url, 83 const WebKit::WebURL& url,
77 MediaStreamClient* client, 84 MediaStreamClient* client,
78 const scoped_refptr<base::MessageLoopProxy>& message_loop, 85 const scoped_refptr<base::MessageLoopProxy>& message_loop,
79 media::FilterCollection* filter_collection) { 86 media::FilterCollection* filter_collection) {
80 if (!client) 87 if (!client)
81 return false; 88 return false;
82 89
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 media::FilterCollection* filter_collection, 126 media::FilterCollection* filter_collection,
120 ProxyDecryptor* proxy_decryptor) { 127 ProxyDecryptor* proxy_decryptor) {
121 filter_collection->SetDemuxer(new media::FFmpegDemuxer( 128 filter_collection->SetDemuxer(new media::FFmpegDemuxer(
122 message_loop, data_source)); 129 message_loop, data_source));
123 130
124 AddDefaultDecodersToCollection(message_loop, filter_collection, 131 AddDefaultDecodersToCollection(message_loop, filter_collection,
125 proxy_decryptor); 132 proxy_decryptor);
126 } 133 }
127 134
128 } // webkit_media 135 } // webkit_media
OLDNEW
« media/filters/vpx_video_decoder.cc ('K') | « media/media.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698