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

Side by Side Diff: media/base/video_frame.h

Issue 101623006: Created VideoFramePool to avoid unnecessary VideoFrame alloc/free. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change SimpleFormatChange test so it can pass on Android. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('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 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_
6 #define MEDIA_BASE_VIDEO_FRAME_H_ 6 #define MEDIA_BASE_VIDEO_FRAME_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/md5.h" 9 #include "base/md5.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const gfx::Size& natural_size, 162 const gfx::Size& natural_size,
163 int32 y_stride, 163 int32 y_stride,
164 int32 u_stride, 164 int32 u_stride,
165 int32 v_stride, 165 int32 v_stride,
166 uint8* y_data, 166 uint8* y_data,
167 uint8* u_data, 167 uint8* u_data,
168 uint8* v_data, 168 uint8* v_data,
169 base::TimeDelta timestamp, 169 base::TimeDelta timestamp,
170 const base::Closure& no_longer_needed_cb); 170 const base::Closure& no_longer_needed_cb);
171 171
172 // Wraps |frame| and calls |no_longer_needed_cb| when the wrapper VideoFrame
173 // gets destroyed.
174 static scoped_refptr<VideoFrame> WrapVideoFrame(
175 const scoped_refptr<VideoFrame>& frame,
176 const base::Closure& no_longer_needed_cb);
177
172 // Creates a frame which indicates end-of-stream. 178 // Creates a frame which indicates end-of-stream.
173 static scoped_refptr<VideoFrame> CreateEOSFrame(); 179 static scoped_refptr<VideoFrame> CreateEOSFrame();
174 180
175 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). 181 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v).
176 static scoped_refptr<VideoFrame> CreateColorFrame( 182 static scoped_refptr<VideoFrame> CreateColorFrame(
177 const gfx::Size& size, 183 const gfx::Size& size,
178 uint8 y, uint8 u, uint8 v, 184 uint8 y, uint8 u, uint8 v,
179 base::TimeDelta timestamp); 185 base::TimeDelta timestamp);
180 186
181 // Allocates YV12 frame based on |size|, and sets its data to the YUV 187 // Allocates YV12 frame based on |size|, and sets its data to the YUV
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 base::TimeDelta timestamp_; 299 base::TimeDelta timestamp_;
294 300
295 const bool end_of_stream_; 301 const bool end_of_stream_;
296 302
297 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 303 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
298 }; 304 };
299 305
300 } // namespace media 306 } // namespace media
301 307
302 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 308 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698