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

Unified Diff: media/base/video_frame.cc

Issue 10824141: Remove VideoDecoder::natural_size() & added VideoFrame::natural_size(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 9e5ff7a26dfaf09d359479463233c69fcca0145c..7b78467fc84c64d42d68a87ebdcf75705327da3b 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -21,10 +21,11 @@ scoped_refptr<VideoFrame> VideoFrame::CreateFrame(
VideoFrame::Format format,
size_t width,
size_t height,
+ const gfx::Size& natural_size,
base::TimeDelta timestamp) {
DCHECK(IsValidConfig(format, width, height));
scoped_refptr<VideoFrame> frame(new VideoFrame(
- format, width, height, timestamp));
+ format, width, height, natural_size, timestamp));
switch (format) {
case VideoFrame::RGB32:
frame->AllocateRGB(4u);
@@ -57,10 +58,11 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
uint32 texture_target,
size_t width,
size_t height,
+ const gfx::Size& natural_size,
base::TimeDelta timestamp,
const base::Closure& no_longer_needed) {
scoped_refptr<VideoFrame> frame(
- new VideoFrame(NATIVE_TEXTURE, width, height, timestamp));
+ new VideoFrame(NATIVE_TEXTURE, width, height, natural_size, timestamp));
frame->texture_id_ = texture_id;
frame->texture_target_ = texture_target;
frame->texture_no_longer_needed_ = no_longer_needed;
@@ -70,7 +72,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
// static
scoped_refptr<VideoFrame> VideoFrame::CreateEmptyFrame() {
return new VideoFrame(
- VideoFrame::EMPTY, 0, 0, base::TimeDelta());
+ VideoFrame::EMPTY, 0, 0, gfx::Size(), base::TimeDelta());
}
// static
@@ -81,7 +83,8 @@ scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(int width, int height) {
// Create our frame.
const base::TimeDelta kZero;
scoped_refptr<VideoFrame> frame =
- VideoFrame::CreateFrame(VideoFrame::YV12, width, height, kZero);
+ VideoFrame::CreateFrame(VideoFrame::YV12, width, height,
+ gfx::Size(width, height), kZero);
// Now set the data to YUV(0,128,128).
const uint8 kBlackY = 0x00;
@@ -165,10 +168,12 @@ void VideoFrame::AllocateYUV() {
VideoFrame::VideoFrame(VideoFrame::Format format,
size_t width,
size_t height,
+ const gfx::Size& natural_size,
base::TimeDelta timestamp)
: format_(format),
width_(width),
height_(height),
+ natural_size_(natural_size),
texture_id_(0),
texture_target_(0),
timestamp_(timestamp) {

Powered by Google App Engine
This is Rietveld 408576698