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

Unified Diff: content/common/gpu/media/vaapi_picture.cc

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after Pawel's review Created 6 years 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.cc
diff --git a/content/common/gpu/media/vaapi_picture.cc b/content/common/gpu/media/vaapi_picture.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9d2ea90791eaeeaf21c6abaa64187ef478cae2ed
--- /dev/null
+++ b/content/common/gpu/media/vaapi_picture.cc
@@ -0,0 +1,55 @@
+// 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.
+
+#include "content/common/gpu/media/vaapi_picture.h"
+#include "content/common/gpu/media/vaapi_wrapper.h"
+#include "ui/gl/gl_bindings.h"
+
+#if defined(USE_X11)
+#include "content/common/gpu/media/vaapi_tfp_picture.h"
+#else
+#include "content/common/gpu/media/vaapi_drm_picture.h"
+#endif
+
+namespace content {
+
+// static
+linked_ptr<VaapiPicture> VaapiPicture::CreatePicture(
+ scoped_refptr<VaapiWrapper> vaapi_wrapper,
Pawel Osciak 2014/12/09 01:19:25 const scoped_refptr<>& please
llandwerlin-old 2014/12/09 11:19:48 Done.
+ gfx::GLContext* gl_context,
+ const base::Callback<bool(void)> make_context_current,
+ int32 picture_buffer_id,
+ uint32 texture_id,
+ const gfx::Size& size) {
+ linked_ptr<VaapiPicture> picture;
+#if defined(USE_X11)
+ picture.reset(
+ new VaapiTFPPicture(vaapi_wrapper,
+ reinterpret_cast<gfx::GLContextGLX*>(gl_context),
+ make_context_current,
+ picture_buffer_id,
+ texture_id,
+ size));
+#else
+ picture.reset(new VaapiDrmPicture(
+ vaapi_wrapper, make_context_current, picture_buffer_id,
+ texture_id, size));
+#endif // USE_X11
+
+ if (!picture->Initialize())
+ picture.reset();
+
+ return picture;
+}
+
+// static
+uint32 VaapiPicture::GetGLTextureTarget() {
+#if defined(USE_OZONE)
+ return GL_TEXTURE_EXTERNAL_OES;
+#else
+ return GL_TEXTURE_2D;
+#endif
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698