| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // 1. Once we call detachFrameGLContext(), it deletes the texture previous | 393 // 1. Once we call detachFrameGLContext(), it deletes the texture previous |
| 394 // attached. | 394 // attached. |
| 395 // 2. SurfaceTexture requires us to apply a transform matrix when we show | 395 // 2. SurfaceTexture requires us to apply a transform matrix when we show |
| 396 // the texture. | 396 // the texture. |
| 397 // TODO(hkuang): get the StreamTexture transform matrix in GPU process | 397 // TODO(hkuang): get the StreamTexture transform matrix in GPU process |
| 398 // instead of using default matrix crbug.com/226218. | 398 // instead of using default matrix crbug.com/226218. |
| 399 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, | 399 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, |
| 400 0.0f, 1.0f, 0.0f, 0.0f, | 400 0.0f, 1.0f, 0.0f, 0.0f, |
| 401 0.0f, 0.0f, 1.0f, 0.0f, | 401 0.0f, 0.0f, 1.0f, 0.0f, |
| 402 0.0f, 0.0f, 0.0f, 1.0f}; | 402 0.0f, 0.0f, 0.0f, 1.0f}; |
| 403 copier_->DoCopyTextureWithTransform( | 403 copier_->DoCopyTextureWithTransform(gl_decoder_.get(), |
| 404 gl_decoder_.get(), GL_TEXTURE_EXTERNAL_OES, surface_texture_id_, | 404 GL_TEXTURE_EXTERNAL_OES, |
| 405 GL_TEXTURE_2D, picture_buffer_texture_id, GL_RGBA, GL_UNSIGNED_BYTE, | 405 surface_texture_id_, |
| 406 size_.width(), size_.height(), false, false, false, nullptr, | 406 picture_buffer_texture_id, |
| 407 default_matrix); | 407 size_.width(), |
| 408 size_.height(), |
| 409 false, |
| 410 false, |
| 411 false, |
| 412 default_matrix); |
| 408 | 413 |
| 409 // TODO(henryhsu): Pass (0, 0) as visible size will cause several test | 414 // TODO(henryhsu): Pass (0, 0) as visible size will cause several test |
| 410 // cases failed. We should make sure |size_| is coded size or visible size. | 415 // cases failed. We should make sure |size_| is coded size or visible size. |
| 411 base::MessageLoop::current()->PostTask( | 416 base::MessageLoop::current()->PostTask( |
| 412 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, | 417 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, |
| 413 weak_this_factory_.GetWeakPtr(), | 418 weak_this_factory_.GetWeakPtr(), |
| 414 media::Picture(picture_buffer_id, bitstream_id, | 419 media::Picture(picture_buffer_id, bitstream_id, |
| 415 gfx::Rect(size_), false))); | 420 gfx::Rect(size_), false))); |
| 416 } | 421 } |
| 417 | 422 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 // software fallback for H264 on Android anyway. | 630 // software fallback for H264 on Android anyway. |
| 626 profile.max_resolution.SetSize(3840, 2160); | 631 profile.max_resolution.SetSize(3840, 2160); |
| 627 profiles.push_back(profile); | 632 profiles.push_back(profile); |
| 628 } | 633 } |
| 629 #endif | 634 #endif |
| 630 | 635 |
| 631 return profiles; | 636 return profiles; |
| 632 } | 637 } |
| 633 | 638 |
| 634 } // namespace content | 639 } // namespace content |
| OLD | NEW |