| 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_codec_image.h" | 5 #include "media/gpu/avda_codec_image.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : shared_state_(shared_state), | 28 : shared_state_(shared_state), |
| 29 codec_buffer_index_(kInvalidCodecBufferIndex), | 29 codec_buffer_index_(kInvalidCodecBufferIndex), |
| 30 media_codec_(codec), | 30 media_codec_(codec), |
| 31 decoder_(decoder), | 31 decoder_(decoder), |
| 32 surface_texture_(surface_texture), | 32 surface_texture_(surface_texture), |
| 33 texture_(0), | 33 texture_(0), |
| 34 picture_buffer_id_(picture_buffer_id) { | 34 picture_buffer_id_(picture_buffer_id) { |
| 35 // Default to a sane guess of "flip Y", just in case we can't get | 35 // Default to a sane guess of "flip Y", just in case we can't get |
| 36 // the matrix on the first call. | 36 // the matrix on the first call. |
| 37 memset(gl_matrix_, 0, sizeof(gl_matrix_)); | 37 memset(gl_matrix_, 0, sizeof(gl_matrix_)); |
| 38 gl_matrix_[0] = gl_matrix_[10] = gl_matrix_[15] = 1.0f; | 38 gl_matrix_[0] = gl_matrix_[10] = gl_matrix_[13] = gl_matrix_[15] = 1.0f; |
| 39 gl_matrix_[5] = -1.0f; | 39 gl_matrix_[5] = -1.0f; |
| 40 shared_state_->SetImageForPicture(picture_buffer_id_, this); | 40 shared_state_->SetImageForPicture(picture_buffer_id_, this); |
| 41 } | 41 } |
| 42 | 42 |
| 43 AVDACodecImage::~AVDACodecImage() { | 43 AVDACodecImage::~AVDACodecImage() { |
| 44 shared_state_->SetImageForPicture(picture_buffer_id_, nullptr); | 44 shared_state_->SetImageForPicture(picture_buffer_id_, nullptr); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void AVDACodecImage::Destroy(bool have_context) {} | 47 void AVDACodecImage::Destroy(bool have_context) {} |
| 48 | 48 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 279 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && | 280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && |
| 281 kRendered > kInvalidCodecBufferIndex, | 281 kRendered > kInvalidCodecBufferIndex, |
| 282 "Codec buffer index enum values are not ordered correctly."); | 282 "Codec buffer index enum values are not ordered correctly."); |
| 283 return codec_buffer_index_ > kRendered && media_codec_; | 283 return codec_buffer_index_ > kRendered && media_codec_; |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace media | 286 } // namespace media |
| OLD | NEW |