py-tgcalls 2.1.0.dev5__py3-none-any.whl → 2.1.0.dev6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: py-tgcalls
3
- Version: 2.1.0.dev5
3
+ Version: 2.1.0.dev6
4
4
  Summary: Async client API for the Telegram Calls.
5
5
  Author-email: Laky-64 <iraci.matteo@gmail.com>
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -187,7 +187,7 @@ Requires-Python: >=3.9
187
187
  Description-Content-Type: text/markdown
188
188
  License-File: LICENSE
189
189
  Requires-Dist: aiohttp>=3.9.3
190
- Requires-Dist: ntgcalls<1.4.0,>=1.3.0b7
190
+ Requires-Dist: ntgcalls<1.4.0,>=1.3.0b8
191
191
  Requires-Dist: deprecation
192
192
  Provides-Extra: pyrogram
193
193
  Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
@@ -1,9 +1,9 @@
1
1
  pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
2
- pytgcalls/__version__.py,sha256=KQAc7KU-mJvztNT933s927lrNsCxny7RGtGEb4R-foc,27
2
+ pytgcalls/__version__.py,sha256=XpaslcQ6vxyxgkMYX7CybYFwTHghQiu_sJjTLT479EA,27
3
3
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
4
4
  pytgcalls/exceptions.py,sha256=0MmAktc53ajYAc7ThjD2tJ9PDyibUi0iHZMfUy2IoKs,4109
5
5
  pytgcalls/ffmpeg.py,sha256=tm6DBxyNfPh3h3an-b2s9x1UyX-cvkCdov9prlXxVZY,8649
6
- pytgcalls/filters.py,sha256=dHRXgxhQoLaLsSAsYYaq4jCwVran9sBWBG1txKWIOjY,6039
6
+ pytgcalls/filters.py,sha256=_TodZPFizBpH5ASGpiU92UBG2t4KUKyKDS2Dff03Dto,6041
7
7
  pytgcalls/mtproto_required.py,sha256=6B-31p5qH_6oekUgypV4nK3hqPS6Nr-pA8S81wjnbaY,630
8
8
  pytgcalls/mutex.py,sha256=Frjji5Ctzlk4AXEBuBLnDK-7HbtreoV6zuyKpFpMNI4,236
9
9
  pytgcalls/pytgcalls.py,sha256=oBcWgBwusnXmjHrLEE99VVXARReVyrXdn9SyeBWHbVo,1479
@@ -36,7 +36,7 @@ pytgcalls/methods/stream/pause_stream.py,sha256=z_AIWABrQMHmTwvlah_PrH9EjXbro8gK
36
36
  pytgcalls/methods/stream/play.py,sha256=1NiAIKBdSsiighc74EKHQv_Fl_ehWLYgGPq5x62s0sE,10189
37
37
  pytgcalls/methods/stream/record.py,sha256=toW1LtgUMiaw-KGe9DnWTRsGYLhoKlG0r8eJphMhGIA,1212
38
38
  pytgcalls/methods/stream/resume_stream.py,sha256=z_DgP4cDExjEqEeX_ZL--50MXQ9lrATK876SIwE71PQ,576
39
- pytgcalls/methods/stream/send_frame.py,sha256=TAHXfKgBrX-nT9x-08GZNOeObqyhtgGYi7i4kuGHO6c,1080
39
+ pytgcalls/methods/stream/send_frame.py,sha256=Kj9R8OqUM-g7pt-FiWP-US7sCFkH5ciPr9S8v-WPtLg,1062
40
40
  pytgcalls/methods/stream/time.py,sha256=5y9TMBf_d6YPLbMcGx3yMZQUZdo8zb5fQb9STsh7R3Y,656
41
41
  pytgcalls/methods/stream/unmute_stream.py,sha256=KUMhfMbhsPmZsmpF4cGWC1FVW7YwXha2MmQnqrBhM8s,576
42
42
  pytgcalls/methods/utilities/__init__.py,sha256=JcKwqNo6fFXXfuab94fNEraKF1P9fnSSgr0WQDRjF2w,339
@@ -48,7 +48,7 @@ pytgcalls/methods/utilities/idle.py,sha256=MDdzHTv1ws2yBhsvhBUnssGdghkZ2KwR0HUCP
48
48
  pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1k4anh8,244
49
49
  pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
50
50
  pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
