Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya,glandium,jgilbert
☠☠ backed out by ce9943ea7091 ☠ ☠
authorMartin Stransky <stransky@redhat.com>
Fri, 04 Dec 2020 09:41:46 +0000
changeset 559404 13936ff79b4ca5d7b6cdb6dfa32e406952022c14
parent 559403 7315e7b327f7f69b28c7bb3ab4e4ff349db29b55
child 559405 151eb1e7bf116b14d19fd5cf90d51c05b20f57d3
push id38004
push userncsoregi@mozilla.com
push dateFri, 04 Dec 2020 16:21:20 +0000
treeherdermozilla-central@c22c3f6c8ead [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, glandium, jgilbert
bugs1660336
milestone85.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya,glandium,jgilbert - Remove MOZ_WAYLAND_CFLAGS and /ipc/chromium/chromium-config.mozbuild from ffmpeg58/moz.build - Build ffvpx with vaapi support at ffvpx/moz.build - Move gfx related headers from DMABUFSurfaceImage.h to DMABUFSurfaceImage.cpp and implement the gfx methods there. - Remove GL headers from DMABufSurface.h and forward declare GLuint/GLContext there. - Move mutex/MessageLoop/task related headers from nsWaylandDisplay.h to nsWaylandDisplay.cpp. Depends on D90556 Differential Revision: https://phabricator.services.mozilla.com/D90557
dom/media/platforms/ffmpeg/ffmpeg58/moz.build
dom/media/platforms/ffmpeg/ffvpx/moz.build
gfx/layers/DMABUFSurfaceImage.cpp
gfx/layers/DMABUFSurfaceImage.h
widget/gtk/DMABufSurface.h
widget/gtk/nsWaylandDisplay.cpp
widget/gtk/nsWaylandDisplay.h
--- a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
+++ b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
@@ -22,13 +22,11 @@ if CONFIG['CC_TYPE'] == 'clang':
     '-Wno-unknown-attributes',
   ]
 if CONFIG['CC_TYPE'] == 'gcc':
   CXXFLAGS += [
     '-Wno-attributes',
   ]
 if CONFIG['MOZ_WAYLAND']:
   CXXFLAGS += CONFIG['TK_CFLAGS']
-  CXXFLAGS += CONFIG['MOZ_WAYLAND_CFLAGS']
   DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1
-  include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
--- a/dom/media/platforms/ffmpeg/ffvpx/moz.build
+++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build
@@ -31,9 +31,13 @@ if CONFIG["CC_TYPE"] == "clang":
 if CONFIG["CC_TYPE"] == "gcc":
     CXXFLAGS += [
         "-Wno-attributes",
     ]
 
 DEFINES["FFVPX_VERSION"] = 46465650
 DEFINES["USING_MOZFFVPX"] = True
 
+if CONFIG["MOZ_WAYLAND"]:
+    CXXFLAGS += CONFIG["TK_CFLAGS"]
+    DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1
+
 FINAL_LIBRARY = "xul"
--- a/gfx/layers/DMABUFSurfaceImage.cpp
+++ b/gfx/layers/DMABUFSurfaceImage.cpp
@@ -1,28 +1,38 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DMABUFSurfaceImage.h"
-#include "gfxPlatform.h"
+#include "mozilla/widget/DMABufSurface.h"
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/DMABUFTextureClientOGL.h"
 #include "mozilla/layers/TextureForwarder.h"
-#include "mozilla/UniquePtr.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
 using namespace mozilla::gfx;
 
+DMABUFSurfaceImage::DMABUFSurfaceImage(DMABufSurface* aSurface)
+    : Image(nullptr, ImageFormat::DMABUF), mSurface(aSurface) {
+  mSurface->GlobalRefAdd();
+}
+
+DMABUFSurfaceImage::~DMABUFSurfaceImage() { mSurface->GlobalRefRelease(); }
+
 TextureClient* DMABUFSurfaceImage::GetTextureClient(
     KnowsCompositor* aKnowsCompositor) {
   if (!mTextureClient) {
     BackendType backend = BackendType::NONE;
     mTextureClient = TextureClient::CreateWithData(
         DMABUFTextureData::Create(mSurface, backend), TextureFlags::DEFAULT,
         aKnowsCompositor->GetTextureForwarder());
   }
   return mTextureClient;
 }
