| OLD | NEW |
| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 uint8* v_data, | 148 uint8* v_data, |
| 149 base::TimeDelta timestamp, | 149 base::TimeDelta timestamp, |
| 150 const base::Closure& no_longer_needed_cb); | 150 const base::Closure& no_longer_needed_cb); |
| 151 | 151 |
| 152 // Wraps |frame| and calls |no_longer_needed_cb| when the wrapper VideoFrame | 152 // Wraps |frame| and calls |no_longer_needed_cb| when the wrapper VideoFrame |
| 153 // gets destroyed. |visible_rect| must be a sub rect within | 153 // gets destroyed. |visible_rect| must be a sub rect within |
| 154 // frame->visible_rect(). | 154 // frame->visible_rect(). |
| 155 static scoped_refptr<VideoFrame> WrapVideoFrame( | 155 static scoped_refptr<VideoFrame> WrapVideoFrame( |
| 156 const scoped_refptr<VideoFrame>& frame, | 156 const scoped_refptr<VideoFrame>& frame, |
| 157 const gfx::Rect& visible_rect, | 157 const gfx::Rect& visible_rect, |
| 158 const gfx::Size& natural_size, |
| 158 const base::Closure& no_longer_needed_cb); | 159 const base::Closure& no_longer_needed_cb); |
| 159 | 160 |
| 160 // Creates a frame which indicates end-of-stream. | 161 // Creates a frame which indicates end-of-stream. |
| 161 static scoped_refptr<VideoFrame> CreateEOSFrame(); | 162 static scoped_refptr<VideoFrame> CreateEOSFrame(); |
| 162 | 163 |
| 163 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). | 164 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). |
| 164 static scoped_refptr<VideoFrame> CreateColorFrame( | 165 static scoped_refptr<VideoFrame> CreateColorFrame( |
| 165 const gfx::Size& size, | 166 const gfx::Size& size, |
| 166 uint8 y, uint8 u, uint8 v, | 167 uint8 y, uint8 u, uint8 v, |
| 167 base::TimeDelta timestamp); | 168 base::TimeDelta timestamp); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 base::TimeDelta timestamp_; | 279 base::TimeDelta timestamp_; |
| 279 | 280 |
| 280 const bool end_of_stream_; | 281 const bool end_of_stream_; |
| 281 | 282 |
| 282 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 283 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 283 }; | 284 }; |
| 284 | 285 |
| 285 } // namespace media | 286 } // namespace media |
| 286 | 287 |
| 287 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 288 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |