Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM RTCRtpParameters.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_RTCRTPPARAMETERSBINDING_H_
#define DOM_RTCRTPPARAMETERSBINDING_H_
#include "RTCRtpCapabilitiesBinding.h"
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct RTCRtcpParameters;
struct RTCRtcpParametersAtoms;
struct RTCRtpCodecParameters;
struct RTCRtpCodecParametersAtoms;
struct RTCRtpEncodingParameters;
struct RTCRtpEncodingParametersAtoms;
struct RTCRtpHeaderExtensionParameters;
struct RTCRtpHeaderExtensionParametersAtoms;
struct RTCRtpParametersAtoms;
struct RTCRtpSendParametersAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class RTCPriorityType : uint8_t {
Very_low,
Low,
Medium,
High,
};
namespace binding_detail {
template <> struct EnumStrings<RTCPriorityType> {
static constexpr nsLiteralCString Values[4] {
"very-low"_ns,
"low"_ns,
"medium"_ns,
"high"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCPriorityType aArgument, JS::MutableHandle<JS::Value> aValue);
enum class RTCDegradationPreference : uint8_t {
Maintain_framerate,
Maintain_resolution,
Balanced,
};
namespace binding_detail {
template <> struct EnumStrings<RTCDegradationPreference> {
static constexpr nsLiteralCString Values[3] {
"maintain-framerate"_ns,
"maintain-resolution"_ns,
"balanced"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCDegradationPreference aArgument, JS::MutableHandle<JS::Value> aValue);
struct RTCRtcpParameters : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mCname;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mReducedSize;
RTCRtcpParameters();
explicit inline RTCRtcpParameters(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtcpParameters(RTCRtcpParameters&& aOther) = default;
explicit inline RTCRtcpParameters(const RTCRtcpParameters& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtcpParameters&
operator=(const RTCRtcpParameters& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtcpParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtcpParameters : public RTCRtcpParameters
{
inline FastRTCRtcpParameters()
: RTCRtcpParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpCodecParameters : public RTCRtpCodec
{
MOZ_INIT_OUTSIDE_CTOR uint8_t mPayloadType;
RTCRtpCodecParameters();
explicit inline RTCRtpCodecParameters(const FastDictionaryInitializer& )
: RTCRtpCodec(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpCodecParameters(RTCRtpCodecParameters&& aOther) = default;
explicit inline RTCRtpCodecParameters(const RTCRtpCodecParameters& aOther)
: RTCRtpCodec(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpCodecParameters&
operator=(const RTCRtpCodecParameters& aOther);
bool
operator==(const RTCRtpCodecParameters& aOther) const;
private:
static bool
InitIds(JSContext* cx, RTCRtpCodecParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpCodecParameters : public RTCRtpCodecParameters
{
inline FastRTCRtpCodecParameters()
: RTCRtpCodecParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpEncodingParameters : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mActive;
MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mMaxBitrate;
MOZ_INIT_OUTSIDE_CTOR Optional<double> mMaxFramerate;
MOZ_INIT_OUTSIDE_CTOR RTCPriorityType mPriority;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mRid;
MOZ_INIT_OUTSIDE_CTOR Optional<double> mScaleResolutionDownBy;
RTCRtpEncodingParameters();
explicit inline RTCRtpEncodingParameters(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpEncodingParameters(RTCRtpEncodingParameters&& aOther) = default;
explicit inline RTCRtpEncodingParameters(const RTCRtpEncodingParameters& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpEncodingParameters&
operator=(const RTCRtpEncodingParameters& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtpEncodingParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpEncodingParameters : public RTCRtpEncodingParameters
{
inline FastRTCRtpEncodingParameters()
: RTCRtpEncodingParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpHeaderExtensionParameters : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mEncrypted;
MOZ_INIT_OUTSIDE_CTOR Optional<uint16_t> mId;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mUri;
RTCRtpHeaderExtensionParameters();
explicit inline RTCRtpHeaderExtensionParameters(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpHeaderExtensionParameters(RTCRtpHeaderExtensionParameters&& aOther) = default;
explicit inline RTCRtpHeaderExtensionParameters(const RTCRtpHeaderExtensionParameters& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpHeaderExtensionParameters&
operator=(const RTCRtpHeaderExtensionParameters& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtpHeaderExtensionParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpHeaderExtensionParameters : public RTCRtpHeaderExtensionParameters
{
inline FastRTCRtpHeaderExtensionParameters()
: RTCRtpHeaderExtensionParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpParameters : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<RTCRtpCodecParameters>> mCodecs;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<RTCRtpHeaderExtensionParameters>> mHeaderExtensions;
MOZ_INIT_OUTSIDE_CTOR Optional<RTCRtcpParameters> mRtcp;
RTCRtpParameters();
explicit inline RTCRtpParameters(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpParameters(RTCRtpParameters&& aOther) = default;
explicit inline RTCRtpParameters(const RTCRtpParameters& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpParameters&
operator=(const RTCRtpParameters& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtpParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpParameters : public RTCRtpParameters
{
inline FastRTCRtpParameters()
: RTCRtpParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpReceiveParameters : public RTCRtpParameters
{
RTCRtpReceiveParameters();
explicit inline RTCRtpReceiveParameters(const FastDictionaryInitializer& )
: RTCRtpParameters(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpReceiveParameters(RTCRtpReceiveParameters&& aOther) = default;
explicit inline RTCRtpReceiveParameters(const RTCRtpReceiveParameters& aOther)
: RTCRtpParameters(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpReceiveParameters&
operator=(const RTCRtpReceiveParameters& aOther);
};
namespace binding_detail {
struct FastRTCRtpReceiveParameters : public RTCRtpReceiveParameters
{
inline FastRTCRtpReceiveParameters()
: RTCRtpReceiveParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpSendParameters : public RTCRtpParameters
{
MOZ_INIT_OUTSIDE_CTOR Sequence<RTCRtpEncodingParameters> mEncodings;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mTransactionId;
RTCRtpSendParameters();
explicit inline RTCRtpSendParameters(const FastDictionaryInitializer& )
: RTCRtpParameters(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpSendParameters(RTCRtpSendParameters&& aOther) = default;
explicit inline RTCRtpSendParameters(const RTCRtpSendParameters& aOther)
: RTCRtpParameters(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
RTCRtpSendParameters&
operator=(const RTCRtpSendParameters& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtpSendParametersAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpSendParameters : public RTCRtpSendParameters
{
inline FastRTCRtpSendParameters()
: RTCRtpSendParameters(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::RTCPriorityType>
{
static constexpr dom::RTCPriorityType value = dom::RTCPriorityType::High;
static_assert(static_cast<uint8_t>(dom::RTCPriorityType::Very_low) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::RTCPriorityType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::RTCDegradationPreference>
{
static constexpr dom::RTCDegradationPreference value = dom::RTCDegradationPreference::Balanced;
static_assert(static_cast<uint8_t>(dom::RTCDegradationPreference::Maintain_framerate) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::RTCDegradationPreference>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_RTCRTPPARAMETERSBINDING_H_