ARDSettingsModel.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright 2016 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. #import <Foundation/Foundation.h>
  11. #import <WebRTC/RTCVideoCodecInfo.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * Model class for user defined settings.
  15. *
  16. * Handles storing the settings and provides default values if setting is not
  17. * set. Also provides list of available options for different settings. Stores
  18. * for example video codec, video resolution and maximum bitrate.
  19. */
  20. @interface ARDSettingsModel : NSObject
  21. /**
  22. * Returns array of available capture resoultions.
  23. *
  24. * The capture resolutions are represented as strings in the following format
  25. * [width]x[height]
  26. */
  27. - (NSArray<NSString *> *)availableVideoResolutions;
  28. /**
  29. * Returns current video resolution string.
  30. * If no resolution is in store, default value of 640x480 is returned.
  31. * When defaulting to value, the default is saved in store for consistency reasons.
  32. */
  33. - (NSString *)currentVideoResolutionSettingFromStore;
  34. - (int)currentVideoResolutionWidthFromStore;
  35. - (int)currentVideoResolutionHeightFromStore;
  36. /**
  37. * Stores the provided video resolution string into the store.
  38. *
  39. * If the provided resolution is no part of the available video resolutions
  40. * the store operation will not be executed and NO will be returned.
  41. * @param resolution the string to be stored.
  42. * @return YES/NO depending on success.
  43. */
  44. - (BOOL)storeVideoResolutionSetting:(NSString *)resolution;
  45. /**
  46. * Returns array of available video codecs.
  47. */
  48. - (NSArray<RTC_OBJC_TYPE(RTCVideoCodecInfo) *> *)availableVideoCodecs;
  49. /**
  50. * Returns current video codec setting from store if present or default (H264) otherwise.
  51. */
  52. - (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)currentVideoCodecSettingFromStore;
  53. /**
  54. * Stores the provided video codec setting into the store.
  55. *
  56. * If the provided video codec is not part of the available video codecs
  57. * the store operation will not be executed and NO will be returned.
  58. * @param video codec settings the string to be stored.
  59. * @return YES/NO depending on success.
  60. */
  61. - (BOOL)storeVideoCodecSetting:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)videoCodec;
  62. /**
  63. * Returns current max bitrate setting from store if present.
  64. */
  65. - (nullable NSNumber *)currentMaxBitrateSettingFromStore;
  66. /**
  67. * Stores the provided bitrate value into the store.
  68. *
  69. * @param bitrate NSNumber representation of the max bitrate value.
  70. */
  71. - (void)storeMaxBitrateSetting:(nullable NSNumber *)bitrate;
  72. /**
  73. * Returns current audio only setting from store if present or default (NO) otherwise.
  74. */
  75. - (BOOL)currentAudioOnlySettingFromStore;
  76. /**
  77. * Stores the provided audio only setting into the store.
  78. *
  79. * @param setting the boolean value to be stored.
  80. */
  81. - (void)storeAudioOnlySetting:(BOOL)audioOnly;
  82. /**
  83. * Returns current create AecDump setting from store if present or default (NO) otherwise.
  84. */
  85. - (BOOL)currentCreateAecDumpSettingFromStore;
  86. /**
  87. * Stores the provided create AecDump setting into the store.
  88. *
  89. * @param setting the boolean value to be stored.
  90. */
  91. - (void)storeCreateAecDumpSetting:(BOOL)createAecDump;
  92. /**
  93. * Returns current setting whether to use manual audio config from store if present or default (YES)
  94. * otherwise.
  95. */
  96. - (BOOL)currentUseManualAudioConfigSettingFromStore;
  97. /**
  98. * Stores the provided use manual audio config setting into the store.
  99. *
  100. * @param setting the boolean value to be stored.
  101. */
  102. - (void)storeUseManualAudioConfigSetting:(BOOL)useManualAudioConfig;
  103. @end
  104. NS_ASSUME_NONNULL_END