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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // texture to main memory. | 101 // texture to main memory. |
102 static scoped_refptr<VideoFrame> WrapNativeTexture( | 102 static scoped_refptr<VideoFrame> WrapNativeTexture( |
103 scoped_ptr<gpu::MailboxHolder> mailbox_holder, | 103 scoped_ptr<gpu::MailboxHolder> mailbox_holder, |
104 const ReleaseMailboxCB& mailbox_holder_release_cb, | 104 const ReleaseMailboxCB& mailbox_holder_release_cb, |
105 const gfx::Size& coded_size, | 105 const gfx::Size& coded_size, |
106 const gfx::Rect& visible_rect, | 106 const gfx::Rect& visible_rect, |
107 const gfx::Size& natural_size, | 107 const gfx::Size& natural_size, |
108 base::TimeDelta timestamp, | 108 base::TimeDelta timestamp, |
109 const ReadPixelsCB& read_pixels_cb); | 109 const ReadPixelsCB& read_pixels_cb); |
110 | 110 |
| 111 #if !defined(MEDIA_FOR_CAST_IOS) |
111 // Read pixels from the native texture backing |*this| and write | 112 // Read pixels from the native texture backing |*this| and write |
112 // them to |pixels| as BGRA. |pixels| must point to a buffer at | 113 // them to |pixels| as BGRA. |pixels| must point to a buffer at |
113 // least as large as 4 * visible_rect().size().GetArea(). | 114 // least as large as 4 * visible_rect().size().GetArea(). |
114 void ReadPixelsFromNativeTexture(const SkBitmap& pixels); | 115 void ReadPixelsFromNativeTexture(const SkBitmap& pixels); |
| 116 #endif |
115 | 117 |
116 // Wraps packed image data residing in a memory buffer with a VideoFrame. | 118 // Wraps packed image data residing in a memory buffer with a VideoFrame. |
117 // The image data resides in |data| and is assumed to be packed tightly in a | 119 // The image data resides in |data| and is assumed to be packed tightly in a |
118 // buffer of logical dimensions |coded_size| with the appropriate bit depth | 120 // buffer of logical dimensions |coded_size| with the appropriate bit depth |
119 // and plane count as given by |format|. The shared memory handle of the | 121 // and plane count as given by |format|. The shared memory handle of the |
120 // backing allocation, if present, can be passed in with |handle|. When the | 122 // backing allocation, if present, can be passed in with |handle|. When the |
121 // frame is destroyed, |no_longer_needed_cb.Run()| will be called. | 123 // frame is destroyed, |no_longer_needed_cb.Run()| will be called. |
122 // Returns NULL on failure. | 124 // Returns NULL on failure. |
123 static scoped_refptr<VideoFrame> WrapExternalPackedMemory( | 125 static scoped_refptr<VideoFrame> WrapExternalPackedMemory( |
124 Format format, | 126 Format format, |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 uint32 release_sync_point_; | 389 uint32 release_sync_point_; |
388 | 390 |
389 const bool end_of_stream_; | 391 const bool end_of_stream_; |
390 | 392 |
391 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 393 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
392 }; | 394 }; |
393 | 395 |
394 } // namespace media | 396 } // namespace media |
395 | 397 |
396 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 398 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |