OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ |
7 | 7 |
8 #include "content/common/gpu/media/avda_shared_state.h" | 8 #include "content/common/gpu/media/avda_shared_state.h" |
9 #include "ui/gl/gl_image.h" | 9 #include "ui/gl/gl_image.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // GLImage that renders MediaCodec buffers to a SurfaceTexture as needed | 13 // GLImage that renders MediaCodec buffers to a SurfaceTexture as needed |
14 // in order to draw them. | 14 // in order to draw them. |
15 class AVDACodecImage : public gfx::GLImage { | 15 class AVDACodecImage : public gl::GLImage { |
16 public: | 16 public: |
17 AVDACodecImage(const scoped_refptr<AVDASharedState>&, | 17 AVDACodecImage(const scoped_refptr<AVDASharedState>&, |
18 media::VideoCodecBridge* codec, | 18 media::VideoCodecBridge* codec, |
19 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, | 19 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, |
20 const scoped_refptr<gfx::SurfaceTexture>& surface_texture); | 20 const scoped_refptr<gfx::SurfaceTexture>& surface_texture); |
21 | 21 |
22 protected: | 22 protected: |
23 ~AVDACodecImage() override; | 23 ~AVDACodecImage() override; |
24 | 24 |
25 public: | 25 public: |
26 // gfx::GLImage implementation | 26 // gl::GLImage implementation |
27 void Destroy(bool have_context) override; | 27 void Destroy(bool have_context) override; |
28 gfx::Size GetSize() override; | 28 gfx::Size GetSize() override; |
29 unsigned GetInternalFormat() override; | 29 unsigned GetInternalFormat() override; |
30 bool BindTexImage(unsigned target) override; | 30 bool BindTexImage(unsigned target) override; |
31 void ReleaseTexImage(unsigned target) override; | 31 void ReleaseTexImage(unsigned target) override; |
32 bool CopyTexImage(unsigned target) override; | 32 bool CopyTexImage(unsigned target) override; |
33 bool CopyTexSubImage(unsigned target, | 33 bool CopyTexSubImage(unsigned target, |
34 const gfx::Point& offset, | 34 const gfx::Point& offset, |
35 const gfx::Rect& rect) override; | 35 const gfx::Rect& rect) override; |
36 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 36 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Should we detach |surface_texture_| from its GL context when we are | 84 // Should we detach |surface_texture_| from its GL context when we are |
85 // deleted? This happens when it's using our Texture's texture handle. | 85 // deleted? This happens when it's using our Texture's texture handle. |
86 bool detach_surface_texture_on_destruction_; | 86 bool detach_surface_texture_on_destruction_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); | 88 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace content | 91 } // namespace content |
92 | 92 |
93 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ | 93 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_CODEC_IMAGE_H_ |
OLD | NEW |