OLD | NEW |
---|---|
(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 | |
OLD | NEW |