| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // setting new texture to |surface_texture_| by calling attachToGLContext() | 114 // setting new texture to |surface_texture_| by calling attachToGLContext() |
| 115 // because: | 115 // because: |
| 116 // 1. Once we call detachFrameGLContext(), it deletes the texture previously | 116 // 1. Once we call detachFrameGLContext(), it deletes the texture previously |
| 117 // attached. | 117 // attached. |
| 118 // 2. SurfaceTexture requires us to apply a transform matrix when we show | 118 // 2. SurfaceTexture requires us to apply a transform matrix when we show |
| 119 // the texture. | 119 // the texture. |
| 120 // TODO(hkuang): get the StreamTexture transform matrix in GPU process | 120 // TODO(hkuang): get the StreamTexture transform matrix in GPU process |
| 121 // instead of using default matrix crbug.com/226218. | 121 // instead of using default matrix crbug.com/226218. |
| 122 copier_->DoCopyTextureWithTransform( | 122 copier_->DoCopyTextureWithTransform( |
| 123 state_provider_->GetGlDecoder().get(), GL_TEXTURE_EXTERNAL_OES, | 123 state_provider_->GetGlDecoder().get(), GL_TEXTURE_EXTERNAL_OES, |
| 124 surface_texture_id_, picture_buffer_texture_id, | 124 surface_texture_id_, GL_TEXTURE_2D, picture_buffer_texture_id, |
| 125 state_provider_->GetSize().width(), state_provider_->GetSize().height(), | 125 state_provider_->GetSize().width(), state_provider_->GetSize().height(), |
| 126 false, false, false, kIdentityMatrix); | 126 false, false, false, kIdentityMatrix); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void AndroidCopyingBackingStrategy::CodecChanged( | 129 void AndroidCopyingBackingStrategy::CodecChanged( |
| 130 media::VideoCodecBridge* codec, | 130 media::VideoCodecBridge* codec, |
| 131 const AndroidVideoDecodeAccelerator::OutputBufferMap&) { | 131 const AndroidVideoDecodeAccelerator::OutputBufferMap&) { |
| 132 media_codec_ = codec; | 132 media_codec_ = codec; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace content | 135 } // namespace content |
| OLD | NEW |