51
- pytgcalls/methods/utilities/start.py,sha256=pG2I3bSWDBn7qNTxwbSCvkwpkhWAYKlAqJ5TzapMgCc,13406
51
+ pytgcalls/methods/utilities/start.py,sha256=tnNMKflSfQecORN4tBYhyDQMctWXpXidj7z1xsfUQb8,13517
52
52
  pytgcalls/methods/utilities/stream_params.py,sha256=V9bKF3w4XLsbzYNAuCXrcjrojioGHLlFeZ3Jz9H3z-0,3235
53
53
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
54
54
  pytgcalls/mtproto/bridged_client.py,sha256=69d59-Vm_CSexd7maHIeGc9BUCiBLoa5YKZy_y-a540,5868
@@ -57,7 +57,7 @@ pytgcalls/mtproto/hydrogram_client.py,sha256=HWYhScpVd7dwfuwngYcohHcNNnPZxcQA0mH
57
57
  pytgcalls/mtproto/mtproto_client.py,sha256=1C1Cc1GOrKom-70NqUOICKxjfjgpPZBSdKdwFUjZzBc,7616
58
58
  pytgcalls/mtproto/pyrogram_client.py,sha256=Z24edwj8wApTqECW5o5fF257fZhEIFvMw69uSULXlPU,23202
59
59
  pytgcalls/mtproto/telethon_client.py,sha256=U9FeII1-nmKCJlAekpAQ7Ljb9doHD0aFlKSbMjlszls,22440
60
- pytgcalls/types/__init__.py,sha256=6DkID8ItCV7G6PjkKBMCgUEWfSHbMJjn6lvJ8ysIq7U,1086
60
+ pytgcalls/types/__init__.py,sha256=iXAzXG5WgbICLQV1JT_F4QtOqKWC8X3334-MOv2SXW4,1127
61
61
  pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
62
62
  pytgcalls/types/cache.py,sha256=FfsOcmYnsBGPlJoTPIXXYcUSpGE3rhx6cjIH77hyUL0,1059
63
63
  pytgcalls/types/dict.py,sha256=lAo9hu4VlVJa9S7P8Y81BYmKtvz0rH7hwpGcH3ynHUw,78
@@ -84,18 +84,19 @@ pytgcalls/types/raw/audio_stream.py,sha256=oN7Sx9oLbNFuNXiGYpoNabMwqWKGquLiHEywe
84
84
  pytgcalls/types/raw/stream.py,sha256=xJ3w77ofKFnLIA4cAWIuw2yREpMPvTzIvtei-3xEbJQ,666
85
85
  pytgcalls/types/raw/video_parameters.py,sha256=nUl9gkfYTVU0iLNGTtlZ5cZg8K6F7odIi9n8POJXCK4,639
86
86
  pytgcalls/types/raw/video_stream.py,sha256=uE3jU9kJsrAoefXtDtEKNqTjcYGaQbZ1gbJ1SfiVWIc,488
87
- pytgcalls/types/stream/__init__.py,sha256=YCJ2sg0ebhFMUzugj4V7SvvqDeeTvc0n_evdnhYFHls,520
87
+ pytgcalls/types/stream/__init__.py,sha256=4CfgKXoEZX8BvV_ImBlY108MvRELNCf_-CPAMJ9szgk,561
88
88
  pytgcalls/types/stream/audio_quality.py,sha256=4X94ErmTeLP4TVcE3eLtPPdtluSPxgxbgTosuNJOVhc,141
89
89
  pytgcalls/types/stream/device.py,sha256=EdoDg6lPE7fgoZI04Nr0E9zbIk-iRIBgYYAzVqoCBPM,961
90
90
  pytgcalls/types/stream/direction.py,sha256=gd10wUmpfsqx87kCAPZt6u8pFiPb09WZfHKcMWAZokU,394
91
91
  pytgcalls/types/stream/external_media.py,sha256=RiuSX5tZGdNsQZ8LIRk5Lp4Ksv9oTvaccmInJRZYo4M,114
92
+ pytgcalls/types/stream/frame.py,sha256=TXo5HZVHbbaVNBqulMhTqGODXH3bpBVlN_of1rosNUQ,586
92
93
  pytgcalls/types/stream/media_stream.py,sha256=sFlP8BMmCjhYp_A8U7XkGV4jbxR7PYsmJiII5Fxs0_A,11971
93
94
  pytgcalls/types/stream/record_stream.py,sha256=pp08OahflXJ5Cs281KxU-K2ULRP88ega5WBkJ7dwBjk,3038
94
95
  pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
95
- pytgcalls/types/stream/stream_frame.py,sha256=NuRaGoRvy4icJruG8ejQQoYVV282JxlIcSB-MQUIWYI,813
96
+ pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
96
97
  pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
