| 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/avda_codec_image.h" | 5 #include "content/common/gpu/media/avda_codec_image.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "content/common/gpu/media/avda_shared_state.h" | 10 #include "content/common/gpu/media/avda_shared_state.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 media_codec_->ReleaseOutputBuffer(codec_buffer_index_, true); | 111 media_codec_->ReleaseOutputBuffer(codec_buffer_index_, true); |
| 112 codec_buffer_index_ = kInvalidCodecBufferIndex; | 112 codec_buffer_index_ = kInvalidCodecBufferIndex; |
| 113 } | 113 } |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void AVDACodecImage::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 117 void AVDACodecImage::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 118 uint64_t process_tracing_id, | 118 uint64_t process_tracing_id, |
| 119 const std::string& dump_name) {} | 119 const std::string& dump_name) {} |
| 120 | 120 |
| 121 bool AVDACodecImage::EmulatingRGB() const { |
| 122 return false; |
| 123 } |
| 124 |
| 121 void AVDACodecImage::UpdateSurfaceTexture(RestoreBindingsMode mode) { | 125 void AVDACodecImage::UpdateSurfaceTexture(RestoreBindingsMode mode) { |
| 122 DCHECK(surface_texture_); | 126 DCHECK(surface_texture_); |
| 123 | 127 |
| 124 // Render via the media codec if needed. | 128 // Render via the media codec if needed. |
| 125 if (!IsCodecBufferOutstanding()) | 129 if (!IsCodecBufferOutstanding()) |
| 126 return; | 130 return; |
| 127 | 131 |
| 128 // The decoder buffer is still pending. | 132 // The decoder buffer is still pending. |
| 129 // This must be synchronous, so wait for OnFrameAvailable. | 133 // This must be synchronous, so wait for OnFrameAvailable. |
| 130 media_codec_->ReleaseOutputBuffer(codec_buffer_index_, true); | 134 media_codec_->ReleaseOutputBuffer(codec_buffer_index_, true); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 235 } |
| 232 | 236 |
| 233 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); | 237 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); |
| 234 } | 238 } |
| 235 | 239 |
| 236 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 240 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 237 return codec_buffer_index_ != kInvalidCodecBufferIndex && media_codec_; | 241 return codec_buffer_index_ != kInvalidCodecBufferIndex && media_codec_; |
| 238 } | 242 } |
| 239 | 243 |
| 240 } // namespace content | 244 } // namespace content |
| OLD | NEW |