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

Unified Diff: webkit/media/crypto/ppapi/cdm_video_decoder.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: Rebase, fix incorrect DCHECK and fix include order. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/crypto/ppapi/cdm_video_decoder.h ('k') | webkit/media/crypto/ppapi/clear_key_cdm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/ppapi/cdm_video_decoder.cc
diff --git a/webkit/media/crypto/ppapi/cdm_video_decoder.cc b/webkit/media/crypto/ppapi/cdm_video_decoder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eb7fe16472cfc147dae72dc0d789d5636e119f99
--- /dev/null
+++ b/webkit/media/crypto/ppapi/cdm_video_decoder.cc
@@ -0,0 +1,58 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "webkit/media/crypto/ppapi/cdm_video_decoder.h"
+#include "webkit/media/crypto/ppapi/content_decryption_module.h"
+
+#if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
+#include "webkit/media/crypto/ppapi/fake_cdm_video_decoder.h"
+#endif
+
+#if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER)
+#include "webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h"
+#endif
+
+#if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER)
+#include "webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.h"
+#endif
+
+namespace webkit_media {
+
+scoped_ptr<CdmVideoDecoder> CreateVideoDecoder(
+ cdm::Allocator* allocator,
+ const cdm::VideoDecoderConfig& config) {
+ scoped_ptr<CdmVideoDecoder> video_decoder;
+#if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
+ video_decoder.reset(new FakeCdmVideoDecoder(allocator));
+
+ if (!video_decoder->Initialize(config))
+ video_decoder.reset();
+#else
+
+#if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER)
+ if (config.codec == cdm::VideoDecoderConfig::kCodecVp8) {
+ video_decoder.reset(new LibvpxCdmVideoDecoder(allocator));
+
+ if (!video_decoder->Initialize(config))
+ video_decoder.reset();
+
+ return video_decoder.Pass();
+ }
+#endif
+
+#if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER)
+ video_decoder.reset(new FFmpegCdmVideoDecoder(allocator));
+
+ if (!video_decoder->Initialize(config))
+ video_decoder.reset();
+#endif
+
+#endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
+
+ return video_decoder.Pass();
+}
+
+} // namespace webkit_media
« no previous file with comments | « webkit/media/crypto/ppapi/cdm_video_decoder.h ('k') | webkit/media/crypto/ppapi/clear_key_cdm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698