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

Side by Side Diff: webkit/media/simple_video_frame_provider.cc

Issue 11269017: Plumb through cropped output size for VideoFrame (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Found the windows failure, and fixed it. Thanks akalin@ Created 8 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « webkit/media/android/webmediaplayer_android.cc ('k') | webkit/media/webvideoframe_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/media/simple_video_frame_provider.h" 5 #include "webkit/media/simple_video_frame_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DVLOG(1) << "SimpleVideoFrameProvider::GenerateFrame"; 59 DVLOG(1) << "SimpleVideoFrameProvider::GenerateFrame";
60 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 60 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
61 if (state_ == kStopped) 61 if (state_ == kStopped)
62 return; 62 return;
63 63
64 if (state_ == kStarted) { 64 if (state_ == kStarted) {
65 // Always allocate a new frame. 65 // Always allocate a new frame.
66 scoped_refptr<media::VideoFrame> video_frame = 66 scoped_refptr<media::VideoFrame> video_frame =
67 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 67 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
68 size_, 68 size_,
69 gfx::Rect(size_),
69 size_, 70 size_,
70 current_time_); 71 current_time_);
71 72
72 // TODO(wjia): set pixel data to pre-defined patterns if it's desired to 73 // TODO(wjia): set pixel data to pre-defined patterns if it's desired to
73 // verify frame content. 74 // verify frame content.
74 75
75 repaint_cb_.Run(video_frame); 76 repaint_cb_.Run(video_frame);
76 } 77 }
77 78
78 current_time_ += frame_duration_; 79 current_time_ += frame_duration_;
79 message_loop_proxy_->PostDelayedTask( 80 message_loop_proxy_->PostDelayedTask(
80 FROM_HERE, 81 FROM_HERE,
81 base::Bind(&SimpleVideoFrameProvider::GenerateFrame, this), 82 base::Bind(&SimpleVideoFrameProvider::GenerateFrame, this),
82 frame_duration_); 83 frame_duration_);
83 } 84 }
84 85
85 } // namespace webkit_media 86 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/android/webmediaplayer_android.cc ('k') | webkit/media/webvideoframe_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698