blob: 0d8d100af50803ab27cbba7e4b243806873cc815 [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.org6879c8a2013-07-23 11:35:00 +000017#include <map>
18
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000019#include "webrtc/system_wrappers/interface/scoped_ptr.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000020
21namespace webrtc {
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000022
andresp@webrtc.org7707d062013-05-13 10:50:50 +000023class Config;
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +000024class CpuOveruseObserver;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000025class ProcessThread;
niklase@google.com470e71d2011-07-07 08:21:25 +000026class ViEChannelManager;
27class ViEInputManager;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000028class ViERenderManager;
niklase@google.com470e71d2011-07-07 08:21:25 +000029
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000030class ViESharedData {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000031 public:
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000032 explicit ViESharedData(const Config& config);
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000033 ~ViESharedData();
niklase@google.com470e71d2011-07-07 08:21:25 +000034
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000035 void SetLastError(const int error) const;
36 int LastErrorInternal() const;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000037 int NumberOfCores() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000038
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000039 // TODO(mflodman) Remove all calls to 'instance_id()'.
40 int instance_id() { return 0;}
41 ViEChannelManager* channel_manager() { return channel_manager_.get(); }
42 ViEInputManager* input_manager() { return input_manager_.get(); }
43 ViERenderManager* render_manager() { return render_manager_.get(); }
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000044
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +000045 std::map<int, CpuOveruseObserver*>* overuse_observers() {
46 return &overuse_observers_; }
47
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000048 private:
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000049 const int number_cores_;
50
mflodman@webrtc.org4dee3092013-05-16 11:13:18 +000051 scoped_ptr<ViEChannelManager> channel_manager_;
52 scoped_ptr<ViEInputManager> input_manager_;
53 scoped_ptr<ViERenderManager> render_manager_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000054 ProcessThread* module_process_thread_;
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000055 mutable int last_error_;
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +000056
57 std::map<int, CpuOveruseObserver*> overuse_observers_;
niklase@google.com470e71d2011-07-07 08:21:25 +000058};
niklase@google.com470e71d2011-07-07 08:21:25 +000059
mflodman@webrtc.org471e83e2011-11-24 15:16:00 +000060} // namespace webrtc
61
62#endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_