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

Unified Diff: media/cdm/cdm_video_frame.h

Issue 1673383002: Add allocator interface for use by cdm_adapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simple classes 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
Index: media/cdm/cdm_video_frame.h
diff --git a/media/cdm/cdm_helpers.h b/media/cdm/cdm_video_frame.h
similarity index 54%
copy from media/cdm/cdm_helpers.h
copy to media/cdm/cdm_video_frame.h
index ea813767938bf12a109d35a1e43085d60f8e7021..52947ececc7b1806f4147c64882b8ead53227dd7 100644
--- a/media/cdm/cdm_helpers.h
+++ b/media/cdm/cdm_video_frame.h
@@ -1,39 +1,25 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 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 MEDIA_CDM_CDM_HELPERS_H_
-#define MEDIA_CDM_CDM_HELPERS_H_
+#ifndef MEDIA_CDM_CDM_VIDEO_FRAME_H_
+#define MEDIA_CDM_CDM_VIDEO_FRAME_H_
#include <stdint.h>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "media/cdm/api/content_decryption_module.h"
+#include "ui/gfx/geometry/size.h"
namespace media {
-class DecryptedBlockImpl : public cdm::DecryptedBlock {
- public:
- DecryptedBlockImpl();
- ~DecryptedBlockImpl() final;
-
- // cdm::DecryptedBlock implementation.
- void SetDecryptedBuffer(cdm::Buffer* buffer) final;
- cdm::Buffer* DecryptedBuffer() final;
- void SetTimestamp(int64_t timestamp) final;
- int64_t Timestamp() const final;
-
- private:
- cdm::Buffer* buffer_;
- int64_t timestamp_;
+class VideoFrame;
- DISALLOW_COPY_AND_ASSIGN(DecryptedBlockImpl);
-};
-
-class VideoFrameImpl : public cdm::VideoFrame {
+class CdmVideoFrame : public cdm::VideoFrame {
public:
- VideoFrameImpl();
- ~VideoFrameImpl() final;
+ CdmVideoFrame();
+ ~CdmVideoFrame() override;
// cdm::VideoFrame implementation.
void SetFormat(cdm::VideoFormat format) final;
@@ -49,7 +35,11 @@ class VideoFrameImpl : public cdm::VideoFrame {
void SetTimestamp(int64_t timestamp) final;
int64_t Timestamp() const final;
- private:
+ // Create a media::VideoFrame based on the data contained in this object.
+ virtual scoped_refptr<media::VideoFrame> CreateVideoFrame(
+ gfx::Size natural_size) = 0;
xhwang 2016/02/11 19:24:14 After this call, what's the state of |this|? Can w
jrummell 2016/02/11 22:08:16 Updated comment. FrameBuffer is transferred to bec
+
+ protected:
// The video buffer format.
cdm::VideoFormat format_;
@@ -70,29 +60,10 @@ class VideoFrameImpl : public cdm::VideoFrame {
// Presentation timestamp in microseconds.
int64_t timestamp_;
- DISALLOW_COPY_AND_ASSIGN(VideoFrameImpl);
-};
-
-class AudioFramesImpl : public cdm::AudioFrames {
- public:
- AudioFramesImpl();
- ~AudioFramesImpl() final;
-
- // cdm::AudioFrames implementation.
- void SetFrameBuffer(cdm::Buffer* buffer) final;
- cdm::Buffer* FrameBuffer() final;
- void SetFormat(cdm::AudioFormat format) final;
- cdm::AudioFormat Format() const final;
-
- cdm::Buffer* PassFrameBuffer();
-
private:
- cdm::Buffer* buffer_;
- cdm::AudioFormat format_;
-
- DISALLOW_COPY_AND_ASSIGN(AudioFramesImpl);
+ DISALLOW_COPY_AND_ASSIGN(CdmVideoFrame);
};
} // namespace media
-#endif // MEDIA_CDM_CDM_HELPERS_H_
+#endif // MEDIA_CDM_CDM_VIDEO_FRAME_H_

Powered by Google App Engine
This is Rietveld 408576698