Bug 1509994 - Move video_engine from webrtc to systemservices; r=pehrsons
authorDan Minor <dminor@mozilla.com>
Wed, 28 Nov 2018 20:16:42 +0000
changeset 507793 0fd399c6caabff60ac0fe53b920b7d26a9806750
parent 507792 bcc079816150ebbb4e20c2cb7c68560b8cdfb075
child 507794 6cea864da2b6ae105a22219cf3e166d9d2b9aa31
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1509994
milestone65.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 1509994 - Move video_engine from webrtc to systemservices; r=pehrsons Historically this code was part of webrtc.org but has since been removed from upstream. Rather than maintaining it as a local diff against upstream, we should just move it to where it is used. Differential Revision: https://phabricator.services.mozilla.com/D13092
dom/media/systemservices/VideoEngine.cpp
dom/media/systemservices/VideoEngine.h
dom/media/systemservices/moz.build
dom/media/systemservices/video_engine/browser_capture_impl.h
dom/media/systemservices/video_engine/desktop_capture_impl.cc
dom/media/systemservices/video_engine/desktop_capture_impl.h
media/webrtc/trunk/webrtc/BUILD.gn
media/webrtc/trunk/webrtc/video_engine/BUILD.gn
media/webrtc/trunk/webrtc/video_engine/browser_capture_impl.h
media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc
media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.h
media/webrtc/trunk/webrtc/video_engine/video_engine_gn/moz.build
--- a/dom/media/systemservices/VideoEngine.cpp
+++ b/dom/media/systemservices/VideoEngine.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et ft=cpp : */
 /* 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 "VideoEngine.h"
-#include "webrtc/video_engine/browser_capture_impl.h"
+#include "video_engine/browser_capture_impl.h"
+#include "video_engine/desktop_capture_impl.h"
 #include "webrtc/system_wrappers/include/clock.h"
 #ifdef WEBRTC_ANDROID
 #include "webrtc/modules/video_capture/video_capture.h"
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "mozilla/jni/Utils.h"
 #endif
--- a/dom/media/systemservices/VideoEngine.h
+++ b/dom/media/systemservices/VideoEngine.h
@@ -8,17 +8,16 @@
 #define mozilla_VideoEngine_h
 
 #include "MediaEngine.h"
 #include "VideoFrameUtils.h"
 #include "mozilla/media/MediaUtils.h"
 #include "webrtc/modules/video_capture/video_capture_impl.h"
 #include "webrtc/modules/video_capture/video_capture_defines.h"
 #include "webrtc/modules/video_capture/video_capture_factory.h"
-#include "webrtc/video_engine/desktop_capture_impl.h"
 #include <memory>
 #include <functional>
 
 namespace mozilla {
 namespace camera {
 
 // Historically the video engine was part of webrtc
 // it was removed (and reimplemented in Talk)
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -15,21 +15,27 @@ if CONFIG['MOZ_WEBRTC']:
     UNIFIED_SOURCES += [
         'CamerasChild.cpp',
         'CamerasParent.cpp',
         'ShmemPool.cpp',
         'VideoEngine.cpp',
         'VideoFrameUtils.cpp'
     ]
     LOCAL_INCLUDES += [
+        '/media/libyuv/libyuv/include',
         '/media/webrtc/signaling',
         '/media/webrtc/trunk',
         '/media/webrtc/trunk/webrtc',
     ]
 
+    if CONFIG['OS_TARGET'] != 'Android':
+        UNIFIED_SOURCES += [
+            'video_engine/desktop_capture_impl.cc',
+        ]
+
 if CONFIG['OS_TARGET'] == 'Android':
     DEFINES['WEBRTC_ANDROID'] = True
 
 
 if CONFIG['OS_TARGET'] == 'Android':
     EXPORTS += [
         'OpenSLESProvider.h'
     ]
rename from media/webrtc/trunk/webrtc/video_engine/browser_capture_impl.h
rename to dom/media/systemservices/video_engine/browser_capture_impl.h
rename from media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc
rename to dom/media/systemservices/video_engine/desktop_capture_impl.cc
rename from media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.h
rename to dom/media/systemservices/video_engine/desktop_capture_impl.h
--- a/media/webrtc/trunk/webrtc/BUILD.gn
+++ b/media/webrtc/trunk/webrtc/BUILD.gn
@@ -293,19 +293,16 @@ if (!build_with_chromium) {
 
     if (build_with_mozilla) {
       deps += [
         "api:base_peerconnection_api",
         "api:video_frame_api",
         "system_wrappers:field_trial_default",
         "system_wrappers:metrics_default",
       ]
-      if (!is_android) {
-        deps += [ "video_engine" ]
-      }
     } else {
       deps += [
         "api",
         "logging",
         "ortc",
         "p2p",
         "pc",
         "sdk",
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/video_engine/BUILD.gn
+++ /dev/null
@@ -1,15 +0,0 @@
-import("../webrtc.gni")
-
-rtc_static_library("video_engine") {
-  sources = [
-    "browser_capture_impl.h",
-    "desktop_capture_impl.cc",
-    "desktop_capture_impl.h",
-  ]
-  deps = [
-    "..:webrtc_common",
-  ]
-  include_dirs = [
-    "/media/libyuv/libyuv/include"
-  ]
-}
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/video_engine/video_engine_gn/moz.build
+++ /dev/null
@@ -1,178 +0,0 @@
-# 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/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["CHROMIUM_BUILD"] = True
-DEFINES["V8_DEPRECATION_WARNINGS"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_RESTRICT_LOGGING"] = True
-
-FINAL_LIBRARY = "webrtc"
-
-
-LOCAL_INCLUDES += [
-    "!/ipc/ipdl/_ipdlheaders",
-    "/ipc/chromium/src",
-    "/ipc/glue",
-    "/media/libyuv/libyuv/include/",
-    "/media/webrtc/trunk/webrtc/"
-]
-
-UNIFIED_SOURCES += [
-    "/media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["WTF_USE_DYNAMIC_ANNOTATIONS"] = "1"
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["CR_XCODE_VERSION"] = "0920"
-    DEFINES["NO_TCMALLOC"] = True
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE"] = "0"
-
-if CONFIG["OS_TARGET"] == "DragonFly":
-
-    DEFINES["USE_X11"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-
-if CONFIG["OS_TARGET"] == "FreeBSD":
-
-    DEFINES["USE_X11"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_NSS_CERTS"] = "1"
-    DEFINES["USE_X11"] = "1"
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-
-if CONFIG["OS_TARGET"] == "NetBSD":
-
-    DEFINES["USE_X11"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_X11"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NO_TCMALLOC"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "1"
-    DEFINES["UNICODE"] = True
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_CRT_SECURE_NO_WARNINGS"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_USING_V110_SDK71_"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["__STD_C"] = True
-
-if CONFIG["CPU_ARCH"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["CPU_ARCH"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_FORTIFY_SOURCE"] = "2"
-
-if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "DragonFly":
-
-    DEFINES["_FORTIFY_SOURCE"] = "2"
-
-if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD":
-
-    DEFINES["_FORTIFY_SOURCE"] = "2"
-
-if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "NetBSD":
-
-    DEFINES["_FORTIFY_SOURCE"] = "2"
-
-if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_FORTIFY_SOURCE"] = "2"
-
-if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["DISABLE_NACL"] = True
-    DEFINES["NO_TCMALLOC"] = True
-
-if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "NetBSD":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-Library("video_engine_gn")