| 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> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <queue> | 12 #include <queue> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/optional.h" | 16 #include "base/optional.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 20 #include "gpu/command_buffer/service/gpu_preferences.h" | 20 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 21 #include "media/base/android/media_codec_bridge_impl.h" | 21 #include "media/base/android/media_codec_bridge_impl.h" |
| 22 #include "media/base/android/media_drm_bridge_cdm_context.h" | 22 #include "media/base/android/media_drm_bridge_cdm_context.h" |
| 23 #include "media/base/android_overlay_mojo_factory.h" |
| 23 #include "media/base/content_decryption_module.h" | 24 #include "media/base/content_decryption_module.h" |
| 24 #include "media/gpu/android_video_surface_chooser.h" | 25 #include "media/gpu/android_video_surface_chooser.h" |
| 25 #include "media/gpu/avda_codec_allocator.h" | 26 #include "media/gpu/avda_codec_allocator.h" |
| 26 #include "media/gpu/avda_picture_buffer_manager.h" | 27 #include "media/gpu/avda_picture_buffer_manager.h" |
| 27 #include "media/gpu/avda_state_provider.h" | 28 #include "media/gpu/avda_state_provider.h" |
| 28 #include "media/gpu/gpu_video_decode_accelerator_helpers.h" | 29 #include "media/gpu/gpu_video_decode_accelerator_helpers.h" |
| 29 #include "media/gpu/media_gpu_export.h" | 30 #include "media/gpu/media_gpu_export.h" |
| 30 #include "media/video/video_decode_accelerator.h" | 31 #include "media/video/video_decode_accelerator.h" |
| 31 #include "ui/gl/android/scoped_java_surface.h" | 32 #include "ui/gl/android/scoped_java_surface.h" |
| 32 #include "ui/gl/android/surface_texture.h" | 33 #include "ui/gl/android/surface_texture.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 59 | 60 |
| 60 // Create a default value that's appropriate for use in production. | 61 // Create a default value that's appropriate for use in production. |
| 61 static PlatformConfig CreateDefault(); | 62 static PlatformConfig CreateDefault(); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 AndroidVideoDecodeAccelerator( | 65 AndroidVideoDecodeAccelerator( |
| 65 AVDACodecAllocator* codec_allocator, | 66 AVDACodecAllocator* codec_allocator, |
| 66 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser, | 67 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser, |
| 67 const MakeGLContextCurrentCallback& make_context_current_cb, | 68 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 68 const GetGLES2DecoderCallback& get_gles2_decoder_cb, | 69 const GetGLES2DecoderCallback& get_gles2_decoder_cb, |
| 70 const AndroidOverlayMojoFactoryCB& overlay_factory_cb, |
| 69 const PlatformConfig& platform_config); | 71 const PlatformConfig& platform_config); |
| 70 | 72 |
| 71 ~AndroidVideoDecodeAccelerator() override; | 73 ~AndroidVideoDecodeAccelerator() override; |
| 72 | 74 |
| 73 // VideoDecodeAccelerator implementation: | 75 // VideoDecodeAccelerator implementation: |
| 74 bool Initialize(const Config& config, Client* client) override; | 76 bool Initialize(const Config& config, Client* client) override; |
| 75 void Decode(const BitstreamBuffer& bitstream_buffer) override; | 77 void Decode(const BitstreamBuffer& bitstream_buffer) override; |
| 76 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; | 78 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; |
| 77 void ReusePictureBuffer(int32_t picture_buffer_id) override; | 79 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
| 78 void Flush() override; | 80 void Flush() override; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 scoped_refptr<AVDASurfaceBundle> incoming_bundle_; | 392 scoped_refptr<AVDASurfaceBundle> incoming_bundle_; |
| 391 | 393 |
| 392 // If we have been given an overlay to use, then this is it. If we've been | 394 // If we have been given an overlay to use, then this is it. If we've been |
| 393 // told to move to SurfaceTexture, then this will be value() == nullptr. | 395 // told to move to SurfaceTexture, then this will be value() == nullptr. |
| 394 base::Optional<std::unique_ptr<AndroidOverlay>> incoming_overlay_; | 396 base::Optional<std::unique_ptr<AndroidOverlay>> incoming_overlay_; |
| 395 | 397 |
| 396 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser_; | 398 std::unique_ptr<AndroidVideoSurfaceChooser> surface_chooser_; |
| 397 | 399 |
| 398 PlatformConfig platform_config_; | 400 PlatformConfig platform_config_; |
| 399 | 401 |
| 402 // Optional factory to produce mojo AndroidOverlay instances. |
| 403 AndroidOverlayMojoFactoryCB overlay_factory_cb_; |
| 404 |
| 400 // WeakPtrFactory for posting tasks back to |this|. | 405 // WeakPtrFactory for posting tasks back to |this|. |
| 401 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 406 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
| 402 | 407 |
| 403 friend class AndroidVideoDecodeAcceleratorTest; | 408 friend class AndroidVideoDecodeAcceleratorTest; |
| 404 }; | 409 }; |
| 405 | 410 |
| 406 } // namespace media | 411 } // namespace media |
| 407 | 412 |
| 408 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 413 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |