gstwebrtc

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Overview

gstwebrtc contains bindings for the gstreamer webrtclib. See also https://gstreamer.freedesktop.org/documentation/webrtclib/index.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundlePolicy

type BundlePolicy C.GstWebRTCBundlePolicy
const (
	BUNDLE_POLICY_NONE       BundlePolicy = C.GST_WEBRTC_BUNDLE_POLICY_NONE       // none
	BUNDLE_POLICY_BALANCED   BundlePolicy = C.GST_WEBRTC_BUNDLE_POLICY_BALANCED   // balanced
	BUNDLE_POLICY_MAX_COMPAT BundlePolicy = C.GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT // max-compat
	BUNDLE_POLICY_MAX_BUNDLE BundlePolicy = C.GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE // max-bundle
)

func (BundlePolicy) String

func (e BundlePolicy) String() string

type DTLSSetup

type DTLSSetup C.GstWebRTCDTLSSetup
const (
	DTLS_SETUP_NONE    DTLSSetup = C.GST_WEBRTC_DTLS_SETUP_NONE    // none
	DTLS_SETUP_ACTPASS DTLSSetup = C.GST_WEBRTC_DTLS_SETUP_ACTPASS // actpass
	DTLS_SETUP_ACTIVE  DTLSSetup = C.GST_WEBRTC_DTLS_SETUP_ACTIVE  // sendonly
	DTLS_SETUP_PASSIVE DTLSSetup = C.GST_WEBRTC_DTLS_SETUP_PASSIVE // recvonly
)

func (DTLSSetup) String

func (e DTLSSetup) String() string

type DTLSTransportState

type DTLSTransportState C.GstWebRTCDTLSTransportState
const (
	DTLS_TRANSPORT_STATE_NEW        DTLSTransportState = C.GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW        // new
	DTLS_TRANSPORT_STATE_CLOSED     DTLSTransportState = C.GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED     // closed
	DTLS_TRANSPORT_STATE_FAILED     DTLSTransportState = C.GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED     // failed
	DTLS_TRANSPORT_STATE_CONNECTING DTLSTransportState = C.GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING // connecting
	DTLS_TRANSPORT_STATE_CONNECTED  DTLSTransportState = C.GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED  // connected
)

func (DTLSTransportState) String

func (e DTLSTransportState) String() string

type DataChannel

type DataChannel struct {
	*glib.Object
}

DataChannel is a representation of GstWebRTCDataChannel. See https://gstreamer.freedesktop.org/documentation/webrtclib/gstwebrtc-datachannel.html?gi-language=c

there is no constructor for DataChannel, you can get it from webrtcbin signals

func (*DataChannel) Close

func (dc *DataChannel) Close()

func (*DataChannel) SendData

func (dc *DataChannel) SendData(data []byte) error

func (*DataChannel) ToGValue

func (dc *DataChannel) ToGValue() (*glib.Value, error)

ToGValue implements glib.ValueTransformer

type DataChannelState

type DataChannelState C.GstWebRTCDataChannelState
const (
	DATA_CHANNEL_STATE_CONNECTING DataChannelState = C.GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING // connecting
	DATA_CHANNEL_STATE_OPEN       DataChannelState = C.GST_WEBRTC_DATA_CHANNEL_STATE_OPEN       // open
	DATA_CHANNEL_STATE_CLOSING    DataChannelState = C.GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING    // closing
	DATA_CHANNEL_STATE_CLOSED     DataChannelState = C.GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED     // closed
)

func (DataChannelState) String

func (e DataChannelState) String() string

type Error

