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_deferred_rendering_backing_strategy.h
" | 5 #include "content/common/gpu/media/android_deferred_rendering_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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Also set the parameters for the level if we're not clearing | 103 // Also set the parameters for the level if we're not clearing |
104 // the image. | 104 // the image. |
105 const gfx::Size size = state_provider_->GetSize(); | 105 const gfx::Size size = state_provider_->GetSize(); |
106 texture_manager->SetTarget(texture_ref, GetTextureTarget()); | 106 texture_manager->SetTarget(texture_ref, GetTextureTarget()); |
107 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, | 107 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, |
108 size.width(), size.height(), 1, 0, GL_RGBA, | 108 size.width(), size.height(), 1, 0, GL_RGBA, |
109 GL_UNSIGNED_BYTE, gfx::Rect(size)); | 109 GL_UNSIGNED_BYTE, gfx::Rect(size)); |
110 } | 110 } |
111 | 111 |
112 texture_manager->SetLevelImage(texture_ref, GetTextureTarget(), 0, | 112 texture_manager->SetLevelImage(texture_ref, GetTextureTarget(), 0, |
113 image.get(), gpu::gles2::Texture::UNBOUND); | 113 image.get()); |
114 } | 114 } |
115 | 115 |
116 void AndroidDeferredRenderingBackingStrategy::UseCodecBufferForPictureBuffer( | 116 void AndroidDeferredRenderingBackingStrategy::UseCodecBufferForPictureBuffer( |
117 int32 codec_buf_index, | 117 int32 codec_buf_index, |
118 const media::PictureBuffer& picture_buffer) { | 118 const media::PictureBuffer& picture_buffer) { |
119 // Make sure that the decoder is available. | 119 // Make sure that the decoder is available. |
120 RETURN_IF_NULL(state_provider_->GetGlDecoder()); | 120 RETURN_IF_NULL(state_provider_->GetGlDecoder()); |
121 | 121 |
122 // Notify the AVDACodecImage for picture_buffer that it should use the | 122 // Notify the AVDACodecImage for picture_buffer that it should use the |
123 // decoded buffer codec_buf_index to render this frame. | 123 // decoded buffer codec_buf_index to render this frame. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // doesn't know about them. | 185 // doesn't know about them. |
186 media_codec_ = codec; | 186 media_codec_ = codec; |
187 for (const std::pair<int, media::PictureBuffer>& entry : buffers) { | 187 for (const std::pair<int, media::PictureBuffer>& entry : buffers) { |
188 AVDACodecImage* avImage = GetImageForPicture(entry.second); | 188 AVDACodecImage* avImage = GetImageForPicture(entry.second); |
189 avImage->SetMediaCodec(codec); | 189 avImage->SetMediaCodec(codec); |
190 avImage->SetMediaCodecBufferIndex(-1); | 190 avImage->SetMediaCodecBufferIndex(-1); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 } // namespace content | 194 } // namespace content |
OLD | NEW |