| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // 1. Once we call detachFrameGLContext(), it deletes the texture previous | 382 // 1. Once we call detachFrameGLContext(), it deletes the texture previous |
| 383 // attached. | 383 // attached. |
| 384 // 2. SurfaceTexture requires us to apply a transform matrix when we show | 384 // 2. SurfaceTexture requires us to apply a transform matrix when we show |
| 385 // the texture. | 385 // the texture. |
| 386 // TODO(hkuang): get the StreamTexture transform matrix in GPU process | 386 // TODO(hkuang): get the StreamTexture transform matrix in GPU process |
| 387 // instead of using default matrix crbug.com/226218. | 387 // instead of using default matrix crbug.com/226218. |
| 388 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, | 388 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, |
| 389 0.0f, 1.0f, 0.0f, 0.0f, | 389 0.0f, 1.0f, 0.0f, 0.0f, |
| 390 0.0f, 0.0f, 1.0f, 0.0f, | 390 0.0f, 0.0f, 1.0f, 0.0f, |
| 391 0.0f, 0.0f, 0.0f, 1.0f}; | 391 0.0f, 0.0f, 0.0f, 1.0f}; |
| 392 copier_->DoCopyTextureWithTransform(gl_decoder_.get(), | 392 copier_->DoCopyTextureWithTransform( |
| 393 GL_TEXTURE_EXTERNAL_OES, | 393 gl_decoder_.get(), GL_TEXTURE_EXTERNAL_OES, surface_texture_id_, |
| 394 surface_texture_id_, | 394 GL_TEXTURE_2D, picture_buffer_texture_id, GL_RGBA, GL_UNSIGNED_BYTE, |
| 395 picture_buffer_texture_id, | 395 size_.width(), size_.height(), false, false, false, nullptr, |
| 396 size_.width(), | 396 default_matrix); |
| 397 size_.height(), | |
| 398 false, | |
| 399 false, | |
| 400 false, | |
| 401 default_matrix); | |
| 402 | 397 |
| 403 // TODO(henryhsu): Pass (0, 0) as visible size will cause several test | 398 // TODO(henryhsu): Pass (0, 0) as visible size will cause several test |
| 404 // cases failed. We should make sure |size_| is coded size or visible size. | 399 // cases failed. We should make sure |size_| is coded size or visible size. |
| 405 base::MessageLoop::current()->PostTask( | 400 base::MessageLoop::current()->PostTask( |
| 406 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, | 401 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, |
| 407 weak_this_factory_.GetWeakPtr(), | 402 weak_this_factory_.GetWeakPtr(), |
| 408 media::Picture(picture_buffer_id, bitstream_id, | 403 media::Picture(picture_buffer_id, bitstream_id, |
| 409 gfx::Rect(size_), false))); | 404 gfx::Rect(size_), false))); |
| 410 } | 405 } |
| 411 | 406 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 // software fallback for H264 on Android anyway. | 613 // software fallback for H264 on Android anyway. |
| 619 profile.max_resolution.SetSize(3840, 2160); | 614 profile.max_resolution.SetSize(3840, 2160); |
| 620 profiles.push_back(profile); | 615 profiles.push_back(profile); |
| 621 } | 616 } |
| 622 #endif | 617 #endif |
| 623 | 618 |
| 624 return profiles; | 619 return profiles; |
| 625 } | 620 } |
| 626 | 621 |
| 627 } // namespace content | 622 } // namespace content |
| OLD | NEW |