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

Unified Diff: webkit/media/crypto/ppapi/cdm_video_decoder.h

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 side-by-side diff with in-line comments
Download patch
Index: webkit/media/crypto/ppapi/cdm_video_decoder.h
diff --git a/webkit/media/crypto/ppapi/cdm_video_decoder.h b/webkit/media/crypto/ppapi/cdm_video_decoder.h
new file mode 100644
index 0000000000000000000000000000000000000000..7173498733f974e62d13feffc02f2569cef8b86d
--- /dev/null
+++ b/webkit/media/crypto/ppapi/cdm_video_decoder.h
@@ -0,0 +1,41 @@
+// 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.
+
+#ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_
+#define WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_
+
+#include "base/basictypes.h"
+#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.
+#include "base/memory/scoped_ptr.h"
+#include "webkit/media/crypto/ppapi/content_decryption_module.h"
+
+namespace webkit_media {
ddorwin 2012/11/17 02:56:22 Should this be in a cdm namespace instead? It's no
Tom Finegan 2012/11/17 04:35:06 All of the decoder wrappers are in webkit_media. I
ddorwin 2012/12/04 04:22:37 SG. Please add a TODO or story. Either is fine.
Tom Finegan 2012/12/04 20:59:40 Done. (added story)
+
+class CdmVideoDecoder {
+ public:
+ virtual ~CdmVideoDecoder() {}
+ virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0;
+ virtual void Deinitialize() = 0;
+ virtual void Reset() = 0;
+
+ // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and
+ // returns |cdm::kSuccess| when an output frame is available. Returns
+ // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output
+ // frame. Returns |cdm::kDecodeError| when decoding fails.
+ virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame,
+ int32_t compressed_frame_size,
+ int64_t timestamp,
+ cdm::VideoFrame* decoded_frame) = 0;
+};
+
+// Initializes appropriate video decoder based on GYP flags and the value of
+// |config.codec|. Returns a scoped_ptr containing a non-null initialized
+// CdmVideoDecoder* upon success.
+scoped_ptr<CdmVideoDecoder> InitializeVideoDecoder(
+ cdm::Allocator* allocator,
+ const cdm::VideoDecoderConfig& config);
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_

Powered by Google App Engine
This is Rietveld 408576698