type Error C.GstWebRTCError
const (
	ERROR_DATA_CHANNEL_FAILURE           Error = C.GST_WEBRTC_ERROR_DATA_CHANNEL_FAILURE           // data-channel-failure
	ERROR_DTLS_FAILURE                   Error = C.GST_WEBRTC_ERROR_DTLS_FAILURE                   // dtls-failure
	ERROR_FINGERPRINT_FAILURE            Error = C.GST_WEBRTC_ERROR_FINGERPRINT_FAILURE            // fingerprint-failure
	ERROR_SCTP_FAILURE                   Error = C.GST_WEBRTC_ERROR_SCTP_FAILURE                   // sctp-failure
	ERROR_SDP_SYNTAX_ERROR               Error = C.GST_WEBRTC_ERROR_SDP_SYNTAX_ERROR               // sdp-syntax-error
	ERROR_HARDWARE_ENCODER_NOT_AVAILABLE Error = C.GST_WEBRTC_ERROR_HARDWARE_ENCODER_NOT_AVAILABLE // hardware-encoder-not-available
	ERROR_ENCODER_ERROR                  Error = C.GST_WEBRTC_ERROR_ENCODER_ERROR                  // encoder-error
	ERROR_INVALID_STATE                  Error = C.GST_WEBRTC_ERROR_INVALID_STATE                  // invalid-state
	ERROR_INTERNAL_FAILURE               Error = C.GST_WEBRTC_ERROR_INTERNAL_FAILURE               // internal-failure
	ERROR_INVALID_MODIFICATION           Error = C.GST_WEBRTC_ERROR_INVALID_MODIFICATION           // invalid-modification
	ERROR_TYPE_ERROR                     Error = C.GST_WEBRTC_ERROR_TYPE_ERROR                     // type-error
)

func (Error) String

func (e Error) String() string

type FECType

type FECType C.GstWebRTCFECType
const (
	FEC_TYPE_NONE    FECType = C.GST_WEBRTC_FEC_TYPE_NONE    // none
	FEC_TYPE_ULP_RED FECType = C.GST_WEBRTC_FEC_TYPE_ULP_RED // ulpfec + red
)

func (FECType) String

func (e FECType) String() string

type ICEComponent

type ICEComponent C.GstWebRTCICEComponent
const (
	ICE_COMPONENT_RTP  ICEComponent = C.GST_WEBRTC_ICE_COMPONENT_RTP  // RTP component
	ICE_COMPONENT_RTCP ICEComponent = C.GST_WEBRTC_ICE_COMPONENT_RTCP // RTCP component
)

func (ICEComponent) String

func (e ICEComponent) String() string

type ICEConnectionState

type ICEConnectionState C.GstWebRTCICEConnectionState
const (
	ICE_CONNECTION_STATE_NEW          ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_NEW          // new
	ICE_CONNECTION_STATE_CHECKING     ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING     // checking
	ICE_CONNECTION_STATE_CONNECTED    ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED    // connected
	ICE_CONNECTION_STATE_COMPLETED    ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED    // completed
	ICE_CONNECTION_STATE_FAILED       ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_FAILED       // failed
	ICE_CONNECTION_STATE_DISCONNECTED ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED // disconnected
	ICE_CONNECTION_STATE_CLOSED       ICEConnectionState = C.GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED       // closed
)

func (ICEConnectionState) String

func (e ICEConnectionState) String() string

type ICEGatheringState

type ICEGatheringState C.GstWebRTCICEGatheringState
const (
	ICE_GATHERING_STATE_NEW       ICEGatheringState = C.GST_WEBRTC_ICE_GATHERING_STATE_NEW       // new
	ICE_GATHERING_STATE_GATHERING ICEGatheringState = C.GST_WEBRTC_ICE_GATHERING_STATE_GATHERING // gathering
	ICE_GATHERING_STATE_COMPLETE  ICEGatheringState = C.GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE  // complete
)

func (ICEGatheringState) String

func (e ICEGatheringState) String() string

type ICERole

type ICERole C.GstWebRTCICERole
const (
	ICE_ROLE_CONTROLLED  ICERole = C.GST_WEBRTC_ICE_ROLE_CONTROLLED  // controlled
	ICE_ROLE_CONTROLLING ICERole = C.GST_WEBRTC_ICE_ROLE_CONTROLLING // controlling
)

func (ICERole) String

func (e ICERole) String() string

type ICETransportPolicy

type ICETransportPolicy C.GstWebRTCICETransportPolicy
const (
	ICE_TRANSPORT_POLICY_ALL   ICETransportPolicy = C.GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL   // all
	ICE_TRANSPORT_POLICY_RELAY ICETransportPolicy = C.GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY // relay
)

func (ICETransportPolicy) String

func (e ICETransportPolicy) String() string

type Kind

type Kind C.GstWebRTCKind
const (
	UNKNOWN Kind = C.GST_WEBRTC_KIND_UNKNOWN // unknown
	AUDIO   Kind = C.GST_WEBRTC_KIND_AUDIO   // audio
	VIDEO   Kind = C.GST_WEBRTC_KIND_VIDEO   // video
)

