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

Unified Diff: media/cdm/cdm_helpers.h

Issue 1673383002: Add allocator interface for use by cdm_adapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add MEDIA_CDM_EXPORT for Windows Created 4 years, 10 months 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 | « media/cdm/cdm_buffer_impl.cc ('k') | media/cdm/simple_cdm_allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/cdm_helpers.h
diff --git a/media/cdm/cdm_helpers.h b/media/cdm/cdm_helpers.h
index ea813767938bf12a109d35a1e43085d60f8e7021..6713d12161a31d33120ffd4dfd9c0194f2143ac8 100644
--- a/media/cdm/cdm_helpers.h
+++ b/media/cdm/cdm_helpers.h
@@ -7,11 +7,23 @@
#include <stdint.h>
+#include "base/compiler_specific.h"
#include "base/macros.h"
#include "media/cdm/api/content_decryption_module.h"
+#if !defined(USE_PPAPI_CDM_ADAPTER)
+#include "base/memory/ref_counted.h"
+#include "media/base/media_export.h"
+#include "ui/gfx/geometry/size.h"
+#define MEDIA_CDM_EXPORT MEDIA_EXPORT
+#else
+#define MEDIA_CDM_EXPORT
+#endif
+
namespace media {
+class VideoFrame;
+
class DecryptedBlockImpl : public cdm::DecryptedBlock {
public:
DecryptedBlockImpl();
@@ -30,10 +42,11 @@ class DecryptedBlockImpl : public cdm::DecryptedBlock {
DISALLOW_COPY_AND_ASSIGN(DecryptedBlockImpl);
};
-class VideoFrameImpl : public cdm::VideoFrame {
+class MEDIA_CDM_EXPORT VideoFrameImpl
+ : NON_EXPORTED_BASE(public cdm::VideoFrame) {
public:
VideoFrameImpl();
- ~VideoFrameImpl() final;
+ ~VideoFrameImpl() override;
// cdm::VideoFrame implementation.
void SetFormat(cdm::VideoFormat format) final;
@@ -49,7 +62,21 @@ class VideoFrameImpl : public cdm::VideoFrame {
void SetTimestamp(int64_t timestamp) final;
int64_t Timestamp() const final;
- private:
+#if !defined(USE_PPAPI_CDM_ADAPTER)
+ // Create a media::VideoFrame based on the data contained in this object.
+ // |natural_size| is the visible portion of the video frame, and is
+ // provided separately as it comes from the configuration, not the CDM.
+ // The returned object will own |frame_buffer_| and will be responsible for
+ // calling Destroy() on it when the data is no longer needed.
+ // Preconditions:
+ // - |this| needs to be properly initialized.
+ // Postconditions:
+ // - |frame_buffer_| will be NULL (now owned by returned media::VideoFrame).
+ virtual scoped_refptr<media::VideoFrame> TransformToVideoFrame(
+ gfx::Size natural_size) = 0;
+#endif
+
+ protected:
// The video buffer format.
cdm::VideoFormat format_;
@@ -70,6 +97,7 @@ class VideoFrameImpl : public cdm::VideoFrame {
// Presentation timestamp in microseconds.
int64_t timestamp_;
+ private:
DISALLOW_COPY_AND_ASSIGN(VideoFrameImpl);
};
« no previous file with comments | « media/cdm/cdm_buffer_impl.cc ('k') | media/cdm/simple_cdm_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698