summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment_factory.cc
blob: f3299a9325886d65cad26019fa1712330f92c2ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/host/desktop_environment_factory.h"

#include "remoting/host/audio_capturer.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/client_session.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/video_frame_capturer.h"

namespace remoting {

DesktopEnvironmentFactory::DesktopEnvironmentFactory(
    scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
    : input_task_runner_(input_task_runner),
      ui_task_runner_(ui_task_runner) {
}

DesktopEnvironmentFactory::~DesktopEnvironmentFactory() {
}

scoped_ptr<DesktopEnvironment> DesktopEnvironmentFactory::Create(
    ClientSession* client) {
  scoped_ptr<DesktopEnvironment> environment(new DesktopEnvironment(
      AudioCapturer::Create(),
      EventExecutor::Create(input_task_runner_, ui_task_runner_),
      VideoFrameCapturer::Create()));
  return environment.Pass();
}

bool DesktopEnvironmentFactory::SupportsAudioCapture() const {
  return AudioCapturer::IsSupported();
}

}  // namespace remoting