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_shared_state.h" | 5 #include "media/gpu/avda_shared_state.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "media/gpu/avda_codec_image.h" | 9 #include "media/gpu/avda_codec_image.h" |
10 #include "ui/gl/android/surface_texture.h" | 10 #include "ui/gl/android/surface_texture.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 << elapsed.InMillisecondsF() | 115 << elapsed.InMillisecondsF() |
116 << "ms, additionally waited: " << remaining.InMillisecondsF() | 116 << "ms, additionally waited: " << remaining.InMillisecondsF() |
117 << "ms, total: " << (elapsed + remaining).InMillisecondsF() | 117 << "ms, total: " << (elapsed + remaining).InMillisecondsF() |
118 << "ms"; | 118 << "ms"; |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 void AVDASharedState::SetSurfaceTexture( | 122 void AVDASharedState::SetSurfaceTexture( |
123 scoped_refptr<gl::SurfaceTexture> surface_texture, | 123 scoped_refptr<gl::SurfaceTexture> surface_texture, |
124 GLuint attached_service_id) { | 124 GLuint attached_service_id) { |
| 125 DCHECK(surface_texture); |
| 126 DCHECK(attached_service_id); |
125 surface_texture_ = surface_texture; | 127 surface_texture_ = surface_texture; |
126 surface_texture_service_id_ = attached_service_id; | 128 surface_texture_service_id_ = attached_service_id; |
127 context_ = gl::GLContext::GetCurrent(); | 129 context_ = gl::GLContext::GetCurrent(); |
128 surface_ = gl::GLSurface::GetCurrent(); | 130 surface_ = gl::GLSurface::GetCurrent(); |
129 DCHECK(context_); | 131 DCHECK(context_); |
130 DCHECK(surface_); | 132 DCHECK(surface_); |
131 on_frame_available_handler_ = | 133 on_frame_available_handler_ = |
132 new OnFrameAvailableHandler(this, surface_texture_.get()); | 134 new OnFrameAvailableHandler(this, surface_texture_.get()); |
133 } | 135 } |
134 | 136 |
(...skipping 10 matching lines...) Expand all Loading... |
145 surface_texture_->UpdateTexImage(); | 147 surface_texture_->UpdateTexImage(); |
146 // Helpfully, this is already column major. | 148 // Helpfully, this is already column major. |
147 surface_texture_->GetTransformMatrix(gl_matrix_); | 149 surface_texture_->GetTransformMatrix(gl_matrix_); |
148 } | 150 } |
149 | 151 |
150 void AVDASharedState::GetTransformMatrix(float matrix[16]) const { | 152 void AVDASharedState::GetTransformMatrix(float matrix[16]) const { |
151 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); | 153 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); |
152 } | 154 } |
153 | 155 |
154 } // namespace media | 156 } // namespace media |
OLD | NEW |