Bug 1497559 - Remove application capture support; r=ng
authorDan Minor <dminor@mozilla.com>
Fri, 26 Apr 2019 16:35:39 +0000
changeset 472112 f8b8e009ac08ecbf01db56484d9ea5b69260e4bf
parent 472111 d9c1fe157813922d86505e0c987908404fffc141
child 472113 a853ab3519b444da8977d7027e3846b5ec2fa4c4
push id35948
push usernerli@mozilla.com
push dateWed, 01 May 2019 21:55:33 +0000
treeherdermozilla-central@c7a22f0ea7b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersng
bugs1497559
milestone68.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 1497559 - Remove application capture support; r=ng This removes all references to application capture except from MediaSourceEnum. That was left in place so as to not change the enumerated values used for WEBRTC_GET_USER_MEDIA_TYPE telemetry. Differential Revision: https://phabricator.services.mozilla.com/D28089
dom/media/MediaManager.cpp
dom/media/systemservices/CamerasParent.cpp
dom/media/systemservices/CamerasTypes.h
dom/media/systemservices/VideoEngine.cpp
dom/media/systemservices/video_engine/desktop_capture_impl.cc
dom/media/tests/mochitest/test_getUserMedia_constraints.html
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
dom/media/webrtc/MediaEngineSource.cpp
dom/media/webrtc/MediaEngineWebRTC.cpp
media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer.cc
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer.h
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_mac.mm
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_unittest.cc
media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_win.cc
media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc
media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1254,17 +1254,16 @@ class GetUserMediaStreamRunnable : publi
         MOZ_ASSERT(IsOn(mConstraints.mVideo));
         RefPtr<MediaStreamTrack> track = domStream->CreateDOMTrack(
             kVideoTrack, MediaSegment::VIDEO, videoSource,
             GetInvariant(mConstraints.mVideo));
         domStream->AddTrackInternal(track);
         switch (source) {
           case MediaSourceEnum::Browser:
           case MediaSourceEnum::Screen:
-          case MediaSourceEnum::Application:
           case MediaSourceEnum::Window:
             // Wait for first frame for screen-sharing devices, to ensure
             // with and height settings are available immediately, to pass wpt.
             firstFramePromise = mVideoDevice->mSource->GetFirstFramePromise();
             break;
           default:
             break;
         }
@@ -2460,17 +2459,16 @@ RefPtr<MediaManager::StreamPromise> Medi
         // Functional defaults are helpful in tests, but also a natural outcome
         // of the constraints API's limited semantics for requiring input.
         if (!vc.mBrowserWindow.WasPassed()) {
           nsPIDOMWindowOuter* outer = aWindow->GetOuterWindow();
           vc.mBrowserWindow.Construct(outer->WindowID());
         }
         MOZ_FALLTHROUGH;
       case MediaSourceEnum::Screen:
