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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame, | 59 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame, |
60 void* rgb_pixels, | 60 void* rgb_pixels, |
61 size_t row_bytes); | 61 size_t row_bytes); |
62 | 62 |
63 // Copy the contents of texture of |video_frame| to texture |texture|. | 63 // Copy the contents of texture of |video_frame| to texture |texture|. |
64 // |level|, |internal_format|, |type| specify target texture |texture|. | 64 // |level|, |internal_format|, |type| specify target texture |texture|. |
65 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. | 65 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. |
66 static void CopyVideoFrameSingleTextureToGLTexture( | 66 static void CopyVideoFrameSingleTextureToGLTexture( |
67 gpu::gles2::GLES2Interface* gl, | 67 gpu::gles2::GLES2Interface* gl, |
68 VideoFrame* video_frame, | 68 VideoFrame* video_frame, |
69 unsigned int target, | |
69 unsigned int texture, | 70 unsigned int texture, |
70 unsigned int internal_format, | 71 unsigned int internal_format, |
71 unsigned int type, | 72 unsigned int type, |
73 int level, | |
74 bool premultiply_alpha, | |
75 bool flip_y); | |
76 static void CopySubVideoFrameSingleTextureToGLTexture( | |
oetuaho-nv
2015/10/01 07:46:21
Same naming issue here. Would rather use "CopyVide
dshwang
2015/10/21 16:12:15
ditto.
| |
77 gpu::gles2::GLES2Interface* gl, | |
78 VideoFrame* video_frame, | |
79 unsigned int target, | |
80 unsigned int texture, | |
81 int level, | |
82 int xoffset, | |
83 int yoffset, | |
72 bool premultiply_alpha, | 84 bool premultiply_alpha, |
73 bool flip_y); | 85 bool flip_y); |
74 | 86 |
75 private: | 87 private: |
76 void ResetCache(); | 88 void ResetCache(); |
77 | 89 |
78 // Last image used to draw to the canvas. | 90 // Last image used to draw to the canvas. |
79 skia::RefPtr<SkImage> last_image_; | 91 skia::RefPtr<SkImage> last_image_; |
80 // Timestamp of the videoframe used to generate |last_image_|. | 92 // Timestamp of the videoframe used to generate |last_image_|. |
81 base::TimeDelta last_timestamp_ = media::kNoTimestamp(); | 93 base::TimeDelta last_timestamp_ = media::kNoTimestamp(); |
82 // If |last_image_| is not used for a while, it's deleted to save memory. | 94 // If |last_image_| is not used for a while, it's deleted to save memory. |
83 base::DelayTimer<SkCanvasVideoRenderer> last_image_deleting_timer_; | 95 base::DelayTimer<SkCanvasVideoRenderer> last_image_deleting_timer_; |
84 | 96 |
85 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 97 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
86 }; | 98 }; |
87 | 99 |
88 } // namespace media | 100 } // namespace media |
89 | 101 |
90 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ | 102 #endif // MEDIA_BLINK_SKCANVAS_VIDEO_RENDERER_H_ |
OLD | NEW |