| 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 "media/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 config_.is_deferred_initialization_allowed = true; | 326 config_.is_deferred_initialization_allowed = true; |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Create and initialize AVDA with |config_|, and return the result. | 329 // Create and initialize AVDA with |config_|, and return the result. |
| 330 bool InitializeAVDA() { | 330 bool InitializeAVDA() { |
| 331 // Because VDA has a custom deleter, we must assign it to |vda_| carefully. | 331 // Because VDA has a custom deleter, we must assign it to |vda_| carefully. |
| 332 AndroidVideoDecodeAccelerator* avda = new AndroidVideoDecodeAccelerator( | 332 AndroidVideoDecodeAccelerator* avda = new AndroidVideoDecodeAccelerator( |
| 333 &codec_allocator_, std::move(chooser_that_is_usually_null_), | 333 &codec_allocator_, std::move(chooser_that_is_usually_null_), |
| 334 base::Bind(&MakeContextCurrent), | 334 base::Bind(&MakeContextCurrent), |
| 335 base::Bind(&GetGLES2Decoder, gl_decoder_.AsWeakPtr()), | 335 base::Bind(&GetGLES2Decoder, gl_decoder_.AsWeakPtr()), |
| 336 platform_config_); | 336 AndroidOverlayMojoFactoryCB(), platform_config_); |
| 337 vda_.reset(avda); | 337 vda_.reset(avda); |
| 338 | 338 |
| 339 bool result = vda_->Initialize(config_, &client_); | 339 bool result = vda_->Initialize(config_, &client_); |
| 340 base::RunLoop().RunUntilIdle(); | 340 base::RunLoop().RunUntilIdle(); |
| 341 return result; | 341 return result; |
| 342 } | 342 } |
| 343 | 343 |
| 344 // Initialize |vda_|, providing a new surface for it. You may get the surface | 344 // Initialize |vda_|, providing a new surface for it. You may get the surface |
| 345 // by asking |codec_allocator_|. | 345 // by asking |codec_allocator_|. |
| 346 void InitializeAVDAWithOverlay() { | 346 void InitializeAVDAWithOverlay() { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 InitializeAVDAWithSurfaceTexture(); | 687 InitializeAVDAWithSurfaceTexture(); |
| 688 | 688 |
| 689 // This should do nothing. | 689 // This should do nothing. |
| 690 EXPECT_CALL(*codec_allocator_.most_recent_codec(), SetSurface(_)).Times(0); | 690 EXPECT_CALL(*codec_allocator_.most_recent_codec(), SetSurface(_)).Times(0); |
| 691 chooser_->ProvideSurfaceTexture(); | 691 chooser_->ProvideSurfaceTexture(); |
| 692 | 692 |
| 693 base::RunLoop().RunUntilIdle(); | 693 base::RunLoop().RunUntilIdle(); |
| 694 } | 694 } |
| 695 | 695 |
| 696 } // namespace media | 696 } // namespace media |
| OLD | NEW |