summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/media/cast_threads.h
blob: 49addef564e7ed996c960149305b2c65ab15fad0 (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
// Copyright 2014 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.

// Manages threads used by Cast Streaming Extensions API. There is a
// singleton object of this class in the renderer.
//
// There are two threads owned by this class:
// 1. Audio encode thread.
// 2. Video encode thread.
// These two threads are started this object is created.

#ifndef CHROME_RENDERER_MEDIA_CAST_THREADS_H_
#define CHROME_RENDERER_MEDIA_CAST_THREADS_H_

#include "base/lazy_instance.h"
#include "base/threading/thread.h"

class CastThreads {
 public:
  scoped_refptr<base::SingleThreadTaskRunner>
  GetAudioEncodeMessageLoopProxy();
  scoped_refptr<base::SingleThreadTaskRunner>
  GetVideoEncodeMessageLoopProxy();

 private:
  friend struct base::DefaultLazyInstanceTraits<CastThreads>;

  CastThreads();

  base::Thread audio_encode_thread_;
  base::Thread video_encode_thread_;

  DISALLOW_COPY_AND_ASSIGN(CastThreads);
};

#endif  // CHROME_RENDERER_MEDIA_CAST_THREADS_H_