Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: media/gpu/avda_codec_image.h

Issue 2351293003: Relocate SurfaceTexture usage from AVDA GLImage into shared state. (Closed)
Patch Set: Unflip default matrix. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/gpu/avda_codec_image.cc » ('j') | media/gpu/avda_shared_state.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 10 matching lines...) Expand all
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(int picture_buffer_id,
29 const scoped_refptr<AVDASharedState>& shared_state, 29 const scoped_refptr<AVDASharedState>& shared_state,
30 VideoCodecBridge* codec, 30 VideoCodecBridge* codec,
31 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, 31 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder);
32 const scoped_refptr<gl::SurfaceTexture>& surface_texture);
33 32
34 // gl::GLImage implementation 33 // gl::GLImage implementation
35 void Destroy(bool have_context) override; 34 void Destroy(bool have_context) override;
36 gfx::Size GetSize() override; 35 gfx::Size GetSize() override;
37 unsigned GetInternalFormat() override; 36 unsigned GetInternalFormat() override;
38 bool BindTexImage(unsigned target) override; 37 bool BindTexImage(unsigned target) override;
39 void ReleaseTexImage(unsigned target) override; 38 void ReleaseTexImage(unsigned target) override;
40 bool CopyTexImage(unsigned target) override; 39 bool CopyTexImage(unsigned target) override;
41 bool CopyTexSubImage(unsigned target, 40 bool CopyTexSubImage(unsigned target,
42 const gfx::Point& offset, 41 const gfx::Point& offset,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int codec_buffer_index_; 136 int codec_buffer_index_;
138 137
139 // Our image size. 138 // Our image size.
140 gfx::Size size_; 139 gfx::Size size_;
141 140
142 // May be null. 141 // May be null.
143 MediaCodecBridge* media_codec_; 142 MediaCodecBridge* media_codec_;
144 143
145 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_; 144 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder_;
146 145
147 // The SurfaceTexture to render to. This is null when rendering to a 146 // Indicates if we're rendering to a SurfaceTexture or not.
148 // SurfaceView. 147 const bool has_surface_texture_;
149 const scoped_refptr<gl::SurfaceTexture> surface_texture_;
150 148
151 // The texture that we're attached to. 149 // The texture that we're attached to.
152 gpu::gles2::Texture* texture_; 150 gpu::gles2::Texture* texture_;
153 151
154 // Texture matrix of the front buffer of the surface texture.
155 float gl_matrix_[16];
156
157 // The picture buffer id attached to this image. 152 // The picture buffer id attached to this image.
158 int picture_buffer_id_; 153 int picture_buffer_id_;
159 154
160 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage); 155 DISALLOW_COPY_AND_ASSIGN(AVDACodecImage);
161 }; 156 };
162 157
163 } // namespace media 158 } // namespace media
164 159
165 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_ 160 #endif // MEDIA_GPU_AVDA_CODEC_IMAGE_H_
OLDNEW
« no previous file with comments | « no previous file | media/gpu/avda_codec_image.cc » ('j') | media/gpu/avda_shared_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698