Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Unified Diff: content/common/gpu/media/vaapi_picture_provider.h

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing modifications in video accelerators Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bb1df4340c750e29fbec03f4d0767aaa86a585e8
--- /dev/null
+++ b/content/common/gpu/media/vaapi_picture_provider.h
@@ -0,0 +1,79 @@
+// 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
+
+namespace content {
+
+// VaapiPictureProvider is in charge of allocating pictures for the
+// window system and binding them to gl textures.
+class VaapiPictureProvider : public base::NonThreadSafe {
+ public:
+ // Picture is native pixmap abstraction (X11/Ozone)
+ class Picture : public base::NonThreadSafe {
+ public:
+ virtual ~Picture() {}
+
+ int32 picture_buffer_id() const {
+ return picture_buffer_id_;
+ };
Pawel Osciak 2014/10/08 08:17:22 Spurious ;
llandwerlin-old 2014/10/08 09:31:18 Acknowledged.
+ uint32 texture_id() const { return texture_id_; }
+ const gfx::Size& size() const { return size_; }
+
+ virtual bool PutSurface(VASurfaceID va_surface_id) = 0;
Pawel Osciak 2014/10/08 08:17:22 "Put" may suggest releasing the surface/resources.
llandwerlin-old 2014/10/08 09:31:17 Acknowledged.
+
+ 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_;
+ };
+
+ // Create a platform specific picture provider for the given
+ // |va_display|. |gl_context| and |make_context_current| will be
+ // used to bind/unbind picture to gl textures.
+ static scoped_ptr<VaapiPictureProvider> Create(
+ VADisplay va_display,
+ gfx::GLContext* gl_context,
+ const base::Callback<bool(void)> make_context_current);
+
+ // Create an RGBA picture of |size| and associate it to the given
+ // gl |texture_id| and |picture_buffer_id|.
+ virtual scoped_ptr<Picture> CreatePicture(int32 picture_buffer_id,
+ uint32 texture_id,
+ const gfx::Size& size) = 0;
+
+ // Notify the picture provider of the picture |size| change.
Pawel Osciak 2014/10/08 08:17:22 Please document return value and what happens, it'
llandwerlin-old 2014/10/08 09:31:18 This will disappear (as per one of your other comm
+ virtual bool SetCodedSurfacesSize(const gfx::Size& size) = 0;
+
+ virtual ~VaapiPictureProvider();
+
+ private:
+ // Initialize the picture provider.
+ virtual bool Initialize() = 0;
+};
Pawel Osciak 2014/10/08 08:17:22 Please DISALLOW_COPY_AND_ASSIGN here and in Pictur
llandwerlin-old 2014/10/08 09:31:18 Acknowledged.
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698