Index: content/common/gpu/media/vaapi_picture_provider.h |
diff --git a/content/common/gpu/media/vaapi_picture_provider.h b/content/common/gpu/media/vaapi_picture_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..910f1faacaec69ed0a510fbad5b68d0ce7cad3cb |
--- /dev/null |
+++ b/content/common/gpu/media/vaapi_picture_provider.h |
@@ -0,0 +1,74 @@ |
+// 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 |
+// different window system (X11/Ozone) used by |
+// VaapiVideoDecodeAccelerator to produce output pictures. |
+ |
+#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_H_ |
+ |
+#include "base/callback.h" |
+#include "base/memory/linked_ptr.h" |
+#include "base/threading/non_thread_safe.h" |
+#include "third_party/libva/va/va.h" |
+#include "ui/gfx/size.h" |
+ |
+namespace gfx { |
+class GLContext; |
+}; // namespace gfx |
Pawel Osciak
2014/09/24 11:27:12
s/;//
llandwerlin-old
2014/09/25 09:54:18
Acknowledged.
|
+ |
+namespace content { |
+ |
+// VaapiPictureProvider is in charge of allocating pictures for the |
+// window system and bind them to gl textures. |
Pawel Osciak
2014/09/24 11:27:12
s/bind/binding/
llandwerlin-old
2014/09/25 09:54:18
Acknowledged.
|
+class VaapiPictureProvider { |
Pawel Osciak
2014/09/24 11:27:12
Please keep NonThreadSafe property on this and pic
llandwerlin-old
2014/09/25 09:54:18
Acknowledged.
|
+ public: |
+ |
+ // Picture is native pixmap abstraction (X11/Ozone) |
+ class Picture { |
+ public: |
+ virtual ~Picture() {} |
+ |
+ int32 picture_buffer_id() const { |
+ return picture_buffer_id_; |
+ }; |
+ |
+ uint32 texture_id() const { return texture_id_; } |
+ const gfx::Size& size() const { return size_; } |
+ |
+ protected: |
+ Picture(int32 picture_buffer_id, uint32 texture_id, const gfx::Size& size) |
+ : picture_buffer_id_(picture_buffer_id), |
+ texture_id_(texture_id), |
+ size_(size) {} |
+ |
+ private: |
+ int32 picture_buffer_id_; |
+ uint32 texture_id_; |
+ gfx::Size size_; |
+ }; |
+ |
+ virtual ~VaapiPictureProvider() {} |
+ |
+ static scoped_ptr<VaapiPictureProvider> Create( |
Pawel Osciak
2014/09/24 11:27:12
Please add documentation for methods.
llandwerlin-old
2014/09/25 09:54:18
Acknowledged.
|
+ VADisplay va_display, |
+ gfx::GLContext* gl_context, |
+ const base::Callback<bool(void)> make_context_current); |
+ |
+ virtual scoped_ptr<Picture> CreatePicture(int32 picture_buffer_id, |
+ uint32 texture_id, |
+ const gfx::Size& size) = 0; |
+ |
+ virtual bool PutSurfaceIntoPicture(VASurfaceID va_surface_id, |
+ Picture* picture) = 0; |
+ |
+ virtual bool SetCodedSurfacesSize(const gfx::Size& size) { return true; } |
Pawel Osciak
2014/09/24 11:27:12
I don't understand this default body... When does
llandwerlin-old
2014/09/25 09:54:18
Making it virtual and moving this body to the X11
|
+ |
+ virtual bool Initialize() = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_H_ |
Pawel Osciak
2014/09/24 11:27:12
Two spaces before '//'.
llandwerlin-old
2014/09/25 09:54:18
Acknowledged.
|