EncoderConfig.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Digital Barriers
4 
37 #pragma once
38 
39 #include <vector>
40 #include <unordered_map>
41 #include "ISettings.h"
42 #include "ConfigTypes.h"
43 #include "VideoCodecMode.h"
45 #include "AnalyticsInfo.h"
46 #include "IridiumConfig.h"
47 #include "AreaOfInterestConfig.h"
48 #include "BandwidthConfig.h"
49 #include "StreamConfig.h"
50 #include "VideoAnalyticsConfig.h"
51 #include "OnvifTopic.h"
52 
53 #include "EdgeVisSDK.h"
54 #include "Pimpl.h"
55 
56 
57 namespace EdgeVisDecoderSDK
58 {
59  typedef EdgeVisSDKCore::AreaOfInterestConfig AreaOfInterestConfig;
60  typedef EdgeVisSDKCore::BandwidthConfig BandwidthConfig;
61  typedef EdgeVisSDKCore::StreamConfig StreamConfig;
62  typedef EdgeVisSDKCore::IridiumConfig IridiumConfig;
63  typedef EdgeVisSDKCore::SecureConnectEndpointConfig SecureConnectEndpointConfig;
64 
65  typedef EdgeVisSDKCore::ConnectionProfile ConnectionProfile;
67 
68  class EncoderConfigImpl;
69 
70  class EncoderConfig : public ISettings, public EdgeVisSDKPimpl<EncoderConfigImpl>
71  {
72  private:
73  friend class EncoderConfigImpl;
74 
75  public:
76  EdgeVisSDKPimplWeakConstructor(EncoderConfig);
77 
81  DB_EDGEVIS_SDK EncoderConfig();
82 
83  DB_EDGEVIS_SDK virtual ~EncoderConfig();
84 
90  DB_EDGEVIS_SDK int32_t VideoInput() const;
91 
100  DB_EDGEVIS_SDK bool VideoInput( int32_t input );
101 
108  DB_EDGEVIS_SDK CameraConfig GetCameraConfig( int32_t input_id ) const;
109 
115  DB_EDGEVIS_SDK ColourInfo GetColourInfo() const;
116 
126  DB_EDGEVIS_SDK bool SetColourInfo( const ColourInfo& ci );
127 
133  DB_EDGEVIS_SDK FilterInfo GetFilterInfo() const;
134 
142  DB_EDGEVIS_SDK bool SetFilterInfo( const FilterInfo& fi );
143 
149  DB_EDGEVIS_SDK AudioInfo GetAudioInfo() const;
150 
163  DB_EDGEVIS_SDK bool SetAudioInfo( const AudioInfo& ai );
164 
170  DB_EDGEVIS_SDK std::vector< std::wstring > AvailableProfiles();
171 
180  DB_EDGEVIS_SDK bool SetAvailableProfiles( const std::vector< std::wstring >& names );
181 
189  DB_EDGEVIS_SDK std::wstring StaticGPSLocation() const;
190 
200  DB_EDGEVIS_SDK bool SetStaticGPSLocation( const std::wstring& loc );
201 
207  DB_EDGEVIS_SDK bool GetGPSEnabled() const;
208 
217  DB_EDGEVIS_SDK bool SetGPSEnabled( bool enabled );
218 
224  DB_EDGEVIS_SDK std::wstring ConnectionProfile() const;
225 
231  DB_EDGEVIS_SDK std::wstring TimeZoneID() const;
232 
238  DB_EDGEVIS_SDK bool SerialAlarmDeviceEnabled() const;
239 
245  DB_EDGEVIS_SDK bool RelayState() const;
246 
255  DB_EDGEVIS_SDK bool RelayState( bool powered );
256 
264  DB_EDGEVIS_SDK bool GetRelayState(int8_t index) const;
265 
274  DB_EDGEVIS_SDK bool SetRelayState(int8_t index, bool powered);
275 
283  DB_EDGEVIS_SDK int32_t CameraPower( int32_t camera ) const;
284 
294  DB_EDGEVIS_SDK bool CameraPower( int32_t camera, int32_t pwr );
295 
301  DB_EDGEVIS_SDK bool ArchiveRemotePlaybackEnabled() const;
302 
309  DB_EDGEVIS_SDK bool LocalWifiEnabled() const;
310 
316  DB_EDGEVIS_SDK LocalWifiDownloadInfo GetLocalWifiDownloadInfo() const;
317 
328  DB_EDGEVIS_SDK bool SetLocalWifiDownloadEnabled( bool enable );
329 
339  DB_EDGEVIS_SDK AreaOfInterestConfig GetAreaOfInterestConfig(const int32_t input) const;
340 
356  DB_EDGEVIS_SDK bool SetAreaOfInterestConfig( const AreaOfInterestConfig& aoi );
357 
358  DB_EDGEVIS_SDK AnalyticsInfo GetAnalyticsInfo() const;
359 
375  DB_EDGEVIS_SDK bool SetAnalyticsInfo(const AnalyticsInfo& ai);
376 
383  DB_EDGEVIS_SDK bool CanConfigureVideoAnalytics() const;
384 
385 
391  DB_EDGEVIS_SDK int32_t GetVideoAnalyticsVersion() const;
392 
400  DB_EDGEVIS_SDK VideoAnalyticsConfig GetVideoAnalyticsConfig(const int32_t input) const;
401 
407  DB_EDGEVIS_SDK std::map<int32_t, VideoAnalyticsConfig> GetVideoAnalyticsConfig() const;
408 
416  DB_EDGEVIS_SDK bool SetVideoAnalyticsConfig(const int32_t input, const VideoAnalyticsConfig& config);
417 
429  DB_EDGEVIS_SDK VideoCodecMode GetCodecMode() const;
430 
445  DB_EDGEVIS_SDK bool SetCodecMode( VideoCodecMode cm );
446 
452  DB_EDGEVIS_SDK std::wstring GetPTZTours();
453 
460  DB_EDGEVIS_SDK bool SetPTZTours( const std::wstring& tours );
461 
467  DB_EDGEVIS_SDK std::wstring PrimaryConnection();
468 
474  DB_EDGEVIS_SDK std::wstring BackupConnection();
475 
482  DB_EDGEVIS_SDK bool PrimaryConnectionInUse();
483 
490  DB_EDGEVIS_SDK bool BackupConnectionInUse();
491 
499  DB_EDGEVIS_SDK std::wstring CommunicationMethod();
500 
507  DB_EDGEVIS_SDK int32_t GetSecureConnectBandwidthPercentage() const;
508 
514  DB_EDGEVIS_SDK std::vector< SecureConnectEndpointConfig > GetSecureConnectEndpoints() const;
515 
521  DB_EDGEVIS_SDK int64_t GetResumeSleepTime() const;
522 
523 
530  DB_EDGEVIS_SDK bool SetResumeSleepTime(int64_t resume_sleep_time);
531 
532 
539  DB_EDGEVIS_SDK std::wstring GetSerialAlarmDevice() const;
540 
549  DB_EDGEVIS_SDK bool GetEdgeRecordingEnabled() const;
550 
561  DB_EDGEVIS_SDK bool SetEdgeRecordingEnabled(bool enabled);
562 
569  DB_EDGEVIS_SDK bool SupportsAlarmRecording() const;
570 
579  DB_EDGEVIS_SDK bool GetAlarmRecording() const;
580 
586  DB_EDGEVIS_SDK bool GetIridiumConfig(IridiumConfig& result) const;
587 
588 
599  DB_EDGEVIS_SDK bool GetBandwidthConfig(BandwidthConfig& bw_cfg) const;
600 
611  DB_EDGEVIS_SDK bool SetBandwidthConfig(const BandwidthConfig& bw_cfg);
612 
620  DB_EDGEVIS_SDK bool GetStreamConfig(StreamConfig& stream_cfg) const;
621 
629  DB_EDGEVIS_SDK bool SetStreamConfig(const StreamConfig& stream_cfg);
630 
638  DB_EDGEVIS_SDK bool GetReserveIdleStreamBandwidth() const;
639 
649  DB_EDGEVIS_SDK bool SetReserveIdleStreamBandwidth(const bool reserve_idle);
650 
657  DB_EDGEVIS_SDK bool GetAudioOnlyEnabled() const;
658 
665  DB_EDGEVIS_SDK std::vector<OnvifTopic> GetCameraONVIFTopics(const int32_t input) const;
666 
667 
668  bool IsUsingCameraInput(int32_t input) const;
669 
670  int32_t DetermineStreamIndex() const;
671  std::unordered_map<int32_t, bool> DetermineStreamEnableStates() const;
672  bool DetermineStreamAvailableInputs(std::vector<int32_t>& inputs) const;
673  std::string DetermineConnectionStatus() const;
674 
675  private:
676  std::wstring GetConnectionMethodName(std::wstring connectionMethod);
677  std::wstring GetCurrentConnectionMethod();
678 
679  double CalculateSensitivity(const double sensitivity, const bool isSafeZone2D) const;
680 
681  public:
682  // ISettings methods
683  virtual std::wstring Name() const
684  {
685  return _Name;
686  }
687 
688  public:
689  static const std::wstring _Name;
690  };
691 }
DB_EDGEVIS_SDK bool SetEdgeRecordingEnabled(bool enabled)
Set edge recording enabled or disabled for the encoder.
DB_EDGEVIS_SDK int32_t VideoInput() const
Gets the current video input.
DB_EDGEVIS_SDK bool SetBandwidthConfig(const BandwidthConfig &bw_cfg)
Set the bandwidth configuration for the encoder.
DB_EDGEVIS_SDK bool SetFilterInfo(const FilterInfo &fi)
Sets the video filter information.
Defines Encoder local Wifi download settings.
Definition: ConfigTypes.h:84
DB_EDGEVIS_SDK bool SetPTZTours(const std::wstring &tours)
Sets the list of available PTZ tours on the encoder.
DB_EDGEVIS_SDK bool PrimaryConnectionInUse()
Gets the status of the primary connection.
AudioSource
Definition: AudioSource.h:24
DB_EDGEVIS_SDK bool GetAlarmRecording() const
Returns whether or not the encoder is recording due to an alarm action.
DB_EDGEVIS_SDK EncoderConfig()
Creates a new EncoderConfig object.
DB_EDGEVIS_SDK bool SetGPSEnabled(bool enabled)
Sets whether a GPS device is enabled for retrieving location information.
DB_EDGEVIS_SDK std::wstring TimeZoneID() const
Gets the Encoder&#39;s timezone ID.
Availability
Definition: ConnectionProfile.h:33
DB_EDGEVIS_SDK std::wstring GetSerialAlarmDevice() const
Retrieve the name of the serial alarm device that is currently configured.
DB_EDGEVIS_SDK bool RelayState() const
Gets the powered state of the relay (if the Encoder has one).
DB_EDGEVIS_SDK bool SerialAlarmDeviceEnabled() const
Gets the enabled state of the serial alarm device.
DB_EDGEVIS_SDK int32_t CameraPower(int32_t camera) const
Gets the powered state of the camera if it is powered from the Encoder (S400 and TriStar Encoders onl...
Class to allow for configuring the streaming characteristics of an Encoder.
Definition: StreamConfig.h:34
DB_EDGEVIS_SDK bool GetEdgeRecordingEnabled() const
Returns if edge recording is enabled for the encoder.
DB_EDGEVIS_SDK std::vector< OnvifTopic > GetCameraONVIFTopics(const int32_t input) const
Gets the list of support ONVIF event topics for the camera with the specified index.
DB_EDGEVIS_SDK bool ArchiveRemotePlaybackEnabled() const
Gets the enabled state of remote archive playback.
Availability
Definition: SecureConnectEndpointConfig.h:33
DB_EDGEVIS_SDK std::wstring ConnectionProfile() const
Gets the name of the currently active connection profile.
DB_EDGEVIS_SDK AudioInfo GetAudioInfo() const
Gets the audio configuration information.
DB_EDGEVIS_SDK std::wstring CommunicationMethod()
Gets the name of the current communication method Will return a string of the type of communication m...
DB_EDGEVIS_SDK ColourInfo GetColourInfo() const
Gets the video colour information.
Defines the area of interest configuration to use for a video input.
Definition: AreaOfInterestConfig.h:34
virtual std::wstring Name() const
Gets the name of the settings object.
Definition: EncoderConfig.h:683
DB_EDGEVIS_SDK bool SetStaticGPSLocation(const std::wstring &loc)
Sets the Encoder&#39;s static GPS location so it can be represented on a map without the need for a GPS d...
DB_EDGEVIS_SDK bool LocalWifiEnabled() const
Gets the enabled state of the local Wifi connection if the Encoder supports it.
DB_EDGEVIS_SDK bool SetStreamConfig(const StreamConfig &stream_cfg)
Set the stream configuration for the encoder.
Definition of the ISettings interface class.
Definition: ISettings.h:34
DB_EDGEVIS_SDK bool GetIridiumConfig(IridiumConfig &result) const
Get the Iridium configuration in use for this encoder.
Defines Encoder video filter settings.
Definition: ConfigTypes.h:69
Contains the structs used in the Encoder settings.
DB_EDGEVIS_SDK bool SetAreaOfInterestConfig(const AreaOfInterestConfig &aoi)
Sets the area of interest configuration information.
DB_EDGEVIS_SDK bool GetBandwidthConfig(BandwidthConfig &bw_cfg) const
Get the bandwidth configuration for the encoder.
DB_EDGEVIS_SDK std::map< int32_t, VideoAnalyticsConfig > GetVideoAnalyticsConfig() const
Get a map of the video analytics configuration for each available input.
DB_EDGEVIS_SDK VideoCodecMode GetCodecMode() const
Gets the current codec mode.
DB_EDGEVIS_SDK LocalWifiDownloadInfo GetLocalWifiDownloadInfo() const
Retrieves the encoder&#39;s local Wifi download information.
DB_EDGEVIS_SDK bool SetResumeSleepTime(int64_t resume_sleep_time)
Sets the UTC timestamp at which the encoder will enter sleep.
DB_EDGEVIS_SDK FilterInfo GetFilterInfo() const
Gets the video filter information.
DB_EDGEVIS_SDK std::wstring GetPTZTours()
Gets the list of available PTZ tours for encoders that support the feature.
DB_EDGEVIS_SDK std::wstring StaticGPSLocation() const
Gets the Encoder&#39;s static GPS location so it can be represented on a map without the need for a GPS d...
DB_EDGEVIS_SDK std::wstring BackupConnection()
Gets the name of the backup connection set on the Encoder.
DB_EDGEVIS_SDK bool GetGPSEnabled() const
Gets whether a GPS device is enabled for retrieving location information.
Defines the Iridium configuration in use for an encoder.
Definition: IridiumConfig.h:32
DB_EDGEVIS_SDK bool SetReserveIdleStreamBandwidth(const bool reserve_idle)
Set the reserve idle stream bandwidth configuration for the encoder.
DB_EDGEVIS_SDK bool GetReserveIdleStreamBandwidth() const
Get the reserve idle stream bandwidth configuration for the encoder.
DB_EDGEVIS_SDK std::vector< SecureConnectEndpointConfig > GetSecureConnectEndpoints() const
Returns the list of available SecureConnect end points.
DB_EDGEVIS_SDK bool GetRelayState(int8_t index) const
Gets the powered state of the relay with the specified index (if the Encoder has a corresponding rela...
DB_EDGEVIS_SDK bool BackupConnectionInUse()
Gets the status of the backup connection.
DB_EDGEVIS_SDK AreaOfInterestConfig GetAreaOfInterestConfig(const int32_t input) const
Retrieves the encoder&#39;s area of interest configuration information.
DB_EDGEVIS_SDK bool SetRelayState(int8_t index, bool powered)
Sets the powered state of the relay with the specified index (if the Encoder has a corresponding rela...
DB_EDGEVIS_SDK std::vector< std::wstring > AvailableProfiles()
Gets the available connection profile names as a list.
The EncoderConfig interface contains the Encoder&#39;s global configuration settings. ...
Definition: EncoderConfig.h:70
DB_EDGEVIS_SDK bool CanConfigureVideoAnalytics() const
Determine if this Decoder SDK can configure video analytics on this specific encoder using the GetVid...
DB_EDGEVIS_SDK CameraConfig GetCameraConfig(int32_t input_id) const
Gets the camera configuration information.
Defines the type of analytics that the encoder will use and the configuration for each video input th...
Definition: AnalyticsInfo.h:39
DB_EDGEVIS_SDK bool SetAvailableProfiles(const std::vector< std::wstring > &names)
Sets the new list of available connection profile names.
VideoCodecMode
These are used by the EncoderConfig class to represent the codec modes available. ...
Definition: VideoCodecMode.h:21
DB_EDGEVIS_SDK bool GetAudioOnlyEnabled() const
Gets whether an encoder is in audio only mode.
DB_EDGEVIS_SDK bool SetAnalyticsInfo(const AnalyticsInfo &ai)
Sets the analytics configuration information.
DB_EDGEVIS_SDK int32_t GetVideoAnalyticsVersion() const
Get the version of the currently configured video analytics config.
DB_EDGEVIS_SDK int32_t GetSecureConnectBandwidthPercentage() const
Gets the percentage of the available bandwidth that may be used for Secure Connect.
DB_EDGEVIS_SDK bool SetLocalWifiDownloadEnabled(bool enable)
Sets the enable state of the local Wifi download access point.
DB_EDGEVIS_SDK int64_t GetResumeSleepTime() const
Returns the UTC timestamp at which the encoder will enter sleep.
DB_EDGEVIS_SDK std::wstring PrimaryConnection()
Gets the name of the primary connection set on the Encoder.
The EdgeVis Decoder SDK namespace.
DB_EDGEVIS_SDK bool SetColourInfo(const ColourInfo &ci)
Sets the video colour information.
DB_EDGEVIS_SDK bool SetAudioInfo(const AudioInfo &ai)
Sets the audio configuration information.
DB_EDGEVIS_SDK bool SupportsAlarmRecording() const
Returns whether or not the encoder is capable of indicating it is recording due to an alarm action...
Defines the bandwidth configuration to use for an encoder.
Definition: BandwidthConfig.h:41
DB_EDGEVIS_SDK bool SetCodecMode(VideoCodecMode cm)
Sets the codec mode.
DB_EDGEVIS_SDK bool SetVideoAnalyticsConfig(const int32_t input, const VideoAnalyticsConfig &config)
Sets the video analytics configuration.
DB_EDGEVIS_SDK bool GetStreamConfig(StreamConfig &stream_cfg) const
Get the stream configuration for the encoder.