Index: media/base/video_frame.cc |
=================================================================== |
--- media/base/video_frame.cc (revision 113907) |
+++ media/base/video_frame.cc (working copy) |
@@ -17,8 +17,9 @@ |
base::TimeDelta duration) { |
DCHECK(width > 0 && height > 0); |
DCHECK(width * height < 100000000); |
- scoped_refptr<VideoFrame> frame(new VideoFrame( |
- format, width, height, timestamp, duration)); |
+ scoped_refptr<VideoFrame> frame(new VideoFrame(format, width, height)); |
+ frame->SetTimestamp(timestamp); |
+ frame->SetDuration(duration); |
switch (format) { |
case VideoFrame::RGB555: |
case VideoFrame::RGB565: |
@@ -46,25 +47,8 @@ |
} |
// static |
-scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture( |
- uint32 texture_id, |
- size_t width, |
- size_t height, |
- base::TimeDelta timestamp, |
- base::TimeDelta duration, |
- const base::Closure& no_longer_needed) { |
- scoped_refptr<VideoFrame> frame( |
- new VideoFrame(NATIVE_TEXTURE, width, height, timestamp, duration)); |
- frame->planes_ = 0; |
- frame->texture_id_ = texture_id; |
- frame->texture_no_longer_needed_ = no_longer_needed; |
- return frame; |
-} |
- |
-// static |
scoped_refptr<VideoFrame> VideoFrame::CreateEmptyFrame() { |
- return new VideoFrame( |
- VideoFrame::EMPTY, 0, 0, base::TimeDelta(), base::TimeDelta()); |
+ return new VideoFrame(VideoFrame::EMPTY, 0, 0); |
} |
// static |
@@ -154,26 +138,16 @@ |
VideoFrame::VideoFrame(VideoFrame::Format format, |
size_t width, |
- size_t height, |
- base::TimeDelta timestamp, |
- base::TimeDelta duration) |
+ size_t height) |
: format_(format), |
width_(width), |
height_(height), |
- planes_(0), |
- texture_id_(0) { |
- SetTimestamp(timestamp); |
- SetDuration(duration); |
+ planes_(0) { |
memset(&strides_, 0, sizeof(strides_)); |
memset(&data_, 0, sizeof(data_)); |
} |
VideoFrame::~VideoFrame() { |
- if (format_ == NATIVE_TEXTURE && !texture_no_longer_needed_.is_null()) { |
- texture_no_longer_needed_.Run(); |
- texture_no_longer_needed_.Reset(); |
- } |
- |
// In multi-plane allocations, only a single block of memory is allocated |
// on the heap, and other |data| pointers point inside the same, single block |
// so just delete index 0. |
@@ -193,10 +167,6 @@ |
case YV16: |
return plane == kYPlane || plane == kUPlane || plane == kVPlane; |
- case NATIVE_TEXTURE: |
- NOTREACHED() << "NATIVE_TEXTUREs don't use plane-related methods!"; |
- return false; |
- |
default: |
break; |
} |
@@ -266,12 +236,6 @@ |
return data_[plane]; |
} |
-uint32 VideoFrame::texture_id() const { |
- DCHECK_EQ(format_, NATIVE_TEXTURE); |
- DCHECK_EQ(planes_, 0U); |
- return texture_id_; |
-} |
- |
bool VideoFrame::IsEndOfStream() const { |
return format_ == VideoFrame::EMPTY; |
} |
Property changes on: media/base/video_frame.cc |
___________________________________________________________________ |
Added: svn:mergeinfo |