-      case MediaSourceEnum::Application:
       case MediaSourceEnum::Window:
         // Deny screensharing request if support is disabled, or
         // the requesting document is not from a host on the whitelist.
         if (!Preferences::GetBool(
                 ((videoType == MediaSourceEnum::Browser)
                      ? "media.getusermedia.browser.enabled"
                      : "media.getusermedia.screensharing.enabled"),
                 false) ||
@@ -2519,17 +2517,16 @@ RefPtr<MediaManager::StreamPromise> Medi
       //
       // For UX reasons we don't want "Entire Screen" to be the first/default
       // choice (in our code first=default). It's a "scary" source that comes
       // with complicated warnings on-top that would be confusing as the first
       // thing people see, and also deserves to be listed as last resort for
       // privacy reasons.
 
       if (videoType == MediaSourceEnum::Screen ||
-          videoType == MediaSourceEnum::Application ||
           videoType == MediaSourceEnum::Browser) {
         videoType = MediaSourceEnum::Window;
         vc.mMediaSource.AssignASCII(
             EnumToASCII(dom::MediaSourceEnumValues::strings, videoType));
       }
       // only allow privileged content to set the window id
       if (vc.mBrowserWindow.WasPassed()) {
         vc.mBrowserWindow.Value() = -1;
@@ -4460,18 +4457,16 @@ void SourceListener::StopSharing() {
   }
 
   MOZ_RELEASE_ASSERT(mWindowListener);
   LOG("SourceListener %p StopSharing", this);
 
   if (mVideoDeviceState && (mVideoDeviceState->mDevice->GetMediaSource() ==
                                 MediaSourceEnum::Screen ||
                             mVideoDeviceState->mDevice->GetMediaSource() ==
-                                MediaSourceEnum::Application ||
-                            mVideoDeviceState->mDevice->GetMediaSource() ==
                                 MediaSourceEnum::Window)) {
     // We want to stop the whole stream if there's no audio;
     // just the video track if we have both.
     // StopTrack figures this out for us.
     StopTrack(kVideoTrack);
   }
   if (mAudioDeviceState && mAudioDeviceState->mDevice->GetMediaSource() ==
                                MediaSourceEnum::AudioCapture) {
--- a/dom/media/systemservices/CamerasParent.cpp
+++ b/dom/media/systemservices/CamerasParent.cpp
@@ -350,20 +350,16 @@ bool CamerasParent::SetupEngine(CaptureE
       case BrowserEngine:
         captureDeviceInfo = MakeUnique<webrtc::CaptureDeviceInfo>(
             webrtc::CaptureDeviceType::Browser);
         break;
       case WinEngine:
         captureDeviceInfo = MakeUnique<webrtc::CaptureDeviceInfo>(
             webrtc::CaptureDeviceType::Window);
         break;
-      case AppEngine:
-        captureDeviceInfo = MakeUnique<webrtc::CaptureDeviceInfo>(
-            webrtc::CaptureDeviceType::Application);
-        break;
       case CameraEngine:
         captureDeviceInfo = MakeUnique<webrtc::CaptureDeviceInfo>(
             webrtc::CaptureDeviceType::Camera);
         break;
       default:
         LOG(("Invalid webrtc Video engine"));
         MOZ_CRASH();
         break;
@@ -903,17 +899,17 @@ mozilla::ipc::IPCResult CamerasParent::R
                         minDistance = distance;
                       }
                     }
                     MOZ_ASSERT(minIdx != -1);
                     capability = candidateCapabilities->second[minIdx];
                   }
                 } else if (aCapEngine == ScreenEngine ||
                            aCapEngine == BrowserEngine ||
-                           aCapEngine == WinEngine || aCapEngine == AppEngine) {
+                           aCapEngine == WinEngine) {
                   for (const auto& it : sDeviceUniqueIDs) {
                     if (strcmp(it.second,
                                cap.VideoCapture()->CurrentDeviceName()) == 0) {
                       capability.maxFPS =
                           std::max(capability.maxFPS,
                                    sAllRequestedCapabilities[it.first].maxFPS);
                     }
                   }
--- a/dom/media/systemservices/CamerasTypes.h
+++ b/dom/media/systemservices/CamerasTypes.h
@@ -13,17 +13,16 @@ namespace mozilla {
 
 namespace camera {
 
 enum CaptureEngine : int {
   InvalidEngine = 0,
   ScreenEngine,
   BrowserEngine,
   WinEngine,
-  AppEngine,
   CameraEngine,
   MaxEngine
 };
 
 }  // namespace camera
 }  // namespace mozilla
 
 namespace IPC {
--- a/dom/media/systemservices/VideoEngine.cpp
+++ b/dom/media/systemservices/VideoEngine.cpp
@@ -184,19 +184,18 @@ VideoEngine::GetOrCreateVideoCaptureDevi
       break;
     }
     case webrtc::CaptureDeviceType::Browser: {
       mDeviceInfo.reset(webrtc::BrowserDeviceInfoImpl::CreateDeviceInfo());
       LOG((
           "webrtc::CaptureDeviceType::Browser: Finished creating new device."));
       break;
     }
-    // Window, Application, and Screen types are handled by DesktopCapture
+    // Window and Screen types are handled by DesktopCapture
     case webrtc::CaptureDeviceType::Window:
-    case webrtc::CaptureDeviceType::Application:
     case webrtc::CaptureDeviceType::Screen: {
 #if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS)
       mDeviceInfo.reset(webrtc::DesktopCaptureImpl::CreateDeviceInfo(
           mId, mCaptureDevInfo.type));
       LOG(("screen capture: Finished creating new device."));
 #else
       MOZ_ASSERT(
           "GetVideoCaptureDeviceInfo NO DESKTOP CAPTURE IMPL ON ANDROID" ==
--- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc
+++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc
@@ -21,17 +21,16 @@
 #include "modules/video_capture/video_capture_config.h"
 #include "system_wrappers/include/clock.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/refcountedobject.h"
 #include "rtc_base/trace_event.h"
 #include "video_engine/desktop_capture_impl.h"
 #include "modules/desktop_capture/desktop_frame.h"
 #include "modules/desktop_capture/desktop_device_info.h"
-#include "modules/desktop_capture/app_capturer.h"
 #include "modules/desktop_capture/desktop_capture_options.h"
 #include "modules/video_capture/video_capture.h"
 
 #if defined(_WIN32)
 #  include "platform_uithread.h"
 #else
 #  include "rtc_base/platform_thread.h"
 #endif
@@ -297,24 +296,17 @@ int32_t WindowDeviceInfoImpl::GetBestMat
 
 int32_t WindowDeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8,
                                              VideoRotation& orientation) {
   return 0;
 }
 
 VideoCaptureModule::DeviceInfo* DesktopCaptureImpl::CreateDeviceInfo(
     const int32_t id, const CaptureDeviceType type) {
-  if (type == CaptureDeviceType::Application) {
-    AppDeviceInfoImpl* pAppDeviceInfoImpl = new AppDeviceInfoImpl(id);
-    if (!pAppDeviceInfoImpl || pAppDeviceInfoImpl->Init()) {
-      delete pAppDeviceInfoImpl;
-      pAppDeviceInfoImpl = NULL;
-    }
-    return pAppDeviceInfoImpl;
-  } else if (type == CaptureDeviceType::Screen) {
+  if (type == CaptureDeviceType::Screen) {
     ScreenDeviceInfoImpl* pScreenDeviceInfoImpl = new ScreenDeviceInfoImpl(id);
     if (!pScreenDeviceInfoImpl || pScreenDeviceInfoImpl->Init()) {
       delete pScreenDeviceInfoImpl;
       pScreenDeviceInfoImpl = NULL;
     }
     return pScreenDeviceInfoImpl;
   } else if (type == CaptureDeviceType::Window) {
     WindowDeviceInfoImpl* pWindowDeviceInfoImpl = new WindowDeviceInfoImpl(id);
@@ -336,33 +328,17 @@ int32_t DesktopCaptureImpl::Init() {
   if (desktop_capturer_cursor_composer_) {
     return 0;
   }
 
   DesktopCaptureOptions options = DesktopCaptureOptions::CreateDefault();
   // Leave desktop effects enabled during WebRTC captures.
   options.set_disable_effects(false);
 
-  if (_deviceType == CaptureDeviceType::Application) {
-    std::unique_ptr<DesktopCapturer> pAppCapturer =
-        DesktopCapturer::CreateAppCapturer(options);
-    if (!pAppCapturer) {
-      return -1;
-    }
-
-    DesktopCapturer::SourceId sourceId = atoi(_deviceUniqueId.c_str());
-    pAppCapturer->SelectSource(sourceId);
-
-    MouseCursorMonitor* pMouseCursorMonitor =
-        MouseCursorMonitor::CreateForScreen(options,
-                                            webrtc::kFullDesktopScreenId);
-    desktop_capturer_cursor_composer_ =
-        std::unique_ptr<DesktopAndCursorComposer>(new DesktopAndCursorComposer(
-            pAppCapturer.release(), pMouseCursorMonitor));
-  } else if (_deviceType == CaptureDeviceType::Screen) {
+  if (_deviceType == CaptureDeviceType::Screen) {
     std::unique_ptr<DesktopCapturer> pScreenCapturer =
         DesktopCapturer::CreateScreenCapturer(options);
     if (!pScreenCapturer.get()) {
       return -1;
     }
 
     DesktopCapturer::SourceId sourceId = atoi(_deviceUniqueId.c_str());
     pScreenCapturer->SelectSource(sourceId);
--- a/dom/media/tests/mochitest/test_getUserMedia_constraints.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_constraints.html
@@ -22,19 +22,19 @@ var tests = [
     constraints: { audio: { somethingUnknown: { exact: 0 } } },
     error: null },
   { message: "audio overconstrained by facingMode ignored",
     constraints: { audio: { facingMode: { exact: 'left' } } },
     error: null },
   { message: "full screensharing requires permission",
     constraints: { video: { mediaSource: 'screen' } },
     error: "NotAllowedError" },
-  { message: "application screensharing requires permission",
+  { message: "application screensharing no longer exists",
     constraints: { video: { mediaSource: 'application' } },
-    error: "NotAllowedError" },
+    error: "OverconstrainedError" },
   { message: "window screensharing requires permission",
     constraints: { video: { mediaSource: 'window' } },
     error: "NotAllowedError" },
   { message: "browser screensharing requires permission",
     constraints: { video: { mediaSource: 'browser' } },
     error: "NotAllowedError" },
   { message: "unknown mediaSource in video fails",
     constraints: { video: { mediaSource: 'uncle' } },
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -55,18 +55,16 @@ MediaEngineRemoteVideoSource::~MediaEngi
 dom::MediaSourceEnum MediaEngineRemoteVideoSource::GetMediaSource() const {
   switch (mCapEngine) {
     case camera::BrowserEngine:
       return MediaSourceEnum::Browser;
     case camera::CameraEngine:
       return MediaSourceEnum::Camera;
     case camera::ScreenEngine:
       return MediaSourceEnum::Screen;
-    case camera::AppEngine:
-      return MediaSourceEnum::Application;
     case camera::WinEngine:
       return MediaSourceEnum::Window;
     default:
       MOZ_CRASH();
   }
 }
 
 void MediaEngineRemoteVideoSource::Init() {
@@ -319,17 +317,16 @@ nsresult MediaEngineRemoteVideoSource::S
 
   NS_DispatchToMainThread(NS_NewRunnableFunction(
       "MediaEngineRemoteVideoSource::SetLastCapability",
       [settings = mSettings, updated = mSettingsUpdatedByFrame,
        capEngine = mCapEngine, cap = mCapability]() mutable {
         switch (capEngine) {
           case camera::ScreenEngine:
           case camera::WinEngine:
-          case camera::AppEngine:
             // Undo the hack where ideal and max constraints are crammed
             // together in mCapability for consumption by low-level code. We
             // don't actually know the real resolution yet, so report min(ideal,
             // max) for now.
             // TODO: This can be removed in bug 1453269.
             cap.width = std::min(cap.width >> 16, cap.width & 0xffff);
             cap.height = std::min(cap.height >> 16, cap.height & 0xffff);
             break;
@@ -513,18 +510,17 @@ int MediaEngineRemoteVideoSource::Delive
       req_ideal_width > 0 ? req_ideal_width : aProps.width(), dst_max_width);
   int32_t dst_height =
       std::min(req_ideal_height > 0 ? req_ideal_height : aProps.height(),
                dst_max_height);
 
   // Apply scaling for screen sharing, see bug 1453269.
   switch (mCapEngine) {
     case camera::ScreenEngine:
-    case camera::WinEngine:
-    case camera::AppEngine: {
+    case camera::WinEngine: {
       // scale to average of portrait and landscape
       float scale_width = (float)dst_width / (float)aProps.width();
       float scale_height = (float)dst_height / (float)aProps.height();
       float scale = (scale_width + scale_height) / 2;
       dst_width = (int)(scale * target_width);
       dst_height = (int)(scale * target_height);
 
       // if scaled rectangle exceeds max rectangle, scale to minimum of portrait
@@ -778,18 +774,17 @@ bool MediaEngineRemoteVideoSource::Choos
       for (auto& advanced : aConstraints.mAdvanced) {
         MediaConstraintsHelper::LogConstraints(advanced);
       }
     }
   }
 
   switch (mCapEngine) {
     case camera::ScreenEngine:
-    case camera::WinEngine:
-    case camera::AppEngine: {
+    case camera::WinEngine: {
       FlattenedConstraints c(aConstraints);
       // The actual resolution to constrain around is not easy to find ahead of
       // time (and may in fact change over time), so as a hack, we push ideal
       // and max constraints down to desktop_capture_impl.cc and finish the
       // algorithm there.
       // TODO: This can be removed in bug 1453269.
       aCapability.width =
           (std::min(0xffff, c.mWidth.mIdeal.valueOr(0)) & 0xffff) << 16 |
--- a/dom/media/webrtc/MediaEngineSource.cpp
+++ b/dom/media/webrtc/MediaEngineSource.cpp
@@ -18,17 +18,16 @@ using dom::MediaTrackSettings;
 const unsigned int MediaEngineSource::kMaxDeviceNameLength;
 const unsigned int MediaEngineSource::kMaxUniqueIdLength;
 
 /* static */
 bool MediaEngineSource::IsVideo(MediaSourceEnum aSource) {
   switch (aSource) {
     case MediaSourceEnum::Camera:
     case MediaSourceEnum::Screen:
-    case MediaSourceEnum::Application:
     case MediaSourceEnum::Window:
     case MediaSourceEnum::Browser:
       return true;
     case MediaSourceEnum::Microphone:
     case MediaSourceEnum::AudioCapture:
     case MediaSourceEnum::Other:
       return false;
     default:
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -241,19 +241,16 @@ void MediaEngineWebRTC::EnumerateDevices
       case dom::MediaSourceEnum::Window:
         // Since the mediaSource constraint is deprecated, treat the Window
         // value as a request for getDisplayMedia-equivalent sharing: Combine
         // window and fullscreen into a single list of choices. The other values
         // are still useful for testing.
         EnumerateVideoDevices(aWindowId, camera::WinEngine, aDevices);
         EnumerateVideoDevices(aWindowId, camera::ScreenEngine, aDevices);
         break;
-      case dom::MediaSourceEnum::Application:
-        EnumerateVideoDevices(aWindowId, camera::AppEngine, aDevices);
-        break;
       case dom::MediaSourceEnum::Screen:
         EnumerateVideoDevices(aWindowId, camera::ScreenEngine, aDevices);
         break;
       case dom::MediaSourceEnum::Browser:
         EnumerateVideoDevices(aWindowId, camera::BrowserEngine, aDevices);
         break;
       case dom::MediaSourceEnum::Camera:
         EnumerateVideoDevices(aWindowId, camera::CameraEngine, aDevices);
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -882,17 +882,16 @@ nsresult TransceiverImpl::ConfigureVideo
     return NS_ERROR_FAILURE;
   }
 
   dom::MediaSourceEnum source = videotrack->GetSource().GetMediaSource();
   webrtc::VideoCodecMode mode = webrtc::kRealtimeVideo;
   switch (source) {
     case dom::MediaSourceEnum::Browser:
     case dom::MediaSourceEnum::Screen:
-    case dom::MediaSourceEnum::Application:
     case dom::MediaSourceEnum::Window:
       mode = webrtc::kScreensharing;
       break;
 
     case dom::MediaSourceEnum::Camera:
     default:
       mode = webrtc::kRealtimeVideo;
       break;
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
@@ -305,26 +305,24 @@ rtc_static_library("desktop_capture_gene
     "window_finder_win.cc",
     "window_finder_win.h",
   ]
 
   if (build_with_mozilla) {
     defines = [ "MULTI_MONITOR_SCREENSHARE" ]
 
     sources += [
-      "app_capturer_win.cc",
       "desktop_device_info.cc",
       "desktop_device_info.h",
       "win/desktop_device_info_win.cc",
       "win/win_shared.cc",
     ]
 
     if (is_mac) {
       sources += [
-        "app_capturer_mac.mm",
         "mac/desktop_device_info_mac.mm",
       ]
     }
 
     include_dirs = [ "/media/libyuv/libyuv/include" ]
   } else {
     sources += [
       "fake_desktop_capturer.cc",
@@ -333,20 +331,16 @@ rtc_static_library("desktop_capture_gene
   }
 
   if (use_x11 || rtc_use_pipewire) {
     sources += [
       "mouse_cursor_monitor_linux.cc",
       "screen_capturer_linux.cc",
       "window_capturer_linux.cc",
     ]
-
-    if (build_with_mozilla) {
-      sources += [ "app_capturer_linux.cc" ]
-    }
   }
 
   if (use_x11) {
     sources += [
       "linux/mouse_cursor_monitor_x11.cc",
       "linux/mouse_cursor_monitor_x11.h",
       "linux/screen_capturer_x11.cc",
       "linux/screen_capturer_x11.h",
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-
-#include "modules/desktop_capture/app_capturer.h"
-#include "modules/desktop_capture/desktop_capture_options.h"
-
-namespace webrtc {
-
-// static
-AppCapturer* AppCapturer::Create() {
-  return Create(DesktopCaptureOptions::CreateDefault());
-}
-
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-
-#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_APP_CAPTURER_H_
-#define WEBRTC_MODULES_DESKTOP_CAPTURE_APP_CAPTURER_H_
-
-#include <vector>
-#include <string>
-
-#include "modules/desktop_capture/desktop_capture_types.h"
-#include "modules/desktop_capture/desktop_capturer.h"
-#include "typedefs.h"
-
-namespace webrtc {
-
-class DesktopCaptureOptions;
-
-class AppCapturer : public DesktopCapturer {
-public:
-    typedef webrtc::ProcessId ProcessId;
-    struct App {
-        ProcessId id;
-        // Application Name in UTF-8 encoding.
-        std::string title;
-    };
-    typedef std::vector<App> AppList;
-
-    static AppCapturer* Create(const DesktopCaptureOptions& options);
-    static AppCapturer* Create();
-
-    virtual ~AppCapturer() {}
-
-    //AppCapturer Interfaces
-    virtual bool GetAppList(AppList* apps) = 0;
-    virtual bool SelectApp(ProcessId id) = 0;
-    virtual bool BringAppToFront() = 0;
-};
-
-}  // namespace webrtc
-
-#endif  // WEBRTC_MODULES_DESKTOP_CAPTURE_APP_CAPTURER_H_
-
deleted file mode 100755
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-#include "modules/desktop_capture/app_capturer.h"
-#include "modules/desktop_capture/shared_desktop_frame.h"
-#include "modules/desktop_capture/linux/shared_x_util.h"
-
-#include <assert.h>
-#include <string.h>
-#include <X11/Xatom.h>
-#include <X11/extensions/Xcomposite.h>
-#include <X11/extensions/Xrender.h>
-#include <X11/Xutil.h>
-#include <X11/Xregion.h>
-
-#include <algorithm>
-
-#include "modules/desktop_capture/desktop_capture_options.h"
-#include "modules/desktop_capture/desktop_frame.h"
-#include "modules/desktop_capture/linux/shared_x_display.h"
-#include "modules/desktop_capture/linux/x_error_trap.h"
-#include "modules/desktop_capture/linux/x_server_pixel_buffer.h"
-#include "rtc_base/logging.h"
-
-namespace webrtc {
-
-namespace {
-
-class ScreenCapturerProxy : DesktopCapturer::Callback {
-public:
-  ScreenCapturerProxy()
-    : screen_capturer_(DesktopCapturer::CreateScreenCapturer(DesktopCaptureOptions::CreateDefault())) {
-    screen_capturer_->SelectSource(kFullDesktopScreenId);
-    screen_capturer_->Start(this);
-  }
-  void CaptureFrame() { screen_capturer_->CaptureFrame(); }
-  std::unique_ptr<DesktopFrame> GetFrame() { return std::move(frame_); }
-
-   // Callback interface
-  virtual void OnCaptureResult(DesktopCapturer::Result result,
-                               std::unique_ptr<DesktopFrame> frame) {
-    frame_ = std::move(frame);
-  }
-
-protected:
-  std::unique_ptr<DesktopCapturer> screen_capturer_;
-  std::unique_ptr<DesktopFrame> frame_;
-};
-
-class AppCapturerLinux : public AppCapturer {
-public:
-  AppCapturerLinux(const DesktopCaptureOptions& options);
-  virtual ~AppCapturerLinux();
-
-  // AppCapturer interface.
-  virtual bool GetAppList(AppList* apps) override;
-  virtual bool SelectApp(ProcessId processId) override;
-  virtual bool BringAppToFront() override;
-
-  // DesktopCapturer interface.
-  virtual void Start(Callback* callback) override;
-  virtual void CaptureFrame() override;
-  virtual bool SelectSource(SourceId id) override
-  {
-    return SelectApp(static_cast<ProcessId>(id));
-  }
-
-protected:
-  Display* GetDisplay() { return x_display_->display(); }
-  bool UpdateRegions();
-
-  void FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame,Region rgn, uint32_t color);
-private:
-  Callback* callback_;
-  ProcessId selected_process_;
-
-  // Sample Mode
-  ScreenCapturerProxy screen_capturer_proxy_;
-  // Mask of foreground (non-app windows in front of selected)
-  Region rgn_mask_;
-  // Region of selected windows
-  Region rgn_visual_;
-  // Mask of background (desktop, non-app windows behind selected)
-  Region rgn_background_;
-
-  rtc::scoped_refptr<SharedXDisplay> x_display_;
-  RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerLinux);
-};
-
-AppCapturerLinux::AppCapturerLinux(const DesktopCaptureOptions& options)
-    : callback_(NULL),
-      selected_process_(0),
-      x_display_(options.x_display()) {
-  rgn_mask_ = XCreateRegion();
-  rgn_visual_ = XCreateRegion();
-  rgn_background_ = XCreateRegion();
-}
-
-AppCapturerLinux::~AppCapturerLinux() {
-  if (rgn_mask_) {
-    XDestroyRegion(rgn_mask_);
-  }
-  if (rgn_visual_) {
-    XDestroyRegion(rgn_visual_);
-  }
-  if (rgn_background_) {
-    XDestroyRegion(rgn_background_);
-  }
-}
-
-// AppCapturer interface.
-bool AppCapturerLinux::GetAppList(AppList* apps) {
-  // Implemented in DesktopDeviceInfo
-  return true;
-}
-bool AppCapturerLinux::SelectApp(ProcessId processId) {
-  selected_process_ = processId;
-  return true;
-}
-bool AppCapturerLinux::BringAppToFront() {
-  // Not implemented yet: See Bug 1036653
-  return true;
-}
-
-// DesktopCapturer interface.
-void AppCapturerLinux::Start(Callback* callback) {
-  assert(!callback_);
-  assert(callback);
-
-  callback_ = callback;
-}
-
-void AppCapturerLinux::CaptureFrame() {
-  XErrorTrap error_trap(GetDisplay());
-
-  //Capture screen >> set root window as capture window
-  screen_capturer_proxy_.CaptureFrame();
-  std::unique_ptr<DesktopFrame> frame = std::move(screen_capturer_proxy_.GetFrame());
-  if (frame) {
-
-    // calculate app visual/foreground region
-    UpdateRegions();
-
-    // TODO: background/foreground mask colors should be configurable; see Bug 1054503
-    // fill background with black
-    FillDesktopFrameRegionWithColor(frame.get(), rgn_background_, 0xFF000000);
-
-    // fill foreground with yellow
-    FillDesktopFrameRegionWithColor(frame.get(), rgn_mask_, 0xFFFFFF00);
- }
-
-  // trigger event
-  if (callback_) {
-    bool worked = error_trap.GetLastErrorAndDisable() == 0;
-    DesktopCapturer::Result res = worked ? DesktopCapturer::Result::SUCCESS
-                                         : DesktopCapturer::Result::ERROR_TEMPORARY;
-    callback_->OnCaptureResult(res, std::move(frame));
-  }
-}
-
-void AppCapturerLinux::FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame, Region rgn, uint32_t color) {
-  XErrorTrap error_trap(GetDisplay());
-
-  if (!pDesktopFrame) {
-    return;
-  }
-  if (XEmptyRegion(rgn)) {
-    return;
-  }
-
-  REGION * st_rgn = (REGION *)rgn;
-  if(st_rgn && st_rgn->numRects > 0) {
-    for (short i = 0; i < st_rgn->numRects; i++) {
-      for (short j = st_rgn->rects[i].y1; j < st_rgn->rects[i].y2; j++) {
-        uint32_t* dst_pos = reinterpret_cast<uint32_t*>(pDesktopFrame->data() + pDesktopFrame->stride() * j);
-        for (short k = st_rgn->rects[i].x1; k < st_rgn->rects[i].x2; k++) {
-          dst_pos[k] = color;
-        }
-      }
-    }
-  }
-}
-
-bool AppCapturerLinux::UpdateRegions() {
-  XErrorTrap error_trap(GetDisplay());
-
-  XSubtractRegion(rgn_visual_, rgn_visual_, rgn_visual_);
-  XSubtractRegion(rgn_mask_, rgn_mask_, rgn_mask_);
-  WindowUtilX11 window_util_x11(x_display_);
-  int num_screens = XScreenCount(GetDisplay());
-  for (int screen = 0; screen < num_screens; ++screen) {
-    int nScreenCX = DisplayWidth(GetDisplay(), screen);
-    int nScreenCY = DisplayHeight(GetDisplay(), screen);
-
-    XRectangle  screen_rect;
-    screen_rect.x = 0;
-    screen_rect.y = 0;
-    screen_rect.width = nScreenCX;
-    screen_rect.height = nScreenCY;
-
-    XUnionRectWithRegion(&screen_rect, rgn_background_, rgn_background_);
-    XXorRegion(rgn_mask_, rgn_mask_, rgn_mask_);
-    XXorRegion(rgn_visual_, rgn_visual_, rgn_visual_);
-
-    ::Window root_window = XRootWindow(GetDisplay(), screen);
-    ::Window parent;
-    ::Window root_return;
-    ::Window *children;
-    unsigned int num_children;
-    int status = XQueryTree(GetDisplay(), root_window, &root_return, &parent, &children, &num_children);
-    if (status == 0) {
-      RTC_LOG(LS_ERROR) << "Failed to query for child windows for screen " << screen;
-      continue;
-    }
-    for (unsigned int i = 0; i < num_children; ++i) {
-      ::Window app_window = window_util_x11.GetApplicationWindow(children[i]);
-      if (!app_window) {
-        continue;
-      }
-
-      // Get window region
-      XRectangle  win_rect;
-      window_util_x11.GetWindowRect(app_window, win_rect, true);
-      if (win_rect.width <= 0 || win_rect.height <= 0) {
-        continue;
-      }
-
-      Region win_rgn = XCreateRegion();
-      XUnionRectWithRegion(&win_rect, win_rgn, win_rgn);
-      // update rgn_visual_ , rgn_mask_,
-      unsigned int processId = window_util_x11.GetWindowProcessID(app_window);
-      if (processId != 0 && processId == selected_process_) {
-        XUnionRegion(rgn_visual_, win_rgn, rgn_visual_);
-        XSubtractRegion(rgn_mask_, win_rgn, rgn_mask_);
-      } else {
-        Region win_rgn_intersect = XCreateRegion();
-        XIntersectRegion(rgn_visual_, win_rgn, win_rgn_intersect);
-
-        XSubtractRegion(rgn_visual_, win_rgn_intersect, rgn_visual_);
-        XUnionRegion(win_rgn_intersect, rgn_mask_, rgn_mask_);
-
-        if (win_rgn_intersect) {
-          XDestroyRegion(win_rgn_intersect);
-        }
-      }
-      if (win_rgn) {
-        XDestroyRegion(win_rgn);
-      }
-    }
-
-    if (children) {
-      XFree(children);
-    }
-  }
-
-  XSubtractRegion(rgn_background_, rgn_visual_, rgn_background_);
-
-  return true;
-}
-
-}  // namespace
-
-// static
-AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) {
-  return new AppCapturerLinux(options);
-}
-
-// static
-std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawAppCapturer(
-    const DesktopCaptureOptions& options) {
-
-  if (!options.x_display())
-    return nullptr;
-
-  std::unique_ptr<AppCapturerLinux> capturer(new AppCapturerLinux(options));
-
-  return std::unique_ptr<DesktopCapturer>(std::move(capturer));
-}
-
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_mac.mm
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <assert.h>
-#include <ApplicationServices/ApplicationServices.h>
-#include <Cocoa/Cocoa.h>
-#include <Carbon/Carbon.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <AppKit/AppKit.h>
-
-#include "modules/desktop_capture/app_capturer.h"
-
-#include "modules/desktop_capture/desktop_frame.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/logging.h"
-
-namespace webrtc {
-
-namespace {
-
-class AppCapturerMac : public AppCapturer {
- public:
-  AppCapturerMac();
-  virtual ~AppCapturerMac();
-
-  // AppCapturer interface.
-  virtual bool GetAppList(AppList* apps) override;
-  virtual bool SelectApp(ProcessId processId) override;
-  virtual bool BringAppToFront() override;
-
-  // DesktopCapturer interface.
-  virtual void Start(Callback* callback) override;
-  virtual void CaptureFrame() override;
-  virtual bool SelectSource(SourceId id) override
-  {
-    return SelectApp(static_cast<ProcessId>(id));
-  }
-
- private:
-  Callback* callback_;
-  ProcessId process_id_;
-
-  RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerMac);
-};
-
-AppCapturerMac::AppCapturerMac()
-  : callback_(NULL),
-    process_id_(0) {
-}
-
-AppCapturerMac::~AppCapturerMac() {
-}
-
-// AppCapturer interface.
-bool AppCapturerMac::GetAppList(AppList* apps) {
-  // handled by DesktopDeviceInfo
-  return true;
-}
-
-bool AppCapturerMac::SelectApp(ProcessId processId) {
-  process_id_ = processId;
-
-  return true;
-}
-
-bool AppCapturerMac::BringAppToFront() {
-  return true;
-}
-
-// DesktopCapturer interface.
-void AppCapturerMac::Start(Callback* callback) {
-  assert(!callback_);
-  assert(callback);
-
-  callback_ = callback;
-}
-
-void AppCapturerMac::CaptureFrame() {
-  // Check that selected process exists
-  NSRunningApplication *ra = [NSRunningApplication runningApplicationWithProcessIdentifier:process_id_];
-  if (!ra) {
-    callback_->OnCaptureResult(DesktopCapturer::Result::ERROR_TEMPORARY, nullptr);
-    return;
-  }
-
-#if defined(__LP64__)
-#define CaptureWindowID int64_t
-#else
-#define CaptureWindowID CGWindowID
-#endif
-
-  CFArrayRef windowInfos = CGWindowListCopyWindowInfo(
-      kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,
-      kCGNullWindowID);
-  CFIndex windowInfosCount = CFArrayGetCount(windowInfos);
-  CaptureWindowID *captureWindowList = new CaptureWindowID[windowInfosCount];
-  CFIndex captureWindowListCount = 0;
-  for (CFIndex idx = 0; idx < windowInfosCount; idx++) {
-    CFDictionaryRef info = reinterpret_cast<CFDictionaryRef>(
-        CFArrayGetValueAtIndex(windowInfos, idx));
-    CFNumberRef winOwner = reinterpret_cast<CFNumberRef>(
-        CFDictionaryGetValue(info, kCGWindowOwnerPID));
-    CFNumberRef winId = reinterpret_cast<CFNumberRef>(
-        CFDictionaryGetValue(info, kCGWindowNumber));
-
-    pid_t owner;
-    CFNumberGetValue(winOwner, kCFNumberIntType, &owner);
-    if (owner != process_id_) {
-      continue;
-    }
-
-    CGWindowID ident;
-    CFNumberGetValue(winId, kCFNumberIntType, &ident);
-
-    captureWindowList[captureWindowListCount++] = ident;
-  }
-  CFRelease(windowInfos);
-
-  // Check that window list is not empty
-  if (captureWindowListCount <= 0) {
-    delete [] captureWindowList;
-    callback_->OnCaptureResult(DesktopCapturer::Result::ERROR_TEMPORARY, nullptr);
-    return;
-  }
-
-  // Does not support multi-display; See bug 1037997.
-  CGRect rectCapturedDisplay = CGDisplayBounds(CGMainDisplayID());
-
-  // Capture all windows of selected process, bounded by desktop.
-  CFArrayRef windowIDsArray = CFArrayCreate(kCFAllocatorDefault,
-                                            (const void**)captureWindowList,
-                                            captureWindowListCount,
-                                            NULL);
-  CGImageRef app_image = CGWindowListCreateImageFromArray(rectCapturedDisplay,
-                                                          windowIDsArray,
-                                                          kCGWindowImageDefault);
-  CFRelease (windowIDsArray);
-  delete [] captureWindowList;
-
-  // Wrap raw data into DesktopFrame
-  if (!app_image) {
-    CFRelease(app_image);
-    callback_->OnCaptureResult(DesktopCapturer::Result::ERROR_TEMPORARY, nullptr);
-    return;
-  }
-
-  int bits_per_pixel = CGImageGetBitsPerPixel(app_image);
-  if (bits_per_pixel != 32) {
-      RTC_LOG(LS_ERROR) << "Unsupported window image depth: " << bits_per_pixel;
-      CFRelease(app_image);
-      callback_->OnCaptureResult(DesktopCapturer::Result::ERROR_TEMPORARY, nullptr);
-      return;
-  }
-
-  int width = CGImageGetWidth(app_image);
-  int height = CGImageGetHeight(app_image);
-  std::unique_ptr<DesktopFrame> frame(new BasicDesktopFrame(DesktopSize(width, height)));
-
-  CGDataProviderRef provider = CGImageGetDataProvider(app_image);
-  CFDataRef cf_data = CGDataProviderCopyData(provider);
-  int src_stride = CGImageGetBytesPerRow(app_image);
-  const uint8_t* src_data = CFDataGetBytePtr(cf_data);
-  for (int y = 0; y < height; ++y) {
-    memcpy(frame->data() + frame->stride() * y, src_data + src_stride * y,
-            DesktopFrame::kBytesPerPixel * width);
-  }
-
-  CFRelease(cf_data);
-  CFRelease(app_image);
-
-  callback_->OnCaptureResult(DesktopCapturer::Result::SUCCESS, std::move(frame));
-}
-
-}  // namespace
-
-// static
-AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) {
-  return new AppCapturerMac();
-}
-
-// static
-std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawAppCapturer(
-    const DesktopCaptureOptions& options) {
-
-  std::unique_ptr<AppCapturerMac> capturer(new AppCapturerMac());
-
-  return std::unique_ptr<DesktopCapturer>(capturer.release());
-}
-
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-#include "webrtc/modules/desktop_capture/window_capturer.h"
-#include "webrtc/modules/desktop_capture/app_capturer.h"
-
-#include <assert.h>
-
-#include "webrtc/modules/desktop_capture/desktop_frame.h"
-
-namespace webrtc {
-
-namespace {
-
-class AppCapturerNull : public AppCapturer {
-public:
-  AppCapturerNull();
-  virtual ~AppCapturerNull();
-
-  // AppCapturer interface.
-  virtual bool GetAppList(AppList* apps) override;
-  virtual bool SelectApp(ProcessId id) override;
-  virtual bool BringAppToFront()	override;
-
-  // DesktopCapturer interface.
-  virtual void Start(Callback* callback) override;
-  virtual void Capture(const DesktopRegion& region) override;
-
-private:
-  Callback* callback_;
-
-  RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerNull);
-};
-
-AppCapturerNull::AppCapturerNull()
-  : callback_(NULL) {
-}
-
-AppCapturerNull::~AppCapturerNull() {
-}
-
-bool AppCapturerNull::GetAppList(AppList* apps) {
-  // Not implemented yet: See Bug 1036653
-  return false;
-}
-
-bool AppCapturerNull::SelectApp(ProcessId id) {
-  // Not implemented yet: See Bug 1036653
-  return false;
-}
-
-bool AppCapturerNull::BringAppToFront() {
-  // Not implemented yet: See Bug 1036653
-  return false;
-}
-
-// DesktopCapturer interface.
-void AppCapturerNull::Start(Callback* callback) {
-  assert(!callback_);
-  assert(callback);
-
-  callback_ = callback;
-}
-
-void AppCapturerNull::Capture(const DesktopRegion& region) {
-  // Not implemented yet: See Bug 1036653
-  callback_->OnCaptureCompleted(NULL);
-}
-
-}  // namespace
-
-// static
-AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) {
-  return new AppCapturerNull();
-}
-
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_unittest.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-#include "webrtc/modules/desktop_capture/app_capturer.h"
-
-#include "gtest/gtest.h"
-#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
-#include "webrtc/modules/desktop_capture/desktop_frame.h"
-#include "webrtc/modules/desktop_capture/desktop_region.h"
-#include "webrtc/system_wrappers/include/logging.h"
-
-namespace webrtc {
-
-class AppCapturerTest : public testing::Test,
-                        public DesktopCapturer::Callback {
-public:
-  void SetUp() override {
-    capturer_.reset(
-      AppCapturer::Create(DesktopCaptureOptions::CreateDefault())
-    );
-  }
-
-  void TearDown() override {
-  }
-
-  // DesktopCapturer::Callback interface
-  virtual SharedMemory* CreateSharedMemory(size_t size) override {
-    return NULL;
-  }
-
-  virtual void OnCaptureCompleted(DesktopFrame* frame) override {
-    frame_.reset(frame);
-  }
-
-protected:
-  rtc::scoped_refptr<AppCapturer> capturer_;
-  rtc::scoped_refptr<DesktopFrame> frame_;
-};
-
-// Verify that we can enumerate applications.
-TEST_F(AppCapturerTest, Enumerate) {
-  AppCapturer::AppList apps;
-  EXPECT_TRUE(capturer_->GetAppList(&apps));
-
-  // Verify that window titles are set.
-  for (AppCapturer::AppList::iterator it = apps.begin();
-       it != windows.end(); ++it) {
-    EXPECT_FALSE(it->title.empty());
-  }
-}
-
-// Verify we can capture a app.
-TEST_F(AppCapturerTest, Capture) {
-  AppCapturer::AppList apps;
-  capturer_->Start(this);
-  EXPECT_TRUE(capturer_->GetAppList(&apps));
-
-  // Verify that we can select and capture each app.
-  for (AppCapturer::AppList::iterator it = apps.begin();
-       it != apps.end(); ++it) {
-    frame_.reset();
-    if (capturer_->SelectApp(it->id)) {
-      capturer_->Capture(DesktopRegion());
-    }
-
-    // If we failed to capture a window make sure it no longer exists.
-    if (!frame_.get()) {
-      AppCapturer::AppList new_list;
-      EXPECT_TRUE(capturer_->GetAppList(&new_list));
-      for (AppCapturer::AppList::iterator new_list_it = apps.begin();
-           new_list_it != apps.end(); ++new_list_it) {
-        EXPECT_FALSE(it->id == new_list_it->id);
-      }
-      continue;
-    }
-
-    EXPECT_GT(frame_->size().width(), 0);
-    EXPECT_GT(frame_->size().height(), 0);
-  }
-}
-
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_win.cc
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
-*  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
-*
-*  Use of this source code is governed by a BSD-style license
-*  that can be found in the LICENSE file in the root of the source
-*  tree. An additional intellectual property rights grant can be found
-*  in the file PATENTS.  All contributing project authors may
-*  be found in the AUTHORS file in the root of the source tree.
-*/
-
-#include "modules/desktop_capture/app_capturer.h"
-#include "modules/desktop_capture/shared_desktop_frame.h"
-#include "modules/desktop_capture/win/win_shared.h"
-
-#include <windows.h>
-#include <vector>
-#include <cassert>
-
-#include "modules/desktop_capture/desktop_capturer.h"
-#include "modules/desktop_capture/desktop_capture_options.h"
-#include "modules/desktop_capture/desktop_frame_win.h"
-
-namespace webrtc {
-
-namespace {
-
-// Proxy over the WebRTC window capturer, to allow post-processing
-// of the frame to merge multiple window capture frames into a single frame
-class WindowsCapturerProxy : DesktopCapturer::Callback {
-public:
-  WindowsCapturerProxy() :
-      window_capturer_(DesktopCapturer::CreateWindowCapturer(DesktopCaptureOptions::CreateDefault())) {
-    window_capturer_->Start(this);
-  }
-  ~WindowsCapturerProxy(){}
-
-  void SelectSource(DesktopCapturer::SourceId id) { window_capturer_->SelectSource(id); }
-  void CaptureFrame() { window_capturer_->CaptureFrame(); }
-  std::unique_ptr<DesktopFrame> GetFrame() { return std::move(frame_); }
-
-  // Callback interface
-  virtual void OnCaptureResult(DesktopCapturer::Result result,
-                               std::unique_ptr<DesktopFrame> frame) {
-    frame_ = std::move(frame);
-  }
-
-private:
-  std::unique_ptr<DesktopCapturer> window_capturer_;
-  std::unique_ptr<DesktopFrame> frame_;
-};
-
-// Proxy over the WebRTC screen capturer, to allow post-processing
-// of the frame to mask out non-application windows
-class ScreenCapturerProxy : DesktopCapturer::Callback {
-public:
-  ScreenCapturerProxy()
-    : screen_capturer_(DesktopCapturer::CreateScreenCapturer(DesktopCaptureOptions::CreateDefault())) {
-    screen_capturer_->SelectSource(kFullDesktopScreenId);
-    screen_capturer_->Start(this);
-  }
-  void CaptureFrame() { screen_capturer_->CaptureFrame(); }
-  std::unique_ptr<DesktopFrame> GetFrame() { return std::move(frame_); }
-
-   // Callback interface
-  virtual void OnCaptureResult(DesktopCapturer::Result result,
-                               std::unique_ptr<DesktopFrame> frame) {
-    frame_ = std::move(frame);
-  }
-
-protected:
-  std::unique_ptr<DesktopCapturer> screen_capturer_;
-  std::unique_ptr<DesktopFrame> frame_;
-};
-
-class AppCapturerWin : public AppCapturer {
-public:
-  AppCapturerWin(const DesktopCaptureOptions& options);
-  virtual ~AppCapturerWin();
-
-  // AppCapturer interface.
-  virtual bool GetAppList(AppList* apps) override;
-  virtual bool SelectApp(ProcessId processId) override;
-  virtual bool BringAppToFront() override;
-
-  // DesktopCapturer interface.
-  virtual void Start(Callback* callback) override;
-  virtual void CaptureFrame() override;
-  virtual bool SelectSource(SourceId id) override
-  {
-    return SelectApp(static_cast<ProcessId>(id));
-  }
-
-  struct WindowItem {
-    HWND handle;
-    RECT bounds;
-    bool owned;
-  };
-
-  struct EnumWindowsCtx {
-    ProcessId process_id;
-    std::vector<WindowItem> windows;
-    bool list_all;
-  };
-
-  static BOOL CALLBACK EnumWindowsProc(HWND handle, LPARAM lParam);
-protected:
-  void CaptureByWebRTC();
-  void CaptureBySample();
-private:
-  Callback* callback_;
-
-  ProcessId processId_;
-
-  // Sample Mode
-  ScreenCapturerProxy screen_capturer_proxy_;
-  // Mask of foreground (non-app windows in front of selected)
-  HRGN hrgn_foreground_;
-  // Mask of background (desktop, non-app windows behind selected)
-  HRGN hrgn_background_;
-  // Region of selected windows
-  HRGN hrgn_visual_;
-
-  void UpdateRegions();
-
-  // WebRTC Window mode
-  WindowsCapturerProxy window_capturer_proxy_;
-
-  RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerWin);
-};
-
-AppCapturerWin::AppCapturerWin(const DesktopCaptureOptions& options)
-  : callback_(nullptr),
-    processId_(0) {
-  // Initialize regions to zero
-  hrgn_foreground_ = CreateRectRgn(0, 0, 0, 0);
-  hrgn_background_ = CreateRectRgn(0, 0, 0, 0);
-  hrgn_visual_ = CreateRectRgn(0, 0, 0, 0);
-}
-
-AppCapturerWin::~AppCapturerWin() {
-  if (hrgn_foreground_) {
-    DeleteObject(hrgn_foreground_);
-  }
-  if (hrgn_background_) {
-    DeleteObject(hrgn_background_);
-  }
-  if (hrgn_visual_) {
-    DeleteObject(hrgn_visual_);
-  }
-}
-
-// AppCapturer interface.
-bool AppCapturerWin::GetAppList(AppList* apps){
-  // Implemented via DesktopDeviceInfo
-  return true;
-}
-
-bool AppCapturerWin::SelectApp(ProcessId processId) {
-  processId_ = processId;
-  return true;
-}
-
-bool AppCapturerWin::BringAppToFront() {
-  // Not implemented yet: See Bug 1036653
-  return true;
-}
-
-// DesktopCapturer interface.
-void AppCapturerWin::Start(Callback* callback) {
-  assert(!callback_);
-  assert(callback);
-
-  callback_ = callback;
-}
-
-void AppCapturerWin::CaptureFrame() {
-  assert(IsGUIThread(false));
-  CaptureBySample();
-}
-
-BOOL CALLBACK AppCapturerWin::EnumWindowsProc(HWND handle, LPARAM lParam) {
-  EnumWindowsCtx *pEnumWindowsCtx = reinterpret_cast<EnumWindowsCtx *>(lParam);
-  if (!pEnumWindowsCtx) {
-    return FALSE;
-  }
-
-  DWORD procId = -1;
-  GetWindowThreadProcessId(handle, &procId);
-  if (procId == pEnumWindowsCtx->process_id || pEnumWindowsCtx->list_all) {
-    WindowItem window_item;
-    window_item.handle = handle;
-
-    if (!IsWindowVisible(handle) || IsIconic(handle)) {
-      return TRUE;
-    }
-
-    GetWindowRect(handle, &window_item.bounds);
-    window_item.owned = (procId == pEnumWindowsCtx->process_id);
-    pEnumWindowsCtx->windows.push_back(window_item);
-  }
-
-  return TRUE;
-}
-
-void AppCapturerWin::CaptureByWebRTC() {
-  assert(IsGUIThread(false));
-  // List Windows of selected application
-  EnumWindowsCtx lParamEnumWindows;
-  lParamEnumWindows.process_id = processId_;
-  lParamEnumWindows.list_all = false;
-  EnumWindows(EnumWindowsProc, (LPARAM)&lParamEnumWindows);
-
-  // Prepare capture dc context
-  // TODO: handle multi-monitor setups; see Bug 1037997
-  DesktopRect rcDesktop(DesktopRect::MakeXYWH(
-      GetSystemMetrics(SM_XVIRTUALSCREEN),
-      GetSystemMetrics(SM_YVIRTUALSCREEN),
-      GetSystemMetrics(SM_CXVIRTUALSCREEN),
-      GetSystemMetrics(SM_CYVIRTUALSCREEN)
-  ));
-
-  HDC dcScreen = GetDC(nullptr);
-  HDC memDcCapture = CreateCompatibleDC(dcScreen);
-  if (dcScreen) {
-    ReleaseDC(nullptr, dcScreen);
-  }
-
-  std::unique_ptr<DesktopFrameWin> frameCapture(DesktopFrameWin::Create(
-      DesktopSize(rcDesktop.width(), rcDesktop.height()),
-      nullptr, memDcCapture));
-  HBITMAP bmpOrigin = static_cast<HBITMAP>(SelectObject(memDcCapture, frameCapture->bitmap()));
-  BOOL bCaptureAppResult = false;
-  // Capture and Combine all windows into memDcCapture
-  std::vector<WindowItem>::reverse_iterator itItem;
-  for (itItem = lParamEnumWindows.windows.rbegin(); itItem != lParamEnumWindows.windows.rend(); itItem++) {
-    WindowItem window_item = *itItem;
-    HWND hWndCapturer = window_item.handle;
-    if (!IsWindow(hWndCapturer) || !IsWindowVisible(hWndCapturer) || IsIconic(hWndCapturer)) {
-      continue;
-    }
-
-    HDC memDcWin = nullptr;
-    HBITMAP bmpOriginWin = nullptr;
-    HBITMAP hBitmapFrame = nullptr;
-    HDC dcWin = nullptr;
-    RECT rcWin = window_item.bounds;
-    bool bCaptureResult = false;
-    std::unique_ptr<DesktopFrameWin> frame;
-    do {
-      if (rcWin.left == rcWin.right || rcWin.top == rcWin.bottom) {
-        break;
-      }
-
-      dcWin = GetWindowDC(hWndCapturer);
-      if (!dcWin) {
-        break;
-      }
-      memDcWin = CreateCompatibleDC(dcWin);
-
-      // Capture
-      window_capturer_proxy_.SelectSource((SourceId) hWndCapturer);
-      window_capturer_proxy_.CaptureFrame();
-      if (window_capturer_proxy_.GetFrame() != nullptr) {
-        DesktopFrameWin *pDesktopFrameWin = reinterpret_cast<DesktopFrameWin *>(
-            window_capturer_proxy_.GetFrame().get());
-        if (pDesktopFrameWin) {
-          hBitmapFrame = pDesktopFrameWin->bitmap();
-        }
-        if (GetObjectType(hBitmapFrame) != OBJ_BITMAP) {
-          hBitmapFrame = nullptr;
-        }
-      }
-      if (!hBitmapFrame) {
-        break;
-      }
-      bmpOriginWin = static_cast<HBITMAP>(SelectObject(memDcWin, hBitmapFrame));
-    } while(0);
-
-    // bitblt to capture memDcCapture
-    if (bmpOriginWin) {
-      BitBlt(memDcCapture,
-          rcWin.left, rcWin.top, rcWin.right - rcWin.left, rcWin.bottom - rcWin.top,
-          memDcWin, 0, 0, SRCCOPY);
-      bCaptureAppResult = true;
-    }
-
-    // Clean resource
-    if (memDcWin) {
-      SelectObject(memDcWin, bmpOriginWin);
-      DeleteDC(memDcWin);
-    }
-    if (dcWin) {
-      ReleaseDC(hWndCapturer, dcWin);
-    }
-  }
-
-  // Clean resource
-  if (memDcCapture) {
-    SelectObject(memDcCapture, bmpOrigin);
-    DeleteDC(memDcCapture);
-  }
-
-  // trigger event
-  if (bCaptureAppResult) {
-    callback_->OnCaptureResult(DesktopCapturer::Result::SUCCESS, std::move(frameCapture));
-  }
-}
-
-// Application Capturer by sample and region
-void AppCapturerWin::CaptureBySample(){
-  assert(IsGUIThread(false));
-  // capture entire screen
-  screen_capturer_proxy_.CaptureFrame();
-
-  HBITMAP hBitmapFrame = nullptr;
-  if (screen_capturer_proxy_.GetFrame() != nullptr) {
-    SharedDesktopFrame* pSharedDesktopFrame = reinterpret_cast<SharedDesktopFrame*>(
-        screen_capturer_proxy_.GetFrame().get());
-    if (pSharedDesktopFrame) {
-      DesktopFrameWin *pDesktopFrameWin =reinterpret_cast<DesktopFrameWin *>(
-          pSharedDesktopFrame->GetUnderlyingFrame());
-      if (pDesktopFrameWin) {
-        hBitmapFrame = pDesktopFrameWin->bitmap();
-      }
-      if (GetObjectType(hBitmapFrame) != OBJ_BITMAP) {
-        hBitmapFrame = nullptr;
-      }
-    }
-  }
-  if (hBitmapFrame) {
-    // calculate app visual/foreground region
-    UpdateRegions();
-
-    HDC dcScreen = GetDC(nullptr);
-    HDC memDcCapture = CreateCompatibleDC(dcScreen);
-
-    RECT rcScreen = {0, 0,
-        screen_capturer_proxy_.GetFrame()->size().width(),
-        screen_capturer_proxy_.GetFrame()->size().height()
-    };
-
-    HBITMAP bmpOriginCapture = (HBITMAP)SelectObject(memDcCapture, hBitmapFrame);
-
-    // TODO: background/foreground mask colors should be configurable; see Bug 1054503
-    // fill background
-    SelectClipRgn(memDcCapture, hrgn_background_);
-    SelectObject(memDcCapture, GetStockObject(DC_BRUSH));
-    SetDCBrushColor(memDcCapture, RGB(0, 0, 0));
-    FillRect(memDcCapture, &rcScreen, (HBRUSH)GetStockObject(DC_BRUSH));
-
-    // fill foreground
-    SelectClipRgn(memDcCapture, hrgn_foreground_);
-    SelectObject(memDcCapture, GetStockObject(DC_BRUSH));
-    SetDCBrushColor(memDcCapture, RGB(0xff, 0xff, 0));
-    FillRect(memDcCapture, &rcScreen, (HBRUSH)GetStockObject(DC_BRUSH));
-
-    if (dcScreen) {
-      ReleaseDC(nullptr, dcScreen);
-    }
-    SelectObject(memDcCapture, bmpOriginCapture);
-    DeleteDC(memDcCapture);
-  }
-
-  // trigger event
-  if (callback_) {
-    callback_->OnCaptureResult(DesktopCapturer::Result::SUCCESS, std::move(screen_capturer_proxy_.GetFrame()));
-  }
-}
-
-void AppCapturerWin::UpdateRegions() {
-  assert(IsGUIThread(false));
-  // List Windows of selected application
-  EnumWindowsCtx lParamEnumWindows;
-  lParamEnumWindows.process_id = processId_;
-  lParamEnumWindows.list_all = true;
-  EnumWindows(EnumWindowsProc, (LPARAM)&lParamEnumWindows);
-
-  SetRectRgn(hrgn_foreground_, 0, 0, 0, 0);
-  SetRectRgn(hrgn_visual_, 0, 0, 0, 0);
-  SetRectRgn(hrgn_background_, 0, 0, 0, 0);
-
-  HRGN hrgn_screen_ = CreateRectRgn(0, 0,
-      GetSystemMetrics(SM_CXVIRTUALSCREEN),
-      GetSystemMetrics(SM_CYVIRTUALSCREEN));
-
-  HRGN hrgn_window = CreateRectRgn(0, 0, 0, 0);
-  HRGN hrgn_internsect = CreateRectRgn(0, 0, 0, 0);
-  std::vector<WindowItem>::reverse_iterator itItem;
-  for (itItem = lParamEnumWindows.windows.rbegin(); itItem != lParamEnumWindows.windows.rend(); itItem++) {
-    WindowItem window_item = *itItem;
-    SetRectRgn(hrgn_window, 0, 0, 0, 0);
-    if (GetWindowRgn(window_item.handle, hrgn_window) == ERROR) {
-      SetRectRgn(hrgn_window, window_item.bounds.left,
-                 window_item.bounds.top,
-                 window_item.bounds.right,
-                 window_item.bounds.bottom);
-    }
-
-    if (window_item.owned) {
-      CombineRgn(hrgn_visual_, hrgn_visual_, hrgn_window, RGN_OR);
-      CombineRgn(hrgn_foreground_, hrgn_foreground_, hrgn_window, RGN_DIFF);
-    } else {
-      SetRectRgn(hrgn_internsect, 0, 0, 0, 0);
-      CombineRgn(hrgn_internsect, hrgn_visual_, hrgn_window, RGN_AND);
-
-      CombineRgn(hrgn_visual_, hrgn_visual_, hrgn_internsect, RGN_DIFF);
-
-      CombineRgn(hrgn_foreground_, hrgn_foreground_, hrgn_internsect, RGN_OR);
-    }
-  }
-  CombineRgn(hrgn_background_, hrgn_screen_, hrgn_visual_, RGN_DIFF);
-
-  if (hrgn_window) {
-    DeleteObject(hrgn_window);
-  }
-  if (hrgn_internsect) {
-    DeleteObject(hrgn_internsect);
-  }
-}
-
-}  // namespace
-
-// static
-AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) {
-  return new AppCapturerWin(options);
-}
-
-// static
-std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawAppCapturer(
-    const DesktopCaptureOptions& options) {
-
-  std::unique_ptr<AppCapturerWin> capturer(new AppCapturerWin(options));
-
-  return std::unique_ptr<DesktopCapturer>(std::move(capturer));
-}
-
-}  // namespace webrtc
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc
@@ -55,26 +55,16 @@ std::unique_ptr<DesktopCapturer> Desktop
   std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options);
   if (capturer && options.detect_updated_region()) {
     capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
   }
 
   return capturer;
 }
 
-// static
-std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateAppCapturer(
-    const DesktopCaptureOptions& options) {
-  std::unique_ptr<DesktopCapturer> capturer = CreateRawAppCapturer(options);
-  if (options.detect_updated_region()) {
-    capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
-  }
-  return capturer;
-}
-
 #if defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11)
 bool DesktopCapturer::IsRunningUnderWayland() {
   const char* xdg_session_type = getenv("XDG_SESSION_TYPE");
   if (!xdg_session_type || strncmp(xdg_session_type, "wayland", 7) != 0)
     return false;
 
   if (!(getenv("WAYLAND_DISPLAY")))
     return false;
--- a/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
@@ -21,21 +21,20 @@
 #if defined(ANDROID)
 #include <jni.h>
 #endif
 
 namespace webrtc {
 
 // Mozilla addition
 enum class CaptureDeviceType {
-  Camera = 0,
-  Screen = 1,
-  Application = 2,
-  Window = 3,
-  Browser = 4
+  Camera,
+  Screen,
+  Window,
+  Browser
 };
 // Mozilla addition
 
 struct CaptureDeviceInfo {
   CaptureDeviceType type;
 
   CaptureDeviceInfo() : type(CaptureDeviceType::Camera) {}
   CaptureDeviceInfo(CaptureDeviceType t) : type(t) {}
@@ -45,19 +44,16 @@ struct CaptureDeviceInfo {
   {
     switch(type) {
     case CaptureDeviceType::Camera: {
       return "Camera";
     }
     case CaptureDeviceType::Screen: {
       return "Screen";
     }
-    case CaptureDeviceType::Application: {
-      return "Application";
-    }
     case CaptureDeviceType::Window: {
       return "Window";
     }
     case CaptureDeviceType::Browser: {
       return "Browser";
     }
     }
     assert(false);