blob: 68a9436974b8e55a36fa8493062802d0ceb56ec8 [file] [log] [blame]
hjon6f5ca082016-01-07 09:29:29 -08001/*
2 * Copyright 2015 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
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020011#import "RTCMediaConstraints.h"
hjon6f5ca082016-01-07 09:29:29 -080012
kwibergbfefb032016-05-01 14:53:46 -070013#include <memory>
14
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "api/mediaconstraintsinterface.h"
hjon6f5ca082016-01-07 09:29:29 -080016
17namespace webrtc {
18
19class MediaConstraints : public MediaConstraintsInterface {
20 public:
Mirko Bonadei17aff352018-07-26 12:20:40 +020021 ~MediaConstraints() override;
hjon6f5ca082016-01-07 09:29:29 -080022 MediaConstraints();
Yves Gerey665174f2018-06-19 15:03:05 +020023 MediaConstraints(const MediaConstraintsInterface::Constraints& mandatory,
24 const MediaConstraintsInterface::Constraints& optional);
Mirko Bonadei17aff352018-07-26 12:20:40 +020025 const Constraints& GetMandatory() const override;
26 const Constraints& GetOptional() const override;
hjon6f5ca082016-01-07 09:29:29 -080027
28 private:
29 MediaConstraintsInterface::Constraints mandatory_;
30 MediaConstraintsInterface::Constraints optional_;
31};
32
33} // namespace webrtc
34
hjon6f5ca082016-01-07 09:29:29 -080035NS_ASSUME_NONNULL_BEGIN
36
37@interface RTCMediaConstraints ()
38
39/**
40 * A MediaConstraints representation of this RTCMediaConstraints object. This is
41 * needed to pass to the underlying C++ APIs.
42 */
kwibergbfefb032016-05-01 14:53:46 -070043- (std::unique_ptr<webrtc::MediaConstraints>)nativeConstraints;
hjon6f5ca082016-01-07 09:29:29 -080044
45/** Return a native Constraints object representing these constraints */
Yves Gerey665174f2018-06-19 15:03:05 +020046+ (webrtc::MediaConstraintsInterface::Constraints)nativeConstraintsForConstraints:
47 (NSDictionary<NSString*, NSString*>*)constraints;
hjon6f5ca082016-01-07 09:29:29 -080048
49@end
50
51NS_ASSUME_NONNULL_END