summaryrefslogtreecommitdiffstats
path: root/remoting/client/client_context.cc
blob: 7dc8f672ff1164c094e6da3a945de2e788d67be7 (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
40
41
42
43
// 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/client/client_context.h"

namespace remoting {

ClientContext::ClientContext(
    const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner)
    : main_task_runner_(main_task_runner),
      decode_thread_("ChromotingClientDecodeThread"),
      audio_decode_thread_("ChromotingClientAudioDecodeThread") {
}

ClientContext::~ClientContext() {
}

void ClientContext::Start() {
  // Start all the threads.
  decode_thread_.Start();
  audio_decode_thread_.Start();
}

void ClientContext::Stop() {
  // Stop all the threads.
  decode_thread_.Stop();
  audio_decode_thread_.Stop();
}

base::SingleThreadTaskRunner* ClientContext::main_task_runner() {
  return main_task_runner_.get();
}

base::SingleThreadTaskRunner* ClientContext::decode_task_runner() {
  return decode_thread_.message_loop_proxy().get();
}

base::SingleThreadTaskRunner* ClientContext::audio_decode_task_runner() {
  return audio_decode_thread_.message_loop_proxy().get();
}

}  // namespace remoting