media/webrtc/trunk/webrtc/modules/desktop_capture/x11/desktop_device_info_x11.cc
author Gian-Carlo Pascutto <gpascutto@mozilla.com>
Wed, 16 Jul 2014 19:16:38 +0200
changeset 215216 d77d27828c76c96a229155cefcc7010ed434c947
parent 215205 f0d2710d4ea58fd8651c5317fcffb821eb1d4f61
child 215612 0f969f1ac011ff681230056c764f5264a7f38487
permissions -rw-r--r--
Bug 1038799 - Properly wrap Xfixes.h header. r=glandium

/* 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 "webrtc/modules/desktop_capture/x11/desktop_device_info_x11.h"
#include "webrtc/modules/desktop_capture/window_capturer.h"

namespace webrtc{

DesktopDeviceInfo * DesktopDeviceInfoImpl::Create() {
  DesktopDeviceInfoX11 * pDesktopDeviceInfo = new DesktopDeviceInfoX11();
  if (pDesktopDeviceInfo && pDesktopDeviceInfo->Init() != 0){
    delete pDesktopDeviceInfo;
    pDesktopDeviceInfo = NULL;
  }
  return pDesktopDeviceInfo;
}

DesktopDeviceInfoX11::DesktopDeviceInfoX11() {
}

DesktopDeviceInfoX11::~DesktopDeviceInfoX11() {
}

int32_t DesktopDeviceInfoX11::Init() {
#if !defined(MULTI_MONITOR_SCREENSHARE)
  DesktopDisplayDevice *pDesktopDeviceInfo = new DesktopDisplayDevice;
  if(pDesktopDeviceInfo){
    pDesktopDeviceInfo->setScreenId(0);
    pDesktopDeviceInfo->setDeviceName("Primary Monitor");
    pDesktopDeviceInfo->setUniqueIdName("\\screen\\monitor#1");

    desktop_display_list_[pDesktopDeviceInfo->getScreenId()] = pDesktopDeviceInfo;
  }
#endif
  return 0;
}

} //namespace webrtc