blob: 4b2888687c660851ee473108bba50d656eaaf108 [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
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:
andresp@webrtc.org7707d062013-05-13 10:50:50 +000029 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 bool Initialized() const;
33 int SetInitialized();
34 int SetUnInitialized();
35 void SetLastError(const int error) const;
36 int LastErrorInternal() const;
astor@webrtc.orgc0496e62012-08-10 10:14:43 +000037 void SetOverUseDetectorOptions(const OverUseDetectorOptions& options);
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000038 int NumberOfCores() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000039
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000040 int instance_id() { return instance_id_;}
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000041 ViEChannelManager* channel_manager() { return &channel_manager_; }
42 ViEInputManager* input_manager() { return &input_manager_; }
43 ViERenderManager* render_manager() { return &render_manager_; }
44
45 private:
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000046 static int instance_counter_;
47 const int instance_id_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000048 bool initialized_;
49 const int number_cores_;
50
astor@webrtc.orgbd7aeba2012-06-26 10:47:04 +000051 OverUseDetectorOptions over_use_detector_options_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000052 ViEChannelManager& channel_manager_;
53 ViEInputManager& input_manager_;
54 ViERenderManager& render_manager_;
55 ProcessThread* module_process_thread_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000056 mutable int last_error_;
niklase@google.com470e71d2011-07-07 08:21:25 +000057};
niklase@google.com470e71d2011-07-07 08:21:25 +000058
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000059} // namespace webrtc
60
61#endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_