/*
* Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.ComponentModel;
namespace Tizen.Multimedia.Remoting
{
///
/// Specifies errors.
///
///
///
/// 9
public enum WebRTCError
{
///
/// The connection failed.
///
ConnectionFailed = WebRTCErrorCode.ConnectionFailed,
///
/// The stream failed.
///
StreamFailed = WebRTCErrorCode.StreamFailed,
///
/// The resource failed.
///
ResourceFailed = WebRTCErrorCode.ResourceFailed,
///
/// The resource conflicted.
///
ResourceConflict = WebRTCErrorCode.ResourceConflict,
///
/// The invalid operation.
///
InvalidOperation = WebRTCErrorCode.InvalidOperation
}
///
/// Specifies states that a can have.
///
/// 9
public enum WebRTCState
{
///
/// The Initial state, create but not started.
///
Idle,
///
/// Started and negotiating.
///
Negotiating,
///
/// Negotiated and started all streams.
///
Playing,
}
///
/// Specifies ICE gathering states that a can have.
///
///
/// 9
public enum WebRTCIceGatheringState
{
///
/// The Initial state.
///
New,
///
/// Ice candidate is creating.
///
Gathering,
///
/// Ice gathering sequence has been completed.
///
Completed,
}
///
/// Specifies signaling states that a can have.
///
/// This state is related in SDP offer/answer.
///
///
///
/// 9
public enum WebRTCSignalingState
{
///
/// The Initial state.
///
Stable,
///
/// The local SDP offer has been applied successfully.
///
HaveLocalOffer,
///
/// The remote SDP offer has been applied successfully.
///
HaveRemoteOffer,
///
/// The SDP offer sent by the remote peer has been applied and
/// an answer has been created and applied.
///
HaveLocalPrAnswer,
///
/// A provisional answer has been received and successfully applied in local.
///
HaveRemotePrAnswer,
///
/// The connection is closed.
///
Closed
}
///
/// Specifies peer connection states that a can have.
///
/// This state is related in peer connection.
/// 9
public enum WebRTCPeerConnectionState
{
///
/// The Initial state.
///
New,
///
/// Establishing a connection is in the process.
///
Connecting,
///
/// The remote SDP offer has been applied successfully.
///
Connected,
///
/// The SDP offer sent by the remote peer has been applied and an answer has been created and applied.
///
Disconnected,
///
/// A provisional answer has been received and successfully applied in local.
///
Failed,
///
/// The connection is closed.
///
Closed
}
///
/// Specifies ICE connection states that a can have.
///
/// This state describe the current state of local and its connection to the ICE server(STUN or TURN).
/// 9
public enum WebRTCIceConnectionState
{
///
/// The Initial state.
///
New,
///
/// Checking pairs of local and remote candidates against one another to try to find a compatible match.
///
Checking,
///
/// A usable pairing of local and remote candidates has been found for all components of the connection,
/// and the connection has been established.
///
Connected,
///
/// Gathering candidates has been finished and hecked all pairs against one another,
/// and has found a connection for all components.
///
Completed,
///
/// There's no compatible matches.
///
Failed,
///
/// This is a less stringent test than "Failed" and may trigger intermittently and resolve just as spontaneously on less reliable networks,
/// or during temporary disconnections. When the problem resolves, the connection may return to the "connected" state.
///
Disconnected,
///
/// Closed.
///
Closed
}
internal static class WebRTCStateExtensions
{
internal static bool IsAnyOf(this T thisState, params T[] states) =>
Array.IndexOf(states, thisState) != -1;
}
///
/// Specifies data type that transfers on data channel.
///
/// 9
public enum DataChannelType
{
///
/// The string data type.
///
Strings,
///
/// The byte data type.
///
Bytes,
}
///
/// Specifies the buffer state type of .
///
/// 9
public enum MediaPacketBufferStatus
{
///
/// The buffer underrun.
///
Underrun,
///
/// The buffer overflow.
///
Overflow,
}
///
/// Specifies the media type.
///
/// 9
public enum MediaType
{
///
/// The audio type.
///
Audio,
///
/// The video type.
///
Video,
}
///
/// Specifies the transceiver direction type.
///
/// 9
public enum TransceiverDirection
{
///
/// Send only.
///
SendOnly,
///
/// Receive only.
///
RecvOnly,
///
/// Send and receive.
///
SendRecv,
}
///
/// Specifies the transceiver codec type.
///
/// 10
public enum TransceiverCodec
{
///
/// PCMU.
///
Pcmu = 0x00000100 | 0x01,
///
/// PCMA.
///
Pcma = 0x00000100 | 0x02,
///
/// OPUS.
///
Opus = 0x00000100 | 0x03,
///
/// VP8.
///
Vp8 = 0x00000200 | 0x01,
///
/// VP9.
///
Vp9 = 0x00000200 | 0x02,
///
/// H264.
///
H264 = 0x00000200 | 0x03
}
///
/// Specifies the policy of Ice transport.
///
///
/// See also https://www.w3.org/TR/webrtc/#rtcicetransportpolicy-enum
///
/// 9
public enum IceTransportPolicy
{
///
/// All.
///
All,
///
/// Relay.
///
Relay
}
///
/// Specifies the display type.
///
/// 9
public enum WebRTCDisplayMode
{
///
/// Letter box.
///
LetterBox,
///
/// Original size.
///
OriginSize,
///
/// Full screen.
///
Full
}
///
/// Specifies the bundle policy.
///
///
/// The details of bundle policy enum is described in https://www.w3.org/TR/webrtc/#rtcbundlepolicy-enum.
///
/// 10
public enum WebRTCBundlePolicy
{
///
/// No bundle.
///
None,
///
/// Bundle all media tracks into a stream when it's transfered to remote peer.
///
MaxBundle
}
///
/// Specifies the signaling message type.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum SignalingMessageType
{
///
/// Connected.
///
Connected,
///
/// Disconnected.
///
Disconnected,
///
/// Session established.
///
SessionEstablished,
///
/// Session closed.
///
SessionClosed,
///
/// SDP(Session Description Protocol).
///
Sdp,
///
/// ICE(Interactive Connectivity Establishment) candidate.
///
IceCandidate,
///
/// Error.
///
Error,
}
internal enum MediaSourceType
{
AudioTest,
VideoTest,
Microphone,
Camera,
Screen,
File,
MediaPacket,
Null
}
internal enum CustomMediaSourceType
{
Audio = 7,
Video
}
internal enum WebRTCDisplayType
{
Overlay,
Evas,
}
///
/// Specifies the category of WebRTC statistics.
///
/// 10
[Flags]
public enum WebRTCStatisticsCategory
{
///
/// Codec.
///
Codec = 0x0001,
///
/// Inbound RTP.
///
InboundRtp = 0x0002,
///
/// Outbound RTP.
///
OutboundRtp = 0x0004,
///
/// Remote inbound RTP.
///
RemoteInboundRtp = 0x0008,
///
/// Remote Outbound RTP.
///
RemoteOutboundRtp = 0x0010,
///
/// All types of WebRTC statistics.
///
All = Codec | InboundRtp | OutboundRtp | RemoteInboundRtp | RemoteOutboundRtp
}
[Flags]
internal enum WebRTCStatisticsPropertyCategory
{
Common = 0x00000100,
Codec = 0x00000200,
RtpStream = 0x00000400,
ReceivedRtpStream = 0x00000800,
InboundRtpStream = 0x00001000,
SentRtpStream = 0x00002000,
OutboundRtpStream = 0x00004000,
RemoteInboundRtpStream = 0x00008000,
RemoteOutboundRtpStream = 0x00010000
}
///
/// Specifies the WebRTC statistics property.
///
/// 10
public enum WebRTCStatisticsProperty
{
///
/// Timestamp.
///
Timestamp = WebRTCStatisticsPropertyCategory.Common | 0x01,
///
/// ID.
///
Id = WebRTCStatisticsPropertyCategory.Common | 0x02,
///
/// Payload type.
///
PayloadType = WebRTCStatisticsPropertyCategory.Codec | 0x01,
///
/// Clock rate.
///
ClockRate = WebRTCStatisticsPropertyCategory.Codec | 0x02,
///
/// The number of channels.
///
Channels = WebRTCStatisticsPropertyCategory.Codec | 0x03,
///
/// MIME type.
///
MimeType = WebRTCStatisticsPropertyCategory.Codec | 0x04,
///
/// Codec type.
///
CodecType = WebRTCStatisticsPropertyCategory.Codec | 0x05,
///
/// SDP FMTP line.
///
SdpFmtpLine = WebRTCStatisticsPropertyCategory.Codec | 0x06,
///
/// SSRC.
///
Ssrc = WebRTCStatisticsPropertyCategory.RtpStream | 0x01,
///
/// Transport ID.
///
TransportId = WebRTCStatisticsPropertyCategory.RtpStream | 0x02,
///
/// Codec ID.
///
CodecId = WebRTCStatisticsPropertyCategory.RtpStream | 0x03,
///
/// Received packet.
///
PacketsReceived = WebRTCStatisticsPropertyCategory.ReceivedRtpStream | 0x01,
///
/// Lost packet.
///
PacketsLost = WebRTCStatisticsPropertyCategory.ReceivedRtpStream | 0x02,
///
/// Discarted packet.
///
PacketsDiscarded = WebRTCStatisticsPropertyCategory.ReceivedRtpStream | 0x03,
///
/// Jitter.
///
Jitter = WebRTCStatisticsPropertyCategory.ReceivedRtpStream | 0x05,
///
/// Received bytes.
///
BytesReceived = WebRTCStatisticsPropertyCategory.InboundRtpStream | 0x01,
///
/// Duplicated packet.
///
PacketsDuplicated = WebRTCStatisticsPropertyCategory.InboundRtpStream | 0x02,
///
/// Sent bytes.
///
BytesSent = WebRTCStatisticsPropertyCategory.SentRtpStream | 0x01,
///
/// Sent packets.
///
PacketsSent = WebRTCStatisticsPropertyCategory.SentRtpStream | 0x02,
///
/// Remote ID.
///
RemoteId = WebRTCStatisticsPropertyCategory.InboundRtpStream | WebRTCStatisticsPropertyCategory.OutboundRtpStream | 0x01,
///
/// FIR count.
///
FirCount = WebRTCStatisticsPropertyCategory.InboundRtpStream | WebRTCStatisticsPropertyCategory.OutboundRtpStream | 0x02,
///
/// PLI count.
///
PliCount = WebRTCStatisticsPropertyCategory.InboundRtpStream | WebRTCStatisticsPropertyCategory.OutboundRtpStream | 0x03,
///
/// NACK count.
///
NackCount = WebRTCStatisticsPropertyCategory.InboundRtpStream | WebRTCStatisticsPropertyCategory.OutboundRtpStream | 0x04,
///
/// Round trip time.
///
RoundTripTime = WebRTCStatisticsPropertyCategory.RemoteInboundRtpStream | 0x01,
///
/// Lost fraction.
///
FractionLost = WebRTCStatisticsPropertyCategory.RemoteInboundRtpStream | 0x02,
///
/// Remote timestamp.
///
RemoteTimestamp = WebRTCStatisticsPropertyCategory.OutboundRtpStream | 0x01,
///
/// Local ID.
///
LocalId = WebRTCStatisticsPropertyCategory.RemoteInboundRtpStream | WebRTCStatisticsPropertyCategory.RemoteOutboundRtpStream | 0x01
}
internal enum WebRTCStatsPropertyType
{
TypeBool,
TypeInt,
TypeUint,
TypeInt64,
TypeUint64,
TypeFloat,
TypeDouble,
TypeString
}
}