Index: content/common/gpu/media/vaapi_picture_provider_drm.h |
diff --git a/content/common/gpu/media/vaapi_picture_provider_drm.h b/content/common/gpu/media/vaapi_picture_provider_drm.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5c31177757c040b4847a4f4a7b7879af1e25d22 |
--- /dev/null |
+++ b/content/common/gpu/media/vaapi_picture_provider_drm.h |
@@ -0,0 +1,62 @@ |
+// Copyright 2014 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. |
+// |
+// This file contains an implementation of picture allocation for the |
+// Ozone window system used by VaapiPictureProvider to produce output |
+// pictures. |
+ |
+#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_DRM_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_DRM_H_ |
+ |
+#include "base/callback.h" |
+#include "content/common/gpu/media/vaapi_picture_provider.h" |
+#include "third_party/libva/va/va.h" |
+#include "ui/gfx/size.h" |
+ |
+namespace content { |
+ |
+class DrmVaapiPictureProvider : public VaapiPictureProvider { |
+ public: |
+ DrmVaapiPictureProvider( |
+ VADisplay va_display, |
+ const base::Callback<bool(void)> make_context_current); |
+ virtual ~DrmVaapiPictureProvider(); |
+ |
+ virtual scoped_ptr<VaapiPictureProvider::Picture> CreatePicture( |
+ int32 picture_buffer_id, |
+ uint32 texture_id, |
+ const gfx::Size& size) OVERRIDE; |
+ |
+ virtual bool SetCodedSurfacesSize(const gfx::Size& size) OVERRIDE; |
+ |
+ // Converts a VASurface from decoder preferred format (NV12) to |
+ // output picture format (RGBA) |
+ bool PutSurfaceIntoPicture(VASurfaceID va_surface_id_src, |
Pawel Osciak
2014/10/08 08:17:22
This should be private?
llandwerlin-old
2014/10/08 09:31:18
With VPP functions into the VaapiWrapper, this wil
|
+ VASurfaceID va_surface_id_dest, |
+ const gfx::Size& dest_size); |
+ |
+ private: |
+ virtual bool Initialize() OVERRIDE; |
+ |
+ // Initialize the video post processing context with the |size| of |
+ // the decoder output pictures. |
+ bool InitializeVpp(const gfx::Size& size); |
+ |
+ // Deinitialize the video post processing context |
+ void DeinitializeVpp(); |
+ |
+ base::Callback<bool(void)> make_context_current_; |
+ |
+ VADisplay va_display_; |
+ |
+ VAConfigID vpp_config_; |
+ VAContextID vpp_context_; |
+ VABufferID vpp_buffer_; |
+ |
+ gfx::Size coded_picture_size_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_DRM_H_ |