summaryrefslogtreecommitdiffstats
path: root/media/base/video_frame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/base/video_frame.cc')
-rw-r--r--media/base/video_frame.cc29
1 files changed, 7 insertions, 22 deletions
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 857af70..e7da94e 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -50,21 +50,26 @@ void VideoFrame::CreateFrame(VideoFrame::Format format,
*frame_out = alloc_worked ? frame : NULL;
}
-void VideoFrame::CreateFrameExternal(VideoFrame::Format format,
+void VideoFrame::CreateFrameExternal(SurfaceType type,
+ Format format,
size_t width,
size_t height,
+ size_t planes,
uint8* const data[kMaxPlanes],
const int32 strides[kMaxPlanes],
base::TimeDelta timestamp,
base::TimeDelta duration,
+ void* private_buffer,
scoped_refptr<VideoFrame>* frame_out) {
DCHECK(frame_out);
scoped_refptr<VideoFrame> frame =
- new VideoFrame(VideoFrame::TYPE_SYSTEM_MEMORY, format, width, height);
+ new VideoFrame(type, format, width, height);
if (frame) {
frame->SetTimestamp(timestamp);
frame->SetDuration(duration);
frame->external_memory_ = true;
+ frame->planes_ = planes;
+ frame->private_buffer_ = private_buffer;
for (size_t i = 0; i < kMaxPlanes; ++i) {
frame->data_[i] = data[i];
frame->strides_[i] = strides[i];
@@ -117,26 +122,6 @@ void VideoFrame::CreateBlackFrame(int width, int height,
*frame_out = frame;
}
-// static
-void VideoFrame::CreatePrivateFrame(VideoFrame::SurfaceType type,
- VideoFrame::Format format,
- size_t width,
- size_t height,
- base::TimeDelta timestamp,
- base::TimeDelta duration,
- void* private_buffer,
- scoped_refptr<VideoFrame>* frame_out) {
- DCHECK(frame_out);
- scoped_refptr<VideoFrame> frame =
- new VideoFrame(type, format, width, height);
- if (frame) {
- frame->SetTimestamp(timestamp);
- frame->SetDuration(duration);
- frame->private_buffer_ = private_buffer;
- }
- *frame_out = frame;
-}
-
static inline size_t RoundUp(size_t value, size_t alignment) {
// Check that |alignment| is a power of 2.
DCHECK((alignment + (alignment - 1)) == (alignment | (alignment - 1)));