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 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 | 364 |
365 // Returns true if frame's COPY_REQUIRED flag needs to be set when using | 365 // Returns true if frame's COPY_REQUIRED flag needs to be set when using |
366 // deferred strategy. | 366 // deferred strategy. |
367 static bool UseTextureCopyForDeferredStrategy( | 367 static bool UseTextureCopyForDeferredStrategy( |
368 const gpu::GpuPreferences& gpu_preferences); | 368 const gpu::GpuPreferences& gpu_preferences); |
369 | 369 |
370 // Indicates if MediaCodec should not be used for software decoding since we | 370 // Indicates if MediaCodec should not be used for software decoding since we |
371 // have safer versions elsewhere. | 371 // have safer versions elsewhere. |
372 bool IsMediaCodecSoftwareDecodingForbidden() const; | 372 bool IsMediaCodecSoftwareDecodingForbidden() const; |
373 | 373 |
374 // Closes idle MediaCodec instances if no Decode() call is received within a | |
375 // few seconds. | |
376 void CloseIdleCodec(); | |
377 | |
374 // Used to DCHECK that we are called on the correct thread. | 378 // Used to DCHECK that we are called on the correct thread. |
375 base::ThreadChecker thread_checker_; | 379 base::ThreadChecker thread_checker_; |
376 | 380 |
377 // To expose client callbacks from VideoDecodeAccelerator. | 381 // To expose client callbacks from VideoDecodeAccelerator. |
378 Client* client_; | 382 Client* client_; |
379 | 383 |
380 // Callback to set the correct gl context. | 384 // Callback to set the correct gl context. |
381 MakeGLContextCurrentCallback make_context_current_cb_; | 385 MakeGLContextCurrentCallback make_context_current_cb_; |
382 | 386 |
383 // Callback to get the GLES2Decoder instance. | 387 // Callback to get the GLES2Decoder instance. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 // Indicates if ResetCodecState() should be called upon the next call to | 481 // Indicates if ResetCodecState() should be called upon the next call to |
478 // Decode(). Allows us to avoid trashing the last few frames of a playback | 482 // Decode(). Allows us to avoid trashing the last few frames of a playback |
479 // when the EOS buffer is received. | 483 // when the EOS buffer is received. |
480 bool codec_needs_reset_; | 484 bool codec_needs_reset_; |
481 | 485 |
482 // Copy of the VDA::Config we were given. | 486 // Copy of the VDA::Config we were given. |
483 Config config_; | 487 Config config_; |
484 | 488 |
485 OnDestroyingSurfaceCallback on_destroying_surface_cb_; | 489 OnDestroyingSurfaceCallback on_destroying_surface_cb_; |
486 | 490 |
491 // Timer used to destroy the MediaCodec if no Decode() call is received after | |
492 // a seconds of idle activity. This prevents older devices from falling over | |
liberato (no reviews please)
2016/07/13 05:25:55
"a seconds"
| |
493 // when too many MediaCodec instances are outstanding. | |
494 base::OneShotTimer no_decode_timeout_; | |
495 | |
487 // WeakPtrFactory for posting tasks back to |this|. | 496 // WeakPtrFactory for posting tasks back to |this|. |
488 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 497 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
489 | 498 |
490 friend class AndroidVideoDecodeAcceleratorTest; | 499 friend class AndroidVideoDecodeAcceleratorTest; |
491 }; | 500 }; |
492 | 501 |
493 } // namespace media | 502 } // namespace media |
494 | 503 |
495 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 504 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |