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, | |
68 unsigned int internal_format, | 67 unsigned int internal_format, |
69 unsigned int type, | 68 unsigned int type, |
70 bool premultiply_alpha, | 69 bool premultiply_alpha, |
71 bool flip_y); | 70 bool flip_y); |
72 | 71 |
73 private: | 72 private: |
74 void ResetLastFrame(); | 73 void ResetLastFrame(); |
75 void ResetAcceleratedLastFrame(); | 74 void ResetAcceleratedLastFrame(); |
76 | 75 |
77 // An RGB bitmap and corresponding timestamp of the previously converted | 76 // An RGB bitmap and corresponding timestamp of the previously converted |
(...skipping 11 matching lines...) Expand all Loading... |
89 VideoImageGenerator* accelerated_generator_; | 88 VideoImageGenerator* accelerated_generator_; |
90 base::TimeDelta accelerated_last_frame_timestamp_; | 89 base::TimeDelta accelerated_last_frame_timestamp_; |
91 base::DelayTimer<SkCanvasVideoRenderer> accelerated_frame_deleting_timer_; | 90 base::DelayTimer<SkCanvasVideoRenderer> accelerated_frame_deleting_timer_; |
92 | 91 |
93 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 92 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace media | 95 } // namespace media |
97 | 96 |
98 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ | 97 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ |
OLD | NEW |