| 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 class VideoCodecBridge; | 22 class VideoCodecBridge; |
| 23 | 23 |
| 24 // GLImage that renders MediaCodec buffers to a SurfaceTexture or SurfaceView as | 24 // GLImage that renders MediaCodec buffers to a SurfaceTexture or SurfaceView as |
| 25 // needed in order to draw them. | 25 // needed in order to draw them. |
| 26 class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { | 26 class AVDACodecImage : public gpu::gles2::GLStreamTextureImage { |
| 27 public: | 27 public: |
| 28 AVDACodecImage(int picture_buffer_id, | 28 AVDACodecImage(const scoped_refptr<AVDASharedState>& shared_state, |
| 29 const scoped_refptr<AVDASharedState>& shared_state, | |
| 30 VideoCodecBridge* codec, | 29 VideoCodecBridge* codec, |
| 31 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder); | 30 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder); |
| 32 | 31 |
| 33 // gl::GLImage implementation | 32 // gl::GLImage implementation |
| 34 gfx::Size GetSize() override; | 33 gfx::Size GetSize() override; |
| 35 unsigned GetInternalFormat() override; | 34 unsigned GetInternalFormat() override; |
| 36 bool BindTexImage(unsigned target) override; | 35 bool BindTexImage(unsigned target) override; |
| 37 void ReleaseTexImage(unsigned target) override; | 36 void ReleaseTexImage(unsigned target) override; |
| 38 bool CopyTexImage(unsigned target) override; | 37 bool CopyTexImage(unsigned target) override; |
| 39 bool CopyTexSubImage(unsigned target, | 38 bool CopyTexSubImage(unsigned target, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 MediaCodecBridge* media_codec_; | 140 MediaCodecBridge* media_codec_; |
| 142 | 141 |
| 143 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_; | 142 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_; |
| 144 | 143 |
| 145 // Indicates if we're rendering to a SurfaceTexture or not. | 144 // Indicates if we're rendering to a SurfaceTexture or not. |
| 146 const bool has_surface_texture_; | 145 const bool has_surface_texture_; |
| 147 | 146 |
| 148 // The texture that we're attached to. | 147 // The texture that we're attached to. |
| 149 gpu::gles2::Texture* texture_; | 148 gpu::gles2::Texture* texture_; |
| 150 | 149 |
| 151 // The picture buffer id attached to this image. | |
| 152 int picture_buffer_id_; | |
| 153 | |
| 154 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); | 150 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); |
| 155 }; | 151 }; |
| 156 | 152 |
| 157 } // namespace media | 153 } // namespace media |
| 158 | 154 |
| 159 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_ | 155 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_ |
| OLD | NEW |