blob: 19f2ebfa4a17a2d2937d58f8d2ffae463be8af00 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
astor@webrtc.orgbd7aeba2012-06-26 10:47:04 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000011// ViESharedData contains data and instances common to all interface
12// implementations.
niklase@google.com470e71d2011-07-07 08:21:25 +000013
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000014#ifndef WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_
15#define WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000016
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000017#include "webrtc/system_wrappers/interface/scoped_ptr.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
19namespace webrtc {
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000020
andresp@webrtc.org7707d062013-05-13 10:50:50 +000021class Config;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000022class ProcessThread;
niklase@google.com470e71d2011-07-07 08:21:25 +000023class ViEChannelManager;
24class ViEInputManager;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000025class ViERenderManager;
niklase@google.com470e71d2011-07-07 08:21:25 +000026
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000027class ViESharedData {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000028 public:
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000029 explicit ViESharedData(const Config& config);
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000030 ~ViESharedData();
niklase@google.com470e71d2011-07-07 08:21:25 +000031
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000032 void SetLastError(const int error) const;
33 int LastErrorInternal() const;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000034 int NumberOfCores() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000035
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000036 // TODO(mflodman) Remove all calls to 'instance_id()'.
37 int instance_id() { return 0;}
38 ViEChannelManager* channel_manager() { return channel_manager_.get(); }
39 ViEInputManager* input_manager() { return input_manager_.get(); }
40 ViERenderManager* render_manager() { return render_manager_.get(); }
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000041
42 private:
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000043 const int number_cores_;
44
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000045 scoped_ptr<ViEChannelManager> channel_manager_;
46 scoped_ptr<ViEInputManager> input_manager_;
47 scoped_ptr<ViERenderManager> render_manager_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000048 ProcessThread* module_process_thread_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000049 mutable int last_error_;
niklase@google.com470e71d2011-07-07 08:21:25 +000050};
niklase@google.com470e71d2011-07-07 08:21:25 +000051
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000052} // namespace webrtc
53
54#endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_