97
- py_tgcalls-2.1.0.dev5.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
98
- py_tgcalls-2.1.0.dev5.dist-info/METADATA,sha256=gg0QIm1PMKjSbyvLHlt8HYlleLRCcNYuP9kO_ckaQjA,14399
99
- py_tgcalls-2.1.0.dev5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
100
- py_tgcalls-2.1.0.dev5.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
101
- py_tgcalls-2.1.0.dev5.dist-info/RECORD,,
98
+ py_tgcalls-2.1.0.dev6.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
99
+ py_tgcalls-2.1.0.dev6.dist-info/METADATA,sha256=8KhT3gZqD-Ube9Drf9oxvhsk7Nnp4KMe7QPYHGPdCw0,14399
100
+ py_tgcalls-2.1.0.dev6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
101
+ py_tgcalls-2.1.0.dev6.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
102
+ py_tgcalls-2.1.0.dev6.dist-info/RECORD,,
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.1.0.dev5'
1
+ __version__ = '2.1.0.dev6'
pytgcalls/filters.py CHANGED
@@ -11,7 +11,7 @@ from .types import Device
11
11
  from .types import Direction
12
12
  from .types import GroupCallParticipant
13
13
  from .types import StreamEnded
14
- from .types import StreamFrame
14
+ from .types import StreamFrames
15
15
  from .types import Update
16
16
  from .types import UpdatedGroupCallParticipant
17
17
 
@@ -209,7 +209,7 @@ class stream_frame(Filter):
209
209
  self.devices = devices
210
210
 
211
211
  async def __call__(self, client: PyTgCalls, update: Update):
212
- if isinstance(update, StreamFrame):
212
+ if isinstance(update, StreamFrames):
213
213
  return (
214
214
  (
215
215
  self.directions is None or
@@ -8,7 +8,7 @@ from ...mtproto_required import mtproto_required
8
8
  from ...scaffold import Scaffold
9
9
  from ...statictypes import statictypes
10
10
  from ...types import Device
11
- from ...types import StreamFrame
11
+ from ...types import Frame
12
12
 
13
13
 
14
14
  class SendFrame(Scaffold):
@@ -19,7 +19,7 @@ class SendFrame(Scaffold):
19
19
  chat_id: Union[int, str],
20
20
  device: Device,
21
21
  data: bytes,
22
- frame_data: StreamFrame.Info = StreamFrame.Info(),
22
+ frame_data: Frame.Info = Frame.Info(),
23
23
  ):
24
24
  chat_id = await self.resolve_chat_id(chat_id)
25
25
  try:
@@ -1,11 +1,12 @@
1
1
  import asyncio
2
2
  import logging
3
+ from typing import List
3
4
 
4
5
  from ntgcalls import CallNetworkState
5
6
  from ntgcalls import ConnectionError
6
7
  from ntgcalls import ConnectionNotFound
7
8
  from ntgcalls import ConnectionState
8
- from ntgcalls import FrameData
9
+ from ntgcalls import Frame as RawFrame
9
10
  from ntgcalls import MediaState
10
11
  from ntgcalls import StreamDevice
11
12
  from ntgcalls import StreamMode
@@ -22,10 +23,11 @@ from ...types import CallData
22
23
  from ...types import ChatUpdate
23
24
  from ...types import Device
24
25
  from ...types import Direction
26
+ from ...types import Frame
25
27
  from ...types import GroupCallParticipant
26
28
  from ...types import RawCallUpdate
27
29
  from ...types import StreamEnded
28
- from ...types import StreamFrame
30
+ from ...types import StreamFrames
29
31
  from ...types import Update
30
32
  from ...types import UpdatedGroupCallParticipant
31
33
 
@@ -229,25 +231,27 @@ class Start(Scaffold):
229
231
 
230
232
  async def stream_frame(
231
233
  chat_id: int,
232
- source_id: int,
233
234
  mode: StreamMode,
234
235
  device: StreamDevice,
235
- frame: bytes,
236
- frame_info: FrameData,
236
+ frames: List[RawFrame],
237
237
  ):
238
238
  await self.propagate(
239
- StreamFrame(
239
+ StreamFrames(
240
240
  chat_id,
241
- source_id,
242
241
  Direction.from_raw(mode),
243
242
  Device.from_raw(device),
244
- frame,
245
- StreamFrame.Info(
246
- frame_info.absolute_capture_timestamp_ms,
247
- frame_info.width,
248
- frame_info.height,
249
- frame_info.rotation,
250
- ),
243
+ [
244
+ Frame(
245
+ x.ssrc,
246
+ x.data,
247
+ Frame.Info(
248
+ x.frame_data.absolute_capture_timestamp_ms,
249
+ x.frame_data.width,
250
+ x.frame_data.height,
251
+ x.frame_data.rotation,
252
+ ),
253
+ ) for x in frames
254
+ ],
251
255
  ),
252
256
  self,
253
257
  )
@@ -324,16 +328,14 @@ class Start(Scaffold):
324
328
  self.loop,
325
329
  ),
326
330
  )
