| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 int32 y_stride, | 143 int32 y_stride, |
| 144 int32 u_stride, | 144 int32 u_stride, |
| 145 int32 v_stride, | 145 int32 v_stride, |
| 146 uint8* y_data, | 146 uint8* y_data, |
| 147 uint8* u_data, | 147 uint8* u_data, |
| 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. | 153 // gets destroyed. |visible_rect| must be a sub rect within |
| 154 // frame->visible_rect(). |
| 154 static scoped_refptr<VideoFrame> WrapVideoFrame( | 155 static scoped_refptr<VideoFrame> WrapVideoFrame( |
| 155 const scoped_refptr<VideoFrame>& frame, | 156 const scoped_refptr<VideoFrame>& frame, |
| 157 const gfx::Rect& visible_rect, |
| 156 const base::Closure& no_longer_needed_cb); | 158 const base::Closure& no_longer_needed_cb); |
| 157 | 159 |
| 158 // Creates a frame which indicates end-of-stream. | 160 // Creates a frame which indicates end-of-stream. |
| 159 static scoped_refptr<VideoFrame> CreateEOSFrame(); | 161 static scoped_refptr<VideoFrame> CreateEOSFrame(); |
| 160 | 162 |
| 161 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). | 163 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). |
| 162 static scoped_refptr<VideoFrame> CreateColorFrame( | 164 static scoped_refptr<VideoFrame> CreateColorFrame( |
| 163 const gfx::Size& size, | 165 const gfx::Size& size, |
| 164 uint8 y, uint8 u, uint8 v, | 166 uint8 y, uint8 u, uint8 v, |
| 165 base::TimeDelta timestamp); | 167 base::TimeDelta timestamp); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 base::TimeDelta timestamp_; | 278 base::TimeDelta timestamp_; |
| 277 | 279 |
| 278 const bool end_of_stream_; | 280 const bool end_of_stream_; |
| 279 | 281 |
| 280 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 282 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 281 }; | 283 }; |
| 282 | 284 |
| 283 } // namespace media | 285 } // namespace media |
| 284 | 286 |
| 285 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 287 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |