2013-07-10 00:45:36 +00:00
|
|
|
/*
|
|
|
|
|
* libjingle
|
2015-01-20 21:36:13 +00:00
|
|
|
* Copyright 2013 Google Inc.
|
2013-07-10 00:45:36 +00:00
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// This file contains the interface for MediaConstraints, corresponding to
|
|
|
|
|
// the definition at
|
|
|
|
|
// http://www.w3.org/TR/mediacapture-streams/#mediastreamconstraints and also
|
|
|
|
|
// used in WebRTC: http://dev.w3.org/2011/webrtc/editor/webrtc.html#constraints.
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#ifndef WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
|
|
|
|
|
#define WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// MediaConstraintsInterface
|
|
|
|
|
// Interface used for passing arguments about media constraints
|
|
|
|
|
// to the MediaStream and PeerConnection implementation.
|
|
|
|
|
class MediaConstraintsInterface {
|
|
|
|
|
public:
|
|
|
|
|
struct Constraint {
|
|
|
|
|
Constraint() {}
|
|
|
|
|
Constraint(const std::string& key, const std::string value)
|
|
|
|
|
: key(key), value(value) {
|
|
|
|
|
}
|
|
|
|
|
std::string key;
|
|
|
|
|
std::string value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Constraints : public std::vector<Constraint> {
|
|
|
|
|
public:
|
|
|
|
|
bool FindFirst(const std::string& key, std::string* value) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
virtual const Constraints& GetMandatory() const = 0;
|
|
|
|
|
virtual const Constraints& GetOptional() const = 0;
|
|
|
|
|
|
|
|
|
|
// Constraint keys used by a local video source.
|
|
|
|
|
// Specified by draft-alvestrand-constraints-resolution-00b
|
|
|
|
|
static const char kMinAspectRatio[]; // minAspectRatio
|
|
|
|
|
static const char kMaxAspectRatio[]; // maxAspectRatio
|
|
|
|
|
static const char kMaxWidth[]; // maxWidth
|
|
|
|
|
static const char kMinWidth[]; // minWidth
|
|
|
|
|
static const char kMaxHeight[]; // maxHeight
|
|
|
|
|
static const char kMinHeight[]; // minHeight
|
|
|
|
|
static const char kMaxFrameRate[]; // maxFrameRate
|
|
|
|
|
static const char kMinFrameRate[]; // minFrameRate
|
|
|
|
|
|
|
|
|
|
// Constraint keys used by a local audio source.
|
2015-06-23 09:50:47 -07:00
|
|
|
static const char kEchoCancellation[]; // echoCancellation
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// These keys are google specific.
|
2015-06-15 09:14:03 +02:00
|
|
|
static const char kGoogEchoCancellation[]; // googEchoCancellation
|
|
|
|
|
|
2015-06-09 16:03:13 +02:00
|
|
|
static const char kExtendedFilterEchoCancellation[]; // googEchoCancellation2
|
2015-03-25 22:45:56 +01:00
|
|
|
static const char kDAEchoCancellation[]; // googDAEchoCancellation
|
2013-07-10 00:45:36 +00:00
|
|
|
static const char kAutoGainControl[]; // googAutoGainControl
|
|
|
|
|
static const char kExperimentalAutoGainControl[]; // googAutoGainControl2
|
|
|
|
|
static const char kNoiseSuppression[]; // googNoiseSuppression
|
2014-02-07 19:03:26 +00:00
|
|
|
static const char kExperimentalNoiseSuppression[]; // googNoiseSuppression2
|
2013-07-10 00:45:36 +00:00
|
|
|
static const char kHighpassFilter[]; // googHighpassFilter
|
2013-09-13 23:48:58 +00:00
|
|
|
static const char kTypingNoiseDetection[]; // googTypingNoiseDetection
|
2013-10-25 21:18:33 +00:00
|
|
|
static const char kAudioMirroring[]; // googAudioMirroring
|
2015-04-29 07:28:10 +02:00
|
|
|
static const char kAecDump[]; // audioDebugRecording
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// Google-specific constraint keys for a local video source
|
|
|
|
|
static const char kNoiseReduction[]; // googNoiseReduction
|
2014-03-26 01:17:30 +00:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// Constraint keys for CreateOffer / CreateAnswer
|
|
|
|
|
// Specified by the W3C PeerConnection spec
|
|
|
|
|
static const char kOfferToReceiveVideo[]; // OfferToReceiveVideo
|
|
|
|
|
static const char kOfferToReceiveAudio[]; // OfferToReceiveAudio
|
|
|
|
|
static const char kVoiceActivityDetection[]; // VoiceActivityDetection
|
|
|
|
|
static const char kIceRestart[]; // IceRestart
|
|
|
|
|
// These keys are google specific.
|
|
|
|
|
static const char kUseRtpMux[]; // googUseRtpMUX
|
|
|
|
|
|
|
|
|
|
// Constraints values.
|
|
|
|
|
static const char kValueTrue[]; // true
|
|
|
|
|
static const char kValueFalse[]; // false
|
|
|
|
|
|
2014-04-02 23:25:15 +00:00
|
|
|
// PeerConnection constraint keys.
|
2013-07-10 00:45:36 +00:00
|
|
|
// Temporary pseudo-constraints used to enable DTLS-SRTP
|
|
|
|
|
static const char kEnableDtlsSrtp[]; // Enable DTLS-SRTP
|
|
|
|
|
// Temporary pseudo-constraints used to enable DataChannels
|
|
|
|
|
static const char kEnableRtpDataChannels[]; // Enable RTP DataChannels
|
2014-04-02 23:25:15 +00:00
|
|
|
// Google-specific constraint keys.
|
2013-10-31 15:40:38 +00:00
|
|
|
// Temporary pseudo-constraint for enabling DSCP through JS.
|
2014-04-02 23:25:15 +00:00
|
|
|
static const char kEnableDscp[]; // googDscp
|
2014-01-14 10:00:58 +00:00
|
|
|
// Constraint to enable IPv6 through JS.
|
2014-04-02 23:25:15 +00:00
|
|
|
static const char kEnableIPv6[]; // googIPv6
|
2014-03-25 17:09:47 +00:00
|
|
|
// Temporary constraint to enable suspend below min bitrate feature.
|
|
|
|
|
static const char kEnableVideoSuspendBelowMinBitrate[];
|
2014-04-02 23:25:15 +00:00
|
|
|
// googSuspendBelowMinBitrate
|
2014-08-25 12:11:58 +00:00
|
|
|
// Constraint to enable combined audio+video bandwidth estimation.
|
|
|
|
|
static const char kCombinedAudioVideoBwe[]; // googCombinedAudioVideoBwe
|
2014-04-02 23:25:15 +00:00
|
|
|
static const char kScreencastMinBitrate[]; // googScreencastMinBitrate
|
|
|
|
|
static const char kCpuOveruseDetection[]; // googCpuOveruseDetection
|
2014-06-17 07:49:15 +00:00
|
|
|
static const char kPayloadPadding[]; // googPayloadPadding
|
2014-06-19 01:56:46 +00:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// The prefix of internal-only constraints whose JS set values should be
|
|
|
|
|
// stripped by Chrome before passed down to Libjingle.
|
|
|
|
|
static const char kInternalConstraintPrefix[];
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// Dtor protected as objects shouldn't be deleted via this interface
|
|
|
|
|
virtual ~MediaConstraintsInterface() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool FindConstraint(const MediaConstraintsInterface* constraints,
|
|
|
|
|
const std::string& key, bool* value,
|
|
|
|
|
size_t* mandatory_constraints);
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2016-02-10 10:53:12 +01:00
|
|
|
#endif // WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
|