| 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 MEDIA_GPU_AVDA_CODEC_IMAGE_H_ | 5 #ifndef MEDIA_GPU_AVDA_CODEC_IMAGE_H_ |
| 6 #define MEDIA_GPU_AVDA_CODEC_IMAGE_H_ | 6 #define MEDIA_GPU_AVDA_CODEC_IMAGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "gpu/command_buffer/service/gl_stream_texture_image.h" | 13 #include "gpu/command_buffer/service/gl_stream_texture_image.h" |
| 14 #include "media/gpu/avda_shared_state.h" | 14 #include "media/gpu/avda_shared_state.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 class ScopedMakeCurrent; | 17 class ScopedMakeCurrent; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace media { | 20 namespace media { |
| 21 | 21 |
| 22 // GLImage that renders MediaCodec buffers to a SurfaceTexture or SurfaceView as | 22 // GLImage that renders MediaCodec buffers to a SurfaceTexture or SurfaceView as |
| 23 // needed in order to draw them. | 23 // needed in order to draw them. |
| 24 class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { | 24 class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { |
| 25 public: | 25 public: |
| 26 AVDACodecImage(int picture_buffer_id, | 26 AVDACodecImage(int picture_buffer_id, |
| 27 const scoped_refptr<AVDASharedState>& shared_state, | 27 const scoped_refptr<AVDASharedState>& shared_state, |
| 28 media::VideoCodecBridge* codec, | 28 media::VideoCodecBridge* codec, |
| 29 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, | 29 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, |
| 30 const scoped_refptr<gfx::SurfaceTexture>& surface_texture); | 30 const scoped_refptr<gl::SurfaceTexture>& surface_texture); |
| 31 | 31 |
| 32 // gl::GLImage implementation | 32 // gl::GLImage implementation |
| 33 void Destroy(bool have_context) override; | 33 void Destroy(bool have_context) override; |
| 34 gfx::Size GetSize() override; | 34 gfx::Size GetSize() override; |
| 35 unsigned GetInternalFormat() override; | 35 unsigned GetInternalFormat() override; |
| 36 bool BindTexImage(unsigned target) override; | 36 bool BindTexImage(unsigned target) override; |
| 37 void ReleaseTexImage(unsigned target) override; | 37 void ReleaseTexImage(unsigned target) override; |
| 38 bool CopyTexImage(unsigned target) override; | 38 bool CopyTexImage(unsigned target) override; |
| 39 bool CopyTexSubImage(unsigned target, | 39 bool CopyTexSubImage(unsigned target, |
| 40 const gfx::Point& offset, | 40 const gfx::Point& offset, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Our image size. | 136 // Our image size. |
| 137 gfx::Size size_; | 137 gfx::Size size_; |
| 138 | 138 |
| 139 // May be null. | 139 // May be null. |
| 140 media::MediaCodecBridge* media_codec_; | 140 media::MediaCodecBridge* media_codec_; |
| 141 | 141 |
| 142 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_; | 142 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_; |
| 143 | 143 |
| 144 // The SurfaceTexture to render to. This is null when rendering to a | 144 // The SurfaceTexture to render to. This is null when rendering to a |
| 145 // SurfaceView. | 145 // SurfaceView. |
| 146 const scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 146 const scoped_refptr<gl::SurfaceTexture> surface_texture_; |
| 147 | 147 |
| 148 // The texture that we're attached to. | 148 // The texture that we're attached to. |
| 149 gpu::gles2::Texture* texture_; | 149 gpu::gles2::Texture* texture_; |
| 150 | 150 |
| 151 // Texture matrix of the front buffer of the surface texture. | 151 // Texture matrix of the front buffer of the surface texture. |
| 152 float gl_matrix_[16]; | 152 float gl_matrix_[16]; |
| 153 | 153 |
| 154 // The picture buffer id attached to this image. | 154 // The picture buffer id attached to this image. |
| 155 int picture_buffer_id_; | 155 int picture_buffer_id_; |
| 156 | 156 |
| 157 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); | 157 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace media | 160 } // namespace media |
| 161 | 161 |
| 162 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_ | 162 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_ |
| OLD | NEW |