Index: content/common/gpu/media/vaapi_jpeg_decoder.h |
diff --git a/content/common/gpu/media/vaapi_jpeg_decoder.h b/content/common/gpu/media/vaapi_jpeg_decoder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9f625bf6b48327075d7aee1a1e96ce7f1f9173ee |
--- /dev/null |
+++ b/content/common/gpu/media/vaapi_jpeg_decoder.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_ |
+ |
+#include "base/macros.h" |
+#include "content/common/content_export.h" |
+#include "content/common/gpu/media/vaapi_wrapper.h" |
+ |
+namespace media { |
+struct JpegParseResult; |
+} // namespace media |
+ |
+namespace content { |
+ |
+// A JPEG decoder that utilizes VA-API hardware video decode acceleration on |
+// Intel systems. Provides functionality to allow plugging VAAPI HW |
+// acceleration into the JDA framework. |
wuchengli
2015/01/20 07:55:53
s/JDA/JpegDecodeAccelerator/ It's an uncommon acro
kcwu
2015/01/21 12:23:48
Done.
|
+// |
+// Clients of this class are expected to manage VA surfaces created via |
+// VaapiWrapper, parse JPEG picture via ParseJpegPicture, and then pass them to |
wuchengli
2015/01/20 07:55:53
s/ParseJpegPicture/media::ParseJpegPicture/
kcwu
2015/01/21 12:23:48
Done.
|
+// this class. |
+// |
+// This class must be called on a single thread, and does nothing internally on |
+// any other thread. |
+class CONTENT_EXPORT VaapiJpegDecoder { |
+ public: |
+ // |vaapi_wrapper| should be initialized in kDecode mode with |
+ // VAProfileJPEGBaseline profile. |
+ // This class doesn't take the ownership of |vaapi_wrapper|. |
+ VaapiJpegDecoder(VaapiWrapper* vaapi_wrapper); |
+ |
+ ~VaapiJpegDecoder(); |
+ |
+ // Decode a JPEG picture. It will fill VA-API parameters and call |
+ // corresponding VA-API methods according to parsed JPEG result |
+ // |parse_result|. Decoded data will be outputted to the given |va_surface|. |
+ // Return false on failure. |
+ bool Decode(const media::JpegParseResult& parse_result, |
wuchengli
2015/01/20 15:41:41
This can be static and pass VaapiWrapper here. It'
kcwu
2015/01/21 12:23:48
Done.
|
+ VASurfaceID va_surface); |
+ |
+ private: |
+ VaapiWrapper* vaapi_wrapper_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecoder); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_ |