dom/media/systemservices/video_engine/browser_capture_impl.h
author Dan Minor <dminor@mozilla.com>
Wed, 28 Nov 2018 20:16:42 +0000
changeset 505013 0fd399c6caabff60ac0fe53b920b7d26a9806750
parent 372450 media/webrtc/trunk/webrtc/video_engine/browser_capture_impl.h@143bb4b9249e528e658f6ccc449991794b8675f8
child 505383 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
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

#ifndef WEBRTC_MODULES_BROWSER_CAPTURE_MAIN_SOURCE_BROWSER_CAPTURE_IMPL_H_
#define WEBRTC_MODULES_BROWSER_CAPTURE_MAIN_SOURCE_BROWSER_CAPTURE_IMPL_H_

#include "webrtc/modules/video_capture/video_capture.h"

using namespace webrtc::videocapturemodule;

namespace webrtc {

  class BrowserDeviceInfoImpl : public VideoCaptureModule::DeviceInfo {
  public:
    virtual uint32_t NumberOfDevices() { return 1; }

    virtual int32_t Refresh() { return 0; }

    virtual int32_t GetDeviceName(uint32_t deviceNumber,
                                  char* deviceNameUTF8,
                                  uint32_t deviceNameLength,
                                  char* deviceUniqueIdUTF8,
                                  uint32_t deviceUniqueIdUTF8Length,
                                  char* productUniqueIdUTF8 = NULL,
                                  uint32_t productUniqueIdUTF8Length = 0,
                                  pid_t* pid = 0) {
      deviceNameUTF8 = const_cast<char*>(kDeviceName);
      deviceUniqueIdUTF8 = const_cast<char*>(kUniqueDeviceName);
      productUniqueIdUTF8 =  const_cast<char*>(kProductUniqueId);
      return 1;
    };


    virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8) {
      return 0;
    }

    virtual int32_t GetCapability(const char* deviceUniqueIdUTF8,
                                  const uint32_t deviceCapabilityNumber,
                                  VideoCaptureCapability& capability) { return 0;};

    virtual int32_t GetOrientation(const char* deviceUniqueIdUTF8,
                                   VideoRotation& orientation) { return 0; }

    virtual int32_t GetBestMatchedCapability(const char* deviceUniqueIdUTF8,
                                             const VideoCaptureCapability& requested,
                                             VideoCaptureCapability& resulting) { return 0;}

    virtual int32_t DisplayCaptureSettingsDialogBox(const char* deviceUniqueIdUTF8,
                                                    const char* dialogTitleUTF8,
                                                    void* parentWindow,
                                                    uint32_t positionX,
                                                    uint32_t positionY) { return 0; }

    BrowserDeviceInfoImpl() : kDeviceName("browser"), kUniqueDeviceName("browser"), kProductUniqueId("browser") {}

    static BrowserDeviceInfoImpl* CreateDeviceInfo() {
      return new BrowserDeviceInfoImpl();
    }
    virtual ~BrowserDeviceInfoImpl() {}

  private:
    const char* kDeviceName;
    const char* kUniqueDeviceName;
    const char* kProductUniqueId;

  };
}
#endif