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

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: Add PoolImpl destructor to make clang on the bots happy. 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') | media/base/video_frame.cc » ('J')
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 |wrapper_destroyed_cb| when the wrapper VideoFrame
173 // gets destroyed.
174 typedef base::Callback<void(const scoped_refptr<VideoFrame>&)>
175 WrapperDestroyedCB;
176
177 static scoped_refptr<VideoFrame> WrapVideoFrame(
178 const scoped_refptr<VideoFrame>& frame,
179 const WrapperDestroyedCB& wrapper_destroyed_cb);
DaleCurtis 2013/12/09 20:48:25 Rename to no_longer_needed_cb for consistency with
acolwell GONE FROM CHROMIUM 2013/12/09 21:42:11 Done.
180
172 // Creates a frame which indicates end-of-stream. 181 // Creates a frame which indicates end-of-stream.
173 static scoped_refptr<VideoFrame> CreateEOSFrame(); 182 static scoped_refptr<VideoFrame> CreateEOSFrame();
174 183
175 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). 184 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v).
176 static scoped_refptr<VideoFrame> CreateColorFrame( 185 static scoped_refptr<VideoFrame> CreateColorFrame(
177 const gfx::Size& size, 186 const gfx::Size& size,
178 uint8 y, uint8 u, uint8 v, 187 uint8 y, uint8 u, uint8 v,
179 base::TimeDelta timestamp); 188 base::TimeDelta timestamp);
180 189
181 // Allocates YV12 frame based on |size|, and sets its data to the YUV 190 // 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_; 302 base::TimeDelta timestamp_;
294 303
295 const bool end_of_stream_; 304 const bool end_of_stream_;
296 305
297 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 306 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
298 }; 307 };
299 308
300 } // namespace media 309 } // namespace media
301 310
302 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 311 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | media/base/video_frame.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698