327
- self._binding.on_frame(
328
- lambda chat_id, source_id, mode, device, frame, info:
331
+ self._binding.on_frames(
332
+ lambda chat_id, mode, device, frames:
329
333
  asyncio.run_coroutine_threadsafe(
330
334
  stream_frame(
331
335
  chat_id,
332
- source_id,
333
336
  mode,
334
337
  device,
335
- frame,
336
- info,
338
+ frames,
337
339
  ),
338
340
  self.loop,
339
341
  ),
@@ -13,10 +13,11 @@ from .stream import AudioQuality
13
13
  from .stream import Device
14
14
  from .stream import Direction
15
15
  from .stream import ExternalMedia
16
+ from .stream import Frame
16
17
  from .stream import MediaStream
17
18
  from .stream import RecordStream
18
19
  from .stream import StreamEnded
19
- from .stream import StreamFrame
20
+ from .stream import StreamFrames
20
21
  from .stream import VideoQuality
21
22
  from .update import Update
22
23
 
@@ -25,6 +26,7 @@ __all__ = (
25
26
  'Device',
26
27
  'Direction',
27
28
  'ExternalMedia',
29
+ 'Frame',
28
30
  'Browsers',
29
31
  'Cache',
30
32
  'ChatUpdate',
@@ -38,7 +40,7 @@ __all__ = (
38
40
  'RecordStream',
39
41
  'MediaStream',
40
42
  'StreamEnded',
41
- 'StreamFrame',
43
+ 'StreamFrames',
42
44
  'Update',
43
45
  'UpdatedGroupCallParticipant',
44
46
  'VideoQuality',
@@ -2,10 +2,11 @@ from .audio_quality import AudioQuality
2
2
  from .device import Device
3
3
  from .direction import Direction
4
4
  from .external_media import ExternalMedia
5
+ from .frame import Frame
5
6
  from .media_stream import MediaStream
6
7
  from .record_stream import RecordStream
7
8
  from .stream_ended import StreamEnded
8
- from .stream_frame import StreamFrame
9
+ from .stream_frames import StreamFrames
9
10
  from .video_quality import VideoQuality
10
11
 
11
12
  __all__ = (
@@ -13,9 +14,10 @@ __all__ = (
13
14
  'Device',
14
15
  'Direction',
15
16
  'ExternalMedia',
17
+ 'Frame',
16
18
  'MediaStream',
17
19
  'RecordStream',
18
20
  'StreamEnded',
19
- 'StreamFrame',
21
+ 'StreamFrames',
20
22
  'VideoQuality',
21
23
  )
@@ -1,11 +1,8 @@
1
- from ...types.update import Update
2
- from .device import Device
3
- from .direction import Direction
1
+ from ...types.update import PyObject
4
2
 
5
3
 
6
- class StreamFrame(Update):
7
-
8
- class Info:
4
+ class Frame(PyObject):
5
+ class Info(PyObject):
9
6
  def __init__(
10
7
  self,
11
8
  capture_time: int = 0,
@@ -20,16 +17,10 @@ class StreamFrame(Update):
20
17
 
21
18
  def __init__(
22
19
  self,
23
- chat_id: int,
24
20
  ssrc: int,
25
- direction: Direction,
26
- device: Device,
27
21
  frame: bytes,
28
22
  info: Info,
29
23
  ):
30
- super().__init__(chat_id)
31
24
  self.ssrc = ssrc
32
- self.direction = direction
33
- self.device = device
34
25
  self.frame = frame
35
26
  self.info = info
@@ -0,0 +1,20 @@
1
+ from typing import List
2
+
3
+ from ...types.update import Update
4
+ from .device import Device
5
+ from .direction import Direction
6
+ from .frame import Frame
7
+
8
+
9
+ class StreamFrames(Update):
10
+ def __init__(
11
+ self,
12
+ chat_id: int,
13
+ direction: Direction,
14
+ device: Device,
15
+ frames: List[Frame],
16
+ ):
17
+ super().__init__(chat_id)
18
+ self.direction = direction
19
+ self.device = device
20
+ self.frames = frames