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 #include "media/gpu/avda_codec_image.h" | 5 #include "media/gpu/avda_codec_image.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "gpu/command_buffer/service/context_group.h" | 11 #include "gpu/command_buffer/service/context_group.h" |
12 #include "gpu/command_buffer/service/context_state.h" | 12 #include "gpu/command_buffer/service/context_state.h" |
13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
14 #include "gpu/command_buffer/service/texture_manager.h" | 14 #include "gpu/command_buffer/service/texture_manager.h" |
15 #include "media/gpu/avda_shared_state.h" | 15 #include "media/gpu/avda_shared_state.h" |
16 #include "ui/gl/android/surface_texture.h" | 16 #include "ui/gl/android/surface_texture.h" |
17 #include "ui/gl/gl_context.h" | 17 #include "ui/gl/gl_context.h" |
18 #include "ui/gl/scoped_make_current.h" | 18 #include "ui/gl/scoped_make_current.h" |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 | 21 |
22 AVDACodecImage::AVDACodecImage( | 22 AVDACodecImage::AVDACodecImage( |
23 int picture_buffer_id, | 23 int picture_buffer_id, |
24 const scoped_refptr<AVDASharedState>& shared_state, | 24 const scoped_refptr<AVDASharedState>& shared_state, |
25 media::VideoCodecBridge* codec, | 25 media::VideoCodecBridge* codec, |
26 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, | 26 const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder, |
27 const scoped_refptr<gfx::SurfaceTexture>& surface_texture) | 27 const scoped_refptr<gl::SurfaceTexture>& surface_texture) |
28 : shared_state_(shared_state), | 28 : shared_state_(shared_state), |
29 codec_buffer_index_(kInvalidCodecBufferIndex), | 29 codec_buffer_index_(kInvalidCodecBufferIndex), |
30 media_codec_(codec), | 30 media_codec_(codec), |
31 decoder_(decoder), | 31 decoder_(decoder), |
32 surface_texture_(surface_texture), | 32 surface_texture_(surface_texture), |
33 texture_(0), | 33 texture_(0), |
34 picture_buffer_id_(picture_buffer_id) { | 34 picture_buffer_id_(picture_buffer_id) { |
35 // Default to a sane guess of "flip Y", just in case we can't get | 35 // Default to a sane guess of "flip Y", just in case we can't get |
36 // the matrix on the first call. | 36 // the matrix on the first call. |
37 memset(gl_matrix_, 0, sizeof(gl_matrix_)); | 37 memset(gl_matrix_, 0, sizeof(gl_matrix_)); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 237 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
238 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && | 238 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && |
239 kRendered > kInvalidCodecBufferIndex, | 239 kRendered > kInvalidCodecBufferIndex, |
240 "Codec buffer index enum values are not ordered correctly."); | 240 "Codec buffer index enum values are not ordered correctly."); |
241 return codec_buffer_index_ > kRendered && media_codec_; | 241 return codec_buffer_index_ > kRendered && media_codec_; |
242 } | 242 } |
243 | 243 |
244 } // namespace media | 244 } // namespace media |
OLD | NEW |