andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 | |
| 11 | // ViESharedData contains data and instances common to all interface |
| 12 | // implementations. |
| 13 | |
| 14 | #ifndef WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_ |
| 15 | #define WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_ |
| 16 | |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 17 | #include <map> |
| 18 | |
mflodman@webrtc.org | 7645e4d | 2013-05-16 11:13:18 +0000 | [diff] [blame] | 19 | #include "webrtc/system_wrappers/interface/scoped_ptr.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
andresp@webrtc.org | ac6d919 | 2013-05-13 10:50:50 +0000 | [diff] [blame] | 23 | class Config; |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 24 | class CpuOveruseObserver; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 25 | class ProcessThread; |
| 26 | class ViEChannelManager; |
| 27 | class ViEInputManager; |
| 28 | class ViERenderManager; |
| 29 | |
| 30 | class ViESharedData { |
| 31 | public: |
mflodman@webrtc.org | 7645e4d | 2013-05-16 11:13:18 +0000 | [diff] [blame] | 32 | explicit ViESharedData(const Config& config); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 33 | ~ViESharedData(); |
| 34 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 35 | void SetLastError(const int error) const; |
| 36 | int LastErrorInternal() const; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 37 | int NumberOfCores() const; |
| 38 | |
mflodman@webrtc.org | 7645e4d | 2013-05-16 11:13:18 +0000 | [diff] [blame] | 39 | // 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(); } |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 44 | |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 45 | std::map<int, CpuOveruseObserver*>* overuse_observers() { |
| 46 | return &overuse_observers_; } |
| 47 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 48 | private: |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 49 | const int number_cores_; |
| 50 | |
mflodman@webrtc.org | 7645e4d | 2013-05-16 11:13:18 +0000 | [diff] [blame] | 51 | scoped_ptr<ViEChannelManager> channel_manager_; |
| 52 | scoped_ptr<ViEInputManager> input_manager_; |
| 53 | scoped_ptr<ViERenderManager> render_manager_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 54 | ProcessThread* module_process_thread_; |
| 55 | mutable int last_error_; |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 56 | |
| 57 | std::map<int, CpuOveruseObserver*> overuse_observers_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } // namespace webrtc |
| 61 | |
| 62 | #endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_ |