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

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

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable vaapi_h264_decoder_unittest on Ozone 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_x11.h
diff --git a/content/common/gpu/media/vaapi_picture_provider_x11.h b/content/common/gpu/media/vaapi_picture_provider_x11.h
new file mode 100644
index 0000000000000000000000000000000000000000..50c7462fc9c3024edf5e2ffc1cbcc3069b27c6bf
--- /dev/null
+++ b/content/common/gpu/media/vaapi_picture_provider_x11.h
@@ -0,0 +1,54 @@
+// 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
+// X11 window system used by VaapiPictureProvider to produce output
+// pictures.
+
+#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_
+#define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_
+
+#include "base/callback.h"
+#include "content/common/gpu/media/vaapi_picture_provider.h"
+#include "content/common/gpu/media/vaapi_wrapper.h"
+#include "third_party/libva/va/va.h"
+#include "ui/gfx/size.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_context_glx.h"
+
+namespace content {
+
+// Implementation of the VaapiPictureProvider for the X11 backed
+// chromium.
+class X11VaapiPictureProvider : public VaapiPictureProvider {
+ public:
+ X11VaapiPictureProvider(
+ scoped_refptr<VaapiWrapper> vaapi_wrapper,
+ gfx::GLContextGLX* glx_context,
+ const base::Callback<bool(void)> make_context_current);
+ virtual ~X11VaapiPictureProvider();
+
+ protected:
+ virtual linked_ptr<VaapiPictureProvider::Picture> AllocatePicture(
+ int32 picture_buffer_id,
+ uint32 texture_id,
+ const gfx::Size& size) override;
+
+ private:
+ virtual bool Initialize() override;
+
+ gfx::GLContextGLX* glx_context_;
+ base::Callback<bool(void)> make_context_current_;
+
+ Display* x_display_;
+ GLXFBConfig fb_config_;
+
+ scoped_refptr<VaapiWrapper> vaapi_wrapper_;
+
+ DISALLOW_COPY_AND_ASSIGN(X11VaapiPictureProvider);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_PROVIDER_X11_H_

Powered by Google App Engine
This is Rietveld 408576698