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_BLINK_SKCANVAS_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ |
6 #define MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ | 6 #define MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const scoped_refptr<media::VideoFrame>& video_frame, | 57 const scoped_refptr<media::VideoFrame>& video_frame, |
58 void* rgb_pixels, | 58 void* rgb_pixels, |
59 size_t row_bytes); | 59 size_t row_bytes); |
60 | 60 |
61 // Copy the contents of texture of |video_frame| to texture |texture|. | 61 // Copy the contents of texture of |video_frame| to texture |texture|. |
62 // |level|, |internal_format|, |type| specify target texture |texture|. | 62 // |level|, |internal_format|, |type| specify target texture |texture|. |
63 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. | 63 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. |
64 static void CopyVideoFrameTextureToGLTexture(gpu::gles2::GLES2Interface* gl, | 64 static void CopyVideoFrameTextureToGLTexture(gpu::gles2::GLES2Interface* gl, |
65 VideoFrame* video_frame, | 65 VideoFrame* video_frame, |
66 unsigned int texture, | 66 unsigned int texture, |
| 67 unsigned int level, |
67 unsigned int internal_format, | 68 unsigned int internal_format, |
68 unsigned int type, | 69 unsigned int type, |
69 bool premultiply_alpha, | 70 bool premultiply_alpha, |
70 bool flip_y); | 71 bool flip_y); |
71 | 72 |
72 private: | 73 private: |
73 void ResetLastFrame(); | 74 void ResetLastFrame(); |
74 void ResetAcceleratedLastFrame(); | 75 void ResetAcceleratedLastFrame(); |
75 | 76 |
76 // An RGB bitmap and corresponding timestamp of the previously converted | 77 // An RGB bitmap and corresponding timestamp of the previously converted |
(...skipping 11 matching lines...) Expand all Loading... |
88 VideoImageGenerator* accelerated_generator_; | 89 VideoImageGenerator* accelerated_generator_; |
89 base::TimeDelta accelerated_last_frame_timestamp_; | 90 base::TimeDelta accelerated_last_frame_timestamp_; |
90 base::DelayTimer<SkCanvasVideoRenderer> accelerated_frame_deleting_timer_; | 91 base::DelayTimer<SkCanvasVideoRenderer> accelerated_frame_deleting_timer_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 93 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
93 }; | 94 }; |
94 | 95 |
95 } // namespace media | 96 } // namespace media |
96 | 97 |
97 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ | 98 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ |
OLD | NEW |