+
+gfx::IntSize DMABUFSurfaceImage::GetSize() const {
+  return gfx::IntSize::Truncate(mSurface->GetWidth(), mSurface->GetHeight());
+}
--- a/gfx/layers/DMABUFSurfaceImage.h
+++ b/gfx/layers/DMABUFSurfaceImage.h
@@ -3,42 +3,34 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef SURFACE_DMABUF_H
 #define SURFACE_DMABUF_H
 
 #include "ImageContainer.h"
-#include "mozilla/widget/DMABufSurface.h"
-#include "mozilla/gfx/Point.h"
-#include "mozilla/layers/TextureClient.h"
+
+class DMABufSurface;
 
 namespace mozilla {
 namespace layers {
 
+class TextureClient;
+
 class DMABUFSurfaceImage : public Image {
  public:
-  explicit DMABUFSurfaceImage(DMABufSurface* aSurface)
-      : Image(nullptr, ImageFormat::DMABUF), mSurface(aSurface) {
-    mSurface->GlobalRefAdd();
-  }
-
-  ~DMABUFSurfaceImage() { mSurface->GlobalRefRelease(); }
+  explicit DMABUFSurfaceImage(DMABufSurface* aSurface);
+  ~DMABUFSurfaceImage();
 
   DMABufSurface* GetSurface() { return mSurface; }
-
-  gfx::IntSize GetSize() const override {
-    return gfx::IntSize::Truncate(mSurface->GetWidth(), mSurface->GetHeight());
-  }
-
+  gfx::IntSize GetSize() const override;
   already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override {
     return nullptr;
   }
-
   TextureClient* GetTextureClient(KnowsCompositor* aKnowsCompositor) override;
 
  private:
   RefPtr<DMABufSurface> mSurface;
   RefPtr<TextureClient> mTextureClient;
 };
 
 }  // namespace layers
--- a/widget/gtk/DMABufSurface.h
+++ b/widget/gtk/DMABufSurface.h
@@ -3,31 +3,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef DMABufSurface_h__
 #define DMABufSurface_h__
 
 #include <stdint.h>
-#include "GLContext.h"
-#include "GLContextTypes.h"
 #include "mozilla/widget/nsWaylandDisplay.h"
 #include "mozilla/widget/va_drmcommon.h"
+#include "GLTypes.h"
 
 typedef void* EGLImageKHR;
 typedef void* EGLSyncKHR;
 
 #define DMABUF_BUFFER_PLANES 4
 
 namespace mozilla {
 namespace layers {
 class SurfaceDescriptor;
 class SurfaceDescriptorDMABuf;
 }  // namespace layers
+namespace gl {
+class GLContext;
+}
 }  // namespace mozilla
 
 typedef enum {
   // Use alpha pixel format
   DMABUF_ALPHA = 1 << 0,
   // Surface is used as texture and may be also shared
   DMABUF_TEXTURE = 1 << 1,
   // Use modifiers. Such dmabuf surface may have more planes
--- a/widget/gtk/nsWaylandDisplay.cpp
+++ b/widget/gtk/nsWaylandDisplay.cpp
@@ -1,16 +1,20 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=4:tabstop=4:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsWaylandDisplay.h"
+
+#include "base/message_loop.h"  // for MessageLoop
+#include "base/task.h"          // for NewRunnableMethod, etc
+#include "mozilla/StaticMutex.h"
 #include "mozilla/StaticPrefs_widget.h"
 
 namespace mozilla {
 namespace widget {
 
 // nsWaylandDisplay needs to be created for each calling thread(main thread,
 // compositor thread and render thread)
 #define MAX_DISPLAY_CONNECTIONS 10
--- a/widget/gtk/nsWaylandDisplay.h
+++ b/widget/gtk/nsWaylandDisplay.h
@@ -5,20 +5,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __MOZ_WAYLAND_DISPLAY_H__
 #define __MOZ_WAYLAND_DISPLAY_H__
 
 #include "DMABufLibWrapper.h"
 
-#include "base/message_loop.h"  // for MessageLoop
-#include "base/task.h"          // for NewRunnableMethod, etc
-#include "mozilla/StaticMutex.h"
-
 #include "mozilla/widget/mozwayland.h"
 #include "mozilla/widget/gbm.h"
 #include "mozilla/widget/gtk-primary-selection-client-protocol.h"
 #include "mozilla/widget/idle-inhibit-unstable-v1-client-protocol.h"
 #include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h"
 #include "mozilla/widget/primary-selection-unstable-v1-client-protocol.h"
 
 namespace mozilla {