Intel® Collaboration Suite for WebRTC  version 4.3.1
Open WebRTC Toolkit (OWT) Client SDK for Windows*
globalconfiguration.h
1 // Copyright (C) <2018> Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 #ifndef OWT_BASE_GLOBALCONFIGURATION_H_
5 #define OWT_BASE_GLOBALCONFIGURATION_H_
6 #include <memory>
7 #include "owt/base/framegeneratorinterface.h"
8 #include "owt/base/videodecoderinterface.h"
9 #if defined(WEBRTC_WIN)
10 #include <windows.h>
11 #endif
12 namespace owt {
13 namespace base{
15 struct AudioProcessingSettings {
21  bool AECEnabled;
26  bool AGCEnabled;
31  bool NSEnabled;
37  bool AEC3Enabled;
38 };
45  friend class PeerConnectionDependencyFactory;
46  public:
47 #if defined(WEBRTC_WIN)
48 
52  static void SetVideoHardwareAccelerationEnabled(bool enabled) {
53  hardware_acceleration_enabled_ = enabled;
54  }
55 #endif
56 
64  static void SetEncodedVideoFrameEnabled(bool enabled) {
65  encoded_frame_ = enabled;
66  }
78  bool enabled,
79  std::unique_ptr<AudioFrameGeneratorInterface> audio_frame_generator) {
80  if (enabled) {
81  audio_frame_generator_ = std::move(audio_frame_generator);
82  } else {
83  audio_frame_generator_.reset(nullptr);
84  }
85  }
91  std::unique_ptr<VideoDecoderInterface> external_video_decoder) {
92  video_decoder_ = std::move(external_video_decoder);
93  }
99  static void SetAECEnabled(bool enabled) {
100  audio_processing_settings_.AECEnabled = enabled;
101  }
107  static void SetAEC3Enabled(bool enabled) {
108  audio_processing_settings_.AEC3Enabled = enabled;
109  }
115  static void SetAGCEnabled(bool enabled) {
116  audio_processing_settings_.AGCEnabled = enabled;
117  }
123  static void SetNSEnabled(bool enabled) {
124  audio_processing_settings_.NSEnabled = enabled;
125  }
126  private:
128  virtual ~GlobalConfiguration() {}
129 #if defined(WEBRTC_WIN)
130 
134  static bool GetVideoHardwareAccelerationEnabled() {
135  return hardware_acceleration_enabled_;
136  }
137  static bool hardware_acceleration_enabled_;
138 #endif
139 
144  static bool GetEncodedVideoFrameEnabled() {
145  return encoded_frame_;
146  }
151  static bool GetCustomizedAudioInputEnabled() {
152  return audio_frame_generator_ ? true : false;
153  }
154 
159  static bool GetAECEnabled() {
160  return audio_processing_settings_.AECEnabled ? true : false;
161  }
166  static bool GetAEC3Enabled() {
167  return audio_processing_settings_.AEC3Enabled ? true : false;
168  }
173  static bool GetAGCEnabled() {
174  return audio_processing_settings_.AGCEnabled ? true : false;
175  }
180  static bool GetNSEnabled() {
181  return audio_processing_settings_.NSEnabled ? true : false;
182  }
183 
187  static std::unique_ptr<AudioFrameGeneratorInterface> GetAudioFrameGenerator(){
188  return std::move(audio_frame_generator_);
189  }
190  // Encoded video frame flag.
195  static bool encoded_frame_;
196  static std::unique_ptr<AudioFrameGeneratorInterface> audio_frame_generator_;
201  static bool GetCustomizedVideoDecoderEnabled() {
202  return video_decoder_ ? true : false;
203  }
208  static std::unique_ptr<VideoDecoderInterface> GetCustomizedVideoDecoder() {
209  return std::move(video_decoder_);
210  }
214  static std::unique_ptr<VideoDecoderInterface> video_decoder_;
215 
216  static AudioProcessingSettings audio_processing_settings_;
217 };
218 }
219 }
220 #endif // OWT_BASE_GLOBALCONFIGURATION_H_
static void SetAGCEnabled(bool enabled)
Definition: globalconfiguration.h:115
static void SetCustomizedAudioInputEnabled(bool enabled, std::unique_ptr< AudioFrameGeneratorInterface > audio_frame_generator)
This function sets the audio input to be an instance of AudioFrameGeneratorInterface.
Definition: globalconfiguration.h:77
static void SetAEC3Enabled(bool enabled)
Definition: globalconfiguration.h:107
static void SetCustomizedVideoDecoderEnabled(std::unique_ptr< VideoDecoderInterface > external_video_decoder)
This function sets the customized video decoder to decode the encoded images.
Definition: globalconfiguration.h:90
Definition: audioplayerinterface.h:8
static void SetVideoHardwareAccelerationEnabled(bool enabled)
This function sets hardware acceleration is enabled for video decoding.
Definition: globalconfiguration.h:52
configuration of global using. GlobalConfiguration class of setting for encoded frame and hardware ac...
Definition: globalconfiguration.h:44
static void SetAECEnabled(bool enabled)
Definition: globalconfiguration.h:99
static void SetNSEnabled(bool enabled)
Definition: globalconfiguration.h:123