func (Kind) String

func (e Kind) String() string

type PeerConnectionState

type PeerConnectionState C.GstWebRTCPeerConnectionState
const (
	PEER_CONNECTION_STATE_NEW          PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_NEW          // new
	PEER_CONNECTION_STATE_CONNECTING   PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING   // connecting
	PEER_CONNECTION_STATE_CONNECTED    PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED    // connected
	PEER_CONNECTION_STATE_DISCONNECTED PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED // disconnected
	PEER_CONNECTION_STATE_FAILED       PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_FAILED       // failed
	PEER_CONNECTION_STATE_CLOSED       PeerConnectionState = C.GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED       // closed
)

func (PeerConnectionState) String

func (e PeerConnectionState) String() string

type PriorityType

type PriorityType C.GstWebRTCPriorityType
const (
	PRIORITY_TYPE_VERY_LOW PriorityType = C.GST_WEBRTC_PRIORITY_TYPE_VERY_LOW // very-low
	PRIORITY_TYPE_LOW      PriorityType = C.GST_WEBRTC_PRIORITY_TYPE_LOW      // low
	PRIORITY_TYPE_MEDIUM   PriorityType = C.GST_WEBRTC_PRIORITY_TYPE_MEDIUM   // medium
	PRIORITY_TYPE_HIGH     PriorityType = C.GST_WEBRTC_PRIORITY_TYPE_HIGH     // high
)

func (PriorityType) String

func (e PriorityType) String() string

type RTPTransceiver

type RTPTransceiver struct {
	*gst.Object
}

func (*RTPTransceiver) ToGValue

func (tc *RTPTransceiver) ToGValue() (*glib.Value, error)

ToGValue implements glib.ValueTransformer

type RTPTransceiverDirection

type RTPTransceiverDirection C.GstWebRTCRTPTransceiverDirection
const (
	RTP_TRANSCEIVER_DIRECTION_NONE     RTPTransceiverDirection = C.GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE     // none
	RTP_TRANSCEIVER_DIRECTION_INACTIVE RTPTransceiverDirection = C.GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE // inactive
	RTP_TRANSCEIVER_DIRECTION_SENDONLY RTPTransceiverDirection = C.GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY // sendonly
	RTP_TRANSCEIVER_DIRECTION_RECVONLY RTPTransceiverDirection = C.GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY // recvonly
	RTP_TRANSCEIVER_DIRECTION_SENDRECV RTPTransceiverDirection = C.GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV // sendrecv
)

func (RTPTransceiverDirection) String

func (e RTPTransceiverDirection) String() string

type SCTPTransportState

type SCTPTransportState C.GstWebRTCSCTPTransportState
const (
	SCTP_TRANSPORT_STATE_NEW        SCTPTransportState = C.GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW        // new
	SCTP_TRANSPORT_STATE_CONNECTING SCTPTransportState = C.GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING // connecting
	SCTP_TRANSPORT_STATE_CONNECTED  SCTPTransportState = C.GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED  // connected
	SCTP_TRANSPORT_STATE_CLOSED     SCTPTransportState = C.GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED     // closed
)

func (SCTPTransportState) String

func (e SCTPTransportState) String() string

type SDPType

type SDPType C.GstWebRTCSDPType
const (
	SDP_TYPE_OFFER    SDPType = C.GST_WEBRTC_SDP_TYPE_OFFER    // offer
	SDP_TYPE_PRANSWER SDPType = C.GST_WEBRTC_SDP_TYPE_PRANSWER // pranswer
	SDP_TYPE_ANSWER   SDPType = C.GST_WEBRTC_SDP_TYPE_ANSWER   // answer
	SDP_TYPE_ROLLBACK SDPType = C.GST_WEBRTC_SDP_TYPE_ROLLBACK // rollback
)

func SDPTypeFromString

func SDPTypeFromString(s string) SDPType

func (SDPType) String

func (e SDPType) String() string

type SessionDescription

type SessionDescription struct {
	// contains filtered or unexported fields
}

func NewSessionDescription

func NewSessionDescription(t SDPType, sdp *gstsdp.Message) *SessionDescription

func (*SessionDescription) Copy

Copy creates a new copy of the SessionDescription

func (*SessionDescription) Free

