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