| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // components need to be reset upon EOS to decode a later stream. Input state | 341 // components need to be reset upon EOS to decode a later stream. Input state |
| 342 // (e.g. queued BitstreamBuffers) is not reset, as input following an EOS | 342 // (e.g. queued BitstreamBuffers) is not reset, as input following an EOS |
| 343 // is still valid and should be processed. | 343 // is still valid and should be processed. |
| 344 void ResetCodecState(); | 344 void ResetCodecState(); |
| 345 | 345 |
| 346 // Registered to be called when surfaces are being destroyed. If |surface_id| | 346 // Registered to be called when surfaces are being destroyed. If |surface_id| |
| 347 // is our surface, we should release the MediaCodec before returning from | 347 // is our surface, we should release the MediaCodec before returning from |
| 348 // this. | 348 // this. |
| 349 void OnDestroyingSurface(int surface_id); | 349 void OnDestroyingSurface(int surface_id); |
| 350 | 350 |
| 351 // Return true if and only if we should use deferred rendering. | 351 // Returns true if and only if we should use deferred rendering. |
| 352 static bool UseDeferredRenderingStrategy( | 352 static bool UseDeferredRenderingStrategy( |
| 353 const gpu::GpuPreferences& gpu_preferences); | 353 const gpu::GpuPreferences& gpu_preferences); |
| 354 | 354 |
| 355 // Returns true if frame's COPY_REQUIRED flag needs to be set when using |
| 356 // deferred strategy. |
| 357 static bool UseTextureCopyForDeferredStrategy( |
| 358 const gpu::GpuPreferences& gpu_preferences); |
| 359 |
| 355 // Used to DCHECK that we are called on the correct thread. | 360 // Used to DCHECK that we are called on the correct thread. |
| 356 base::ThreadChecker thread_checker_; | 361 base::ThreadChecker thread_checker_; |
| 357 | 362 |
| 358 // To expose client callbacks from VideoDecodeAccelerator. | 363 // To expose client callbacks from VideoDecodeAccelerator. |
| 359 Client* client_; | 364 Client* client_; |
| 360 | 365 |
| 361 // Callback to set the correct gl context. | 366 // Callback to set the correct gl context. |
| 362 MakeGLContextCurrentCallback make_context_current_cb_; | 367 MakeGLContextCurrentCallback make_context_current_cb_; |
| 363 | 368 |
| 364 // Callback to get the GLES2Decoder instance. | 369 // Callback to get the GLES2Decoder instance. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 472 |
| 468 // WeakPtrFactory for posting tasks back to |this|. | 473 // WeakPtrFactory for posting tasks back to |this|. |
| 469 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 474 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
| 470 | 475 |
| 471 friend class AndroidVideoDecodeAcceleratorTest; | 476 friend class AndroidVideoDecodeAcceleratorTest; |
| 472 }; | 477 }; |
| 473 | 478 |
| 474 } // namespace media | 479 } // namespace media |
| 475 | 480 |
| 476 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 481 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |