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 "content/common/gpu/media/android_copying_backing_strategy.h" | 5 #include "content/common/gpu/media/android_copying_backing_strategy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/common/gpu/media/avda_return_on_failure.h" | 10 #include "content/common/gpu/media/avda_return_on_failure.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // 2. SurfaceTexture requires us to apply a transform matrix when we show | 137 // 2. SurfaceTexture requires us to apply a transform matrix when we show |
138 // the texture. | 138 // the texture. |
139 copier_->DoCopyTextureWithTransform( | 139 copier_->DoCopyTextureWithTransform( |
140 state_provider_->GetGlDecoder().get(), GL_TEXTURE_EXTERNAL_OES, | 140 state_provider_->GetGlDecoder().get(), GL_TEXTURE_EXTERNAL_OES, |
141 surface_texture_id_, GL_TEXTURE_2D, picture_buffer_texture_id, | 141 surface_texture_id_, GL_TEXTURE_2D, picture_buffer_texture_id, |
142 state_provider_->GetSize().width(), state_provider_->GetSize().height(), | 142 state_provider_->GetSize().width(), state_provider_->GetSize().height(), |
143 true, false, false, transform_matrix); | 143 true, false, false, transform_matrix); |
144 } | 144 } |
145 | 145 |
146 void AndroidCopyingBackingStrategy::CodecChanged( | 146 void AndroidCopyingBackingStrategy::CodecChanged( |
147 media::VideoCodecBridge* codec, | 147 media::VideoCodecBridge* codec) { |
148 const AndroidVideoDecodeAccelerator::OutputBufferMap&) { | |
149 media_codec_ = codec; | 148 media_codec_ = codec; |
150 } | 149 } |
151 | 150 |
152 void AndroidCopyingBackingStrategy::OnFrameAvailable() { | 151 void AndroidCopyingBackingStrategy::OnFrameAvailable() { |
153 // TODO(liberato): crbug.com/574948 . The OnFrameAvailable logic can be | 152 // TODO(liberato): crbug.com/574948 . The OnFrameAvailable logic can be |
154 // moved into AVDA, and we should wait for it before doing the copy. | 153 // moved into AVDA, and we should wait for it before doing the copy. |
155 // Because there were some test failures, we don't do this now but | 154 // Because there were some test failures, we don't do this now but |
156 // instead preserve the old behavior. | 155 // instead preserve the old behavior. |
157 } | 156 } |
158 | 157 |
(...skipping 24 matching lines...) Expand all Loading... |
183 RETURN_IF_NULL(texture_ref); | 182 RETURN_IF_NULL(texture_ref); |
184 gpu::gles2::TextureManager* texture_manager = | 183 gpu::gles2::TextureManager* texture_manager = |
185 state_provider_->GetGlDecoder()->GetContextGroup()->texture_manager(); | 184 state_provider_->GetGlDecoder()->GetContextGroup()->texture_manager(); |
186 RETURN_IF_NULL(texture_manager); | 185 RETURN_IF_NULL(texture_manager); |
187 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, | 186 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, |
188 new_size.width(), new_size.height(), 1, 0, | 187 new_size.width(), new_size.height(), 1, 0, |
189 GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(new_size)); | 188 GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(new_size)); |
190 } | 189 } |
191 | 190 |
192 } // namespace content | 191 } // namespace content |
OLD | NEW |