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_DECODER_H_ | 5 #ifndef MEDIA_GPU_VAAPI_JPEG_DECODER_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_ | 6 #define MEDIA_GPU_VAAPI_JPEG_DECODER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/common/content_export.h" | 9 #include "media/gpu/media_gpu_export.h" |
10 #include "content/common/gpu/media/vaapi_wrapper.h" | 10 #include "media/gpu/vaapi_wrapper.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 struct JpegParseResult; | 13 struct JpegParseResult; |
14 } // namespace media | 14 } // namespace media |
15 | 15 |
16 namespace content { | 16 namespace media { |
17 | 17 |
18 // A JPEG decoder that utilizes VA-API hardware video decode acceleration on | 18 // A JPEG decoder that utilizes VA-API hardware video decode acceleration on |
19 // Intel systems. Provides functionality to allow plugging VAAPI HW | 19 // Intel systems. Provides functionality to allow plugging VAAPI HW |
20 // acceleration into the JpegDecodeAccelerator framework. | 20 // acceleration into the JpegDecodeAccelerator framework. |
21 // | 21 // |
22 // Clients of this class are expected to manage VA surfaces created via | 22 // Clients of this class are expected to manage VA surfaces created via |
23 // VaapiWrapper, parse JPEG picture via media::ParseJpegPicture, and then pass | 23 // VaapiWrapper, parse JPEG picture via media::ParseJpegPicture, and then pass |
24 // them to this class. | 24 // them to this class. |
25 class CONTENT_EXPORT VaapiJpegDecoder { | 25 class MEDIA_GPU_EXPORT VaapiJpegDecoder { |
26 public: | 26 public: |
27 // Decode a JPEG picture. It will fill VA-API parameters and call | 27 // Decode a JPEG picture. It will fill VA-API parameters and call |
28 // corresponding VA-API methods according to parsed JPEG result | 28 // corresponding VA-API methods according to parsed JPEG result |
29 // |parse_result|. Decoded data will be outputted to the given |va_surface|. | 29 // |parse_result|. Decoded data will be outputted to the given |va_surface|. |
30 // Return false on failure. | 30 // Return false on failure. |
31 // |vaapi_wrapper| should be initialized in kDecode mode with | 31 // |vaapi_wrapper| should be initialized in kDecode mode with |
32 // VAProfileJPEGBaseline profile. | 32 // VAProfileJPEGBaseline profile. |
33 // |va_surface| should be created with size at least as large as the picture | 33 // |va_surface| should be created with size at least as large as the picture |
34 // size. | 34 // size. |
35 static bool Decode(VaapiWrapper* vaapi_wrapper, | 35 static bool Decode(VaapiWrapper* vaapi_wrapper, |
36 const media::JpegParseResult& parse_result, | 36 const media::JpegParseResult& parse_result, |
37 VASurfaceID va_surface); | 37 VASurfaceID va_surface); |
38 | 38 |
39 private: | 39 private: |
40 DISALLOW_IMPLICIT_CONSTRUCTORS(VaapiJpegDecoder); | 40 DISALLOW_IMPLICIT_CONSTRUCTORS(VaapiJpegDecoder); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace content | 43 } // namespace media |
44 | 44 |
45 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_ | 45 #endif // MEDIA_GPU_VAAPI_JPEG_DECODER_H_ |
OLD | NEW |