| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "content/common/content_export.h" | |
| 20 #include "content/common/gpu/media/shared_memory_region.h" | |
| 21 #include "content/common/gpu/media/vaapi_jpeg_decoder.h" | |
| 22 #include "content/common/gpu/media/vaapi_wrapper.h" | |
| 23 #include "media/base/bitstream_buffer.h" | 19 #include "media/base/bitstream_buffer.h" |
| 20 #include "media/gpu/media_gpu_export.h" |
| 21 #include "media/gpu/shared_memory_region.h" |
| 22 #include "media/gpu/vaapi_jpeg_decoder.h" |
| 23 #include "media/gpu/vaapi_wrapper.h" |
| 24 #include "media/video/jpeg_decode_accelerator.h" | 24 #include "media/video/jpeg_decode_accelerator.h" |
| 25 | 25 |
| 26 namespace content { | 26 namespace media { |
| 27 | 27 |
| 28 // Class to provide JPEG decode acceleration for Intel systems with hardware | 28 // Class to provide JPEG decode acceleration for Intel systems with hardware |
| 29 // support for it, and on which libva is available. | 29 // support for it, and on which libva is available. |
| 30 // Decoding tasks are performed in a separate decoding thread. | 30 // Decoding tasks are performed in a separate decoding thread. |
| 31 // | 31 // |
| 32 // Threading/life-cycle: this object is created & destroyed on the GPU | 32 // Threading/life-cycle: this object is created & destroyed on the GPU |
| 33 // ChildThread. A few methods on it are called on the decoder thread which is | 33 // ChildThread. A few methods on it are called on the decoder thread which is |
| 34 // stopped during |this->Destroy()|, so any tasks posted to the decoder thread | 34 // stopped during |this->Destroy()|, so any tasks posted to the decoder thread |
| 35 // can assume |*this| is still alive. See |weak_this_| below for more details. | 35 // can assume |*this| is still alive. See |weak_this_| below for more details. |
| 36 class CONTENT_EXPORT VaapiJpegDecodeAccelerator | 36 class MEDIA_GPU_EXPORT VaapiJpegDecodeAccelerator |
| 37 : public media::JpegDecodeAccelerator { | 37 : public media::JpegDecodeAccelerator { |
| 38 public: | 38 public: |
| 39 VaapiJpegDecodeAccelerator( | 39 VaapiJpegDecodeAccelerator( |
| 40 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); | 40 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); |
| 41 ~VaapiJpegDecodeAccelerator() override; | 41 ~VaapiJpegDecodeAccelerator() override; |
| 42 | 42 |
| 43 // media::JpegDecodeAccelerator implementation. | 43 // media::JpegDecodeAccelerator implementation. |
| 44 bool Initialize(media::JpegDecodeAccelerator::Client* client) override; | 44 bool Initialize(media::JpegDecodeAccelerator::Client* client) override; |
| 45 void Decode(const media::BitstreamBuffer& bitstream_buffer, | 45 void Decode(const media::BitstreamBuffer& bitstream_buffer, |
| 46 const scoped_refptr<media::VideoFrame>& video_frame) override; | 46 const scoped_refptr<media::VideoFrame>& video_frame) override; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 gfx::Size coded_size_; | 110 gfx::Size coded_size_; |
| 111 // The VA RT format associated with |va_surface_id_|. | 111 // The VA RT format associated with |va_surface_id_|. |
| 112 unsigned int va_rt_format_; | 112 unsigned int va_rt_format_; |
| 113 | 113 |
| 114 // The WeakPtrFactory for |weak_this_|. | 114 // The WeakPtrFactory for |weak_this_|. |
| 115 base::WeakPtrFactory<VaapiJpegDecodeAccelerator> weak_this_factory_; | 115 base::WeakPtrFactory<VaapiJpegDecodeAccelerator> weak_this_factory_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecodeAccelerator); | 117 DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecodeAccelerator); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace content | 120 } // namespace media |
| 121 | 121 |
| 122 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODE_ACCELERATOR_H_ | 122 #endif // MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_ |
| OLD | NEW |