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

Side by Side Diff: webkit/media/crypto/ppapi/cdm_video_decoder_initializer.cc

Issue 11316045: Add a libvpx video decoder to ClearKeyCdm and move the fake video decoder to its own class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up, and deal with some of the preprocessor evil in ClearKeyCdm. Created 8 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
ddorwin 2012/11/17 02:56:22 It's odd to have a .cc without a matching header.
Tom Finegan 2012/11/17 04:35:06 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h"
ddorwin 2012/11/17 02:56:22 Why is this needed?
Tom Finegan 2012/11/17 04:35:06 Done.
7 #include "base/memory/scoped_ptr.h"
8 #include "webkit/media/crypto/ppapi/cdm_video_decoder.h"
9 #include "webkit/media/crypto/ppapi/content_decryption_module.h"
10
11 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
12 #include "webkit/media/crypto/ppapi/fake_cdm_video_decoder.h"
13 #endif
14
15 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER)
16 #include "webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h"
17 #endif
18
19 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER)
20 #include "webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.h"
21 #endif
22
23 namespace webkit_media {
24
25 scoped_ptr<CdmVideoDecoder> InitializeVideoDecoder(
26 cdm::Allocator* allocator,
27 const cdm::VideoDecoderConfig& config) {
28 scoped_ptr<CdmVideoDecoder> video_decoder;
29 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
30 video_decoder.reset(new FakeCdmVideoDecoder(allocator));
31
32 if (!video_decoder->Initialize(config))
33 video_decoder.reset();
34 #else
35
36 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER)
37 if (config.codec == cdm::VideoDecoderConfig::kCodecVp8) {
38 video_decoder.reset(new LibvpxCdmVideoDecoder(allocator));
39
40 if (!video_decoder->Initialize(config))
41 video_decoder.reset();
42
43 return video_decoder.Pass();
44 }
45 #endif
46
47 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER)
48 video_decoder.reset(new FFmpegCdmVideoDecoder(allocator));
49
50 if (!video_decoder->Initialize(config))
51 video_decoder.reset();
52 #endif
53
54 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
55
56 return video_decoder.Pass();
57 }
58
59 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698