func (sd *SessionDescription) Free()

func (*SessionDescription) ToGValue

func (sd *SessionDescription) ToGValue() (*glib.Value, error)

ToGValue implements glib.ValueTransformer

func (*SessionDescription) ToW3SDP

ToW3SDP returns a W3RTCSessionDescription that can be marshaled to JSON

func (*SessionDescription) UnownedCopy

func (sd *SessionDescription) UnownedCopy() *SessionDescription

UnownedCopy creates a new copy of the SessionDescription that will not be finalized

this is needed for passing the SessionDescription to other functions that will take ownership of it.

used in the bindings, should not be called by application code

type SignalingState

type SignalingState C.GstWebRTCSignalingState
const (
	SIGNALING_STATE_STABLE               SignalingState = C.GST_WEBRTC_SIGNALING_STATE_STABLE               // stable
	SIGNALING_STATE_CLOSED               SignalingState = C.GST_WEBRTC_SIGNALING_STATE_CLOSED               // closed
	SIGNALING_STATE_HAVE_LOCAL_OFFER     SignalingState = C.GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER     // have-local-offer
	SIGNALING_STATE_HAVE_REMOTE_OFFER    SignalingState = C.GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER    // have-remote-offer
	SIGNALING_STATE_HAVE_LOCAL_PRANSWER  SignalingState = C.GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER  // have-local-pranswer
	SIGNALING_STATE_HAVE_REMOTE_PRANSWER SignalingState = C.GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER // have-remote-pranswer
)

func (SignalingState) String

func (e SignalingState) String() string

type StatsType

type StatsType C.GstWebRTCStatsType
const (
	STATS_CODEC               StatsType = C.GST_WEBRTC_STATS_CODEC               // codec
	STATS_INBOUND_RTP         StatsType = C.GST_WEBRTC_STATS_INBOUND_RTP         // inbound-rtp
	STATS_OUTBOUND_RTP        StatsType = C.GST_WEBRTC_STATS_OUTBOUND_RTP        // outbound-rtp
	STATS_REMOTE_INBOUND_RTP  StatsType = C.GST_WEBRTC_STATS_REMOTE_INBOUND_RTP  // remote-inbound-rtp
	STATS_REMOTE_OUTBOUND_RTP StatsType = C.GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP // remote-outbound-rtp
	STATS_CSRC                StatsType = C.GST_WEBRTC_STATS_CSRC                // csrc
	STATS_PEER_CONNECTION     StatsType = C.GST_WEBRTC_STATS_PEER_CONNECTION     // peer-connection
	STATS_DATA_CHANNEL        StatsType = C.GST_WEBRTC_STATS_DATA_CHANNEL        // data-channel
	STATS_STREAM              StatsType = C.GST_WEBRTC_STATS_STREAM              // stream
	STATS_TRANSPORT           StatsType = C.GST_WEBRTC_STATS_TRANSPORT           // transport
	STATS_CANDIDATE_PAIR      StatsType = C.GST_WEBRTC_STATS_CANDIDATE_PAIR      // candidate-pair
	STATS_LOCAL_CANDIDATE     StatsType = C.GST_WEBRTC_STATS_LOCAL_CANDIDATE     // local-candidate
	STATS_REMOTE_CANDIDATE    StatsType = C.GST_WEBRTC_STATS_REMOTE_CANDIDATE    // remote-candidate
	STATS_CERTIFICATE         StatsType = C.GST_WEBRTC_STATS_CERTIFICATE         // certificate
)

func (StatsType) String

func (e StatsType) String() string

type W3RTCSessionDescription

type W3RTCSessionDescription struct {
	Type string `json:"type"`
	Sdp  string `json:"sdp"`
}

W3RTCSessionDescription is used to marshal/unmarshal SessionDescription to/from JSON.

We cannot implement the json.(Un-)Marshaler interfaces on SessionDescription directly because the finalizer would run and free the memory, because the value would have to be copied.

it complies with the WebRTC spec for SessionDescription, see https://www.w3.org/TR/webrtc/#rtcsessiondescription-class

func (*W3RTCSessionDescription) ToGstSDP

func (w3SDP *W3RTCSessionDescription) ToGstSDP() (*SessionDescription, error)

ToGstSDP converts a W3RTCSessionDescription to a SessionDescription

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL