8000 Merge pull request #177 from MarshalX/main · MarshalX/python-webrtc@d7d3e46 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7d3e46

Browse files
authored
Merge pull request #177 from MarshalX/main
0.0.9 (dev)
2 parents 8dc14e6 + 1f8134b commit d7d3e46

40 files changed

+998
-57
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(python_webrtc
77
LANGUAGES C CXX
88
DESCRIPTION "a Python extension that provides bindings to WebRTC"
99
HOMEPAGE_URL "https://github.com/MarshalX/python-webrtc"
10-
VERSION "0.0.0.8"
10+
VERSION "0.0.0.9"
1111
)
1212

1313
include(ExternalProject)

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test:
1313
@${RUN_TESTS} ${TESTS_DIR} ${RUN_TESTS_OPTS} $(O)
1414

1515
stub:
16-
python -m "pybind11_stubgen" wrtc --non-stop
16+
python -m "pybind11_stubgen" wrtc
1717

1818
doc:
1919
cd docs && make gen && make html

docs/links/wrtc/__init__.py

+209-13
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
__all__ = [
66
"CallbackPythonWebRTCException",
77
"CricketIceGatheringState",
8+
"DtlsTransportState",
89
"MediaStream",
910
"MediaStreamSourceState",
1011
"MediaStreamTrack",
1112
"MediaStreamTrackState",
13+
"MediaType",
1214
"PeerConnectionFactory",
1315
"PythonWebRTCException",
1416
"PythonWebRTCExceptionBase",
1517
"RTCAudioSource",
1618
"RTCCallbackException",
19+
"RTCDtlsTransport",
1720
"RTCException",
1821
"RTCIceComponent",
1922
"RTCIceConnectionState",
@@ -32,9 +35,12 @@
3235
"RTCSessionDescription",
3336
"RTCSessionDescriptionInit",
3437
"RTP",
38+
"RtpEncodingParameters",
39+
"RtpTransceiverInit",
3540
"SdpParseException",
3641
"TransceiverDirection",
3742
"answer",
43+
"audio",
3844
"checking",
3945
"closed",
4046
"complete",
@@ -43,6 +49,7 @@
4349
"connecting",
4450
"controlled",
4551
"controlling",
52+
"data",
4653
"disconnected",
4754
"ended",
4855
"failed",
@@ -62,7 +69,9 @@
6269
"sendonly",
6370
"sendrecv",
6471
"stopped",
65-
"unknown"
72+
"unknown",
73+
"unsupported",
74+
"video"
6675
]
6776

6877

@@ -103,6 +112,46 @@ def value(self) -> int:
103112
gathering: wrtc.CricketIceGatheringState # value = <CricketIceGatheringState.gathering: 1>
104113
new: wrtc.CricketIceGatheringState # value = <CricketIceGatheringState.new: 0>
105114
pass
115+
class DtlsTransportState():
116+
"""
117+
Members:
118+
119+
new
120+
121+
connecting
122+
123+
connected
124+
125+
closed
126+
127+
failed
128+
"""
129+
def __eq__(self, other: object) -> bool: ...
130+
def __getstate__(self) -> int: ...
131+
def __hash__(self) -> int: ...
132+
def __index__(self) -> int: ...
133+
def __init__(self, value: int) -> None: ...
134+
def __int__(self) -> int: ...
135+
def __ne__(self, other: object) -> bool: ...
136+
def __repr__(self) -> str: ...
137+
def __setstate__(self, state: int) -> None: ...
138+
@property
139+
def name(self) -> str:
140+
"""
141+
:type: str
142+
"""
143+
@property
144+
def value(self) -> int:
145+
"""
146+
:type: int
147+
"""
148+
__members__: dict # value = {'new': <DtlsTransportState.new: 0>, 'connecting': <DtlsTransportState.connecting: 1>, 'connected': <DtlsTransportState.connected: 2>, 'closed': <DtlsTransportState.closed: 3>, 'failed': <DtlsTransportState.failed: 4>}
149+
closed: wrtc.DtlsTransportState # value = <DtlsTransportState.closed: 3>
150+
connected: wrtc.DtlsTransportState # value = <DtlsTransportState.connected: 2>
151+
connecting: wrtc.DtlsTransportState # value = <DtlsTransportState.connecting: 1>
152+
failed: wrtc.DtlsTransportState # value = <DtlsTransportState.failed: 4>
153+
new: wrtc.DtlsTransportState # value = <DtlsTransportState.new: 0>
154+
pass
106155
class MediaStream():
107156
def addTrack(self, arg0: MediaStreamTrack) -> None: ...
108157
def clone(self) -> MediaStream: ...
@@ -176,9 +225,9 @@ def id(self) -> str:
176225
:type: str
177226
"""
178227
@property
179-
def kind(self) -> str:
228+
def kind(self) -> MediaType:
180229
"""
181-
:type: str
230+
:type: MediaType
182231
"""
183232
@property
184233
def muted(self) -> bool:
@@ -222,6 +271,43 @@ def value(self) -> int:
222271
ended: wrtc.MediaStreamTrackState # value = <MediaStreamTrackState.ended: 1>
223272
live: wrtc.MediaStreamTrackState # value = <MediaStreamTrackState.live: 0>
224273
pass
274+
class MediaType():
275+
"""
276+
Members:
277+
278+
audio
279+
280+
video
281+
282+
data
283+
284+
unsupported
285+
"""
286+
def __eq__(self, other: object) -> bool: ...
287+
def __getstate__(self) -> int: ...
288+
def __hash__(self) -> int: ...
289+
def __index__(self) -> int: ...
290+
def __init__(self, value: int) -> None: ...
291+
def __int__(self) -> int: ...
292+
def __ne__(self, other: object) -> bool: ...
293+
def __repr__(self) -> str: ...
294+
def __setstate__(self, state: int) -> None: ...
295+
@property
296+
def name(self) -> str:
297+
"""
298+
:type: str
299+
"""
300+
@property
301+
def value(self) -> int:
302+
"""
303+
:type: int
304+
"""
305+
__members__: dict # value = {'audio': <MediaType.audio: 0>, 'video': <MediaType.video: 1>, 'data': <MediaType.data: 2>, 'unsupported': <MediaType.unsupported: 3>}
306+
audio: wrtc.MediaType # value = <MediaType.audio: 0>
307+
data: wrtc.MediaType # value = <MediaType.data: 2>
308+
unsupported: wrtc.MediaType # value = <MediaType.unsupported: 3>
309+
video: wrtc.MediaType # value = <MediaType.video: 1>
310+
pass
225311
class PeerConnectionFactory():
226312
def __init__(self) -> None: ...
227313
@staticmethod
@@ -243,6 +329,18 @@ def onData(self, arg0: RTCOnDataEvent) -> None: ...
243329
class RTCCallbackException():
244330
def what(self) -> str: ...
245331
pass
332+
class RTCDtlsTransport():
333+
@property
334+
def iceTransport(self) -> RTCIceTransport:
335+
"""
336+
:type: RTCIceTransport
337+
"""
338+
@property
339+
def state(self) -> DtlsTransportState:
340+
"""
341+
:type: DtlsTransportState
342+
"""
343+
pass
246344
class RTCException(PythonWebRTCExceptionBase, Exception, BaseException):
247345
pass
248346
class RTCIceComponent():
@@ -506,14 +604,20 @@ def sampleRate(self, arg0: int) -> None:
506604
pass
507605
class RTCPeerConnection():
508606
def __init__(self) -> None: ...
509-
@staticmethod
510-
def addTrack(*args, **kwargs) -> typing.Any: ...
607+
@typing.overload
608+
def addTrack(self, arg0: MediaStreamTrack, arg1: typing.List[MediaStream]) -> RTCRtpSender: ...
609+
@typing.overload
610+
def addTrack(self, arg0: MediaStreamTrack, arg1: typing.Optional[MediaStream]) -> RTCRtpSender: ...
611+
@typing.overload
612+
def addTransceiver(self, arg0: MediaStreamTrack, arg1: typing.Optional[RtpTransceiverInit]) -> RTCRtpTransceiver: ...
613+
@typing.overload
614+
def addTransceiver(self, arg0: MediaType, arg1: typing.Optional[RtpTransceiverInit]) -> RTCRtpTransceiver: ...
511615
def close(self) -> None: ...
512616
def createAnswer(self, arg0: typing.Callable[[RTCSessionDescription], None], arg1: typing.Callable[[CallbackPythonWebRTCException], None]) -> None: ...
513617
def createOffer(self, arg0: typing.Callable[[RTCSessionDescription], None], arg1: typing.Callable[[CallbackPythonWebRTCException], None]) -> None: ...
514-
def getReceivers(self) -> typing.List[python_webrtc::RTCRtpReceiver]: ...
515-
def getSenders(self) -> typing.List[python_webrtc::RTCRtpSender]: ...
516-
def getTransceivers(self) -> typing.List[python_webrtc::RTCRtpTransceiver]: ...
618+
def getReceivers(self) -> typing.List[RTCRtpReceiver]: ...
619+
def getSenders(self) -> typing.List[RTCRtpSender]: ...
620+
def getTransceivers(self) -> typing.List[RTCRtpTransceiver]: ...
517621
def setLocalDescription(self, arg0: typing.Callable[[], None], arg1: typing.Callable[[CallbackPythonWebRTCException], None], arg2: RTCSessionDescription) -> None: ...
518622
def setRemoteDescription(self, arg0: typing.Callable[[], None], arg1: typing.Callable[[CallbackPythonWebRTCException], None], arg2: RTCSessionDescription) -> None: ...
519623
pass
@@ -566,13 +670,23 @@ def track(self) -> MediaStreamTrack:
566670
"""
567671
:type: MediaStreamTrack
568672
"""
673+
@property
674+
def transport(self) -> typing.Optional[RTCDtlsTransport]:
675+
"""
676+
:type: typing.Optional[RTCDtlsTransport]
677+
"""
569678
pass
570679
class RTCRtpSender():
571680
@property
572681
def track(self) -> typing.Optional[MediaStreamTrack]:
573682
"""
574683
:type: typing.Optional[MediaStreamTrack]
575684
"""
685+
@property
686+
def transport(self) -> typing.Optional[RTCDtlsTransport]:
687+
"""
688+
:type: typing.Optional[RTCDtlsTransport]
689+
"""
576690
pass
577691
class RTCRtpTransceiver():
578692
def stop(self) -> None: ...
@@ -679,6 +793,84 @@ def type(self) -> RTCSdpType:
679793
def type(self, arg0: RTCSdpType) -> None:
680794
pass
681795
pass
796+
class RtpEncodingParameters():
797+
def __init__(self) -> None: ...
798+
@property
799+
def active(self) -> bool:
800+
"""
801+
:type: bool
802+
"""
803+
@active.setter
804+
def active(self, arg0: bool) -> None:
805+
pass
806+
@property
807+
def maxBitrate(self) -> typing.Optional[int]:
808+
"""
809+
:type: typing.Optional[int]
810+
"""
811+
@maxBitrate.setter
812+
def maxBitrate(self, arg0: typing.Optional[int]) -> None:
813+
pass
814+
@property
815+
def maxFramerate(self) -> typing.Optional[float]:
816+
"""
817+
:type: typing.Optional[float]
818+
"""
819+
@maxFramerate.setter
820+
def maxFramerate(self, arg0: typing.Optional[float]) -> None:
821+
pass
822+
@property
823+
def rid(self) -> str:
824+
"""
825+
:type: str
826+
"""
827+
@rid.setter
828+
def rid(self, arg0: str) -> None:
829+
pass
830+
@property
831+
def scaleResolutionDownBy(self) -> typing.Optional[float]:
832+
"""
833+
:type: typing.Optional[float]
834+
"""
835+
@scaleResolutionDownBy.setter
836+
def scaleResolutionDownBy(self, arg0: typing.Optional[float]) -> None:
837+
pass
838+
@property
839+
def ssrc(self) -> typing.Optional[int]:
840+
"""
841+
:type: typing.Optional[int]
842+
"""
843+
@ssrc.setter
844+
def ssrc(self, arg0: typing.Optional[int]) -> None:
845+
pass
846+
pass
847+
class RtpTransceiverInit():
848+
def __init__(self) -> None: ...
849+
@property
850+
def direction(self) -> TransceiverDirection:
851+
"""
852+
:type: TransceiverDirection
853+
"""
854+
@direction.setter
855+
def direction(self, arg0: TransceiverDirection) -> None:
856+
pass
857+
@property
858+
def sendEncodings(self) -> typing.List[webrtc::RtpEncodingParameters]:
859+
"""
860+
:type: typing.List[webrtc::RtpEncodingParameters]
861+
"""
862+
@sendEncodings.setter
863+
def sendEncodings(self, arg0: typing.List[webrtc::RtpEncodingParameters]) -> None:
864+
pass
865+
@property
866+
def streamIds(self) -> typing.List[str]:
867+
"""
868+
:type: typing.List[str]
869+
"""
870+
@streamIds.setter
871+
def streamIds(self, arg0: typing.List[str]) -> None:
872+
pass
873+
pass
682874
class SdpParseException(PythonWebRTCExceptionBase, Exception, BaseException):
683875
pass
684876
class TransceiverDirection():
@@ -728,24 +920,26 @@ def ping() -> None:
728920
RTCP: wrtc.RTCIceComponent # value = <RTCIceComponent.RTCP: 1>
729921
RTP: wrtc.RTCIceComponent # value = <RTCIceComponent.RTP: 0>
730922
answer: wrtc.RTCSdpType # value = <RTCSdpType.answer: 2>
923+
audio: wrtc.MediaType # value = <MediaType.audio: 0>
731924
checking: wrtc.RTCIceTransportState # value = <RTCIceTransportState.checking: 1>
732-
closed: wrtc.RTCIceTransportState # value = <RTCIceTransportState.closed: 6>
925+
closed: wrtc.DtlsTransportState # value = <DtlsTransportState.closed: 3>
733926
complete: wrtc.CricketIceGatheringState # value = <CricketIceGatheringState.complete: 2>
734927
completed: wrtc.RTCIceTransportState # value = <RTCIceTransportState.completed: 3>
735-
connected: wrtc.RTCIceTransportState # value = <RTCIceTransportState.connected: 2>
736-
connecting: wrtc.RTCPeerConnectionState # value = <RTCPeerConnectionState.connecting: 1>
928+
connected: wrtc.DtlsTransportState # value = <DtlsTransportState.connected: 2>
929+
connecting: wrtc.DtlsTransportState # value = <DtlsTransportState.connecting: 1>
737930
controlled: wrtc.RTCIceRole # value = <RTCIceRole.controlled: 1>
738931
controlling: wrtc.RTCIceRole # value = <RTCIceRole.controlling: 0>
932+
data: wrtc.MediaType # value = <MediaType.data: 2>
739933
disconnected: wrtc.RTCIceTransportState # value = <RTCIceTransportState.disconnected: 5>
740934
ended: wrtc.MediaStreamSourceState # value = <MediaStreamSourceState.ended: 2>
741-
failed: wrtc.RTCIceTransportState # value = <RTCIceTransportState.failed: 4>
935+
failed: wrtc.DtlsTransportState # value = <DtlsTransportState.failed: 4>
742936
gathering: wrtc.CricketIceGatheringState # value = <CricketIceGatheringState.gathering: 1>
743937
inactive: wrtc.TransceiverDirection # value = <TransceiverDirection.inactive: 3>
744938
initializing: wrtc.MediaStreamSourceState # value = <MediaStreamSourceState.initializing: 0>
745939
live: wrtc.MediaStreamSourceState # value = <MediaStreamSourceState.live: 1>
746940
max: wrtc.RTCIceConnectionState # value = <RTCIceConnectionState.max: 7>
747941
muted: wrtc.MediaStreamSourceState # value = <MediaStreamSourceState.muted: 3>
748-
new: wrtc.RTCIceTransportState # value = <RTCIceTransportState.new: 0>
942+
new: wrtc.DtlsTransportState # value = <DtlsTransportState.new: 0>
749943
offer: wrtc.RTCSdpType # value = <RTCSdpType.offer: 0>
750944
pranswer: wrtc.RTCSdpType # value = <RTCSdpType.pranswer: 1>
751945
recvonly: wrtc.TransceiverDirection # value = <TransceiverDirection.recvonly: 2>
@@ -754,3 +948,5 @@ def ping() -> None:
754948
sendrecv: wrtc.TransceiverDirection # value = <TransceiverDirection.sendrecv: 0>
755949
stopped: wrtc.TransceiverDirection # value = <TransceiverDirection.stopped: 4>
756950
unknown: wrtc.RTCIceRole # value = <RTCIceRole.unknown: 2>
951+
unsupported: wrtc.MediaType # value = <MediaType.unsupported: 3>
952+
video: wrtc.MediaType # value = <MediaType.video: 1>

docs/source/webrtc.interfaces.rst

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Submodules
1515
webrtc.interfaces.media_stream
1616
webrtc.interfaces.media_stream_track
1717
webrtc.interfaces.rtc_audio_source
18+
webrtc.interfaces.rtc_dtls_transport
1819
webrtc.interfaces.rtc_ice_transport
1920
webrtc.interfaces.rtc_peer_connection
2021
webrtc.interfaces.rtc_rtp_receiver
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
webrtc.interfaces.rtc\_dtls\_transport
2+
======================================
3+
4+
.. automodule:: webrtc.interfaces.rtc_dtls_transport
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/webrtc.models.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ Submodules
1515
webrtc.models.rtc_on_data_event
1616
webrtc.models.rtc_session_description
1717
webrtc.models.rtc_session_description_init
18+
webrtc.models.rtp_encoding_parameters
19+
webrtc.models.rtp_transceiver_init
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
webrtc.models.rtp\_encoding\_parameters
2+
=======================================
3+
4+
.. automodule:: webrtc.models.rtp_encoding_parameters
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)
0