blob: 886cf67fb1321aad87b0466154e530a278b82029 [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.orgb11424b2012-01-25 13:42:03 +000017#include "video_engine/vie_defines.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
19namespace webrtc {
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000020
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000021class ProcessThread;
niklase@google.com470e71d2011-07-07 08:21:25 +000022class ViEChannelManager;
23class ViEInputManager;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000024class ViERenderManager;
niklase@google.com470e71d2011-07-07 08:21:25 +000025
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000026class ViESharedData {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000027 public:
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000028 ViESharedData();
29 ~ViESharedData();
niklase@google.com470e71d2011-07-07 08:21:25 +000030
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000031 bool Initialized() const;
32 int SetInitialized();
33 int SetUnInitialized();
34 void SetLastError(const int error) const;
35 int LastErrorInternal() const;
astor@webrtc.orgc0496e62012-08-10 10:14:43 +000036 void SetOverUseDetectorOptions(const OverUseDetectorOptions& options);
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000037 int NumberOfCores() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000038
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000039 int instance_id() { return instance_id_;}
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000040 ViEChannelManager* channel_manager() { return &channel_manager_; }
41 ViEInputManager* input_manager() { return &input_manager_; }
42 ViERenderManager* render_manager() { return &render_manager_; }
43
44 private:
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000045 static int instance_counter_;
46 const int instance_id_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000047 bool initialized_;
48 const int number_cores_;
49
astor@webrtc.orgbd7aeba2012-06-26 10:47:04 +000050 OverUseDetectorOptions over_use_detector_options_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000051 ViEChannelManager& channel_manager_;
52 ViEInputManager& input_manager_;
53 ViERenderManager& render_manager_;
54 ProcessThread* module_process_thread_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000055 mutable int last_error_;
niklase@google.com470e71d2011-07-07 08:21:25 +000056};
niklase@google.com470e71d2011-07-07 08:21:25 +000057
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000058} // namespace webrtc
59
60#endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_